Re: Advent of Code 2018 megathread

2018-12-18 Thread filip
I know atleast three people who rage quit advent of code this year because of day 15. Day 16 was a lot of fun and I'm currently finding time to work on day 17 but I still have nightmares about goblins and elves :(

Re: Future of Nim ?

2018-12-18 Thread shashlick
Talking about killer app or general pattern, I think this recent article is interesting: [https://chameth.com/2018/12/09/over-the-top-optimisations-in-nim](https://chameth.com/2018/12/09/over-the-top-optimisations-in-nim)/ * Prototype quickly in a clean high level language - already faster tha

Re: Future of Nim ?

2018-12-18 Thread Libman
> Do you think that Nim will have a future ? Definitely. It is open source and liked by thousands of programmers (most of whom are waiting for it to stabilize and mature). No matter what happens, there will be some people interested in developing Nim. As I recently posted, [Nim's package ecosys

Re: constness of refs & ptrs

2018-12-18 Thread mratsim
It's not about Nim and Rust but about expectation for keywords like let and var which are used in plenty of other languages (C#, Ocaml, Javascript, Swift, Julia, ...)

Re: constness of refs & ptrs

2018-12-18 Thread JD
This is the common sense in design I've come to expect. This may come off as blunt, but if someone wants nim to be rust, they should just go use rust. Use what works for you.

Re: Unexpected behaviour

2018-12-18 Thread Araq
This works type SNodeAny = ref object of RootObj SNode[T] = ref object of SNodeAny DNode[T] = ref object method newDNode(s: SNodeAny) {.base.} = echo "newDNode base" method newDNode[T](s: SNode[T]) = echo "newDNode generic" meth

Re: Unexpected behaviour

2018-12-18 Thread zevv
Thanks for explaining. I'll leave this thread and continue discussion in the github issue.

Re: Unexpected behaviour

2018-12-18 Thread yglukhov
@zevv please report this issue on github.

Re: Unexpected behaviour

2018-12-18 Thread zevv
https://github.com/nim-lang/Nim/issues/10038

Re: constness of refs & ptrs

2018-12-18 Thread Araq
> ...may I push this idea again ? :) You may and I'm hearing you but in the longer run `ref` usage should be discouraged and then the problem disappears too. And solving problems by avoiding some language features is much more elegant than yet-another-feature IMHO. Pointers are like `goto`, to

Re: Unexpected behaviour

2018-12-18 Thread mashingan
> let s = SNodeAny(SNode[float]()) > > newDNode(s) s is SNodeAny, is it given? ;/ @mratsim's post should be helpful in this case [https://forum.nim-lang.org/t/4415#27607](https://forum.nim-lang.org/t/4415#27607) I think it's because generic is compile-time while what you wanted is in runtime.

Re: constness of refs & ptrs

2018-12-18 Thread sendell
1 year later, I'm still worried about that missed opportunity of stronger immutability guarantees in Nim. The whole distinction between var and let feels useless without this. When looking at a proc signature, I have no way to know if its parameters will be modified, unless they are value-types

Unexpected behaviour

2018-12-18 Thread zevv
I've been hunting strange behaviour in my code base which I have reduced to the following snippet. type SNodeAny = ref object of RootObj SNode[T] = ref object of SNodeAny DNode[T] = ref object method getStr(s: SNode[float]): string {.base.} = "blahblah"

Re: Nim video lists

2018-12-18 Thread juancarlospaco
I am sure theres more on Twitch.

Re: How to parse JSON at compile time?

2018-12-18 Thread juancarlospaco
This would be nice as a Nimble module.

Re: How to parse JSON at compile time?

2018-12-18 Thread moigagoo
Thanks! Indeed, that's tricky a lot 😂

Re: Future of Nim ?

2018-12-18 Thread shashlick
I'd really like to ask this question: what does popularity have to do with success and future? Nim has been around for 13 years and is actively developed. It is useful and productive and the community is helpful. Stability releases are being actively worked (v0.19.2) and point releases have bee

Re: Future of Nim ?

2018-12-18 Thread mashingan
As long the language and the idea is persisting, it will eventually become (almost) everyone favorite. Look Python for example, or Smalltalk and/or Lisp-families that always be "smart guys" secret weapon.

Re: Nim video lists

2018-12-18 Thread geotre
Nice lists! Maybe there could be a videos section on the Nim website with links to videos? Could be a page linked from here: [https://nim-lang.org/documentation.html](https://nim-lang.org/documentation.html)

Get proc arg type with templates

2018-12-18 Thread Arrrrrrrrr
Is it possible without using custom macros, to get the type of a proc argument? proc inc(a: int): int = a + 1 template typeArg(p): type = ??? # typeArg(inc) = int Run

Re: Future of Nim ?

2018-12-18 Thread Antho000
Hello Ar, I like the pseudo lol Indeed, I am slow to stability and see later but I really cross the fingers for this language is successful.

Re: Future of Nim ?

2018-12-18 Thread Arrrrrrrrr
It needs a bit of luck. It cannot compete against the great ones, do not ever expect nim to become as popular as C#, javascript or python. But once some important project using nim is announced, nim will receive more visibility. This is right now hard as it is not common for important projects t

SslError: ssl3_write_pending:bad write retry

2018-12-18 Thread jlhouchin
Hello, In an app I am writing I am getting the following error. This is occurring inside code which when encountering an exception will sleep(100) and retry. After 10 retries (1 second) it will close the client and create a newHttpClient. Rather than catching this exception the app just stops,

Future of Nim ?

2018-12-18 Thread Antho000
Hello the Nims ^^ A friend told me about the language to which he also bought the book and convinced me of the language, however I remain skeptical on certain points. 1. Do you think that Nim will have a future ? 2. How to make this beautiful language more recognized so that they take more

My code has too many casts to overcome "int" type

2018-12-18 Thread MarcL
Hi, I came accross a real problem that always forces me to cast my values. I coded my raw socket library with epoll, using available nim libraries (pure and posix). Coding in assembly as well, I tend to use uint32 for performance reasons (uint16_t and uint64_t tend to be slower than uint32_t o

Re: How to parse JSON at compile time?

2018-12-18 Thread alexsad
Hi! It's a little bit tricky :) macro parseSwagger*(iApi: untyped, fn: string): untyped {.gensym.} = var inputJsonStr = slurp($fn).multiReplace([($'\n', ""), ($'\r', ""), ($'\c', ""), ($'\t', "")]) parseJsnMcr = ident(nskMacro.genSym("parseJsn").repr) p

Re: nim-result - Result-Either style return values lib

2018-12-18 Thread Arrrrrrrrr
It would be nice to have either in the standard library, and also to make more use of options instead of returning -1 or exceptions, even sometimes using [cheap replacements](https://nim-lang.org/docs/channels.html#tryRecv%2CChannel%5BTMsg%5D).