Re: Thoughts on ideas from the Unison Language

2019-04-05 Thread cdome
Interesting hoe everthing inter related, Literally, in this PR [https://github.com/nim-lang/Nim/pull/10819](https://github.com/nim-lang/Nim/pull/10819) I have added the implementation hashes very surprisingly very close to what described in the unison link. You can start using it in macros for

Re: Thoughts on ideas from the Unison Language

2019-04-05 Thread rayman22201
> I like these ideas very much but Nim can't innovate on all fronts at the same > time. I did not mean to say I want this feature now. Nim's current direction is great! This post was about my day dreams :-P > Sounds roughly similar to what "incremental compilation" will bring to Nim. I had to

Re: Why Nim so inconsistent?

2019-04-05 Thread alexeypetrushin
Thanks, I saw tolower in some nim word count demo, maybe it was outdated. Can you please also explain about the types, is there any convention to its naming string vs Natural \- why one is lowercased and another is not?

Re: Why Nim so inconsistent?

2019-04-05 Thread Araq
It is written `toLower`, see [https://nim-lang.org/docs/theindex.html#toLower](https://nim-lang.org/docs/theindex.html#toLower) The type names all follow capitalization except for the really common one we found to annoying to type this way. They also predate our style guide,

Re: Thoughts on ideas from the Unison Language

2019-04-05 Thread Araq
I like these ideas very much but Nim can't innovate on all fronts at the same time. I'm also a big fan of Mathematica, programming based on this silly "sequence of bytes" notion should have died a decade ago. But it didn't. So my hope is that editors let us get further and further away from the

Thoughts on ideas from the Unison Language

2019-04-05 Thread rayman22201
Offtopic but programming related philosophy question. I've been following the Unison programming language a little bit, and I'm very interested in their idea of keeping a code base as a database of hash id's -> function definitions, instead of just "bags of text files" that get compiled.

Why Nim so inconsistent?

2019-04-05 Thread alexeypetrushin
Just checked out Nim, lots of things and design decision that I like about the language. But I noticed that there are some inconsistencies with how things are named, example: function names tolower vs toSeq or types string vs Natural \- really weird. Why in some cases they start with capital

Re: Is there a 2D game framework recently updated for Nim ?

2019-04-05 Thread matthias
I didn't see nim-csfml when I was checking them out a few weeks ago, but I found [https://github.com/Vladar4/nimgame2](https://github.com/Vladar4/nimgame2) to be by far the best documented and most extensive of the game frameworks that I reviewed.

Is there a 2D game framework recently updated for Nim ?

2019-04-05 Thread wittygat
I would like to make a 2D game with Nim, but I can't find any game library with documentation or recently updated, can you suggest me one ? Thank you

Re: ".h" files are not found for (nim) dependencies

2019-04-05 Thread cdunn2001
If found some discussion and ideas: * [https://forum.nim-lang.org/t/3798#23682](https://forum.nim-lang.org/t/3798#23682) * [https://github.com/status-im/nim-ttmath/blob/master/src/ttmath.nim#L5](https://github.com/status-im/nim-ttmath/blob/master/src/ttmath.nim#L5) const

Re: Running Selector on device file in linux. How to get file descriptor (int fd) from file object?

2019-04-05 Thread mp035
Cheers for your help. You are right, compiling Nim is not that hard. Just for anyone who finds this thread: sudo apt install nim git clone https://github.com/Araq/Nim cd Nim sh build_all.sh Run and I have nim 0.19.9 (compiled, but not installed). Whilst

".h" files are not found for (nim) dependencies

2019-04-05 Thread cdunn2001
[https://github.com/nim-lang/Nim/issues/10971](https://github.com/nim-lang/Nim/issues/10971) The problem is hard to describe and even harder to search for. Any ideas? The way I got around this in the past was to symlink my dependencies into project's directory. That way, to Nim, they are all

Re: Running Selector on device file in linux. How to get file descriptor (int fd) from file object?

2019-04-05 Thread cblake
0.19.0 is very old in "Nim years" { like "dog years", but even more compressed ;-) }. 0.19.2 works better, but personally I would recommend `git clone https://github.com/Araq/Nim` and learning how to build that/run right out of the build. It's not too hard to follow the instructions. I think

Re: Nim vs V language

2019-04-05 Thread dom96
> I'm pretty sure you're joking, but that's absolutely not what the Nim > community should do. Thank you for picking up on this @bpr. I definitely wasn't serious and I agree with your points 100%.

Re: Running Selector on device file in linux. How to get file descriptor (int fd) from file object?

2019-04-05 Thread mp035
Agreed, I don't want to waste your time, and am happy to update. I am using Nim Compiler Version 0.19.0 [Linux: amd64] Compiled at 2018-10-27 Copyright (c) 2006-2018 by Andreas Rumpf active boot switches: -d:release Run Which was installed from the

Re: Running Selector on device file in linux. How to get file descriptor (int fd) from file object?

2019-04-05 Thread cblake
Well, to make it work without the rest of your type environment, I changed just the first couple lines of your posted code to: import posix, selectors proc readDevice(dev: string) = let devfd = posix.open(dev, posix.O_RDWR) Run Then it compiled fine for me.

Re: Suggestions for gui frameworks to make an app in nim for android?

2019-04-05 Thread mrhdias
I've tried your solution, but it does not work. When I execute the command it gives the following result: $ nim --cc:clang --clang.exe:/home/hdias/tmp/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang

Re: Running Selector on device file in linux. How to get file descriptor (int fd) from file object?

2019-04-05 Thread mp035
Thank you very much. You are quite correct. An unbuffered file is ideal, and yes, linux only (OpenWrt). Thank you for pointing me to the posix module (and getFileHandle()). I am trying to decipher the most elegant way of accomplishing this, but am failing miserably. this is what I have

Re: Running Selector on device file in linux. How to get file descriptor (int fd) from file object?

2019-04-05 Thread cblake
There is also `proc open*(a1: cstring, a2: cint)` in the `posix` module: import posix let fd = open("/dev/mydevice", O_RDONLY) Run if you want an unbuffered raw file handle which sounds like it might be the case (and you don't need portability which is implied by

Re: similar language

2019-04-05 Thread Arrrrrrrrr
In that aspect nim is unique. Crystal comes the closest, but it only works for linux.

Re: Nim vs V language

2019-04-05 Thread Arrrrrrrrr
> function main is undeclared in the main module. Cool example you got there. Personally speaking, once you go full identation, you cannot go back.

Re: Running Selector on device file in linux. How to get file descriptor (int fd) from file object?

2019-04-05 Thread cblake
You probably want `proc getFileHandle*(f: File): FileHandle` from the system module (no need to import). That just calls through to the C fileno().

Re: similar language

2019-04-05 Thread GGG123
Because I'm looking for a cross-platform[Windows +Linux, etc], fast, relatively easy language that compiles to C or C++, and which can interop or imbed with code +libs from C or C++. Of the 100s of languages, that eliminates about all, except Freebasic, and Nim and Haxe. Of the 3, it seems

Re: Ebnf Lexer and Parser generator in nim

2019-04-05 Thread Araq
Ah please support "0 or more", it sucks to write simple loops as recursion.

Running Selector on device file in linux. How to get file descriptor (int fd) from file object?

2019-04-05 Thread mp035
The answer to this question is probably very simple, but I can't seem to get it to work, and the documnetation is very sparse for these functions for some reason. I need to read a linux device file until there is nothing left to read for 0.1 second. I know that I need to use a selector, but I