Live data from Hacker News

Nimrod: A New Approach to Metaprogramming [video]

infoq.com

11–20 of 84 posts

Re: Nimrod: A New Approach to Metaprogramming [video]

#11
post #8

I am very intrigued by Nimrod. The language seems to have goals that overlap with e.g. Rust, but with a bunch of really interesting design decisions (e.g. GC by default, but first class support for manual memory management). Given the amount of force driving Rust (and Rust's PR machine), compared to Nimrod which seems to be really pushed forward by one single person, I'm really impressed by how far Nimrod got. I real…

> GC by default, but first class support for manual memory management

Since Mesa/Cedar (1978) there have been quite a few systems languages proposing that approach.

http://bitsavers.trailing-edge.com/pdf/xerox/parc/techReport...

Re: Nimrod: A New Approach to Metaprogramming [video]

#12
post #3

I really enjoy the language so far. For me, it's the perfect middleground between C and python: a fast compiled language, and one where you can be as productive as in python. I also tend to prefer catching errors early, and having a typed language that warns and errors at compile-time is great.

heh.. sounds like Go

Go is not that modern, for those of us that know the alternative world of Algol family of languages.

Re: Nimrod: A New Approach to Metaprogramming [video]

#13
post #8

I am very intrigued by Nimrod. The language seems to have goals that overlap with e.g. Rust, but with a bunch of really interesting design decisions (e.g. GC by default, but first class support for manual memory management). Given the amount of force driving Rust (and Rust's PR machine), compared to Nimrod which seems to be really pushed forward by one single person, I'm really impressed by how far Nimrod got. I real…

Initially, I was kind of 'meh' towards Nimrod since Rust already looked so good. But when I recently read about the features, especially the metaprogramming and compile-time features, it seems like it could be really fun and powerful to program in.

Re: Nimrod: A New Approach to Metaprogramming [video]

#14
post #3

I really enjoy the language so far. For me, it's the perfect middleground between C and python: a fast compiled language, and one where you can be as productive as in python. I also tend to prefer catching errors early, and having a typed language that warns and errors at compile-time is great.

I've found some (arguably minor) things to be kinda messy. Maybe the result of a one-person language that grows too much before getting some feedback.

1) Everything is (strangely) called a procedure, and then there's syntax to differentiate arguments that will be modified in place (proc myproc(myarg : int, inplacearg : var int)). Kinda weird, and a lost opportunity to have checking for pure functions at compile time.

2) import vs. include. Why have include at all to shoot yourself in the foot if you have cheap namespacing?

3) If vs. When ?

4) varargs feels kinda unnecessary

5) Case-insensitive. Oh... why?

On the bright side, I like how OO was implemented.

I disagree that it's a middleground between C and Python though. I see it more like an evolution of Pascal, it has the same niceties (ALGOL-like, static types, builds executables) and some things added on top (no VM, but GC'ed, metaprogramming).

Re: Nimrod: A New Approach to Metaprogramming [video]

#15
post #12

Earlier quoted context omitted.

heh.. sounds like Go

Go is not that modern, for those of us that know the alternative world of Algol family of languages.

Go basically only has one modern feature (goroutines). Beyond that it's a throwback to Java version 1.

Re: Nimrod: A New Approach to Metaprogramming [video]

#17

From the little I know about metaprogramming, it sounds analogous to doing string manipulations in a language, and then eval'ing it (which is heavily frowned upon, at least in python). How is this understanding wrong?

Because here you're not doing string manipulation, but AST manipulation (i.e., the datastructure you get after parsing the language).

Re: Nimrod: A New Approach to Metaprogramming [video]

#18

From the little I know about metaprogramming, it sounds analogous to doing string manipulations in a language, and then eval'ing it (which is heavily frowned upon, at least in python). How is this understanding wrong?

It's a bit higher level, roughly like generating HTML using a templating library that auto-escapes to avoid XSS attacks. There are fewer ways to screw up and since it happens at compile-time, it's more secure.

Generally speaking, if you would normally do something using reflection, you can also do it using code generation, which should compile to faster code (since you're not interpreting it at runtime) but possibly at the cost of code bloat and making the code harder to follow.

Re: Nimrod: A New Approach to Metaprogramming [video]

#19
post #12

Earlier quoted context omitted.

Go is not that modern, for those of us that know the alternative world of Algol family of languages.

Go basically only has one modern feature (goroutines). Beyond that it's a throwback to Java version 1.

Go interfaces are also new.

Re: Nimrod: A New Approach to Metaprogramming [video]

#20
post #10

Earlier quoted context omitted.

heh.. sounds like Go

With Nimrod's macro, you can do awesome things. It can improve readability a good deal. Here's an example I made: https://github.com/TechEmpower/FrameworkBenchmarks/blob/mast... Go version: https://github.com/TechEmpower/FrameworkBenchmarks/blob/mast...

The Nimrod version is shorter, but it seems harder to tell whether error-checking is done right.
Post reply on HN