4 ms·
Is it statically typed?
by dataangel 4y ago
Is it statically typed?
- Cyberdog 4y agoNo: https://wren.io/try/?code=G4QwTgBAZg9jEF4ICIBG5kChbyQFgCZMBlATwGcAXAUwFsA6ABzAEsA7SgChwEog https://wren.io/try/?code=G4QwTgBAZg9jEF4ICIBG5kChbyQFgCZMBl...
- IshKebab 4y agoI have yet to find any nice easy "normal" (like Typescript or Dart) statically typed languages that can be easily embedded. In the Rust space there's Gluon which is statically typed but has a really weird syntax and is functional, and there's Rhai which is really quite nice but dynamically typed. I guess static type checking is probably more work on its own than writing an entire dynamically typed language.
- goodpaul6 4y agoI’m currently working on Tiny [0], a small statically typed programming languages which is even more minimal than Wren. [0] https://github.com/goodpaul6/Tiny https://github.com/goodpaul6/Tiny
- IshKebab 4y agoLooks interesting. How is the type just `array` in that example though? Doesn't it have to be an array of something?
- goodpaul6 4y agoInterestingly, given the minimal core of the language, arrays are not built in (this is something I'm looking to change, of course). As such, the "array" type is just an opaque type exposed via the C binding API. Given that there are no generics at the moment, this array API works with "any" values (similar to "any" in e.g. TypeScript).
- fm77 4y agoVery interesting! BTW: I think I found a typo: "MATCH2("+=", PERCENTEQUAL);" — should be "%=" ??
- goodpaul6 4y agoThanks! Just fixed this. Seems the "%=" operator is less useful than I thought.
- 10000truths 4y agoHave you checked out AngelScript? https://www.angelcode.com/angelscript/ https://www.angelcode.com/angelscript/
- IshKebab 4y agoOh yeah I always forget about this. I had seen it but it feels a bit archaic. Also it completely fails the "examples on the home page" litmus test.
- npage97 4y agoIn the lua realm, there is teal. It is very much like a typescript for lua https://github.com/teal-language/tl https://github.com/teal-language/tl
- pitaj 4y agoThere's mun [1] which is statically typed and AOT compiled. 1: https://github.com/mun-lang/mun https://github.com/mun-lang/mun
- IshKebab 4y agoThat has no mention of embedding in its description and has LLVM as a dependency so I assume it isn't easy. Looks like a decent language though.
- born-jre 4y agoWhat about just embedding WASM vm then languages like assemblyscript and c/c++,rust,zig,go can target it ?