Re: how to reliably search where a symbol is declared using cmd line?

2018-08-23 Thread dom96
> But what about something like fgGreen that's public, yet doesn't show a * > next to it? Search using a regex, something like: `enum(.+)fgGreen` (untested). You could easily write a command-line utility that makes searching for this super easy.

Re: A critique of Nim

2018-08-14 Thread dom96
In general I agree with most things you've mentioned. Thank you for taking the time to write this :) I especially agree with the `system` module changes, @amalek implies that this is going to be done for 1.0. As it stands right now, the [v1.0

Re: A critique of Nim

2018-08-14 Thread dom96
> > I think grep is always a last resort tool as it doesn't understand any > > programming language... > > [...] Many modern languages are easy to grep since they prefix declarations > with a keyword but in Nim this is slightly harder, I'm not advocating to > change the language for this, just

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

2018-08-13 Thread dom96
> What do you think of setting up a fund that we could put a little money into > and @dom96 can use at his discretion to gift a book to those who need it? This is a really good idea and I would love to do this, but the logistics seem like a PITA. I have been planning to create a book giv

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: Is this valid Nim code or a typo?

2018-08-11 Thread dom96
https://nim-lang.org/docs/manual.html#procedures-anonymous-procs

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

2018-08-09 Thread dom96
Two chapters are available for free on [http://book.picheta.me](http://book.picheta.me)/ for what it's worth. > Nim in Action is geared more towards Web Development anyway. I wouldn't say that. Only one chapter focuses on web development.

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

2018-08-09 Thread dom96
You don't want to support poor author's like me? :(

Re: Nim partners with Status.im

2018-08-09 Thread dom96
> Silly and hostile comments under Reg text show that popularity is hard. Yeah, perhaps I'm crazy but the people in those comments don't seem inclined to have a rational discussion about style insensitivity. > Maybe it is time to create well exposed "Common misconceptions" at the >

Re: NEWBIE - cannot find libraries when linking

2018-08-08 Thread dom96
Compiling using `nimble` should work just as well as using `nim` (nimble will call `nim` for you, passing explicit paths to each dependency)

Re: Concepts syntax and interfaces - declarative vs procedural

2018-08-07 Thread dom96
I don't think my proposal is just about the syntax, the underlying semantics change significantly. As I've mentioned, the specification becomes more concrete and less prone to surprises, i.e. _semantically_ concepts become simpler.

Re: NEWBIE - cannot find libraries when linking

2018-08-07 Thread dom96
Okay, so the issue is that you're trying to compile the .c code yourself using gcc. But whatever the Nim compiler does seems to be working fine. I would suggest taking a look at `nimcache/docker_nim_dev_example.json`, it will contain information about how to compile the C sources. That should

Re: Nim partners with Status.im

2018-08-07 Thread dom96
This news has been picked up by two websites, their write ups are worth a read. The Register: [https://www.theregister.co.uk/2018/08/07/nim_funding_ethereum_cryptocurrency](https://www.theregister.co.uk/2018/08/07/nim_funding_ethereum_cryptocurrency)/ EthNews:

Nim partners with Status.im

2018-08-07 Thread dom96
> We’re incredibly excited to announce the new partnership between Status and > Nim. Status is developing an open source mobile DApp browser and messenger > for Ethereum. —

Re: Concepts syntax and interfaces - declarative vs procedural

2018-08-06 Thread dom96
Personally I would prefer to simplify the concept syntax. >From the current syntax: type Comparable = concept x, y (x < y) is bool Run To something like: type Comparable[T] = concept proc `<`(x, y: T): bool Run

Forum mailing list

2018-08-06 Thread dom96
For those of you that enjoy following the forum via a mailing list, [@wavexx has created](https://github.com/nim-lang/nimforum/issues/57#issuecomment-410691929) this mirror: [https://www.mail-archive.com/nim-general@thregr.org/](https://www.mail-archive.com/nim-general@thregr.org/).

Re: echo without new line or async write

2018-08-06 Thread dom96
Please format your code as described in the "Code Blocks" section [here](https://forum.nim-lang.org/about/rst#code-blocks). I think you just need to write `stdout.flushFile()` after your `stdout.write`.

Re: Error converting json to types

2018-08-06 Thread dom96
> I think the Marshal module can help you there N. Please read the marshal module's docs: > The serialization format uses JSON. Warning: The serialization format could > change in future! Do not use `marshal` for JSON!

Re: strformat using a run-time defined format string

2018-08-05 Thread dom96
To elaborate a bit on @mratsim's answer: you cannot change the format pattern string at runtime. But perhaps that isn't what you are trying to do, in any case the docs actually have some good examples:

Re: Next release? (re: bioconda)

2018-08-05 Thread dom96
Except that Nim doesn't use semantic versioning

Re: How should I contribute documentation?

2018-08-02 Thread dom96
Yes, the stdlib is in dire need of more documentation. For the `options` module specifically I don't think documentation for specific procedures is what is needed. We need documentation at the top of each module explaining its purpose, along with small and specific examples (that are cook-book

Re: Nimbus, an Ethereum 2.0 client written in Nim

2018-08-02 Thread dom96
This is awesome! Keep up the great work guys :) > AsyncDispatch2, an alternative to asyncdispatch, tradeoffs and design in the > README. But please, please, consider pushing this stuff upstream. Fracturing something so fundamental is a really bad idea.

Re: Uninstall Nim and Tools

2018-07-24 Thread dom96
Try again, seems like a network hiccup.

Welcome to the new Nim programming language forum

2018-07-21 Thread dom96
I have tagged and deployed NimForum 2.0.1 yesterday. This is a very minor release. The two main improvements are: * The forum now runs on Jester 0.4.0 and HttpBeast 0.2.0. * User sessions are no longer tied to your IP address. So for those of us on the go, or with an ISP that likes to

Re: On exceptions (again)

2018-07-21 Thread dom96
I do want Nim to compete with Rust. I think it's a mistake to chase every feature it has when we are so early to a 1.0 release. Even if Nim gets rid of GC and exceptions, Rust will have had a large lead on Nim. We need to distinguish ourselves from Rust, not copy its every feature. By chasing

Re: On exceptions (again)

2018-07-20 Thread dom96
I think it would be very difficult for us right now to follow what Rust does and attract users away from it. Is there a reason that you think Rust isn't a serious competitor in this space?

nogc Exceptions

2018-07-19 Thread dom96
Wow, this is pretty scary: [https://github.com/dlang/DIPs/blob/master/DIPs/DIP1008.md#breaking-changes](https://github.com/dlang/DIPs/blob/master/DIPs/DIP1008.md#breaking-changes) Does D not offer any backwards compatibility guarantees?

There is a problem in password reset

2018-07-18 Thread dom96
You've possibly got an older Nim in your PATH, check with `which nim` and `nim -v`.

Re: Should I use Async IO for this?

2018-05-19 Thread dom96
without either a thread or async. I would simply use async. If you want to squeeze as much power out of your hardware as possible then you should still use async, but in a way that allows you to take advantage of parallelism, my [httpbeast](https://github.com/dom96/httpbeast) project is a good

Re: idiomatic name for object setup

2018-05-01 Thread dom96
I guess the NEP needs a link to this document: [https://nim-lang.org/docs/apis.html](https://nim-lang.org/docs/apis.html) **TL;DR:** You should define a ` newFruit` procedure which performs the "setup". That answers #1 and #3. (Note that for non-ref object the convention is `initFruit`) As

Re: Perfecting Nim

2018-04-24 Thread dom96
This is a thread that I wanted to create myself in preparation for v1. Thank you for creating it. For everyone reading this thread: **please let us know your opinions of what needs to go before v1 is released.** I'll probably read everyone's answers later, but here is the quick small list off

Re: How to change send timeout asyncftpclient

2018-04-19 Thread dom96
Okay, cool. Feel free to make a PR for this (it should be configurable and stored in AsyncFtpClient).

Re: Memory usage skyrocketed with nim 0.18.0 (in my async tcp service test)

2018-04-07 Thread dom96
Nice find I think dynamically increasing FDs might be less efficient than allocating them all up front. Perhaps we could offer this as an option?

Re: Though about identifiers in text editors.

2018-04-04 Thread dom96
> This choice force the user to follow the naming convention, otherwise, the > highlighting becomes inconsistent and annoying. Yeah, that's precisely why it's done and you should follow it. It's that simple. Why not make the compiler enforce it? Because there are genuine cases where it's just

Re: [RFC] use `when predef.os.macosx` instead of `when defined(macosx)` ; more robust and scalable

2018-04-04 Thread dom96
Go for it. It's a boring job but if you can create a PR to introduce these new symbols then please do

Re: NimShooter

2018-04-04 Thread dom96
Nice! Works well on my Mac Tough game, but I love the score mechanic, having to get closer to enemies to increase your score. It's cool.

Re: Memory usage skyrocketed with nim 0.18.0 (in my async tcp service test)

2018-04-04 Thread dom96
That is interesting. Async has indeed changed significantly, I have no idea what could account for such a large memory usage difference though. Will you dig deeper?

Re: Nim in Action errata

2018-04-02 Thread dom96
Sure, report them as well. I will put them in the errata but under a special section.

Nim in Action errata

2018-04-02 Thread dom96
Hello guys, So my publisher is asking me to update my errata list. Some of you have already reported errata here: [https://forums.manning.com/posts/list/41366.page](https://forums.manning.com/posts/list/41366.page) (which is the de-facto place for errata in Nim in Action). Before I compile an

Re: SIGSEGV using lines(filename)

2018-03-31 Thread dom96
"SIGSEGV (Attempt to read from nil?)" You are reading from nil. You haven't initialised `result`. Use `result = @[]` at the top of your proc.

Re: module name collision across nimble packages

2018-03-31 Thread dom96
Good questions. Most of them are answered by Nimble's readme, but the packages readme should also contain this info (PRs welcome). > Q1 :what happens if 2 nimble packages with same name are published to nimble? > eg: >

Re: Doc error

2018-03-29 Thread dom96
The docs are missing.

Re: a proc returning void creates 1 arg, not 0: breaking generic code

2018-03-29 Thread dom96
> @timothee > > Why don't you write D as d? Please learn to write Nim with a capital letter. > This is disrespectful at least. I seriously doubt @timothee meant it in a disrespectful way. This is a programming forum, not a parliamentary chambers so no need to call people out for such things.

Re: Reflection and JSON decoding

2018-03-27 Thread dom96
There are two ways, by dynamically accessing each field as described [here](https://nim-lang.org/docs/json.html#dynamically-retrieving-fields-from-json) or by using the `to` macro:

Re: Protocol Buffer library for Nim

2018-03-27 Thread dom96
Nice! Do add it to the Nimble packages repo when you get a chance

Re:

2018-03-24 Thread dom96
Hrm, I don't consider this post to be insulting. It's a valid concern. Why do you think it's insulting? We will eventually have an official package repository, but the idea behind Nimble's design is to be decentralised at its core, the official repo will just be another mirror for packages.

Re: TechEmpower Web Framework Benchmarks: Round 10

2018-03-23 Thread dom96
This is an important lesson why benchmarks shouldn't be trusted. This benchmark doesn't compile Jester in release mode... I created a PR to fix this: [https://github.com/tbrand/which_is_the_fastest/pull/168](https://github.com/tbrand/which_is_the_fastest/pull/168)

Re: Introducing loopfusion: loop over any number of sequences of any single type.

2018-03-23 Thread dom96
Nice, but is there a reason this couldn't have been implemented as an iterator?

Re: Is there any way to create template with await?

2018-03-22 Thread dom96
Yes, you can do this: template withDb(body: untyped) = let dbFut = open(...) yield dbFut let db = dbFut.read() defer: close(db) block: body

Re: Error: module names need to be unique per Nimble package;

2018-03-22 Thread dom96
The compiler uses a .nimble file in a similar way as Python uses the __init__.py files. To fix your issue you can just: touch src/moje/a.nimble touch src/moje/b.nimble Should work then.

Re: Increasing Nim exposure

2018-03-14 Thread dom96
I can see Nim: [https://hacklines.com/en?tags=Nim](https://hacklines.com/en?tags=Nim) The Nim Forum is a staple of Nim. I'd rather spend time improving it than switching to Discourse, are there features of Discourse that you think might make it more accessible? There are also other places to

Re: Lots of problems with package-level objects

2018-03-14 Thread dom96
> No. I couldn't get people to test this feature, sorry. You should have advertised it more. I didn't even know this feature existed...

Re: Nim syntax Quiz

2018-03-13 Thread dom96
> Bonus Question: One of lines crashes the compiler (as of 0.18). Can you > detect it? My bet is `var myObject: MyObject = MyObject(a = 5)`, although it could actually be a lot of the lines. You have covered different permutations of invalid code quite well. > I see development of better

Re: Need more detailed examples with async/await

2018-03-13 Thread dom96
This is the fundamental difference between concurrency and parallelism. Async await provides concurrency (which is always on a single thread), `spawn` provides parallelism. There is currently no way to `await` a `FlowVar` (which is what the `spawn` returns), but it will be soon. You can do a

Re: fileExists and existsFile. This made my day

2018-03-12 Thread dom96
lol wtf. Why have this synonym, I thought one of them was deprecated and was about to say "This is why all deprecated procs need to be removed before v1.0 is released"...

Re: Need help with async client/server

2018-03-12 Thread dom96
In regards to some other things written here: > I'm "pretty sure" that I observed in Windows that asyncdispatch would use > multiple different threads to run the code. It doesn't, and it cannot do that unless you pass `--threads:on`. This is assuming that Windows doesn't do something weird

Re: Need help with async client/server

2018-03-12 Thread dom96
Indeed, I was going to mention the ChatApp example from Nim in Action. Pretty sure it implements precisely what you're trying to implement. See both server and client here: [https://github.com/dom96/nim-in-action-code/blob/master/Chapter3/ChatApp](https://github.com/dom96/nim-in-action-code

Re: Before you start !

2018-03-11 Thread dom96
> Is it still worth investing in the book NIM IN ACTION where it is better to > wait for a next issue ? It's worth investing now, we are going to ensure that v1 is compatible with the book

Re: thanks for init.sh

2018-03-11 Thread dom96
Thanks! Glad you like it, it's called `choosenim` btw. Your request is already an issue: [https://github.com/dom96/choosenim/issues/28](https://github.com/dom96/choosenim/issues/28)

Re: Announce: SuperCollider Realtime Music-Synthesizer plugins in Nim (Proof of concept)

2018-03-10 Thread dom96
> One the things nim needs right now is some exposition. If you have a blog (or > maybe as a guest blog entry in this site) you could write your experience and > how this project work. This x 1000. Always happy to accept guest posts on nim-lang.org. I've [tweeted about your

Re: Unable to reply?

2018-03-06 Thread dom96
New users are in moderation mode by default so that's probably what the issue was.

Re: Can we use warmer names?

2018-03-05 Thread dom96
This thread has turned off-topic and so I'm going to lock it (any further posts to this thread will be deleted). @libman I would kindly ask you to stop derailing threads into ramblings about how GitHub is communist and other such topics, stick to Nim please. I dislike removing posts so I will

Re: how to define compiler's options in .nimble file?

2018-03-03 Thread dom96
Indeed, use a `module.nim.cfg` or `module.nims` file for configuring the compiler.

Re: how to fix ambiguous call's.

2018-03-03 Thread dom96
1\. I'm not entirely sure what the purpose of your `contains` proc is, but you should _probably_ fix it by creating a ` distinct string` and having your `contains` proc work on that. Really, you should actually rename your `contains` proc to something else because `contains` should always

Re: tree, recursive type

2018-03-03 Thread dom96
Like this: type AstKind* = enum Id, List AstNode* = ref object kind*: AstKind flags*: int lineno*: int children*: AstNode

Re: Nim logo - What colour?

2018-03-03 Thread dom96
The logo on the home page is the official logo. The variation in the readme is another accepted alternative. Others are deprecated.

Re: Dragging Rectangles Over Background

2018-02-28 Thread dom96
Hey Jim, I'm not sure how you've ended up here, but this is a forum for the Nim programming language. Not for JavaScript. You should consider asking your question on StackOverflow or another forum dedicated to HTML/JS.

Re: Nim 0.18

2018-02-28 Thread dom96
0.18 hasn't been released yet. Godot-nim appears to depend on `devel` (a.k.a v0.17.3 a.k.a the development version). Easiest way to get `devel` is via [choosenim](https://github.com/dom96/choosenim)

Re: Several problems with nimcr

2018-02-25 Thread dom96
What version of Git are you running? The Nimble requirements state the following: > Warning: Ensure that you have a fairly recent version of Git installed. If > the version is older than 1.9.0, then Nimble may have trouble using it. See > this issue for more information. So it's likely that

Re: [RFC] Cyclic imports and symbol dependencies

2018-02-25 Thread dom96
The lack of cyclic dependencies in Nim is usually worked around by having a `types` module.

Re: Echo and UTF8

2018-02-21 Thread dom96
https://stackoverflow.com/questions/14109024/how-to-make-unicode-charset-in-cmd-exe-by-default

Re: Discussion: Nim system integration (linux)

2018-02-21 Thread dom96
Some relevant things: Nim already expects global Nimble packages in `/opt/nimble/pkgs` ([https://github.com/nim-lang/Nim/blob/devel/config/nim.cfg#L49](https://github.com/nim-lang/Nim/blob/devel/config/nim.cfg#L49)) This issue has a lot of relevant discussion

Re: Can we mimic the structure of how Go implements the OS apis for different kind of things ?

2018-02-21 Thread dom96
You mean `winlean`? That's not the "new" win api, it's the "lean" API. Maybe the full wrapper has what you need? [https://github.com/nim-lang/oldwinapi](https://github.com/nim-lang/oldwinapi)

Re: asyncdispatch.poll() eats cpu

2018-02-20 Thread dom96
You're not performing any async IO. As soon as you do this won't be a problem. If you aren't intending to perform async IO then you don't need async.

Re: asyncdispatch.poll() eats cpu

2018-02-19 Thread dom96
It hasn't been fixed yet. But that's a pretty extreme case I think? Are you having problems in your application because of it?

Re: Socket file descriptor leaks?

2018-02-17 Thread dom96
This example is actually wrong. You should just use `new` instead of `newSocket`, this is described in the docs for `accept`/`acceptAddr` ([https://nim-lang.org/docs/net.html#acceptAddr,Socket,Socket,string)](https://nim-lang.org/docs/net.html#acceptAddr,Socket,Socket,string\)). Edit: I created

Re: Socket file descriptor leaks?

2018-02-14 Thread dom96
You're creating a new socket FD for the client and acceptAddr then overwrites it with another FD without closing the socket you created. I've seen this gotcha happen to at least two people now. Please report it as an issue on github

Re: nimble question

2018-02-13 Thread dom96
This explains it well (I hope): [https://github.com/nim-lang/nimble#nimble-develop](https://github.com/nim-lang/nimble#nimble-develop)

Re: nimble question

2018-02-13 Thread dom96
Run `nimble develop` in your library's directory, then simply add a `requires` in your new project for that library.

Re: Nim Dogfooding

2018-02-06 Thread dom96
Hacker News is one of the most popular tech sites and it does not have any of these fancy "forum features". Despite this I would like to refresh the Forum's design and make it mobile friendly. But we shouldn't overcomplicate things with features found in phpbb.

Re: Any photos or videos from NIM @FOSDEM ?

2018-02-05 Thread dom96
Check out our Twitter: [https://twitter.com/nim_lang](https://twitter.com/nim_lang)

Re: Nim at FOSDEM

2018-02-01 Thread dom96
There will definitely be some Nim people there. I might join (still not 100% sure if I will though), in any case I'll see you at the stand hopefully

Re: How to call runForever()?

2018-01-31 Thread dom96
@monster certainly the code should crash with a better error message. Please report this on GitHub.

Re: Can't send email via port 587 with TLS

2018-01-29 Thread dom96
Tried with `useSsl = true`?

Re: Error on runtime (SFML/CSFML related)

2018-01-29 Thread dom96
I was using 0.17.3 to develop this, so you might want to try the same.

Re: How to call runForever()?

2018-01-29 Thread dom96
You can try running your exe using gdb: `gdb runforever.exe`. Then type `run` in gdb and once it crashes `bt`.

Re: How to call runForever()?

2018-01-27 Thread dom96
Thanks for reproducing. It doesn't crash for me (macOS), what OS are you on and what Nim version are you using? btw, the `: void` is redundant for proc return types.

Re: How to call runForever()?

2018-01-27 Thread dom96
Can you reproduce the crashes in a simple program that creates a new thread that calls `runForever` (and does nothing else except waiting for that thread)?

Re: A "future" LOC affects a "past" LOC!

2018-01-27 Thread dom96
I've run into things like this in the past and the reason for them usually is a stack corruption. Unfortunately I don't have any magic ways to debug this. I can see that you're using raw pointers so it's likely that you're doing something unsafe incorrectly, so I would start by carefully

Re: postContent with custom header

2018-01-25 Thread dom96
There is no need for this procedure to be exported. You should use the `post` procedure which uses this `format` proc: [https://github.com/nim-lang/Nim/blob/master/lib/pure/httpclient.nim#L1197](https://github.com/nim-lang/Nim/blob/master/lib/pure/httpclient.nim#L1197)

Re: Json key names encoding

2018-01-25 Thread dom96
Nim offers similar functionality via the `to` macro, but indeed it doesn't support fields that begin with a number. I created an issue for this: [https://github.com/nim-lang/Nim/issues/7139](https://github.com/nim-lang/Nim/issues/7139). Depending on your JSON you may be able to use a

Re: postContent with custom header

2018-01-24 Thread dom96
You need to give more info. This example shows how to handle posting data: [https://nim-lang.org/docs/httpclient.html#using-http-post](https://nim-lang.org/docs/httpclient.html#using-http-post) Without knowing what data you want to send I can't help much more.

Re: Partial casing is foo_bar

2018-01-24 Thread dom96
> A user is reading someone's code and wants to see all instances of a name. So > they go using find in their editor and fail to pick up on all because some > instances have underscores in their name. There is an easy solution to this problem: case insensitive and style insensitive search

Re: Json key names encoding

2018-01-24 Thread dom96
You should do this: [https://nim-lang.org/docs/json.html#dynamically-retrieving-fields-from-json](https://nim-lang.org/docs/json.html#dynamically-retrieving-fields-from-json)

Re: Nim Syntax ''Skins''

2018-01-22 Thread dom96
> This thread scares me as a new Nim user It scares me too. Things like [this](https://github.com/nim-lang/Nim/issues/7124#issuecomment-359458919) make me want to change the language. There is a limit to how many different ways it should be possible to do the same thing. While Araq seems to

Re: Partial casing is foo_bar

2018-01-22 Thread dom96
> Araq if you want to succeed with this language you need to realize how silly > it is to have style insensitive name parsing. It really isn't that big of a deal. Don't judge a book by its cover. Try the language and if you find some genuine problems with style insensitivity then report them.

Re: lib\pure\asyncmacro.nim(43, 27) Error: attempting to call undeclared routine: 'callback='

2018-01-22 Thread dom96
Try changing the forward declaration by replacing the async pragma with `: Future[void]`. Seems like an async macro bug.

Re: Increasing Nim exposure

2018-01-18 Thread dom96
@bli Thank you for taking the time to write down the pains you've experienced while learning Nim > Look here for instance: > [https://codereview.stackexchange.com/questions/tagged/nim](https://codereview.stackexchange.com/questions/tagged/nim) > Two questions only, none answered. I didn't

Re: Increasing Nim exposure

2018-01-18 Thread dom96
@jzakiya Thank you for these suggestions and for writing up that longer post, it was an interesting read. Please don't be dissuaded by the replies to this thread so far. Your suggestions are good, here are my requests/thoughts: > Having access to various Ruby article feeder sites I recently

Re: Very new winapi

2018-01-18 Thread dom96
It's old because it used to be in the stdlib but was moved out of it. You're right though, the name is confusing, we should probably just rename it to `winapi`.

<    1   2   3   4   5   6   7   >