Re: Maybe a bug about built-in string to cstring converter

2017-01-08 Thread Araq
Your WORST solution is what the C backend would have emitted.

Re: Installation on 64-bit Windows

2017-01-08 Thread Kerp
It seems too that tdm-gcc is the most convienent way in windows to get a compiler but it does not seem to like vulkan libs (trouble linking). And you have to deal with winpthreads licence, but you get a working compiler easier it still works for opengl for instance. but i switched too linux

Re: create code in static blocks?

2017-01-08 Thread LeuGim
> Is it possible to make the static block evaluate to echo "hello world", that > then gets evaluated at runtime again? Just to call one and the same code at compile- and at run-time? This? template hw = echo "hello world!" static: hw() hw()

create code in static blocks?

2017-01-08 Thread Krux02
I know Nim has support for [static blocks](http://nim-lang.org/docs/manual.html#statements-and-expressions-static-statement-expression), but I do not know what they can be used for, except from printing hello world at compile time, like it is written in the example. I was hoping I could create

Re: Maybe a bug about built-in string to cstring converter

2017-01-08 Thread Ward
I don't think adding a nil check will become the performance bottleneck. Here is my test code: import times proc MulDiv*(P1: int32, P2: int32, P3: int32): int32 {.stdcall, discardable, dynlib: "kernel32", importc.} proc test(s: cstring) = # do someting, to

Re: What do you think about Redox and Electron?

2017-01-08 Thread LeuGim
@Krux02: All my thoughts. Using web technologies is a torture even for developing modern web applications (they were created in 90s for formatted text, not for what sites are today), and using them for desktop applications, for which sane technologies exist in quantity - is just madness. It's

Re: What do you think about Redox and Electron?

2017-01-08 Thread Krux02
Redox: I like the idea that people want to build an operating system in Rust. I think it is a great way to show how powerful and productive that language is. As a real operating system that people want to use, I dont really want it. I am using Linux, and I have already not all software. Adding

Re: What do you think about Redox and Electron?

2017-01-08 Thread Stefan_Salewski
I heard about Rust OS some months ago (Is there one more than Redox). I think that is very interesting, indeed that would be my main motivation to learn Rust language deeply. But it is very hard for new operating systems to become popular. For Linux it was a bit different, because it was only

Re: Surprises with Generics

2017-01-08 Thread Varriount
The symbol binding rules for generics are outlined in the manual [here](http://manual.nim-lang.org/docs/manual.html#generics-symbol-lookup-in-generics). It might help if the section defined what exactly 'open' and 'closed' symbols are, since most programmers don't know about compiler-specific

Re: Code snippet of the month (py2nim)

2017-01-08 Thread Krux02
Now I with this forum had a `run code` button, so I can see the result in the browser, but aporia is not far away. I did not look into the implementation, but I think I could use something very similar, but instead on strings it should work on the AST. But how do you write a grammar for AST

Re: Overloading indexing operator for string type

2017-01-08 Thread gergelyk
I see. Thank you for explanations.

Code snippet of the month (py2nim)

2017-01-08 Thread Araq
Don't use regular expressions to parse programming languages, but if you have no better tool at hand, at least use a `multiMatch` in combination with regular expressions. What's a multi match? Something that considers all the given patterns in lock-step. Hopefully somebody can give a better

Re: Overloading indexing operator for string type

2017-01-08 Thread Araq
Yeah, pretty much. Overloaded indexers are looked for if the builtin indexers fail, but it is a special case in the language.