Live data from Hacker News

Nimrod: C + Macros + GC

nimrod-code.org

111–116 of 116 posts

Re: Nimrod: C + Macros + GC

#111
post #109

Earlier quoted context omitted.

In Factor, code is data. Remember, though, that there are many sources of goodness in a language. As for your actual question, I decided to write a stack-based language because: • They can be implemented very efficiently on real hardware. The stack-based VM is well established as an implementation technique for non–stack-based languages. • Like in Lisp, the simple structure makes them suitable for useful visualisatio…

I agree with all of those, to me is just seems like transformation into stack-based language should be made as part of the compilation process, not written down by the programmer. Maybe it's just me, I totally admit that I'm not used to thinking in concatenative languages as I've never used one, but mathematics, with named variables and control- and data-flow denoted by functions or sequential lines of operations, se…

I totally understand. In fact, Kitten has named variables for that reason. You can write code that looks imperative, expressiony, or dataflowy, according to taste. Here’s a silly example:

    // Implicitly thread state between functions.
    def promptInt:
      ": " cat prompt
      readInt
      fromSome

    // Write stacky code if you want.
    def squareDiff:
      - dup *

    // Use locals as much as you need to.
    "x0" promptInt ->x0
    "y0" promptInt ->y0
    "x" promptInt ->x
    "y" promptInt ->y

    x0 x squareDiff ->a
    y0 y squareDiff ->b

    a b + sayInt

Re: Nimrod: C + Macros + GC

#112
post #98

Ugh, the community is barely alive and it's an unwieldy collection of non-orthogonal constructs. Generics and a few whiz-bang features doesn't paper over the sins upon sins. I see this project cutting back features or dying under the weight of crushing unmaintainability. (sad.)

>> ...unwieldy collection of non-orthogonal constructs... >> ...doesn't paper over the sins upon sins... Please elaborate. I didn't see any of that and honestly don't know what "non-orthogonal constructs" means. I'm no language design expert but would like to know what, to you, are the obvious deficiencies.

Non-orthogonality: Multiple features that accomplish nearly the same result in different ways.

For a language maintainer, this is another piece that will have to be supported, troubleshooted and documented.

The other problem for users is that it gives a sense of confusion and uncertainty (Paradox of Choice) about the correctness of a program that may lead to multiple refactorings that don't add any value. Also, more features require more learning and makes programs harder to understand.

The goals of any good language should be correctness and understandability. Arguably, Python learned the lessons from Perl. But there are many different languages, and some are better in different instances.

What Nimrod turns into will be hard to say, but Go and Erlang need more competition.

Re: Nimrod: C + Macros + GC

#113

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"…

On first sight it resembled Python, while a second look revealed lots of Pascal legacy... Really what's the deal-maker?

Re: Nimrod: C + Macros + GC

#114
post #110

I don't understand why Nimrod has to mostly look like Python, but then make all kinds of innovations in syntax and formatting which have nothing to do with performance.

And I find these "innovation" mostly solving problems that didn't have to exist.

Re: Nimrod: C + Macros + GC

#115
post #89
post #72

Earlier quoted context omitted.

I'm in scientific computing so the floating-point performance is by far my biggest concern. In the tests I just ran, Nimrod and C are virtually identical in time (probably creating near-identical machine code). test.nim: var sum = 1.0 while sum int main() { double sum = 1.0; while(sum C time / Nimrod time, average of 10 runs: 1.00

Perhaps unrelated. What are you thoughts so far on Julia? http://julialang.org/

I've checked it out on your recommendation. I like the syntax even better than Nimrod's, it has better support for scientific work, and the floating-point performance is virtually identical. The only problem is that global variables are apparently not allowed to be typed as plain primitives, so this program:

  s = 1.0
  while s
Has mysteriously terrible performance. You have to use:

  function test()
   s = 1.0
   while s
to see what Julia can really do.

Re: Nimrod: C + Macros + GC

#116
My favorite example from their tutorial:

  if yes("Should I delete all your important files?"):
    echo("I'm sorry Dave, I'm afraid I can't do that.")
  else:
    echo("I think you know what the problem is just as well as I do.")
Post reply on HN