Small Nim js fib benchmark

2022-11-15 Thread Araq
Oh yeah and we're so bad at code size. Stop the fear mongering.

Small Nim js fib benchmark

2022-11-15 Thread xigoi
Unfortunately, since webpages are loaded often, and many people are on a limited data connection, code size is a non-negligible part of JavaScript performance.

Nimble on Termux uses invalid temp folder

2022-11-15 Thread amadan
You can probably just clone the repo or use it has a submodule and then add it with --path when compiling But best to use the termux package since it has fixes for this unless you specifically need devel. If not then you can apply this patch file before building devel

Nimble on Termux uses invalid temp folder

2022-11-15 Thread HJarausch
Nimble on Termux(Android) (current devel version) tries to access /data/local/tmp/nimble_19543/. How can I change the path of the temporary folder? How can I "install" a package (like bigints) without using nimble. Even on a rooted Android device it's hard to make /data/local/tmp accessible for

Internal compiler error - how to debug?

2022-11-15 Thread HJarausch
I have managed to reduce the size of a source file which triggers a compiler error - see bug 19984. Now commenting out a single line makes this source file compile. Thanks for Hint, Helmut

Nim 2: "Memory can be shared effectively between threads without copying in Nim version 2"

2022-11-15 Thread Araq
I guess we need an API for it. But here are the required steps for `ref T`. (For dedicated types like `SharedPtr[T]` it is easier): * Ensure the destination is still empty so that no unprotected RC decrements can happen. * Ensure there is no race on the destination location. * Use an atomi

Nim 2: "Memory can be shared effectively between threads without copying in Nim version 2"

2022-11-15 Thread giaco
Is '''cast(gcsafe)''' an answer to this problem we can rely on?

You need to compare this figure to the result

2022-11-15 Thread Seokhairul9
You will have a reduced number of results from the search engine, and at the same time have the time you need to scroll and examine the results. When you want to search for a specific website, you need to restrict the URLs that will be included in the search. Example of site search on Google To

Why I enjoy using the Nim programming language at Reddit.

2022-11-15 Thread jasonfi
Since you're working on data with Nim, perhaps could you give me feedback on Nexus' ORM, if you have the time? You can't do joins yet, but for my own purposes it has worked quite well.

Nim 2: "Memory can be shared effectively between threads without copying in Nim version 2"

2022-11-15 Thread sls1005
When I'm just curious about the implementation details, I read the C code. And as I can tell, it's safe after moving, as `local` is then set to `nil` (, which is the side effect of moving.) But the operation of moving can be unsafe, as it's unknown if `move` is an atomic operation. You may need

How to add a file to a project without importing

2022-11-15 Thread sls1005
Do you mean that you don't need anything from `startup.nim`, but need it to run? If so, from startup import nil Run

How to add a file to a project without importing

2022-11-15 Thread mashingan
By `include` -ing it: `include startup` . Combine with `when` block you can decide whether to include `startup1.nim` or `startup2.nim` or others during the compilation. @templatedperson > What's the use case for this? To treat both `main.nim` and `startup.nim` as a single package, as opposed t

How to add a file to a project without importing

2022-11-15 Thread templatedperson
What's the use case for this?

Nim 1.6.10 RC2

2022-11-15 Thread dlesnoff
Can we automate testing on Nimble libraries ? I have tested it on nim-lang/bigints. No bugs, no obvious speed regressions.

How to add a file to a project without importing

2022-11-15 Thread japplegame
So, the answer is: "no way"

Small Nim js fib benchmark

2022-11-15 Thread Siltaar
I played with `nim js` and recorded the results here : It shows that `nim js` compiled JavaScript code is as fast as native JavaScript code for this particular example. Tested on `nodejs` and `js78`. It also shows that `nim e fib.nim`

Why I enjoy using the Nim programming language at Reddit.

2022-11-15 Thread GavinRay
You founded Pushbullet? I don't use it anymore, but in the mid 2010's that tool was one of the best things since sliced bread. I had my phone and all my devices hooked up to my browser and would just text + message everyone from there. Great stuff!

Why I enjoy using the Nim programming language at Reddit.

2022-11-15 Thread treeform
I started to work at Reddit when data team was quite small and got to choose my own tech, back then the tool was not that important for reddit as it is now. Founding Pushbullet was great but it did not use Nim, wish I would know about Nim back then. Same with game Istrolid, i wish I would have u

Nim 2: "Memory can be shared effectively between threads without copying in Nim version 2"

2022-11-15 Thread Araq
Pff so use `cast(gcsafe)` to make the compiler shut up.

Nim 2: "Memory can be shared effectively between threads without copying in Nim version 2"

2022-11-15 Thread PMunch
Is that safe? How can we tell? What are the rules with multithreading and ARC? For us who didn't implement it we're just left guessing about what we can and can't do here.. This example "works", but I have no idea if it actually works (added in some echos to make sure the string is actually move

How can I concatenate strings of type sqlQuery (db_sqlite)?

2022-11-15 Thread Araq
Via `echo string(someSql)`

How to add a file to a project without importing

2022-11-15 Thread Araq
By using `import startup`. There are other ways via `--import` on the command line or in some config file but these are bad. ;-)

Nim 2: "Memory can be shared effectively between threads without copying in Nim version 2"

2022-11-15 Thread PMunch
This runs into the dreaded `is not GC-safe as it accesses 'g' which is a global using GC'ed memory` error though.

Nim 2: "Memory can be shared effectively between threads without copying in Nim version 2"

2022-11-15 Thread Araq
Untested but what about: type X = ref object a: string var g: X proc foreign {.thread.} = var local = X(a: "abc") g = move local spawn foreign() # g now has an X Run

How to add a file to a project without importing

2022-11-15 Thread japplegame
Let's say the project consists of two files: `main.nim` (project file) and `startup.nim`. I don't want to import `startup.nim`, but I want to compile and link it. How to do it?

nvim-summon: Neovim plugin for adding standerd library imports

2022-11-15 Thread xigoi
One of the most annoying things when writing Nim code is having to add imports when you use symbols from the standard library. I created a proof-of-concept Neovim plugin to make it easier:

Nim 2: "Memory can be shared effectively between threads without copying in Nim version 2"

2022-11-15 Thread zevv
Araq's recent post "A cost model for Nim" states that "Memory can be shared effectively between threads without copying in Nim version 2". This is related to a problem I have been struggling with for a long time. Basically, the problem is this: * I have a program with two threads, A and B.

Nim 1.6.10 RC2

2022-11-15 Thread didlybom
It works great for me (although the choosenim upgrade step failed while trying to update nimsuggest because I had VSCode running). It is nice that using the incorrect -mm:orc switch fails with a much better error.

Opportunity to adopt a new linker?

2022-11-15 Thread planetis
All you need to pass is `-l:"-fuse-ld=mold"`

problems with gcc.exe and gcc.linkexe

2022-11-15 Thread foxoman
looks like one lib your app depend on is linked with glibc dynamic and it was not built with musl statically as you wanted. (Maybe libnss ) as suggested in different occasion with same error. Not sure which linux you are using but i will suggest using a fully musl built linux distro like alpine

problems with gcc.exe and gcc.linkexe

2022-11-15 Thread Yardanico
> I also tried to put some random text istead of musl-gcc and got no error so > they seem to just do nothing Are you sure you're set Nim to use GCC? For example on macOS the default is clang. Try also adding `--cc:gcc` in addition to your flags. And yeah, if you're using httpclient for anything

problems with gcc.exe and gcc.linkexe

2022-11-15 Thread choltreppe
Hi there, Im trying to statically link to musl. nim c --gcc.exe:musl-gcc --gcc.linkexe:musl-gcc --passL:-static -d:release --threads:on -o:build/server devel/backend.nim Run but then I get this warning: warning: Using 'getaddrinfo' in statically linked appl

How can I concatenate strings of type sqlQuery (db_sqlite)?

2022-11-15 Thread Hobbyman
O yeah view the string-concat of course duh...

How can I concatenate strings of type sqlQuery (db_sqlite)?

2022-11-15 Thread Hobbyman
Thanx it works, also with vars. You cannot echo it though, to view the result... Is there a way to view the result?

How can I concatenate strings of type sqlQuery (db_sqlite)?

2022-11-15 Thread Araq
Use this instead: `sql("blabla" & "blabla")`

How can I concatenate strings of type sqlQuery (db_sqlite)?

2022-11-15 Thread Hobbyman
When i have two db_sqlite-sqlQuery-strings how do i concatenate them? The folowing doesnt work: sql"blabla" & sql"blabla" Use-case: dynamic composition of queries.

Why I enjoy using the Nim programming language at Reddit.

2022-11-15 Thread pietroppeter
that's a great post thanks for sharing! in particular I liked a lot this initial part: > I have worked at Reddit for five years and have used Nim nearly every day > during that time. The internal data tool I am working on is written primarily > in Nim. I have developed a tiny but powerful data

Bad out of the box experience with MSVC

2022-11-15 Thread Araq
It is fixed.

Nim 1.6.10 RC2

2022-11-15 Thread pietroppeter
I need to try again and use choosenim on the Mac M1 so that is easy to switch versions. Did anyone succeed in having it work?

new to nim install fail Ubuntu 22.04.1 LTS

2022-11-15 Thread federico3
I understand your worry! Hopefully OpenSSL 3 will be supported in 1.6.10 and 2.0

I drew nim-chan

2022-11-15 Thread Vindaar
It's one of the many honorific suffixes in Japanese:

new to nim install fail Ubuntu 22.04.1 LTS

2022-11-15 Thread sls1005
Will there be a day we can no longer install Nim via a package manager?