Re: Experimenting with a FreeRTOS OS Port

2020-07-10 Thread dom96
> Currently I'm using Nim on an ESP32 with posix.select for a custom TCP > protocol. Have you given the selectors module a try? It should provide an even nicer API on top of the raw POSIX select.

Re: Is there a command line one-line to start an HTTP server using Nim?

2020-07-06 Thread dom96
Please please tag new versions. It's not enough to just bump the version in the .nimble file.

Re: getFileSize async and sync

2020-07-02 Thread dom96
Yes the current file IO "async" implementation isn't actually async.

Re: Norm 2.0.0

2020-06-28 Thread dom96
> Did you have a chance to try out the new version? Not yet, been having a bit of a break from Nim development lately. Hopefully soon I'll have time to dive back into my projects and will be able to give Norm 2.0 a try :)

Re: Change Nim colour on GitHub

2020-06-25 Thread dom96
Nice, looks good. And in the meantime it seems GitHub's new design separates these colours better.

Re: Change Nim colour on GitHub

2020-06-25 Thread dom96
Oh, one thing, doesn't JavaScript use a similar colour? Can we see what that looks like? @pietroppeter?

Re: Norm 2.0.0

2020-06-25 Thread dom96
This is awesome! As someone that has used norm in a number of his apps now I can attest to its quality, in fact I would say this is one of the gems in Nim's ecosystem. Keep up the awesome work! (And if you want a challenge, help us transition the NimForum to using Norm :D)

Re: Change Nim colour on GitHub

2020-06-24 Thread dom96
Nice! I must say, I do like that colour.

Re: Newbie question: why do I get a "No handles or timers registered in dispatcher" error?

2020-06-23 Thread dom96
See [https://github.com/nim-lang/Nim/issues/14564](https://github.com/nim-lang/Nim/issues/14564). TL;DR: As the error suggests, you don't have any IO operations or timers in progress so the event loop has nothing to do and so you get this error (if you didn't get this error your program would

Re: Idea: Nim Online Conference

2020-06-22 Thread dom96
We shouldn't forget about @miran's awesome work here. Big thanks to him for all his work on scheduling, planning and organising this conference. It went incredibly smoothly, the bar has been set very high for the next conf :D

Re: Why is my HTTP handler not gcsafe?

2020-06-16 Thread dom96
You shouldn't need to do that. Passing `--threadAnalysis:off` to the compiler should work too.

Re: When will the NimConf timeline get posted?

2020-06-12 Thread dom96
Likely after Tuesday which is the deadline for recording submissions.

Re: Lambda syntax is awkward

2020-06-02 Thread dom96
I wouldn't depend on the do notation. The reason it's experimental is that it doesn't fit the language and may be removed entirely eventually. Personally, I don't think this is too verbose: let fourthPower = twice(10, proc(n: int): int = echo "Gratuitous echo!"

Re: How mature is async/threading in Nim?

2020-05-22 Thread dom96
> Read mratsim's post from the same thread then, > [https://forum.nim-lang.org/t/6352#39200](https://forum.nim-lang.org/t/6352#39200) @mratsim shows no examples of what ARC can do, but I assume that ARC can help with the third scenario that he describes... > You need a shared state, for

Re: How mature is async/threading in Nim?

2020-05-21 Thread dom96
> I have limited experience with nim mobile apps. But knowing what I know don't > think I would use async on the client. Async is great if you are doing tons > of http style requests. But really a mobile client? Just regular threads are > probably better if you are just writing and reading from

Re: How mature is async/threading in Nim?

2020-05-21 Thread dom96
ding out hope for my suggestion above. There are alternatives, and I have been pretty successful in creating a very performant HTTP server for example: [https://github.com/dom96/httpbeast](https://github.com/dom96/httpbeast) (which this forum runs on). Now to answer some of your questions... &

Re: proposal: PTAL tag to make it clear that a PR is ready again for review

2020-05-17 Thread dom96
Please no. If you want someone to have a look at your PR then bump the PR so it gets put at the top of our notifications or just ping the best person to review that PR (if you know who they are). All these title/tag changes are just noise and we've got enough of that already.

Re: Idea: Nim Online Conference

2020-05-17 Thread dom96
I think the consensus so far is that we will let the participants choose whether they wish to pre-record their talk or to do it live. I would personally suggest pre-recording it to give us the ability to stream the highest quality talk possible, but I understand that some dislike that approach

Re: Idea: Nim Online Conference

2020-05-15 Thread dom96
The time is important I agree, but the platform shouldn't matter. It's unlikely to be anything other than Twitch/YouTube, streaming to those services is always just a case of using OBS and watching just needs a browser.

Re: Markdown test

2020-05-13 Thread dom96
We can already do italics and bold via * though, so it really isn't so bad. What is more annoying is the inability to respond with just a code block, those are bugs that need to be fixed.

Re: I cannot understand ARC

2020-05-07 Thread dom96
> "Compile your code with --gc:arc". That's it, the rest are details, the > document describes how --gc:arc is implemented. Don't you need to at least mention `--gc:orc` as well? The difference between them at least is useful knowledge, since as soon as someone compiles async code with

Re: What's the async way to receive channel messages?

2020-05-02 Thread dom96
Yes, we have been after marrying the parallelism and concurrency primitives in Nim for a while now. You can see some efforts for this being made in [https://github.com/nim-lang/Nim/pull/11724](https://github.com/nim-lang/Nim/pull/11724), but it didn't get to a point where it could be merged.

Re: Javascript browser backend: cannot include more than a single nim compiled source ?

2020-05-02 Thread dom96
> I'm also thinking that since now JavaScript modules landed in browsers, > perhaps Nim could target a javascript module with export directives instead > of a script to include inline on a webpage. Keep in mind that a lot of us want to have support for a large variety of browsers, and this

Re: Typography update - now it can render 99% the Google Fonts ttf.

2020-05-01 Thread dom96
I use this in my [upcoming game](https://twitter.com/stardust_dev), and I must confirm that it works beautifully (not only on Windows but also on Android!). @treeform is also very responsive to bug reports and fixed the fonts that I found were rendering incorrectly very quickly, thanks

Re: How to use file system watcher (fsmonitor) in Nim?

2020-04-24 Thread dom96
Depends on an external dylib though, would be nice to have a native Nim implementation, it shouldn't be hard to implement either, someone just needs to commit some time.

Re: Time to stabilize the ecosystem

2020-04-19 Thread dom96
> Memory management seems to be going in the right direction but I fear "ARC" > needlessly fractured the small community A lot of implication here that ARC is going to be the new default. While this _may_ happen, it's far from certain, and even if it does it won't be until Nim 2.0. So there is

Re: Nim Forum build error

2020-04-19 Thread dom96
Have you tried symlinking `libsass.so` to `libsass.so.0` in `/usr/lib/x86_64-linux-gnu`, or just straight up changing the DLL name inside the sass Nim module?

Re: Time to stabilize the ecosystem

2020-04-19 Thread dom96
> 3\. I'd argue that Jester (and it's underlying httpbeast) are mostly > production-ready Yeah. You're all using it right now through this forum, been running in prod for years.

Re: Nim programming book for kids

2020-04-19 Thread dom96
> Funny to hear that from someone who wrote a Nim book. Wisdom of the ages or > more a result of dissapointment by tiny selling rates :-) ? This isn't about my experience with writing the book, it's about my experience as a kid learning how to program. For what it's worth, I consider Nim in

Re: Nim programming book for kids

2020-04-19 Thread dom96
> Although I don't think it's for kids. I'd have to agree, this is great work you're doing @Stefan_Salewski. But personally I am of the opinion that kids rarely enjoy learning by reading books, there is a minority that do, but I think a much better way to teach kids (and many adults)

Re: Nim Forum build error

2020-04-17 Thread dom96
Yep, it's trying to install karax and that fails for some reason (I think there might be a Nimble bug here). Try to install it manually by running nimble install karax@#f6bda9a.

Re: AsyncHTTPClient crashes saying invalid http version

2020-04-17 Thread dom96
Stop mixing callbacks and async procs. Your `download` async proc finishes before your download operation finishes because you are not awaiting the `download` proc. Just do this: await downloader.downloadFile(node.mediaLink(board, thread), downFileName) Run

Re: generate c++ code from .nim file

2020-04-17 Thread dom96
You'll need to copy this file beside your .cpp file. This is supposed to be copied automatically when using `--genScript` (if you're using 1.0.6 it should work), with latest versions of Nim it doesn't get copied (see

Re: Nim Forum build error

2020-04-17 Thread dom96
Are you sure you're not getting this error because of a dependency that's being installed? Can you paste the full output of `nimble c -r src/buildcss --debug`?

Re: AsyncHTTPClient crashes saying invalid http version

2020-04-17 Thread dom96
> Writing a synchronous downloader script was a breeze: > [https://gitlab.com/snippets/1967018](https://gitlab.com/snippets/1967018) Is this a wrong link? because that doesn't look synchronous. You're doing a number of things incorrectly here. One important thing to know is that you should

Re: Where can I deploy a Nim web application? Is there a "NimAnywhere" yet?

2020-04-13 Thread dom96
> I thought Digital Ocean wouldn't have been an option with Nim, but Docker > seems to make it possible... You don't need Docker to run Nim on Digital Ocean (or any VPS/server hosting provider). You've got a whole Linux machine to do with what you wish. Most of the time Docker is overkill.

Re: Format() problem with Jester

2020-04-12 Thread dom96
300k/s nice, usually people see much less. What specced hardware are you running this on? :)

Re: Nim 1.2 is here

2020-04-08 Thread dom96
could not import: X509_check_host Run > > every time I invoke nimble :-( This is because we removed dead code elimination from the openssl wrapper, why did we do this? I was fixing something in openssl and noticed this yesterday (very time I invoke nimble :-(), can we

Re: Call for testing of arm64, armhf, and i386 snaps of Nim

2020-04-04 Thread dom96
I cannot test these right now but I just want to say thank you for your work on this!

Nim 1.2 is here

2020-04-03 Thread dom96
Since nobody else is reaping the NimForum karma, I might as well share this. Nim 1.2 is here: [https://nim-lang.org/blog/2020/04/03/version-120-released.html](https://nim-lang.org/blog/2020/04/03/version-120-released.html) As always, update via: choosenim update stable

Re: Idea: Nim Online Conference

2020-03-30 Thread dom96
@moigagoo that heading is far too large :) I would prefer if we have a more structured submission process (i.e. a google form). It's too easy for submissions to get lost in a forum thread like this (speaking partially from experience here).

Re: Idea: Nim Online Conference

2020-03-30 Thread dom96
Great idea. Happy to help with promoting and setting this up. I should be able to come up with something to talk about too :)

Re: (Meta) Why is there no beginners' section in the forum?

2020-03-28 Thread dom96
Whether something is a "Beginner" question or not is largely subjective, hence it is a bad category. We will have categories, but we will not be getting categories like "Beginner Question" or "Advanced Question", instead it'll be "Question", "Announcement" and probably "Off-topic" and that's

Re: (Meta) Why is there no beginners' section in the forum?

2020-03-26 Thread dom96
We will get categories soon. They won't be that granular though.

Re: "If you need an embedded C compiler" - from the latest zig blog includes an suggestion for Nim

2020-03-25 Thread dom96
Yep, Andrew pinged me on IRC to suggest Nim adopts this. It might not be a half bad idea, we can pretty easily add it to choosenim for example to make cross-compilation much easier.

Re: Nimble raiseOSError: cannot install a package

2020-03-21 Thread dom96
It's looking like Nimble cannot find git for some reason, are you sure it's in the PATH of the terminal you're running it from?

Re: Async web servers and database

2020-03-01 Thread dom96
Nope, you're correct. Someone needs to create an async mysql/sqlite/postgres etc. driver.

Re: Gedit syntax highlighting.

2020-02-28 Thread dom96
yes, it can. You "just" need to get it into gedit's source code, send them a patch.

Re: Using async Nim procedures in Python

2020-02-24 Thread dom96
asyncdispatcher's FD and ask Python to tell when it should be polled. Then simply poll it. I take this approach in my HTTP server: [https://github.com/dom96/httpbeast/blob/master/src/httpbeast.nim#L168-L171](https://github.com/dom96/httpbeast/blob/master/src/httpbeast.nim#L168-L171). Happy to help

Re: Nim Community Survey 2019

2020-02-20 Thread dom96
The VS Code plugin is community supported. I do agree that it would be nice to have an official plugin.

Re: Can I use IOCP / async on startProcess?

2020-02-11 Thread dom96
Not with the stdlib. You might have some luck using [https://github.com/cheatfate/asynctools/blob/master/asynctools/asyncproc.nim](https://github.com/cheatfate/asynctools/blob/master/asynctools/asyncproc.nim) though.

Re: FOSDEM 2020 - Brussels February 1st & 2nd

2020-02-08 Thread dom96
](https://fosdem.org/2020/schedule/event/nimultralowoverheadruntime/) @mratsim * [Async await in Nim](https://fosdem.org/2020/schedule/event/asyncawaitnim/) @dom96 All talk videos bar @mratsim's are ready to view at time of writing.

Re: FOSDEM Call for Participation

2020-02-03 Thread dom96
Videos should be up soon, and we'll likely post links in a separate forum thread or in this once which is more recent: [https://forum.nim-lang.org/t/5866](https://forum.nim-lang.org/t/5866). Please try to find a more recent thread before bumping an old one like this. I'm going to lock this

Re: Is "danger" define supposed to also define "release"?

2020-02-03 Thread dom96
Even though this happened before 1.0 (AFAIK) it would have broken a lot of code, so it makes perfect sense that we should consider this to be a bug and a serious one at that.

Re: FOSDEM 2020 - Brussels February 1st & 2nd

2020-01-30 Thread dom96
That's a shame, we will miss you. Maybe this could be our excuse to have a meetup in London finally :)

Re: Nim 1.0.6 is out!

2020-01-29 Thread dom96
To be honest I'm now confused about 1.1 being skipped. We've always only skipped odd numbers in the "patch" number (i.e. last number in the version). Wasn't the weird 1.0.99 thing used for the in-development 1.1 version?

Re: future of htmlgen

2020-01-23 Thread dom96
`htmlgen` is part of 1.0 so it won't be removed, but it may be deprecated. Mention that in your video but do show it off.

Re: Impossible situation trying to get minimal glfw example working±±±

2020-01-18 Thread dom96
You need to install the dynamic library to use it, homebrew is indeed the easiest way. As for passing that flag to Nim via Nimble, you can simply run `nimble c -d:nimDebugDlOpen ` (or maybe even `nimble build -d:nimDebugDlOpen`).

Re: Ported a Python game to Nim

2020-01-17 Thread dom96
> I don't think it makes sense for a game to be in someone's ~/.nimble/bin (or > equivalent), and I don't expect anyone to use this project as a library. Why not? If someone wants to play your game they may want to install it into their PATH :) > Can the user provide the name of a text file

Re: Introducing --gc:arc

2020-01-17 Thread dom96
> Another update: The async bugs on Windows have been fixed and async is now in > the state "almost working" for all major OSes. That's brilliant! Thanks to everyone that helped with this :) I'd love to see someone give httpbeast a shot with --gc:arc vs. normal GC to see what the numbers look

Re: How to create and manage a http users sessions?

2020-01-11 Thread dom96
That code looks like it does what you intend. One thing to keep in mind is: never ever discard the result of an `async` call. You need to use `asyncCheck` already otherwise you'll be swallowing exceptions in your sessions_manager function.

Re: Goto based exception handling

2020-01-08 Thread dom96
Wonderful, short and sweet write up. I really enjoyed reading this and am becoming more and more excited about ARC :)

Re: Nim Community Survey 2019

2020-01-07 Thread dom96
When's the cut-off?

Re: Embedding libclang into Nim's compiler

2020-01-04 Thread dom96
I've had a very similar idea and I actually have a pretty nice libclang wrapper which I've used for my C/C++ code obfuscator ([https://picheta.me/obfuscator)](https://picheta.me/obfuscator\)). I've been meaning to open source it for a while now... My idea differs in one important way though:

Re: nimble always install @#head for url

2020-01-03 Thread dom96
hrm, that's weird. Can you report it on GitHub?

Re: nimble always install @#head for url

2020-01-02 Thread dom96
Like this? requires "https://url/repo.git #head" Run

Re: Game unlock gui written with gintro

2020-01-02 Thread dom96
wow, that's a significant app. Nice job :)

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

2019-12-31 Thread dom96
Yeah, it's definitely not perfect and indeed the deviation from original naming conventions was my number one annoyance too (would love to fix that if I had the time). Getting rid of the need to destroy pointers manually should now be possible with Nim's better destructors and/or ARC (but at

Re: Nimble broken for pre-built binary installs

2019-12-29 Thread dom96
That's a poor error from Nimble, can you report this as an issue? IMO we need a better error message here.

Re: Introducing --gc:arc

2019-12-24 Thread dom96
This is awesome, and a great overview thanks for writing it up. I am also curious about the shared heap, the implication from your post is that you are still sticking to the "one heap per thread" model and that we will continue to restrict the sharing of memory between threads. Is that the

Re: Anything to notice before using JavaScript backend of Nim?

2019-12-15 Thread dom96
`-d:release` will remove any `assert` calls, apart from that it shouldn't change any behaviour, so this may be a JS backend bug. Make sure you aren't running any procedures that have side effects with `assert` as those statements will just be removed.

Re: Is it possible to browse the nimble.directory?

2019-12-08 Thread dom96
You can introduce a page which lists each tag, sorted by how many packages are in that tag. This would already give a nice way to explore our packages.

Re: TXT DNS lookup

2019-12-08 Thread dom96
Yeah, there is nothing for this in the stdlib. You will have to call out into posix/win api to do it, if you're up for it contributing this to the stdlib would be much appreciated :)

Re: Advent of Nim 2019 megathread

2019-12-01 Thread dom96
Decided to give this a proper try this year. Let's see how this goes. My repo is here: [https://github.com/dom96/aoc2019](https://github.com/dom96/aoc2019) Already found a bug in Nim heh: [https://github.com/nim-lang/Nim/issues/12788](https://github.com/nim-lang/Nim/issues/12788)

Re: Discord server improvements

2019-11-28 Thread dom96
If you'd like we can look into giving you the permissions needed to implement this, I'm not familiar with Discord's permissions, do you know what is required to be able to structure channels this way?

Re: recvmsg on AsyncSocket

2019-11-28 Thread dom96
> Maybe @dom96 have some experience with this ? Never attempted to transfer FDs between processes, personally I would avoid it as I doubt it's well supported across different platforms, but I'm no expert on this particular aspect of how sockets/FDs behave when sent across processes. You sho

Re: Any decent non-video async socket tutorials in c#?

2019-11-28 Thread dom96
> Any decent non-video async socket tutorials in c# Is that a typo or are you trolling us?

Re: FOSDEM CfP deadline is 26/11/19

2019-11-26 Thread dom96
Last chance to submit is today! Bumping for visibility.

Re: FOSDEM CfP deadline is 26/11/19

2019-11-25 Thread dom96
Submitted 3 talks: * Nim - A walk-through of a new emerging language * Async await in Nim - A demonstration of the flexibility metaprogramming can bring to a language * Karax - SPAs in a compiled systems programming language I'm quite proud of my abstract for the first one, the others I

Re: The authors of the Nimacros project stopped working on that book

2019-11-23 Thread dom96
Can someone explain what this project is? This is literally the first I'm hearing of it and I'm quite puzzled about what I've read so far, do we have gardeners working on a Nim programming language book?

Re: when to use 'ref object' vs plain 'object'

2019-11-23 Thread dom96
@enthus1ast You can also use `FutureVar[T]` as a workaround for this restriction. Eventually my hope was to have the `async` macro do this automatically, but I wonder if it would make more sense to push for `var T` to be supported in closure iterators instead.

FOSDEM CfP deadline is 26/11/19

2019-11-21 Thread dom96
We are nearing the deadline to submit a talk for the Minimalistic, Experimental and Emerging Languages devroom. This is a devroom that is co-run by one of our very own, @PMunch. **The deadline is Tuesday, 26th November 2019.** This devroom, alongside being aimed at Minimalistic languages (like

Re: Running several processes asynchronously?

2019-11-20 Thread dom96
Yeah, I think this is a bug in asynctools. I recall running into similar things, I created an issue for this a while ago: [https://github.com/cheatfate/asynctools/issues/9](https://github.com/cheatfate/asynctools/issues/9). If you have some time it would be brilliant if you could look into the

Re: How to avoid recursive module dependency ?

2019-11-18 Thread dom96
I would strongly recommend avoiding `include` as much as possible, and in particular in this case. What works usually is to create a module for your types, or to think about how you structure your program, usually you will see that you aren't organising your code in the best way.

Re: Jester performance on FreeBSD is 1/10 of that on Linux

2019-11-16 Thread dom96
Cool, thanks for testing. I can't imagine what could cause this difference in httpbeast, perhaps Nim's kqueue implementation is significantly worse than its epoll implementation. Maybe Amazon's EC2 has worse performance on FreeBSD? Have you tried comparing other http servers?

Re: the "type" of the curly-bracket structure

2019-11-16 Thread dom96
This curly bracket structure is called the "Table constructor": [https://nim-lang.org/docs/manual.html#statements-and-expressions-table-constructor](https://nim-lang.org/docs/manual.html#statements-and-expressions-table-constructor). You should be able use `varargs[(string, string)]` as the type

Re: Jester performance on FreeBSD is 1/10 of that on Linux

2019-11-15 Thread dom96
This is interesting. Can you test httpbeast on its own?

Re: async/await for embedded sysmtems

2019-11-15 Thread dom96
For something like an embedded system the current async/await is likely to be far too heavy (it allocates far too much on the heap). What I would personally like to see is alloc-free async/await which is, I believe, what Rust achieves. Since you're working on an embedded system already, this

Re: Jester memory usage keep rising using sqlite

2019-11-15 Thread dom96
Does it ever rise above 12mb? To be honest, 12mb isn't bad and I don't think the GC will aggressively free that. Maybe it's too much for you?

Re: Memory leak

2019-11-14 Thread dom96
Are you using async await in your program? In any case, the best way I've found to diagnose memory leaks for long-running programs is by logging the memory usage of each object to something like prometheus. My [prometheus package](https://github.com/dom96/prometheus) can do that automatically

Re: donation

2019-11-13 Thread dom96
Guessing @JPLRouge means that our donations page does not list their donation. We need to update that page more often.

Re: let & const on C backend

2019-11-06 Thread dom96
You can always workaround this by creating a nice macro which will generate something like: {.emit: """ const int a[] = {1,2,3}; """.} Run

Re: Nim v. 1.0.2 is out!

2019-10-23 Thread dom96
The link to share, now that we've got an article: [https://nim-lang.org/blog/2019/10/23/version-102-released.html](https://nim-lang.org/blog/2019/10/23/version-102-released.html)

Re: Nim Podcast

2019-10-23 Thread dom96
Since this thread has popped up again, I should ask, what ever happened to these lost episodes? Among them is one of mine, would love to hear it again.

Re: Telegram group

2019-10-20 Thread dom96
Done. Sorry it took so long :)

Re: FOSDEM Call for Participation

2019-10-18 Thread dom96
Where has this been emailed out? Is there not a page which has this description on the FOSDEM website somewhere? It would be great to update it if so, and also the description in your original post.

Re: Winning the Base64 benchmarks.

2019-10-17 Thread dom96
> benchmarks are a game. > > you can always beat or come close to C with Nim. Agree with you 100% and especially these statements. For compiled languages like C/Nim/Rust/Go it really is just a case of putting in the time to optimise the code for a specific architecture or compiler. Even

Re: nim cannot reference libraries installed with nimble.

2019-10-14 Thread dom96
Did you follow Choosenim's instructions to modify your PATH?

Re: FOSDEM Call for Participation

2019-10-14 Thread dom96
In that case, IMO, this whole paragraph needs to be removed or rewritten: > Minimalism is an important topic for this devroom. Minimalism matters. > Minimalism allows for smaller systems that take less resources and consume > less energy. More importantly, free and open source minimalism allows

Re: How to turn thread spawn call into an async call [redux; Nim 1.0.0]

2019-10-12 Thread dom96
Not yet AFAIK. We're still waiting on @rayman22201's patches to be finalised.

  1   2   3   4   5   6   7   >