Live data from Hacker News

Nimrod: C + Macros + GC

nimrod-code.org

61–70 of 116 posts

Re: Nimrod: C + Macros + GC

#61
post #31

What's really amazing about this language is that until only recently it has been developed solely by one person in his spare time no less. It is competing with the likes of Rust and Go which have pretty big companies behind them.

There are quite a few very performant languages like that. I would like to list two, ATS and Felix. I commented on Felix today at https://news.ycombinator.com/item?id=6274322

A good HN day for language enthusiasts.

Re: Nimrod: C + Macros + GC

#62
post #57

I wonder what other wonderful languages I've never heard of. Really, please share!

Some of my relatively obscure favorites: Io: http://iolanguage.org/ Dylan: http://opendylan.org/ Euphoria: http://www.rapideuphoria.com/

i've always felt that had i discovered euphoria earlier in my programming life, i would have really liked it. these days i'd miss all the features more recent languages have borrowed from lisp and/or ml, but it would have been an awesome second or third language (after basic and c).

Re: Nimrod: C + Macros + GC

#63
post #36
post #19

This reminds me a lot of D. It's low-level, GCed, essentially intended as a nicer C/C++. But I think it suffers from the same fatal flaw that D does: you have to semi-manually translate C headers that you want to use. Like D, it provides an automated tool to help, but the translated headers will inevitably lag their original counterparts. As another commenter below noted, the var and proc thing is also redundant and…

Is "fatal flaw" the right term? I do not see any way to fix this. Even including a full C parser and preprocessor into the D/Nimrod compiler would not solve the problem.

Obviously, I have no perfect solution. I was initially harboring the vague hope that Nimrod would be able to avoid this problem by virtue of compiling to C.

But I do still assert that this is a "fatal flaw" for a systems programming language. When I wrap a C library in, say, Python, I am already forced to write a wrapper layer, so there's no discomfort or surprise in declaring a few additional structs or function prototypes.

For a novel systems programming language, however, whose raison d'être is to save me keystrokes over C/C++, it feels like two steps forward and one step back to have a more concise main program but lots of auxillary handwritten header translations that have to be manually maintained.

I believe that the primary reason for the success of C++ is its easy compatibility with C, and any creators of would-be C++ replacements who fail to understand this are doomed to failure.

Re: Nimrod: C + Macros + GC

#64
post #20

Earlier quoted context omitted.

Nobody can explain to a dedicated C++ programmer why a new language is better than C++. I have tried for more than a decade many times and all I have ever gotten across has apparently been a "wah wah wah" noise like the adults in Peanuts. Because C++ is multi-paradigm, all paradigms are possible within it (although they may not be syntactically easy or have reasonable error messages, etc etc). Therefore, either C++ i…

std::cout If you're using namespace std then it's obvious (note that this is considered bad practice), assuming you haven't overridden <<, but otherwise it depends on endl's type and value. Maybe you meant std::endl?

You may also be surprised that "??!" is a trigraph for "|" in case your keyboard doesn't have one. I am not making this up.

Re: Nimrod: C + Macros + GC

#65

I wonder what other wonderful languages I've never heard of. Really, please share!

For an interesting systems programming language try ATS [1]. It's an ML style functional programming language with dependent types, linear types, macros, generics and compiles to C giving reasonable portability.

[1] http://www.ats-lang.org/

Re: Nimrod: C + Macros + GC

#66
post #54

Earlier quoted context omitted.

Note that nimrod compiles to C, and your JVM may be implemented in C or C++. So for the measly gain of not having to run a command on the destination platform (nimrod c name.nim) you are bringing in the runtime performance drawbacks of the whole JVM and requiring a further layer of abstraction. Plus bytecode doesn't mean a program will run at all, look at all the java programs which run on android without modificatio…

I'm in CompBio and the sense I get is that it's a lot easier to get someone to try your tool if all you have to do is provide them the jar which they just have to click on and it runs. Whereas with compilation, you first have to make sure you have all the platforms covered and then force the potential user to select the right executable for the platform.

Just distribute the source.

I'm in CompBio too and actively avoid software distributed as just jar files. Give me the source so I can fix your (probably) broken software.

(Yes, I have a low opinion of the quality of software in my field.)

Re: Nimrod: C + Macros + GC

#67
post #62
post #57

Earlier quoted context omitted.

Some of my relatively obscure favorites: Io: http://iolanguage.org/ Dylan: http://opendylan.org/ Euphoria: http://www.rapideuphoria.com/

i've always felt that had i discovered euphoria earlier in my programming life, i would have really liked it. these days i'd miss all the features more recent languages have borrowed from lisp and/or ml, but it would have been an awesome second or third language (after basic and c).

I discovered Euphoria back in the DOS days when it was still commercial. I agree that it seems a little dated these days but I still fondly remember it.

Also it is still a great language for non-professional programmers and still has an active community there. Note the recently updated SDL2, SFML2, and Allegro bindings for example.

Re: Nimrod: C + Macros + GC

#68
I actually discovered this yesterday and spent Saturday morning learning about it. I really like most of the syntax, especially the "var/const/let" distinction together with "if/when". I'm sort of wish that Rust and Go would just copy that. The semantics seemed to be up to par with this generation of potential C replacements, but not any better than the others.

Re: Nimrod: C + Macros + GC

#69
Nimrod looks a lot like someone took Borland's ObjectPascal and removed the begin/end block semantics in favour of whitespace indentation.

For example, they use the "var: type" syntax; the syntax for declaring classes is nearly identical; "case [value] of" is right out of Pascal, as is the "0..2" range syntax. They refer to "procedures" as opposed to functions. They even use naming conventions from ObjectPascal: "T" as a prefix for types (eg., TChannel), "P" for the Nimrod equivalent to pointers (eg., PChannel is a "ref TChannel"), "F" for class members.

I would not be surprised if the author was an old Turbo Pascal/Delphi hand.

Re: Nimrod: C + Macros + GC

#70

Earlier quoted context omitted.

std::cout If you're using namespace std then it's obvious (note that this is considered bad practice), assuming you haven't overridden <<, but otherwise it depends on endl's type and value. Maybe you meant std::endl?

You may also be surprised that "??!" is a trigraph for "|" in case your keyboard doesn't have one. I am not making this up.

Ohhhh... GCC warns about trigraphs, so I tend to forget about them, but wow did I fall for that one.

C++ is a wonderful language for people who like puzzles, and it's also good for making fun of know-it-alls.

Post reply on HN