Re: Announcement: The Nim compiler is rewritten in Python with some modules optimized in C
You had me there for a few minutes @Araq, fair play :)
Re: Announcement: The Nim compiler is rewritten in Python with some modules optimized in C
today I don't eat fish (lol) on April 1st rewrite all that in Python ... and why not in gwbasic with the one opening on the assembler
Re: Announcement: The Nim compiler is rewritten in Python with some modules optimized in C
I'm strongly opposed to that plan! While I fully agree that Nim (currently) does a lot of uncool stuff (e.g. static typing) I do not consider Python and C good choices. Instead of Python we should be bold and directly walk into where the future is: AI based image interpretation instead of Python, which while being widely liked still implements, pardon me, an old-school boring paradigm. We should not allow ourselves to be blocked by frankly meaningless dictums like a PL having to be "text based"! As for C I _almost_ agree if it were not for the stubborn newer standards introducing anti-freedom stuff like "restrict" and, as I just learned by even GCC inventing "safety" devices like "access". Reason: All of that costs performance. Sorry, some might not like to hear it, but _every_ check, every "safety feature", and in fact even superficial type checking _costs performance_ either at compile time or at run time. I do however fully propose our BDFL's plan to use void pointers and would infect strongly urge the Nim team to _only_ support void pointers. No more nice and dandy - but performance hungry and attention demanding - integers, floats, and what not (let alone signed and unsigned!) but only 'ptr void'. If something can't be expressed by void pointers it's not worth to be expressed anyway.
Re: Announcement: The Nim compiler is rewritten in Python with some modules optimized in C
"I think we can get away with modelling the Nim AST in C via a single void* type" This one line killed me haha
Re: Announcement: The Nim compiler is rewritten in Python with some modules optimized in C
Best 1 April ever XD
Re: Announcement: The Nim compiler is rewritten in Python with some modules optimized in C
Read that post, peek at the calendar and have a laugh ;-)
Re: Announcement: The Nim compiler is rewritten in Python with some modules optimized in C
what does this mean for us, humble mortals?
Re: Announcement: The Nim compiler is rewritten in Python with some modules optimized in C
Writing performant code in C these days? How absolutely immoral! Have you considered our lord and saviour Rust? /s Also, I love this part: "The perfomance critical parts inside the Nim compiler are probably: The lexer, the parser, the semantic checker, the overloading resolution mechanism, the VM for macro evaluations and the code generators. " \--> that's the entire compiler right there boiz
Re: Announcement: The Nim compiler is rewritten in Python with some modules optimized in C
great ! I can't wait !
Re: Announcement: The Nim compiler is rewritten in Python with some modules optimized in C
臘♂️ Nice one.
Re: Announcement: The Nim compiler is rewritten in Python with some modules optimized in C
Hey jjude - Check your calendar.
Re: Announcement: The Nim compiler is rewritten in Python with some modules optimized in C
All of NIM will be rewritten in Python or only machine learning part? Isn't rewriting all of the language into another language waste of time rather than spending it on improving either the language or the ecosystem?
Re: Announcement: The Nim compiler is rewritten in Python with some modules optimized in C
Took to long for me to realize XD
Announcement: The Nim compiler is rewritten in Python with some modules optimized in C
So, this is something that we've considered for a while now, after all these years writing production code in Nim, we long for Python's lack of static checking; in the end there is always a Nim code snippet that tests the part of the Nim compiler we touched anyway, the static type system doesn't speed up Nim's core development. Python is simply more productive to work in, especially considering its ecosystem. For example, we want to add machine learning to the Nim compiler, if the Nim compiler were written in Python, it would be as simple as `import machinelearning`. However, it is well known that Python code can sometimes be slow if it's CPU bound. So these CPU bound parts of the Nim compiler will be written as Python extension modules in C. Writing a product in two vastly different programming languages allows us to use each language for the part where it shines, C for speed, Python for the glue code. The perfomance critical parts inside the Nim compiler are probably: The lexer, the parser, the semantic checker, the overloading resolution mechanism, the VM for macro evaluations and the code generators. Thankfully C is a well understood language with a friction-less type system, for example, I think we can get away with modelling the Nim AST in C via a single `void*` type. We have been working on this in the last couple of months secretly and these improvements will be part of the upcoming version 1.2 release.