Nim too, as it can use Zig as a compiler. There's also https://github.com/treeform/shady to compile Nim to GLSL. Also, more generally, there's an LLVM-IR->SPIR-V compiler that you can use for any language that has an…
Behaviours don't have to be decoupled from the data they operate on. If I write a procedure that takes a particular data type as a parameter, it's a form of coupling. However, there's no need to fuse data and code…
Unfortunately, while OOP promises code reuse, it usually makes it worse by introducing boundaries as static architecture. OOP's core tenet of "speciating" processing via inheritance in the hope of sharing subprocesses…
> It will not emit warnings saying it did that. You're right. I was sure I read that it would announce when it does a copy over a sink but now I look for it I can't find it! > The static analysis is not very…
Nim is stack allocated unless you specifically mark a type as a reference, and "does not use classical GC algorithms anymore but is based on destructors and move semantics": https://nim-lang.org/docs/destructors.html…
Although it's not as extensive as Rust's lifetime management, Nim manages to infer lifetimes without specific syntax, so is it really a syntax issue? As you say, though, C++ template magic definitely has its limits.
To be fair, you've posted a toy example. Real games are often chains of dependent systems, and as complexity increases, clean threading opportunities decrease. So, while yes it's nice in theory, in practice it often…
Native Nim libs are definitely nicer, but being able to output C/C++/JS/LLVM-IR with nice FFI means you can access those ecosystems natively too. It's one reason the language has been so great for me, as I can write…
Personally, I think Python's success is down to the productivity of its peudocode-like syntax letting you hack prototypes out fast and easy. In turn, that makes building libraries more attractive, and these things build…
Interestingly, Delphi Pascal has a single pass compiler with generics, though I'm not sure about type inference. I was under the impression Go originally avoided generics more for a perceived abstract complexity for…
Shoot me an email at arctsint@proton.me Cheers!
Types are stack allocated by default. "var data: MyObject" is on the stack. "var arr: array[1000, MyObject]" is allocated on the stack sequentially. Only dynamic seq or ref types use the heap by default.
Reference semantics are part of the type. So "var i: int" is value, "var i: ref int" is a heap allocated reference that's deterministically managed like a borrow checked smart pointer, eliding reference counting if…
Too much string copying iirc. It was written a while ago. Hopefully it'll get updated/replaced some time, but there's plenty of faster 3rd party ones already.
Of all the recent changes, default values is my favorite. Aside from generally useful and further reducing the need for initialisation boilerplate, I lets us guarantee valid state at compile time for things like enums -…
Looking forward to trying out this release! After programming professionally for 25 years, IMO Nim really is the best of all worlds. Easy to write like Python, strongly typed but with great inference, and defaults that…
I should add that Nim still still has a 'separate language' for types, so doesn't quite fit OP's bill. Nevertheless, it's quite easy to build type constructs using statically resolvable expressions. I'd love to know if…
> Eventually we need to make type systems just metaprogramming using the primary language Nim is like this and its fantastic. None of the weird special rules for metaprogramming, just Nim code manipulating ASTs at…
That was fascinating, thanks. Please do consider posting this here as its own article, it would be interesting to read others comments. My reading of this - and please correct me if I'm wrong, I'm still learning - is…
What you describe sounds like experiments with "generative agents". Check out https://arxiv.org/abs/2304.03442
Your argument applies to style sensitivity as well to be fair - do you search for 'MyTestFunction' or 'my_TestFunction'... or was it 'My_TestFunction', maybe 'm_Y_tEsT_fUnCtION'? Style insensitivity lets you automate…
> That's a a compelling argument: GC/RC w/ stack allocation where possible. Indeed, it's a great combination that means you're productive and performant without really trying most of the time. The type system is really…
Also, aside from the fact GC is optional in Nim, what are you thinking of that cant be done with a GC?
Nim uses stack allocated value types by default, and GC (or ptr) is an optional tag to the type definition. GC types use borrow & move analysis like rust (not as good yet tho) so it can elide GC work when possible. GC…
Agree with all of this. The Nim language might fit the bill of treating humans as first class citizens, and certainly fits better with my need for productivity and performance without over-specifying details. The…
Nim too, as it can use Zig as a compiler. There's also https://github.com/treeform/shady to compile Nim to GLSL. Also, more generally, there's an LLVM-IR->SPIR-V compiler that you can use for any language that has an…
Behaviours don't have to be decoupled from the data they operate on. If I write a procedure that takes a particular data type as a parameter, it's a form of coupling. However, there's no need to fuse data and code…
Unfortunately, while OOP promises code reuse, it usually makes it worse by introducing boundaries as static architecture. OOP's core tenet of "speciating" processing via inheritance in the hope of sharing subprocesses…
> It will not emit warnings saying it did that. You're right. I was sure I read that it would announce when it does a copy over a sink but now I look for it I can't find it! > The static analysis is not very…
Nim is stack allocated unless you specifically mark a type as a reference, and "does not use classical GC algorithms anymore but is based on destructors and move semantics": https://nim-lang.org/docs/destructors.html…
Although it's not as extensive as Rust's lifetime management, Nim manages to infer lifetimes without specific syntax, so is it really a syntax issue? As you say, though, C++ template magic definitely has its limits.
To be fair, you've posted a toy example. Real games are often chains of dependent systems, and as complexity increases, clean threading opportunities decrease. So, while yes it's nice in theory, in practice it often…
Native Nim libs are definitely nicer, but being able to output C/C++/JS/LLVM-IR with nice FFI means you can access those ecosystems natively too. It's one reason the language has been so great for me, as I can write…
Personally, I think Python's success is down to the productivity of its peudocode-like syntax letting you hack prototypes out fast and easy. In turn, that makes building libraries more attractive, and these things build…
Interestingly, Delphi Pascal has a single pass compiler with generics, though I'm not sure about type inference. I was under the impression Go originally avoided generics more for a perceived abstract complexity for…
Shoot me an email at arctsint@proton.me Cheers!
Types are stack allocated by default. "var data: MyObject" is on the stack. "var arr: array[1000, MyObject]" is allocated on the stack sequentially. Only dynamic seq or ref types use the heap by default.
Reference semantics are part of the type. So "var i: int" is value, "var i: ref int" is a heap allocated reference that's deterministically managed like a borrow checked smart pointer, eliding reference counting if…
Too much string copying iirc. It was written a while ago. Hopefully it'll get updated/replaced some time, but there's plenty of faster 3rd party ones already.
Of all the recent changes, default values is my favorite. Aside from generally useful and further reducing the need for initialisation boilerplate, I lets us guarantee valid state at compile time for things like enums -…
Looking forward to trying out this release! After programming professionally for 25 years, IMO Nim really is the best of all worlds. Easy to write like Python, strongly typed but with great inference, and defaults that…
I should add that Nim still still has a 'separate language' for types, so doesn't quite fit OP's bill. Nevertheless, it's quite easy to build type constructs using statically resolvable expressions. I'd love to know if…
> Eventually we need to make type systems just metaprogramming using the primary language Nim is like this and its fantastic. None of the weird special rules for metaprogramming, just Nim code manipulating ASTs at…
That was fascinating, thanks. Please do consider posting this here as its own article, it would be interesting to read others comments. My reading of this - and please correct me if I'm wrong, I'm still learning - is…
What you describe sounds like experiments with "generative agents". Check out https://arxiv.org/abs/2304.03442
Your argument applies to style sensitivity as well to be fair - do you search for 'MyTestFunction' or 'my_TestFunction'... or was it 'My_TestFunction', maybe 'm_Y_tEsT_fUnCtION'? Style insensitivity lets you automate…
> That's a a compelling argument: GC/RC w/ stack allocation where possible. Indeed, it's a great combination that means you're productive and performant without really trying most of the time. The type system is really…
Also, aside from the fact GC is optional in Nim, what are you thinking of that cant be done with a GC?
Nim uses stack allocated value types by default, and GC (or ptr) is an optional tag to the type definition. GC types use borrow & move analysis like rust (not as good yet tho) so it can elide GC work when possible. GC…
Agree with all of this. The Nim language might fit the bill of treating humans as first class citizens, and certainly fits better with my need for productivity and performance without over-specifying details. The…