4 ms·
You jumped on while it’s on the up and up.
by pducks32 9y ago
You jumped on while it’s on the up and up.
- joshbaptiste 9y agoif you're still looking around, you want to have a look at Nim, an alternative systems programming language with optional GC. https://nim-lang.org/ https://nim-lang.org/
- reificator 9y agoThanks for the heads up, but meaningful whitespace means I'm not likely to look too closely at it. The use of invisible characters to determine control flow is not something I'm a fan of. Here's a post I made on the topic a few months ago: https://news.ycombinator.com/item?id=15251078 https://news.ycombinator.com/item?id=15251078 Take note of how the reply that tried to play with whitespace was already broken by HN's code formatting. EDIT: Beyond whitespace sensitivity: * It compiles to an intermediary language rather than leveraging something like LLVM. * Despite having sum types it appears that idomatic Nim uses null pointers. * I'm seeing that it disallows pointer arithmetic in the same search results page that links to a runnable example of pointer arithmetic. * It uses exceptions, which obscure control flow and make grokking code much more difficult IMO. * Bindings are mutable by default. I'm not seeing a good reason to use Nim over Rust in the places where I would use Rust. (For personal use: game development) I could see it being competitive with where I use Go, but with whitespace sensitivity, exceptions instead of error values, and compiling to C, I'm not even sold on using it there.
- earenndil 9y agoHow about D[1] or possibly ante[2]? Ante has significant whitespace (sorry), BUT it has fancy macros. Goto is implemented as a macro, for instance. 1: https://dlang.org/ https://dlang.org/ 2: https://github.com/jfecher/ante https://github.com/jfecher/ante
- reificator 9y agoNote that I did edit the above post as you were replying. Also I should note that I'm writing this from the perspective of developing game engine style code. D: * D's garbage collector can be switched off, but last I checked (to be fair a few years ago) this even locked you out of parts of the stdlib. For smaller game engine projects, this is an issue. For larger ones, they often rewrite the stdlib anyway, though I'd expect growing pains while bootstrapping up to that point. * Memory safety guarantees appear to be much stronger in Rust than in D. The difference in approach demonstrates this well I think, Rust has an `unsafe` keyword while D has a `@safe` attribute. * It's great at its goal, which is to be (C++)++. It sidesteps a lot of the problems found in C++ and appears much more intentionally designed. * Despite a 7-8 year headstart for D, from the outside of both communities the Rust community appears much more vibrant. I've not heard of Ante, I'll go take a look.
- earenndil 9y ago> D's garbage collector can be switched off, but last I checked (to be fair a few years ago) this even locked you out of parts of the stdlib. For smaller game engine projects, this is an issue. For larger ones, they often rewrite the stdlib anyway, though I'd expect growing pains while bootstrapping up to that point. Yeah, that is a problem -- albeit one that people are currently working on fixing. Look at BetterC[1]. And I've heard rumours someone is rewriting the GC to be much more performant? And if nothing else, you can just stop the GC and manually collect your own memory, and a smart pointer implementation is probably relatively simple. However, is the GC even a problem? You know what they say about premature optimization. 1: https://dlang.org/spec/betterc.html https://dlang.org/spec/betterc.html
- reificator 9y agoI've spent enough time writing games in various GCed languages, and GC has been an issue in all of them. It's less about the optimization of the actual pause time and more about trying to make sure that things are as deterministic as possible for debugging's sake. Though the pause is of course an issue as well.