NestedVM & Nim to make android apps?

2021-07-28 Thread Yardanico
First of all, you can make Android apps with Nim using the traditional NDK APIs and amazing libraries like and . Secondly, that project seems to be dead (not active for over 9 years), which is not that good :P

NestedVM & Nim to make android apps?

2021-07-28 Thread Phpostrich
/ So if you can use gcc to interpret C to Java bytecode, could we use Nim to make android apps (with this method)? I actually don't know if android uses a JVM. I'm not quite sure.

techempower entry for nim stdlib http server

2021-07-28 Thread sdmcallister
I believe Jester has been added for json.

Nimscript produces slower executable

2021-07-28 Thread tsojtsoj
Thanks! I'll open a GitHub issue using your example. The issue with the workaround will be that on Windows it sometimes doesn't work in combination with Clang if I remember correctly (I don't have access to a Windows machine currently). It will work for now, though.

PIG's

2021-07-28 Thread cblake
This is a good question, but the answer for such small deltas may not be related to "less work" as much as compiler/CPU variations. Unless you can really identify the extra work and why it happens/why it cannot be elided, I would not conclude much from 1.2x. Part of answering such questions shou

Nimscript produces slower executable

2021-07-28 Thread shirleyquirk
you are correct about that. `dang.nim` var s = [0,1,2,3] echo s[4] Run `config.nims` task default,"default compile": --define:danger --hints:off --define:lto --genScript:on setCommand "c" task manual,"manual comp

PIG's

2021-07-28 Thread treeform
Why do you think there is a 20% improvement? How does the look of nim code compare to rust and python code?

Nimscript produces slower executable

2021-07-28 Thread tsojtsoj
This doesn't seem to be the reason. If I replace `--define:danger` with `--define:release` in the nimscript it becomes significantly slower. (The compiler also says `Hint: gc: arc; threads: on; opt: speed; options: -d:danger` when I have the danger flag.)

Mac GUI

2021-07-28 Thread Neodim
App Bundle works, thanks! By layout tools I mean tools for widgets aligning, adjusting margins, paddings, gaps, grouping them into boxes, frames and layers..I used to use it in GTK and just trying to get how it works in Cocoa... Also please advice how to use widget methods, for example how to ge

Nimscript produces slower executable

2021-07-28 Thread shirleyquirk
`d: danger` and `d: release` have no effect in a `nim.cfg` or a `nims` because they take effect when the global `nim.cfg` gets read. cf

Nimscript produces slower executable

2021-07-28 Thread tsojtsoj
Normalley I compile my program with nim c -d:danger --panics:on --gc:arc -d:useMalloc -d:lto --passL:"-static" --cc:clang --threads:on --run Nalwald.nim Run Now I tried to write a nimscript for the build process: task default, "default compile":

techempower entry for nim stdlib http server

2021-07-28 Thread rishavs
i had actually added prologue one in the past but stopped with just json & plaintext due to lack of time and as xflywind (prologue creator) was still optimizing the framework code. But yeah, it would be great if we add all the tests for the other nim frameworks. Its easy enough.

techempower entry for nim stdlib http server

2021-07-28 Thread xigoi
Great idea! When we're at it, we should also add Jester and Prologue.

Why can't I use my macro like this?

2021-07-28 Thread ynfle
Seem overly complex for the example, but there are for loop macros which is an experimental feature documented in the experimental manual

techempower entry for nim stdlib http server

2021-07-28 Thread rishavs
Hey folks I just added the nim stdlib http server implementation into the techempower benchmark. the next test onwards it should get included into the main benchmark. as I am not a nim expert, my impleme

What is the difference between `quote do:` and just `quote:`?

2021-07-28 Thread Araq
The `do` here binds the body to the `quote` whereas otherwise it's bound to the `add` operation which is clearly not what we want.

What is the difference between `quote do:` and just `quote:`?

2021-07-28 Thread Araq
This works: import macros macro m(x: untyped) = result = newStmtList() result.add quote do: echo `x` m: "hi" Run And this doesn't: import macros macro m(x: untyped) = result = newStmtList() r

What is the difference between `quote do:` and just `quote:`?

2021-07-28 Thread xigoi
I posed this question as an aside in [this thread](https://forum.nim-lang.org/t/8259) and nobody answered; @dom96 was also wondering. Why do macros often use the construct `quote do:`, when `quote:` alone seems to work just fine?

Why can't I use my macro like this?

2021-07-28 Thread solo989
I've thought of a better solution that allows you to access the procs outside of the loop. import macros macro staticFor(i : untyped, startI, endI : static[int], body : untyped) : untyped = result = newStmtList() let t = genSym(nskTemplate,"t") result.

Why can't I use my macro like this?

2021-07-28 Thread ynfle
Sorry. I forgot to post the link to my solution on the playground

Youtube "Software Drag Racing" to count primes in Nim

2021-07-28 Thread miran
@GordonBGood's article is now available at

Why can't I use my macro like this?

2021-07-28 Thread solo989
How about you test his code before questioning my logic. It compiles but problem 50 is never declared. Try this and the assert will fail. template test(number) = echo "Generating ", number proc `problem number`() = echo "test: ", number test(1000) problem100

Guidance on Isolating Memory Leak

2021-07-28 Thread rbohl64
Thanks! I had misinterpreted that system modules were auto-imported in nim. The change does fix the memory leak when using the default refc gc. For --gc:{orc|arc}, the app still leaks memory at a far faster rate than originally with --gc:refc.

PIG's

2021-07-28 Thread ynfle
Please consider adding this to This Month in Nim and HN

Why can't I use my macro like this?

2021-07-28 Thread ynfle
This should work. You can also pass in a macro. You should do macro logic inside the macro

Guidance on Isolating Memory Leak

2021-07-28 Thread planetis
yes, int system/strs_v2.nim the cstrToStr makes a fresh string. 2) if you don't want to import system/ansi_c ? then just copy the definition to your own file.

What is the purpose of do notation

2021-07-28 Thread ashleylose07
Damm even I am having a similar kind of issue, I have searched all over the internet and even have posted on number of threads on different forum, no solution seems to work. I am really frustrated, can anyone of you here help me resolve this issue, I am very much tired now.

PIG's

2021-07-28 Thread linwaytin
It's amazing that the `nim` version outperforms the `rust` version by 20%!

Guidance on Isolating Memory Leak

2021-07-28 Thread rbohl64
The decimal maintainers surmise the leak is from not freeing the cstring returned by the underlying mpd_decimal library function mpd_to_sci(). This seems to be in the following code snippet: proc `$`*(s: DecimalType): string = ## Convert DecimalType to string result = $

PIG's

2021-07-28 Thread rforcen
hi, just a few days with nim and i've been able to easily port some PIGs (Parallel Image Generation) apps from rust, performance results are impressive (20% improvement), programming is joyful, fluid and clear, also opencl interface is very intuitive also, ported some python apps, i've added c