6 ms·
I'm a bit torn between these as none is suiting all of my needs: http://ecere.org/ http://ecere.org/ https://haxe.org/ https://haxe.org/ https://dlang.org/ htt
by danielEM 5y ago
I'm a bit torn between these as none is suiting all of my needs:
http://ecere.org/ http://ecere.org/
https://haxe.org/ https://haxe.org/
https://dlang.org/ https://dlang.org/
and ofc ...
https://vlang.io/ https://vlang.io/
All can compile to C and I find it somewhat important as would be very happy to share same code base with microcontrollers (SDCC), Android, Linux, Windows and web wasm. Unfortunately (to my knowledge) not all offer optional or selective garbage collection, some look immature and so on :-(
- moonchild 5y agoD does not compile to c, and has garbage collection.
- adamnemecek 5y agoIt had optional GC.
- danielEM 5y agoLooks like it does, sort of... https://forum.dlang.org/thread/cweufizceawykuglbara@forum.dlang.org https://forum.dlang.org/thread/cweufizceawykuglbara@forum.dl...
- tored 5y agoD has a BetterC mode without garbage collection https://dlang.org/spec/betterc.html https://dlang.org/spec/betterc.html
- fyzix 5y agoSounds like nim is the perfect fit for your usecase. https://nim-lang.org https://nim-lang.org It can also compiles to c, c++, obj-c and js...plus it has an official jetbrains plugin.
- elcritch 5y agoNim works great on microcontrollers. I'm using it with a goal of sharing codebases on embedded and not. It's awesome to be able to write some POSIX network code test it on Linux and get it running on an MCU. The new ARC garbage collector fits the domain well. The non-atomic reference counting makes it predictable and deterministic. Though, it's possible to write Nim without using the GC or turn it off completely.
- danielEM 5y agoNIM looks really amazing, and I mean it. Only thing that stops me from using it is that indentation hell. Can't understand regime enforced on devs to format code in only small number of predefined ways.
- xigoi 5y agoEnforcing a certain format is the best way to avoid bikeshedding and focus on writing code.
- tyingq 5y agoMaybe nim then? Compiles to C and has a sort of optional GC in that you can configure it to do plain reference counting.
- danielEM 5y agoMentioned earlier, NIM looks very mature and I like it in sense of what you can already do with it. Unfortunately indentation based scopes is something that I can't stand in programming language
- Tozen 5y agoPut me also in the group of those not feeling nim. Sad they decided to go the Python route of white space insanity.
- xigoi 5y agoHave you actually worked with an indentation-based language?
- pdimitar 5y agoI did and hated every minute of it. Automatic formatting is fine but if you don't indent while working it can get ambiguous and format your code wrongly. Also it's harder to visually parse. So yes I did and no, your subjective tastes aren't an objective reality. What's your point?
- xigoi 5y ago> if you don't indent while working it can get ambiguous And if you don't write braces in a language that uses braces, it will also get ambiguous. What's your point? > Also it's harder to visually parse. I know that ease of reading is subjective, but I still find it weird that a human finds this: a { b { c; d { e } } f } easier to parse than this: a: b: c d: e f > your subjective tastes aren't an objective reality I'm not the one who used the word "insanity" for the block delimiting system I don't like. > What's your point? You shouldn't disregard a language just for superficial syntax features.
- adamredwoods 5y agoNo optional GC: https://ziglang.org/ https://ziglang.org/
- danielEM 5y agono C backend unfortunately
- sitkack 5y agoAnything that can target Wasm can target C. https://webassembly.github.io/wabt/doc/wasm2c.1.html https://webassembly.github.io/wabt/doc/wasm2c.1.html
- danielEM 5y agoI thought of that solution, but the problem is that when you have 8bit microcontroller and all your operations from webassembly are translated to 32 bit operations then you gonna end up doing 8 bit math on 32 bit emulated math operations aligned back to 8 bit. :(
- sitkack 5y agoYou should see how it works in practice. Not try to discount your goals, but chasing 8 bits is anachronistic, an ESP32-C3 is a single core 160Mhz risc-v chip with 400KB of on chip ram for $1 qty 1. Rust can target AVR directly, https://www.avr-rust.com/ https://www.avr-rust.com/ Wasm runtimes also available for embedded platforms, https://github.com/wasm3/wasm3 https://github.com/wasm3/wasm3
- ylluminate 5y agoPop onto Discord share your problems about V and why you're not seeing it fit your needs: https://discord.gg/vlang https://discord.gg/vlang
- danielEM 5y agoThis is what spooks me out most for now: https://github.com/vlang/v/issues https://github.com/vlang/v/issues It looks like a lot of non trivial issues. Other than that I like the concept of V. Maybe except one small thing ":=" ;-)
- delian66 5y agoV does have an optional garbage collected mode. Just compile your program with: v -gc boehm file.v
- deleted 5y ago[deleted]
- errcorrectcode 5y agoRust had compile to C. It does wasm. No GC. Much safer than most everything except Pony and arguably Idris. Edit: IIRC, there is a wasm2c program that might work.
- TheCipster 5y agoTake a look at Nelua: https://nelua.io https://nelua.io You might like it.
- pjmlp 5y agoD can make use of -DbetterC, -v to track allocations, call GC.disable(), or just place a @nogc on the modules you don't want a GC running.