Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/TechnoJo4/luadaul
A programming language that compiles to Lua.
https://github.com/TechnoJo4/luadaul
compiler lua luajit
Last synced: 3 months ago
JSON representation
A programming language that compiles to Lua.
- Host: GitHub
- URL: https://github.com/TechnoJo4/luadaul
- Owner: TechnoJo4
- Created: 2021-01-07T02:45:53.000Z (almost 4 years ago)
- Default Branch: rewrite
- Last Pushed: 2024-02-04T19:52:41.000Z (9 months ago)
- Last Synced: 2024-06-25T22:41:40.198Z (4 months ago)
- Topics: compiler, lua, luajit
- Language: Lua
- Homepage:
- Size: 451 KB
- Stars: 7
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# daul
daul is a language that transpiles to Lua. It aims to simplify the use of
functional-style code by eliminating the distinction between statements and
expressions.Daul Generated/Equivalent Lua code
Tables:
```kotlin
// Use [] instead of {}
val arr = [ 1, 2, 3 ]// Use "key:" instead of "[key] ="
val tbl = [ "arr": arr ]
val zeroindexed = [ 0: 1, 2, 3 ];
``````lua
local arr={1,2,3};
local tbl={["arr"]=arr};
local zeroindexed={[0]=1,2,3};
```Statements and blocks:
```kotlin
// Example TODO
``````lua
-- Example TODO
```Constant variables:
```kotlin
var x = 0
x = 1
val y = 2
y = 3
```Compiler error:
```
4 | y = 3
~
Variable 'y' was declared as constant (val)
```Functions:
```kotlin
val f1 = \arg1, arg2 -> {
print(arg1)
arg1 + arg2
}// Block can be omitted for a single expression
val f2 = \x -> 1+x// Arguments can be omitted when there are none
val f3 = \[ "a": "b" ]
val f4 = \{
print("f4")
f3()
}
``````lua
local f1 = (function(arg1,arg2)
print(arg1);
return (arg1+arg2);
end);local f2 = (function(x)
return (1+x);
end);local f3 = (function()
return {["a"]="b"};
end);local f4 = (function()
print("f4");
return f3();
end);
```