Releases: ditabase/dit-cli
v0.5.1
Functions are finished!
This release is nearly a total rewrite. In the April 2020 prototype, "functions" were extremely limited. The language was not designed to be fully generic, or recursive, and there was no way to adapt it without a major rewrite. That rewrite is now complete! This means you can now do things like this:
getConfig();
pull JavaScript, Python, Lua from 'https://raw.githubusercontent.com/ditabase/dits/master/langs/commonLangs.dit';
sig JavaScript func jsLoop(Num counter){|
for(let i=0; i<2; i++) {
<|counter = (|<|counter|> + 1|)|>;
<|print(counter)|>;
}
<|pyLoop(counter)|>;
if(<|counter|> === 8) {
<|print('Functions in any language!')|>
}
|}
sig Python func pyLoop(Num counter){|
for i in range(2):
<|counter = (|<|counter|> + 1|)|>
<|print(counter)|>
<|luaLoop(counter)|>
|}
sig Lua func luaLoop(Num counter){|
for i = 0, 2 do
<|counter = (|<|counter|> + 1|)|>
<|print(counter)|>
end
|}
jsLoop(1);
This is absolutely as powerful as it seems. You can use any library from any other language at any time. I've shown JavaScript (NodeJS), Python, and Lua here, but you can currently add any interpreted language very easily! Compiled languages will also work with a minor change. You can see a complete tutorial on the new functions here, and how these languages were implemented here.
0.5.1 was released to fix typos in links.
v0.4.1
Changes
-
More consistent and helpful error messages for 'Expected ";"'
-
Fixed a crash caused by loading a restricted file.
-
Fixed crashes caused by unexpected EOF in various parsing locations.
-
Fixed a parsing fail caused when the last element of a class was a comment.
-
Recursive attribution and extension were mistakenly allowed.
-
Empty scripts will no longer be run.
v0.4.0
Install with pip install dit-cli
or update with pip install dit-cli --upgrade
. You should also run rm ~/.dit-languages
to refresh the changes to the language config.
What's new?
The import
statement
Load data from https:
import Names from 'https://raw.githubusercontent.com/isaiahshiner/dits/master/dits/Number.dit';
Or the local file system:
import MyClasses from '/home/user/MyClasses.dit';
This will download the file, parse it, and make all of it's components available behind the Names
namespace. Classes, objects, and assigners can be referenced from imported namespaces. Now dits can be composed of different code from many other dits. There's also a new repo intended for exactly this purpose. Please add your own dits.
More examples of usage in this dit.
Other changes
- Dit strings now support all basic escape characters, including
\n
,\t
,\'
and\"
. - An empty dit will now return
file is empty
and one with classes but no objects will returndit is valid, no objects to check
. - Due to imported namespaces, assigners can no longer have the same name as a class or object.
- Many bugfixes, which are not being heavily documented yet.