Is a Java-style GC possible?

2022-09-22 Thread dom96
> Unfortunately allocation and deallocation with --gc:orc and --threads:on is > slow, because it has to lock/unlock the heap, but this could be alleviated > soon with mimalloc. But even then in such an extreme example classical GC's > will be faster than --gc:orc's ref counting, because they can

Show Nim: TheArtButton.ai, a new web Stable Diffusion runner

2022-09-11 Thread dom96
Nice, what are you running this on?

libpe & peni - Portable Executable parsing lib & tool released

2022-09-08 Thread dom96
There is also a famous Polish song by that name, but I have no idea if it's related to the movie: . Guess I should watch that movie lol

QRgen - A QR generation library fully written in nim

2022-09-08 Thread dom96
One of the coolest libraries I've seen in a while!

Ideas for useful/cute little GUI programs?

2022-08-24 Thread dom96
> Haha sure. Though would it be possible to add json output to choosenim? > Relying on parsing the text output isn’t great. ahh yeah, that is indeed missing and would be good to have.

Ideas for useful/cute little GUI programs?

2022-08-23 Thread dom96
Wow, nice! I was actually thinking of something much simpler. Just a classic Windows setup wizard which: * Downloads choosenim * Runs `choosenim.exe stable --firstInstall` * Adds ~/.nimble/bin to PATH (Which to be fair, is probably best implemented using native Windows widgets) But your

Ideas for useful/cute little GUI programs?

2022-08-20 Thread dom96
GUI installer for Nim/Choosenim

Anti-virus at work prevents the use of Nim binaries

2022-08-20 Thread dom96
Yeah, I tried to repro on my own machine and 1.6.6 can be downloaded just fine. Microsoft Edge nor Windows Defender complain. So maybe something has changed indeed.

Anti-virus at work prevents the use of Nim binaries

2022-08-19 Thread dom96
Yeah, I also think a blog post calling the antivirus companies out is our best bet. In the meantime I noticed replit has the same problems and I tweeted at a Microsoft PM who has helped them:

Anti-virus at work prevents the use of Nim binaries

2022-08-18 Thread dom96
> to me it worked with chosenim 0.7.4, this is the version dom96 is linking for > Windows.. That's only because I didn't bother to update the link, nothing to do with Windows AV compatibility. Though maybe I shouldn't update the link since it works for now.

Alternative to gravatar for the forums?

2022-08-17 Thread dom96
There is also . Any of these analytics services free for open source projects? They all cost money which is fair, but if we can get them for free that would be nice. Btw there is no chance we can avoid proprietary software completely and I don't think we should

Why is db_postgres so slow?

2022-08-16 Thread dom96
The bottleneck here is likely that db_postgres blocks. I would give @treeform's async library a try. On the other hand, even though Nim stdlib is 0.6% of the top Rust framework that's still nearly 4k QPS. If you want to help market Nim then look into optimising this, but if you want to just get

Best websocket library?

2022-08-11 Thread dom96
Just a note: you shouldn't be creating a proc that is both async _and_ a thread. Create a thread and then run async procs in it, something like: proc myThread() {.thread.} = asynCheck(asyncProc1) waitFor(longRunningAsyncProc2) Run

Best websocket library?

2022-08-11 Thread dom96
Async and threads isn't a problem. Just run the async event loop in only one of the threads for the websocket server. That being said: you should avoid threads as much as you can. They make your code more complex and it's very difficult to use them for efficient parallelism (you'll end up with

Best websocket library?

2022-08-11 Thread dom96
There is also which I use for

The Nim team's latest efforts in mitigating the false postives on the Nim binaries

2022-08-10 Thread dom96
This is a great start! Thank you for setting this up. I think another avenue to pursue here is writing a blog post on nim-lang.org calling out the AV vendors for their poor detection. If we can get that on to Reddit/Hacker News then we stand a good chance of the employees of those vendors to re

Async musings

2022-08-05 Thread dom96
Nice, have you done any benchmarks yet? Really curious how it compares to stdlib async.

Effect system: filtering tags

2022-07-26 Thread dom96
> It's already very clear. Look for cast and addr keywords... if we can build the equivalent of with this then I'm content. The least we can do is have a document written up describing which Nim constructs are considered "unsafe".

Effect system: filtering tags

2022-07-26 Thread dom96
How about we simply follow the Rust way? In Nim this could mean: `addr`, `ptr`, etc get an unsafe effect, everything else is implicitly `.notTags: {Unsafe}` and we need to put a `.cast` block around the code using `addr` etc. to make it safe (we could create a macro called `unsafe` which is just

downloading big files

2022-07-26 Thread dom96
Yeah, unfortunately I think the current FutureStreams implementation is somehow broken. Maybe there is an easy fix though?

Nim packages dependencies visualizations

2022-07-25 Thread dom96
Nice! Though it seems slightly outdated, did you grab an older choosenim? Choosenim hasn't depended on nimterop for a long while now.

Implement api rate limiting with jester

2022-07-25 Thread dom96
Yeah, we need manual docs for this stuff.

Carbon lang

2022-07-25 Thread dom96
If Carbon stays focused on becoming what TypeScript is to Javascript but for C++ then it will do very well. Nim may have good C++ interop but it's not focused on that, Carbon seems to be specifically focused on making a transition from a C++ code base to a easy (and there is a lot of C++ develo

Implement api rate limiting with jester

2022-07-25 Thread dom96
You don't need middleware for this. You can create a route that runs before all requests (or all requests under a specific sub-path), for example: <https://github.com/dom96/jester/blob/master/tests/alltest.nim#L49>. So the following should work for you: before re&quo

Force compilation of unused parts of a module

2022-07-16 Thread dom96
Why are we creating a new pragma for this? Doesn't `exportc` already have these semantics? > The only way I can see to force Nim to compile the rest is to mark them > {.exportc.} which isn't ideal. Isn't it possible to `push` the `exportc` pragma? if not, maybe it should be.

Which metrics we should collect for each commit if building a GitHub Action bot?

2022-06-29 Thread dom96
There are many different ones you could measure. But probably a good start is the compiler bootstrapping time. The most important thing though is to use dedicated hardware to get consistent results. Doubt GitHub Actions will be very consistent here.

If imported name conflicts with Nim keyword, what would you call it?

2022-06-27 Thread dom96
In this case I would go for `httpMethod`.

Threading error: calling procs off objects (httpbeast)

2022-06-22 Thread dom96
A `threadvar` needs to be initialised manually per-thread. I guess your expectation is that assigning the value in one thread will assign the same one in all threads, that is not the case. You will only assign it in the main thread. Best way to do what you want is to create a proc for each threa

Show Nim: Pure Nim .jpeg decoder in Pixie

2022-06-20 Thread dom96
You can always build a binary which reads JPEGs and outputs them in a format that you can then read at compile-time. That way you'll get the same functionality.

Jester disable content-length header

2022-06-14 Thread dom96
Yeah, you can use this `send` overload: <https://github.com/dom96/jester/blob/master/jester.nim#L142>. (Be sure to also call `enableRawMode()` in your route).

Questions regarding async - How to display text while downloadFile()

2022-06-12 Thread dom96
Hello and welcome! For this you don't even need async. You can just use the blocking http client. You should use the `onProgressChanged` callback for this. Here is an example, it uses async but the same should work for the blocking `HttpClient`:

Cursed: Working braces in Nim

2022-06-09 Thread dom96

Small improvement discussion: Use `let` to lock variable previously declared as `var`

2022-05-27 Thread dom96
> I use this pattern a lot, although @dom96 either forgot to return tmp in his > expression, or suggests computeFoo returns, and not just modifies its argument For what it's worth I just followed @cmc's block example and translated it into an expression instead of a block st

Is it possible to have a nim forum rss feed publicly?

2022-05-27 Thread dom96
True, we should add that.

Small improvement discussion: Use `let` to lock variable previously declared as `var`

2022-05-27 Thread dom96
You can also do something like this: let foo = (var tmp = initFoo(); computeFoo(tmp)) foo = "foo" # compiler error, good Run Depending on the situation it might fit better.

Is it possible to have a nim forum rss feed publicly?

2022-05-27 Thread dom96
The forum already offers an Atom feed: * * Code pointer for reference:

Beware: phishing attempts on Nim users (PSA)

2022-05-25 Thread dom96
Just got an email about the `nim-iang` account as well. Props to GitHub for acting on the report(s).

Beware: phishing attempts on Nim users (PSA)

2022-05-20 Thread dom96
I have noticed a recent uptick in changes being made to the Nim GitHub wiki. It started with changes that appear to be simple SEO spam, but now somebody has actually gone further and appears to be readying for a phishing attack. Right now `nim-iang.org` redirects to `nim-lang.org`, but I expect

Nim v2: what would you change?

2022-05-11 Thread dom96
> oh, im sure others are. Of course, nobody likes refactoring, what's your point? :)

Nim v2: what would you change?

2022-05-11 Thread dom96
I think we are moving too much towards an off-topic discussion in here. I would encourage a separate thread for your questions around responsibility and refactoring. I will just say that I am always happy to lend a hand in reviewing refactoring PRs for the stdlib, in practice there isn't anythi

Nim v2: what would you change?

2022-05-11 Thread dom96
Thank you @j-james for putting this together! ❤️

Nim v2: what would you change?

2022-05-11 Thread dom96
I suspect @Araq and the other members that are on the payroll will have their own priorities. As for me personally, I enjoy thinking about how we can make Nim better. Sometimes the most impactful changes require breakage and as we only now have a small time window[1] to make them I am eager to

Async musings

2022-05-09 Thread dom96
Really awesome to see your approach focus on keeping semantics the same (or as close as possible) to existing async in Nim. I think adoption for something that forks the semantics/API will be difficult, especially if the improvements over the existing implementation are relatively niche. >From

Hello Javascript!

2022-05-09 Thread dom96
The Google closure minimizer can decrease the JS even further. If you want an example: . Yes, it's 1.32MB but web servers nowadays do compression and the JS Nim produces compresses well.

Nim 1.6.6 released

2022-05-05 Thread dom96
It looks like it was failing originally because of permissions issues. As for custom `choosenimDir` I discussed with someone else recently: I would prefer an env var for this. Nimble already has one called `NIMBLE_DIR` so choosenim should have the same and then you'll be able to set `CHOOSENIM_D

Nim 1.6.6 released

2022-05-05 Thread dom96
@didlybom I've seen others running into this in the past: <https://github.com/dom96/choosenim/issues/284>. This code seems to be failing for you: <https://github.com/dom96/choosenim/blob/master/src/choosenimpkg/utils.nim#L124-L143>. Do you have `gcc` in your PATH? can you see

Fidgets!

2022-05-04 Thread dom96
or just FidgetWidgets, it's longer but reads nicely :)

Nim v2: what would you change?

2022-05-03 Thread dom96
Just want to reiterate: please focus your suggestions on ones that require breaking changes. I’m seeing responses which don’t fit this. I plan to go through all your suggestions and put together all the ideas, but I will be filtering out any that can be done without breakage (keep those for a d

Nim v2: what would you change?

2022-04-30 Thread dom96
> If we were to talk about v2 changes, I hope the compiler will finally see > some work on refactoring and making it more accessible to other developers. That's something that can always happen without breakage. Let's focus on language/stdlib changes that _need_ breakage :) > And please, please

Nim v2: what would you change?

2022-04-30 Thread dom96
Hello all, I have been thinking about Nim v2 lately and after speaking with @Araq about it I think we can be a lot more ambitious with what we change for this major release. The original plan is to change the default GC, but we can do much more (time permitting of course). I wanted to create t

Brogrammer uptick

2022-04-29 Thread dom96
> So the server will serve old html or process new json into html on request? > Where's the code for the irclogs backend? Yep.

Brogrammer uptick

2022-04-27 Thread dom96
To be fair, scraping the html is more resilient: the early logs were only saved as HTML (so you will get 404s when requesting the JSON). Wasn't expecting this graph to just be HTML, really nice styling!

Brogrammer uptick

2022-04-26 Thread dom96
Wow, very cool visualisation. How did you create it? Can you share any scripts you've used? Really interesting to see the late-EU-time majority diminish into flatness. It is interesting that 2020 has so much more activity, my guess is it's due to 1.0 being released but it was released late 2019

Hacker News discussion abou the recently discussed Rust vs Nim performance comparison

2022-04-23 Thread dom96
@elcritch that's awesome. You don't see memory consumption benchmarks very often. That is a website someone should build :)

Hacker News discussion abou the recently discussed Rust vs Nim performance comparison

2022-04-22 Thread dom96
> Is it that hard to beat rust in performance, that you want to give up > entirely? No, what's hard is making sure every benchmark site has optimal Nim code that is fair for Nim. There are plenty of other sites doing similar comparisons and doing them well, so removing the poor comparisons cou

Hacker News discussion abou the recently discussed Rust vs Nim performance comparison

2022-04-22 Thread dom96
At what point is it better for us to just ask for Nim to be removed from such benchmarks? We're slower than Python according to them, that's pretty bad. Bumping because @nlhnt from Discord was looking into these benchmarks and wondering why Nim is so slow. Has anyone had any closer look at optim

Installing choosenim (on Windows) on a custom folder does not seem to work

2022-04-21 Thread dom96
Yes, choosenim could be smarter here. Nimble has a configuration mechanism where it reads a nimble.ini file from the system's default config dir (~/.config/nimble on linux iirc). We could have choosenim do the same, but I don't think it's necessary. I think a better solution is to have chooseni

Brogrammer uptick

2022-04-21 Thread dom96
bruh

Optimize parsing large file line-by-line

2022-04-19 Thread dom96
> Note that parsing files was discussed in the Manning book Thanks for mentioning! In case you want to have a look at the example code from Nim in Action: <https://github.com/dom96/nim-in-action-code/tree/master/Chapter6/WikipediaStats>. Happy to answer any questions about it.

net: recv/readLine: How receive more one line or not waiting for fill buffer size?

2022-04-04 Thread dom96
If you're relying on whatever is in the buffer then you're more than likely not doing things correctly. You want to read as much as the protocol asks for, usually it's a known size or up to a delimiter like `\r\n`.

server-client webframework

2022-03-23 Thread dom96
Looks amazing! Nim is definitely a language that needs something like this. Thank you for taking the initiative to build it :)

Replit featured us in their newsletter this week!

2022-03-02 Thread dom96
Nice! Thanks for letting us know, I sent out a quick tweet about it: :)

How to correctly augment async future data

2022-02-28 Thread dom96
You might be able to simply change the `URLInfo` to be a `ref object` as well.

Raises tracking and no more cyclic references in `chronos`

2022-02-25 Thread dom96
Really awesome! Great job @Menduist :)

Nim 1.6.4 released

2022-02-20 Thread dom96
Doesn't include . Can we make sure to include it in the next patch?

Forum crashes when search term includes "(" or ")"

2022-02-20 Thread dom96
Reposting what I just wrote on the GitHub issue: > Wow, this is really interesting. I was wondering how the forum was crashing > here, turns out it doesn't. I'm not quite sure why CloudFlare returns a 502 > after the search with a "(" but it seems to be browser-local. You can test > this yourse

NimForum 2.2.0 - Fixes a big CVE!

2022-02-19 Thread dom96
We can probably render these as raw rst, I implemented this quickly as the new rst parser was failing to render a particular quirk of how some people write their posts. But it's easily fixable by the mods by just editing the post, so feel free to report these if you see them.

A better looking Nimble (web, design, feedback, ideas)

2022-02-16 Thread dom96
This is epic! I wouldn't change a thing. Just perfection :) I've been wanting art work for Nim t-shirts that looks as amazing as this, maybe these art works could be a great thing to put on a t-shirt with similar text like "Build amazing things with Nim". Maybe you'd be interested in designing

[asyncnet] Difference between a natural socket close and close(AsyncSocket)

2022-02-16 Thread dom96
You can have a look at the implementation of asyncnet.close. It's pretty simple so I think it's more likely your locking code is causing dead locks.

Forum crashes when search term includes "(" or ")"

2022-02-16 Thread dom96
Please report these kinds of things on GitHub

i am just saying a splitted .sendall on socket would be much clear

2022-02-14 Thread dom96
> Mainly there's EINTR that can cause partial writes to occur. It only occurs > under very heavy loads or lots of small writes, etc. IIRC we disable EINTR on Nim's sockets.

after called `AsyncFuture.fail`, the future is still running

2022-02-12 Thread dom96
@royneary there are two kinds of timers in asyncdispatch, virtual ones and OS ones. The `addTimer` proc creates the latter:

Compressing resulting JS

2022-02-12 Thread dom96
Here is what I use for Stardust.dev's JS: task clientr, "Build JS sources": exec "nimble js -d:client -d:js -d:danger --out:out/client.js client.nim" when defined(linux): # Little hack, replace {val: 0, has: false, val: 0, has: false} exec "sed -i 's/{val:

after called `AsyncFuture.fail`, the future is still running

2022-02-12 Thread dom96
The only way you can cancel operations right now in Nim's async is by closing the FD they are pending on. This might work on the timers created by `addTimer` as well.

Hacker News discussion abou the recently discussed Rust vs Nim performance comparison

2022-02-08 Thread dom96
Look at the implementation: . These benchmarks are a poor reflection of Nim. If you're interested in what Nim can do check out HttpBeast and the TechEmpower benchmarks.

Exclude from generated docs

2022-02-04 Thread dom96
Yep, like this: when not defined(nimdoc): # put your code here Run

Nim 1.6.4 release candidate

2022-02-02 Thread dom96
If you could, please report this on choosenim's github. We should get a nice "version not found" error here instead of whatever that is :)

Nim's autoformatter situation

2022-01-31 Thread dom96
I definitely won't be working on this any time soon, but if somebody is interested in creating a Black for Nim I would encourage them. The challenge of actually implementing it may seem easier than it actually is though, this is a good article I read a while back about the subject:

Nim's autoformatter situation

2022-01-31 Thread dom96
> Nimpretty doesn't do that by design, it assumes that if you took the effort > to type in newlines, it's because they are meaningful to you and that you > want it this way. The problem with this is that you will end up with inconsistent formatting. I do also wish for a Black for Nim. As a sid

NimForum 2.2.0 - Fixes a big CVE!

2022-01-31 Thread dom96
> But refusing to use an objectively better solution because you're too > emotionnally invested in some code you wrote 14 years ago who may have been > relevant then is just stubbornness. Wow. I think turning to these kinds of ad hominem attacks really does your arguments a disservice. What a w

NimForum 2.2.0 - Fixes a big CVE!

2022-01-30 Thread dom96
> why not switch for a superior solution like discourse who not only has less > bugs but more functionality (like the ability to research old post) ? * You can search this forum using the search bar at the top-right, or using Google (or another search engine). * The forum is a great showcase

NimForum 2.2.0 - Fixes a big CVE!

2022-01-30 Thread dom96
Did it work before I deployed the new version? Did something change to break old iPad's?

NimForum 2.2.0 - Fixes a big CVE!

2022-01-30 Thread dom96
Pretty sure that's a Karax bug, fix welcome :)

NimForum 2.2.0 - Fixes a big CVE!

2022-01-28 Thread dom96
_give a man a feature and he 'll take months to deploy it, show a man a CVE and he'll fix it and deploy everything ASAP_ A new deployment of the forum has been due for a while now, some wonderful bug fixes and new features were introduced, but what really pushed things was a brand new exploit t

Is there a HTTPS enabled HTTP server in Nim?

2022-01-27 Thread dom96
For embedded I would recommend just wrapping the C web server and using it. AsyncHttpServer isn't suited for embedded and I wouldn't run it "bare" without a reverse proxy anyway.

Trojan:Win32/Wacatac.B!ml

2022-01-22 Thread dom96
> I have no idea what can be done, unfortunately. The only thing I can think of unfortunately is to write a blog post calling out AV vendors for this. If it gets traction it might be read by somebody in the industry that can help us.

profiler for mac?

2022-01-20 Thread dom96
Have you seen ?

libmysqlclient.so Not Found

2022-01-19 Thread dom96
I hate to be that person but this is easily googleable... in any case try `sudo apt-get install libmysqlclient-dev`.

Youtube "Software Drag Racing" to count primes in Nim

2022-01-02 Thread dom96
For those wondering (like I was) about how to get the actual results (you need to click the "Leaderboard" under the filters or just click the following link): [https://plummerssoftwarellc.github.io/PrimeView/report?id=davepl-1641120327.json&hi=False&hf=False&hp=False&fi=&fp=mt&fa=wh~ot&ff=uf&fb=u

Require Nim devel branch as dependency (nimble)

2021-12-25 Thread dom96
Hm. Does Nimble not allow it to be omitted?

Nim at FOSDEM 2022 - CfP is open!

2021-12-21 Thread dom96
Deadline for talk proposals in 2 days(!)

Nim with curly brace and tab

2021-12-21 Thread dom96
That action isn't common enough to learn a dedicated set of commands for, which is the whole problem with Vim (that and the fact that its custom commands only work in Vim and Vim-compatible places, which the OS is not one of). At the end of the day, what it comes down to is whether editing the t

What am I missing here? (async)

2021-12-17 Thread dom96
Be sure to also follow the convention and name your types starting with a capital letter. If you don't you run the risk of running into some confusing situations :)

Nim 1.6.2 released

2021-12-17 Thread dom96
oh cool. So breaking changes are now allowed in `devel`? Big if true :) Guess this is a good opportunity to optimise `json`?

HttpBeast 0.4.0 is here

2021-12-14 Thread dom96
Just released v0.4.0 of HttpBeast. Looking forward to the benchmarks, feedback welcome :) Major changes: * Big performance improvements: <https://github.com/dom96/httpbeast/pull/65>, <https://github.com/dom96/httpbeast/pull/64>, <https://github.com/dom96/httpbeast/pull/63

Httpbeast failed to compile on Android arm device

2021-12-14 Thread dom96
probably just an oversight, should be an easy fix

Httpbeast failed to compile on Android arm device

2021-12-12 Thread dom96
yeah, your Nim version appears to be outdated

Improve forum

2021-12-08 Thread dom96
You can use imgur (or another image host) and then use the RST syntax to embed images from there. I think we'd rather avoid having to deal with any possible legal troubles to do with hosting images on our servers.

Nim at FOSDEM 2022 - CfP is open!

2021-12-01 Thread dom96
We're excited to announce that for FOSDEM 2022 there will be a Nim Programming Language developer room! This means we need talks and lots of them. The talks will be pre-recorded so it's a good opportunity for anyone who may not be confident speaking in front of a live audience. For more details

TLS protocol negociation (TLS-ALPN)

2021-11-30 Thread dom96
Happy to accept any patches that add this support. :) If you want a bigger project: BearSSL support in the stdlib would be cool too :D

  1   2   3   4   >