5 ms·
(Disclaimer: one of the Nim core devs here) Happy to see you paint Nim in a (sort of) positive light, I hope I can help with this one negative. > I liked Nim
by dom96 9y ago
(Disclaimer: one of the Nim core devs here)
Happy to see you paint Nim in a (sort of) positive light, I hope I can help with this one negative.
> I liked Nim better in almost every way but one: the compiler was fickle and would just fail silently sometimes.
Can you give some examples and elaborate on what you mean by "fail silently"? Did you at least get a segfault?
- christophilus 9y agoUnfortunately, I don't have any examples off-hand. It was a month ago. I'll see if I can dig the repo back up and reproduce the error. As for how it failed, it did not segfault. It just stopped and dumped me back out on the terminal with no output at all. (I'm on OSX 10.12.6.)
- dom96 9y agoThat's a pity. Let me know if you dig it up. Next time please create an issue on GitHub[1], you don't have to worry about creating a small example either, as long as you give us all the code to compile it. 1 - https://github.com/nim-lang/nim https://github.com/nim-lang/nim
- christophilus 9y agoHey. I appreciate you showing this level of concern. I'll track down that project and open a few issues if I can reproduce it... It may not be until next week, due to traveling and other things coming up.
- christophilus 9y agoI tracked down the repo and wasn't able to get it to bomb on me as before. I honestly can't remember what scenarios triggered that, unfortunately, and I'm no longer working on the project (due to actually being back at the 9-5 job!).
- dom96 9y agoThank you for taking a look. Maybe the problem was already fixed :) If you do find anything else then do post it on GitHub, or at least let us know on IRC/Gitter.
- e12e 9y agoSince it's already brought up in this thread, I recently had (another) look at nim and was a little disappointed too. It's been a while, but as I recall, on Windows - it was difficult to find a supported way to output Unicode on the console in a sane, portable way (write utf8 nim source code, get wide strings in Windows console and utf8 under eg Linux) - and I think I also had some problems getting off the ground with statically linking sdl2 (again on Windows). The build/package/config system appear to in a bit of flux? [ED: and I think there were old open issues and forum posts for both problems, hence no new bug reports...]
- dom96 9y agoIndeed there are some bugs with unicode output[1]. Just to be clear the standard way to output anything to the console is `echo` (similar to Python's `print`). It seems that the progress on that issue has stalled. It's unfortunate but we do have limited man-power and rely on the community to help us out, this does mean that at this stage it helps if you don't mind getting your hands dirty with potential bugs. Unless one of us are directly affected by a bug, or we see a large number of users affected by it, it's unlikely that we will focus on it. Not much we can do there sadly. I hope you can understand. Regarding static linking I would say that it's challenging for most languages. Especially on Windows. If you pop into our IRC/Gitter channel[2] though I'm sure somebody would help you out. You can also probably get pretty far by asking C users for help. Regarding the build system, perhaps you are referring to the fairly recent addition of NimScript? I think that has stabilised by now. But if you've got any specific questions about it then feel free to ask them. 1 - https://github.com/nim-lang/Nim/issues/2348 https://github.com/nim-lang/Nim/issues/2348 2 - https://nim-lang.org/community.html https://nim-lang.org/community.html
- e12e 9y agoAs I'm now on my laptop with access to the two simple programs; for text output: import encodings var hello1 = convert("Hellø, wørld!", "850", "UTF-8") # Doesn't work - seems to think current codepage is utf8. var hello2 = convert("Hellø, wørld!", getCurrentEncoding(), "UTF-8") # Outputs correct text: echo hello1 # Outputs corrupted text: echo hello2 (And simply outputting an unconverted string fails, like hello2 does). As for the linking problem I had, the main issue is that it seems to be harder than it probably should, to get started with the GUI-programming with nim on windows. The following code works, provided one manually obtains sdl2.dll (and sdl2.lib for static linking) - however, even with static linking flags (no errors), the resulting exe still depends on the presence of sdl2.dll: import nimx.window import nimx.text_field import nimx.system_logger proc startApp() = var window = newWindow(newRect(40, 40, 800, 600)) let label = newLabel(newRect(20, 20, 150, 20)) label.text = "Hellø, wørld!" window.addSubview(label) runApplication: startApp() With sdl2.dll (and .lib) in the same folder both of these work: nim --threads:on --dynlibOverride:SDL2 --passL:SDL2.lib c -r win.nim nim --threads:on c -r win.nim but both fail without sdl2.dll present (ie: the "statically" linked exe still depends on dynamically loading sdl2.dll). And there's so far no easy way of getting a "supported" sdl2.dll to go with the nim compiler - as far as I can tell, neither "nimble install sdl2" or "nimble install nimx" provide a way to get the sdl2.dll and/or C source code to compile it. But perhaps managing DLLs and such is considered to be out-of-scope for nimble/nim package manager for now.