Re: UDP socket closing after send

2017-07-28 Thread Araq
@xyz32: That `#? braces` parsing mode was never documented and will be removed again. It's already out of sync with the latest parser/grammar changes.

Re: Nim to C transpiler

2017-07-28 Thread Jehan
> What amazes me is that Nim is a bit faster than some recent languages who > compiles directly to machine language. That should not be _so_ surprising. A major aspect of the "speed" of a language is how much effort went into writing the backend of the compiler. C/C++ compilers have seen by

Re: thounghs about Nim language in godot

2017-07-28 Thread Tiberium
Author said that only one PR to godot engine left

Re: thounghs about Nim language in godot

2017-07-28 Thread DTxplorer
Unfortunately this binding needs a forked version of the engine. You must consider this binding as a W.I.P. Anyway it's nice work and I hope this will be completed soon.

Re: Gdb pretty printers for nim

2017-07-28 Thread def
Haven't seen any, good idea. Should be pretty easy for seqs, arrays, strings and pretty useful when debugging. I'd also be interested if it's possible to demangle identifiers so that we can tell GDB what the mapping between original identifier and C identifier is, like the #line pragma.

Re: UDP socket closing after send

2017-07-28 Thread Arrrrrrrrr
Why do you set the keepalive flag? I'd like to experiment, but i can't find windows binaries of the server.

Re: UDP socket closing after send

2017-07-28 Thread mashingan
Unless the socket was out of scope, it should (kinda) able to `receive` the message from server. The problem is server won't know whether its message received by client or not. So I cannot follow how UDP server knows the connection closed? UDP, in simple term, only sends without caring whether

Gdb pretty printers for nim

2017-07-28 Thread cdome
Hi, I trying to ease my pain debugging Nim. Thinking if anyone already implemented GDB pretty printers for Nim basic types. Visual studios natvis debug custrom visualizers will also work. Thank you

Re: UDP socket closing after send

2017-07-28 Thread xyz32
@Ar, [https://systembash.com/a-simple-java-udp-server-and-udp-client](https://systembash.com/a-simple-java-udp-server-and-udp-client)/ @mashingan, I just created a new nim project and copy pasted your UDP client, and changed mystatus = "I'm sending for " & $count & "

Re: UDP socket closing after send

2017-07-28 Thread mashingan
@xyz32, could you show the revised version of your Nim UDP client? By definition, UDP is connection-less so it works that way. Also, please show in what way it should work properly, because, like I said, UDP is connection-less.

Re: What is missing for the seq/string types to be not nil by default?

2017-07-28 Thread bpr
This may not be directly related to your goal, but under [Future directions:](https://nim-lang.org/docs/manual.html#types-memory-regions) we have that seq and string may get memory regions.

Re: What is missing for the seq/string types to be not nil by default?

2017-07-28 Thread Krux02
Ok the problem is somewhere in the garbage collecter. It tries to create an object and fails. My motivation to fix issues with the GC is pretty low. I would spend my time rather on removing the dependency on the GC than to fix the problem with it.

Re: UDP socket closing after send

2017-07-28 Thread xyz32
Thanks, but still doesn't solve the issue. I am trying to build a client library for the roboCUP 2D simulation server (rcssserver). You can find documentation here:

Re: Nim to C transpiler

2017-07-28 Thread leledumbo
> How reliably can Nim translate to C or C++? As with any other compilers: nothing but [a bunch of test cases](https://github.com/nim-lang/Nim/tree/v0.17.0/tests), which is why code generation bug can still exist because covering all cases is almost impossible. Compiler's basic building block

Re: What is missing for the seq/string types to be not nil by default?

2017-07-28 Thread cdome
Uesful page [https://github.com/nim-lang/Nim/wiki/Debugging-the-compiler](https://github.com/nim-lang/Nim/wiki/Debugging-the-compiler)

Re: thounghs about Nim language in godot

2017-07-28 Thread Tiberium
>From the example: # Copyright 2017 Xored Software, Inc. import strutils import godot import engine, label, resource_loader, packed_scene gdobj FPSCounter of Label: var lastFPS: float32 method ready*() = setProcess(true)

Re: Nim to C transpiler

2017-07-28 Thread mashingan
@aedt, you should know there's [AST](https://en.wikipedia.org/wiki/Abstract_syntax_tree) for each statement and expression. It's the AST that converted to C, so that's how compiled it correctly. Of course, using the same AST, you can compile directly to assembly too but I think kudos for Nim

Re: String sort and handling sequence

2017-07-28 Thread mashingan
Use [sorted](https://nim-lang.org/docs/algorithm.html#sorted,openArray\[T\],proc\(T,T\)) version for returning new sequence.

Re: UDP socket closing after send

2017-07-28 Thread mashingan
For UDP, you don't `send` / `recv` but `sendTo` / `recvFrom`. See this stackoverflow [answer](https://stackoverflow.com/a/1829480) for detailed answer. For simple UDP server/client in Nim. Here's the example: `server.nim` import net var server = newSocket(AF_INET,

Re: What is missing for the seq/string types to be not nil by default?

2017-07-28 Thread Krux02
well I did something in that direction on a branch. I have a problem with the nim compiler to crash here and there. How do I enable debug information again in the compiler? And why is is such a hassle in nim to get debug information? Debug builds should have them.

String sort and handling sequence

2017-07-28 Thread aedt
Hi I was wondering 1\. how you would sort a string by characters For example: fn main() { let mut x = "bad cab".chars().collect::>(); x.sort(); println!("{}", x.into_iter().collect::()); } // prints " aabbcd" 2\. if there is any equivalent to

Re: thounghs about Nim language in godot

2017-07-28 Thread DTxplorer
I wonder how the Nim particular OOP works with the Godot Engine and his huge inheritance tree. Maybe it does not matter... But anyway, this engine is gradually gaining popularity and it can help Nim language to be more spreaded.

Re: Nim to C transpiler

2017-07-28 Thread DTxplorer
What amazes me is that Nim is a bit faster than some recent languages who compiles directly to machine language.

Re: thounghs about Nim language in godot

2017-07-28 Thread Tiberium
[https://github.com/pragmagic/godot-nim](https://github.com/pragmagic/godot-nim) Yay, proper GDNative bindings!!!

Re: UDP socket closing after send

2017-07-28 Thread xyz32
Thanks for the help, but that is not the issue. There is a UDP server running and listening on port 6000. That is why the java client works. The Nim client works as well but just for the first message. After that the server console tells me that the client has disconnected. The connection is

Re: What is missing for the seq/string types to be not nil by default?

2017-07-28 Thread Krux02
well are you open for a pull request for that. I think that's easy to implement.

Re: Thoughts on imports

2017-07-28 Thread Libman
That would be consistent and logical. But (IMHO) pragmas are ugly...