Fake Nim books an Amazon, which ones are real?

2024-04-23 Thread r3c
This is how a bureaucrat would tell you "What? I don't know that bro..."

Dear Araq, how do I create a programming language?

2024-04-20 Thread r3c
> Harmful: OOP for compiler plus the visitor pattern. Why?

`nph` opinonated formatter v0.2

2023-12-25 Thread r3c
It's compiling the compiler all over again... Bruh :

Wishlist: Ideal UI library for Nim

2023-07-26 Thread r3c
High quality software mostly have their own custom UI library, for example FL Studio or Blender. And modern consoomer UIs with their huge, gigantic butons made for touchscreens first look like crap. Especially on Linux, wether is Qt, Gtk, Wx, the buttons are huge and disproportional. If I woul

Wishlist: Ideal UI library for Nim

2023-07-25 Thread r3c
VST plugins UIs always amaized me how fast they are with all that knobs widgets, FFT, osciloscopes, spectrum analyzers, and they worked flawlessly on a potato.

Some of Nim's convention needs to change in order for it to succeed

2023-07-24 Thread r3c
"The lack of namespaces in Nim" is like saying "The lack of pointers in C"

Nim 1.6.14 released

2023-07-23 Thread r3c
There is a showsopper error in latest devel, in the generated c file ...exceptions.c there is redefinition of some variables. This issue is not present in v1.6.14

Ferus -- a tiny web engine written in Nim

2023-07-05 Thread r3c
* Take OpenGL "Hello Triangle" example * Fiddle it to render boxes and text * Add the html parser * Slap a client on top of it A C U S T O M W E B B R O W S E R

realloc and self referencing array problem

2023-07-04 Thread r3c
I was kinda hoping Nim has some pragma for this :)))

Recursive Fibonacci function

2023-07-04 Thread r3c
What C compiler and what flags? You can see the c-flags Nim used in the generated source/json. Try compiling the C code with those flags.

Is it possible to write Linux kernel modules in Nim without having to "hack" the Nim compiler?

2023-07-03 Thread r3c
Like gc:arc can replace kalloc?

realloc and self referencing array problem

2023-07-03 Thread r3c
"allocate chunks at a time or something" Its the same thing as linked list of arrays, but from different angle :P

realloc and self referencing array problem

2023-07-03 Thread r3c
When you expand an array/tree where each member has a pointer to other member, but realloc sometimes copy the old data and the pointers are gone. What im doing now is instead of pointers im using indexes, but its not enough flexible if you want to go up/down to parent/child trees. Other solution

Why Svelte is far superior than React (Karax)

2022-09-08 Thread r3c
That's why in most of the frameworks there's one way data flow. For example in Vue 1 you could do two way updates, in v2 they removed that option.

Why Svelte is far superior than React (Karax)

2022-09-06 Thread r3c
Challenge: Rewrite the Svelte compiler in Nim :)

if-else VS case-else VS case

2022-08-04 Thread r3c
One might see a difference when using C compiler that generates jump tables, it should be several times faster than if-else

Effect system: filtering tags

2022-07-29 Thread r3c
"Safety" is a mindset, not a language feature or concept. C# started with the "unsafe" keyword, then Rust came up and they use it as a selling argument. Just look at the kind of people it attracts :/ There is no "Safety"

Effect system: filtering tags

2022-07-26 Thread r3c
This part of Rust documentation :P > Unsafe Superpowers To switch to unsafe Rust, use the unsafe keyword and then > start a new block that holds the unsafe code. You can take five actions in > unsafe Rust, called unsafe superpowers, that you can’t in safe Rust.

Carbon lang

2022-07-25 Thread r3c
> I think the original question is worth considering. If Nim can wrap Carbon > easily, it could be a faster gateway to 100% C++ compatibility. Or even better: Lets ditch Nim and switch to Carbon. After all, it's from Google, it's got electrolytes :)

Carbon lang

2022-07-23 Thread r3c
"Carbon is a new early-stage programming language from Google" ugh... Thanks, but no.

Please help me understand the performance difference between Nim/Rust in this (contrived) example

2022-06-06 Thread r3c
Nim's `int` is 8 bytes 64 bit integer, in your Rust code you are using `u32` which is 4 bytes 32 bit unsigned integer. Can you change the Rust example to `i64` and see what happens?

GC refc crash calling into nim from C++

2022-05-28 Thread r3c
Afaik you should call `NimMain()` from your cpp code

Best practices for porting huge C projects to Nim

2022-05-26 Thread r3c
Is there any global hook which works with arc? If you importc, lets say a linked list, how do you free it from nim with --gc:arc? There is already existing FreelinkedLists() function in C, how can i call it from Nim?

Identifier names space in Nim

2022-05-25 Thread r3c
Nim is better than c++ in this regard import myModule as m echo m.function1() echo m.function1() ... Run

Best practices for porting huge C projects to Nim

2022-05-15 Thread r3c
Well the game is written in C, it doesnt exists in another language

Nim v2: what would you change?

2022-05-15 Thread r3c
Make threading stable and documented, even if it's not perfect, even if it's breaking change.

Problem with --threads:on

2022-05-15 Thread r3c
Works fine, what is your build command?

Why I left the Nim community

2022-05-07 Thread r3c
imo there is desperate need for Roadmap

Why I left the Nim community

2022-05-06 Thread r3c
Np, I mentioned this here, it was someone else on discord. So im not the only one with this impression :) And maybe that's the problem, being too nice and trying to help/please everyone? :/

Why I left the Nim community

2022-05-06 Thread r3c
> I can say so personally as I was just having questions answered by all of the > folks you mentioned > in another PL discord last month maybe? You're > gaslighting here just a bit. Who mentioned what folks and where?? I just told you my personal experience here, and I think people in general a

Why I left the Nim community

2022-05-06 Thread r3c
Honestly, I'm not aware of any other community where the creator/core devs/senior members communicate and answer questions from Nim noobs (including myself when I joined here) on the forum and irc.

Why I left the Nim community

2022-05-06 Thread r3c
Regarding your comments on hn - you'll never have the "perfect language" :)

Best practices for porting huge C projects to Nim

2022-05-04 Thread r3c
> Throw it all away and start from scratch. I'm not confident :P Even if i manage to implement the level loading, it just has too many things, the platforms, console system, entity manager, renderers, networking, sound, client-server communication, prediction, etc.

C FFI using only types?

2022-05-04 Thread r3c
I made a mistake, ffi.h should be included, not mod.h, now it works

Best practices for porting huge C projects to Nim

2022-05-03 Thread r3c
What is the best practice for this? You can't do it in one time, I suppose you'll have to use FFI, so my idea was to port Xash3D (Half-Life engine), but its too complicated, the modules are too big and depend of globals, void functions, hash tables, structs with function pointers, etc. So how

C FFI using only types?

2022-05-03 Thread r3c
I'll take look at Genny, tnx.

Moderation policy for bans

2022-05-03 Thread r3c
Every community, at its start consist of relative small number of highly talented and motivated people that have something in common and contribute to something great. They help eachother, debate, somethimes argue - howewer, they are kinda on the same 'frequency', so to speak. ...But! As the co

C FFI using only types?

2022-05-02 Thread r3c
Can you import a type from C, make function for it, export that function and use in the C file?

Nim v2: what would you change?

2022-05-02 Thread r3c
>From end user perspective * case sensitivity (unless explicitly overriden) * improve stdlib performance (for ex. std json is way slower than Jsony) * improve tooling (codenav, dedduging, profiling etc.) * better documentation >From dev perspective * Refactor the compiler

import from url

2022-02-24 Thread r3c
> i just answered the question :))) It's ok, I chuckled how you answered it > strait, although i admit my question was little bit<> grammatically > incorrect <>

Calling nim-server-code from javascript

2022-02-24 Thread r3c
> I know you can compile to javascript but it seems simpler to pipe > procedure-calls thru the cookie-system from the client-side to the server-side That's odd... Just use fetch to call the endpoint in Nim, you'll need basic routing to target your endpoints

import from url

2022-02-19 Thread r3c
Did I hurt your feelings? If yes, I'm very sorry for them. Anyway... > But without a "safe by default" runtime, like Deno, there's no much sense > doing it, too dangerous... This is legitimate concern, but the same can be said about installing via Nimble. Or npm.

import from url

2022-02-18 Thread r3c
What do you think about web imports like in Go or Deno, would you like to see them in Nim? import "nimble.io/foo/bar.nim" bar.use() Run On comp time: execCmd ("nimble get gnimble.io/foo/bar.nim") Run

Call Nim code from C (linking errors)

2021-09-16 Thread r3c
Doh! Found it. It's gcc that causes the bug, not Nim, it was the **filename case**. Nim generates lower case .c files, but in the project has files with upper case eg. 'TEST.C'. So I reanamed all .c files generated from Nim to uppercase (with .C extension) and it works!

Call Nim code from C (linking errors)

2021-09-16 Thread r3c
NimMain() is called and its `undefined reference to `NimMain()'`... > +1 `--compileOnly` :) @enthus1ast, you mean like proc test_add(x, y, z: float32): Vec3t {.exportc cdecl.} = Vec3t(x: x, y: y, z: z) Run Didn't work ): what confuses me is `hidden symbol `_Z8

Call Nim code from C (linking errors)

2021-09-16 Thread r3c
According to [Nim Backend Integration,](https://nim-lang.org/docs/backends.html#interfacing-backend-code-calling-nim) I have the following code type Vec3t {.exportc.} = object x, y, z: float32 proc test_add(x, y, z: float32): Vec3t {.exportc.} = Vec3t(x: x, y:

Getting varargs parameter from JS

2021-04-27 Thread r3c
What's the output?

nim-1.4.6_x64.zip/bin/nimble.exe reports as Trojan:Win32/Zpevdo.B

2021-04-27 Thread r3c
> There are too many different AntiVir vendors and they keep changing all the > time. That's exacly what I meant, AV vendors tend to cleanup their signatures from time to time, so in a year they're all going to mark Nim as false positive anyway. On the other hand some AVs have option to report

nim-1.4.6_x64.zip/bin/nimble.exe reports as Trojan:Win32/Zpevdo.B

2021-04-24 Thread r3c
> Use a better virus scanner? This whole thread is a meme

How to use global immutable variables in Threads?

2021-03-26 Thread r3c
I've never saw crash in a gcsafe marked proc, but if someone knows better solution please post it.

How to use global immutable variables in Threads?

2021-03-26 Thread r3c
import mimetypes, threadpool proc parse_format(mime: any): string = mime.get_ext("text/html", "unknown") var cresp = spawn parse_format(new_mimetypes()) echo ^cresp Run

Nimble download/install sequence improvement

2021-03-21 Thread r3c
Made some mockup [here](https://gist.github.com/JDragan/e53f159c73d4402c8543865e5dc327f9) It downloads the .nimble file and extracts the dependencies. If the package dependencies were in `packages_official.json` it would be a lot faster

Nimble download/install sequence improvement

2021-03-20 Thread r3c
Compared to Rust's `cargo install` it looks like `nimble install` sequence is foreach package do: download() check() install() Run while cargo looks like foreach package: download() foreach package: check

Criticism of Parallel Nim

2021-03-20 Thread r3c
"The Asynctread Wars started have..." * \-- Master Yoda *

Nicer function anmes and other identifiers in the JS output

2021-03-18 Thread r3c
> When developing a web app in Nim, you shouldn't look at the generated > JavaScript, just like you don't > look at the generated C when developing a > native program in Nim. For simple todo app, sure.

Nicer function anmes and other identifiers in the JS output

2021-03-18 Thread r3c
This could be default way for generating var names, at least those which are not derived. There's no need for names like `var answer_4576375436745 = 42` at all

Memory increase on simple http server after 50 requests

2021-03-17 Thread r3c
Yes, the behavior is the same, only it starts with ~300KB instead of 1.2MB :)

Memory increase on simple http server after 50 requests

2021-03-17 Thread r3c
Thanks, that was quite detailed explanation :) I ran for i in {1..50}; do curl ; done it goes up to 5.4MB and stays there, I just wonder why Whip allocates 1.2MB and doesn't move. Is there any difference between asynchttpserver and httpbeast in allocating buffers, or thi

Memory increase on simple http server after 50 requests

2021-03-17 Thread r3c
If you run this code import asynchttpserver, asyncdispatch var server = newAsyncHttpServer() proc cb(req: Request) {.async.} = await req.respond(Http200, "Hello World", newHttpHeaders()) waitFor server.serve(Port(8080), cb) Run on start the m

How to evaluate string in Nim's VM at runtime?

2020-11-28 Thread r3c
Thanks, i think tcompilerapi.nim will do. But if one wants to create html templating engine is this the right direction? {if user.loggedIn} Log out {/if} Run

How to evaluate string in Nim's VM at runtime?

2020-11-27 Thread r3c
Hi, I'm writing custom ast builder, and was thinking instead of dumping the ast to file, use nim for runtime evaluation For ex. lets say we have echo(1 < 2) # true Run what I want is: echo evalDsl("1 < 2") # should output true Run Is thi

JS target: second param of proc `[]` is taken as JsObject instead of cstring

2020-11-09 Thread r3c
Works :)))

JS target: second param of proc `[]` is taken as JsObject instead of cstring

2020-11-09 Thread r3c
Is this a bug, or am I doing something wrong? import jsffi var jsdata = js{ one: js{"one": "asdasd"}, two: 2, print: "" } var vue = js{ data: jsdata, watch: js{ # template/generic instantiation of `{}` from here

Avoid adding `m_type` field in JS Objects?

2020-11-07 Thread r3c
Tnx, it worked! Still, this is a workaround, the good thing about Nim when compiling to JS is that you can use the types, but i still dont see why this extra typeinfo is added, the size of the output could be reduced by half if it wasn't this m_type. Who needs it anyway :)))

Avoid adding `m_type` field in JS Objects?

2020-11-07 Thread r3c
Lets say we have type User = object name: cstring id: cstring Run if we do var user: User user.name = "Somename" user.id = "Someid" Run The resulting JS code is var user = {[name: "Somename", id: "Someid

Passing X to a sink parameter introduces an implicit copy

2020-10-19 Thread r3c
Was wondering the same thing

What are Nim programmers called?

2020-07-17 Thread r3c
Nimoids :)