Re: develop nim in SpaceVim

2018-08-12 Thread SpaceVim
This layer includes a nim plugin for vim, the link is: [https://github.com/wsdjeg/vim-nim](https://github.com/wsdjeg/vim-nim) this is just a fork of some other plugins, but I will make some changes. @mashingan, can you use chrome debug tool to see which source is slow?

Re: develop nim in SpaceVim

2018-08-12 Thread SpaceVim
link works well for me, as in SpaceVim we enable neomake by default. you can also have a try with neomake without SpaceVim. [https://github.com/neomake/neomake](https://github.com/neomake/neomake)

Re: How can I generate highly-customized DSL from Nim?

2018-08-12 Thread Hlaaftana
This is my best shot at generating your C code without codegendecl or emit. type Data {.importc: "DATA".} = object ... Int {.importc: "INT".} = int String {.importc: "STRING".} = string proc test1(arg: Data): Data {.exportc: "func_test1", importc:

Undeclared identifier even when .nim file is properly imported

2018-08-12 Thread drifter
Hi there, I'm wondering if you had managed to resolve this issue, as I'm running into the same problem.

Re: Can you leave a link to download the Nim in Action book in pdf / djvu format?

2018-08-12 Thread emekoi
that may be true, but the question is where you get that BTC.

Re: How can I generate highly-customized DSL from Nim?

2018-08-12 Thread amalek
Haven't you considered macros? You could have something like this: import my_awesome_DSL_macros func_declare: test1(arg: DATA): DATA func_create: test2(arg: int): string = do_something(arg) Run The `func_declare:` and `func_create:` are

Lessons learned/idioms

2018-08-12 Thread yatesco
Howdy - is there a good resource for benefitting from others experiences of writing nim? A set of best practices or idioms? Nim is awesome, but the choice to “how do I do X” is usually “this, that or the other”, and as a green newbie I can feel a bit adrift. I highly recommend Nim in Action,

Re: A tutorial for cross-compiling to Windows on a Linux machine?

2018-08-12 Thread juancarlospaco
`--embedsrc` is not really needed, and can make fat binaries IMHO, but looks good.

Re: Can you leave a link to download the Nim in Action book in pdf / djvu format?

2018-08-12 Thread juancarlospaco
You can still use BTC at 15...

How to read string slices as integers performantly?

2018-08-12 Thread tim_st
Assuming I have a string var x = "" Run of length 16. I want to read the chars "" as int32, the chars "" as int64 and the chars "" as int32. What would be the most performant way to read these 3 slices into the int types if I know

Re: How can I generate highly-customized DSL from Nim?

2018-08-12 Thread RedFred
Thank you @Hlaaftana, not only for the snippet but also for mentioning codegenDecl which I was totally unaware of. I just looked it up on the docs and I think this may be what I'm looking for so I'm going to investigate this further, cheers.

Re: compile-times

2018-08-12 Thread amalek
Looking at this line [(1)](https://github.com/cdunn2001/compile-times/blob/91c41d81a1ccb46406bf64eb9f923ee6eacdd679/driver.py#L22), which I assume to be the actual command that runs the Nim compiler, it seems that you're not using [tcc](https://en.wikipedia.org/wiki/Tiny_C_Compiler), which

Re: How can I generate highly-customized DSL from Nim?

2018-08-12 Thread RedFred
thanks for replying @amalek, yes I did consider macros - but was just wondering if a compile-time approach might be feasible or even better somehow.

compile-times

2018-08-12 Thread cdunn2001
Times in seconds for compiling 10,000 functions: > [https://github.com/cdunn2001/compile-times/blob/master/results/MacAir2015-10k.csv](https://github.com/cdunn2001/compile-times/blob/master/results/MacAir2015-10k.csv) That is copied from a reddit thread nearly 2 years ago, and I've added Nim.

Re: Lessons learned/idioms

2018-08-12 Thread drifter
hi there, I found [https://scripter.co/notes/nim](https://scripter.co/notes/nim)/ to be very useful.

How can I generate highly-customized DSL from Nim?

2018-08-12 Thread RedFred
Hi all, I'd like to be able to compile Nim (or generate from Nim) code in a specialised C-based DSL. For example I'd like to write something like this in Nim func_declare test1(arg: DATA): DATA func_create test2(arg: int): string = do_something(arg) Run which

Re: Uninstall Nim and Tools

2018-08-12 Thread dom96
This is curl failing. So you might need to diagnose whether there is something wrong with it.

Re: Can you leave a link to download the Nim in Action book in pdf / djvu format?

2018-08-12 Thread yatesco
@dom96 deserves payment because it is an awesome resource and it requires untold effort to produce a book. It is also a shame that someone is denied access because of their situation. The assumption we should challenge is that the funds must be provided by the recipient! What do you think of

Re: A tutorial for cross-compiling to Windows on a Linux machine?

2018-08-12 Thread yatesco
I put a docker together to demonstrate my issue with cross compiling and the awesome community sent a PR ([https://github.com/yatesco/docker-nim-dev-example/pull/1](https://github.com/yatesco/docker-nim-dev-example/pull/1))