Developing a high level language over Zig
2 points
1 day ago
| 2 comments
| HN
Hi everyone I saw zig is and intresting language I am learning it and also making a transpilied High level language over it I want some help with developing syntax. in my lang there are three types of var declaration 1) using local keyword this are added in arena of the specific function. 2) using let keyword this are on stack but i am finding solution to make strings easier here. 3) manual memory but my transpiler will automatically use defer keywords so they are safe and delete once block exit 4) using unsafe direct fully manual memory management but still my transpiler will not let compiler till once in code the are freed.
gethly
2 hours ago
[-]
Why bother? Just use Odin https://odin-lang.org or Go https://go.dev/ if you want GC.
reply
auxym
1 day ago
[-]
Just an idea but Nim seems to have the features you mentioned. Nim "transpiles" to C, and can even be compiled via `zig cc` (which is an interace to clang). If you really want to, maybe you could make a zig backend for Nim?
reply
ziyaadsaqlain
1 day ago
[-]
no one even use nim plus nim dont give inline zig
reply
cb321
6 hours ago
[-]
Popularity is one thing { and probably more people use it than a non-existing new PLang you are only at the design phase of :-) }, but I think you misunderstood the backend idea. Nim has a javascript backend via `nim js` and on that backend you can use `emit` to do inline javascript, just as on the C/C++ backends you can use emit to put out C/C++. So, if you did do a zig backend, being able to emit inline zig would be part of that. It may still not be what you want, of course.
reply