there are much more important things that need to be worked on (just look at the issue tracker).
Indeed. In regards to backends, the continued development and testing of the JS backend is more important.
I don't think that having a backend for language X simplifies interfacing to that language all that much. You still have to map the concepts you are trying to wrap into nimrod concepts and doing an end-run around nimrod with emit and {.header.} is really far from ideal. If you make a mistake you get errors in the generated code and you sacrifice the ability to use any other backend. I like backends for added portability and more optimization opertunities but I do not think having a backend that generates language X makes it eaiser to interface with language X in a meaningful way.
All this could change in the future but it would require a lot of design work and it would be highly expermental (think being able to write a generic and apply a pragma that mapped it to a c++ template)
Another thing to note is that the backends we have seem to be rotting, I know the c++ one has had problems that nobody has bothered to fix because nobody used it in the first place and I doubt the js backend is really usable today (although my definition of usable may not be the same as other people's).
I don't think that having a backend for language X simplifies interfacing to that language all that much.
I think without a backend for a specific language its much harder - and in most cases almost impossible without writing ugly glue code in that specific language. But I agree, having a language backend is only half of the game. Mapping a nimrod generic to a C++ template would be really cool, but this is fiction at the moment.
I would really appreciate to have a Pascal backend, which would open the doors to the Lazarus GUI ( and a to faster compile times at the cost of little less optimized code, which is irrelevant for these kind of apps).
If the code generation process could be delegated to a compiletime macro library it would be much easier for third parties, which are not involved in the compiler process, to generate custom language backends. Haxe for example can do this and this was used to make a (not yet official) Python and a Lua backend.
The creators of Smart Mobile Studio, www.smartmobilestudio.com have announced a free version of their Object Pascal to Javascript compiler free.
This makes a FreePascal target more appealing, if their compiler is that good.
Why not Haxe target?
crazy idea, eh
Agreed that a D backend is a spectacularly bad idea.
An LLVM backend might make sense. What would be the aim? Better codegen than Nim->Clang? Maybe that would be a good GSOC project?
I don't think another backend is a worthwhile idea at the moment.
I'll have to agree with the Lazarus / FreePascal backend idea also.
Wouldn't adding support for a RAD IDE such as Lazarus help increase Nim's popularity? I would think so.
I am very interested in a freepascal backend. If there is enough interest, we should start a discussion how it should be done. I see two options:
1. translate the C backend to plain pascal. This should be "easy" because almost anything you can do in C you can do in pascal too. pro: could be done in a relatively short time con: it's C in a pascal disguise. Interop between nim and lazarus/fpc would be pia.
2. make a more mature backend, which takes fpc specialties into account (nim String -> pascal String,seq[T] -> array of T ...). pro: Interop between lazarus/fpc and nim would be much better con: takes much more time. more standard libs would be affected - maybe even GC.
2. is the only realistic option to get excellent interop with Lazarus. And if you don't need excellent interop generating object files and link them to the Lazarus project works fine already. (Yes, I know nobody does that.)
2. is not even hard to do (I learned a couple of new tricks, so it's much easier than it seemed to be a few years ago ;-) ), but I lack the time to do it. However I can give you precise instructions of how to do it.
So speak up if somebody here feels he is ready to write and maintain (!) yet another backend.
I know nothing of compiler writing, but if I want to try writing a FreePascal backend, where do I get started?
caveat: I suspect I may be biting more than I can chew.