> 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.
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
> > 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
> 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
This is curl failing. So you might need to diagnose whether there is something
wrong with it.
https://nim-lang.org/docs/manual.html#procedures-anonymous-procs
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.
You don't want to support poor author's like me? :(
> 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
>
Compiling using `nimble` should work just as well as using `nim` (nimble will
call `nim` for you, passing explicit paths to each dependency)
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.
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
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:
> 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.
—
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
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/).
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`.
> 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!
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:
Except that Nim doesn't use semantic versioning
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
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.
Try again, seems like a network hiccup.
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
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
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?
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?
You've possibly got an older Nim in your PATH, check with `which nim` and `nim
-v`.
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
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
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
Okay, cool. Feel free to make a PR for this (it should be configurable and
stored in AsyncFtpClient).
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?
> 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
Go for it. It's a boring job but if you can create a PR to introduce these new
symbols then please do
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.
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?
Sure, report them as well. I will put them in the errata but under a special
section.
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
"SIGSEGV (Attempt to read from nil?)"
You are reading from nil. You haven't initialised `result`. Use `result = @[]`
at the top of your proc.
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:
>
The docs are missing.
> @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.
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:
Nice! Do add it to the Nimble packages repo when you get a chance
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.
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)
Nice, but is there a reason this couldn't have been implemented as an iterator?
Yes, you can do this:
template withDb(body: untyped) =
let dbFut = open(...)
yield dbFut
let db = dbFut.read()
defer: close(db)
block:
body
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.
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
> 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...
> 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
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
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"...
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
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
> 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
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)
> 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
New users are in moderation mode by default so that's probably what the issue
was.
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
Indeed, use a `module.nim.cfg` or `module.nims` file for configuring the
compiler.
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
Like this:
type
AstKind* = enum
Id, List
AstNode* = ref object
kind*: AstKind
flags*: int
lineno*: int
children*: AstNode
The logo on the home page is the official logo.
The variation in the readme is another accepted alternative. Others are
deprecated.
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.
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)
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
The lack of cyclic dependencies in Nim is usually worked around by having a
`types` module.
https://stackoverflow.com/questions/14109024/how-to-make-unicode-charset-in-cmd-exe-by-default
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
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)
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.
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?
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
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
This explains it well (I hope):
[https://github.com/nim-lang/nimble#nimble-develop](https://github.com/nim-lang/nimble#nimble-develop)
Run `nimble develop` in your library's directory, then simply add a `requires`
in your new project for that library.
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.
Check out our Twitter:
[https://twitter.com/nim_lang](https://twitter.com/nim_lang)
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
@monster certainly the code should crash with a better error message. Please
report this on GitHub.
Tried with `useSsl = true`?
I was using 0.17.3 to develop this, so you might want to try the same.
You can try running your exe using gdb: `gdb runforever.exe`. Then type `run`
in gdb and once it crashes `bt`.
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.
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)?
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
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)
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
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.
> 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
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)
> 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
> 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.
Try changing the forward declaration by replacing the async pragma with `:
Future[void]`.
Seems like an async macro bug.
@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
@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
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`.
301 - 400 of 634 matches
Mail list logo