Any libraries for dictionary coding (compression) of array structures ?

2022-11-25 Thread void09
I have started my second project in nim, mostly for learning purposes, and in both I have encountered the need to save memory when storing sequential data with many repeating symbols. (storing unique/deduplicated value in a dictionary + an array w

Initial OS porting experience

2022-11-25 Thread Araq
Did you look into our `os.nim` refactorings? It's now split up into different topics. > Nim is a bit weird that it outputs several C and object files with for humans > unpredictable file names. Yes but it also generates a `nimcache/myproject.json` file that lists these C and object files. cmak

Best way for ipc between a rust app and Nim app?

2022-11-25 Thread arnetheduck
We use in some of our projects to generate nim bindings for rust code (it's similar to wrapping a C library).

Electron in nim like Tarui and Wails v2

2022-11-25 Thread juancarlospaco
https://juancarlospaco.github.io/webgui/#realminuslife-projects

Choosing Nim out of a crowded market for systems programming languages

2022-11-25 Thread Rich_Morin
I still use Ruby for small scripts, but have turned to Elixir for larger projects. It seems to have all the type support I need at the moment (and fancier stuff is being worked on). Finally, folding Nim into an Elixir project appears to be pretty trivial, so if I need to get close to the metal,

Initial OS porting experience

2022-11-25 Thread RodSteward
I begun to port Nim to a custom operating system (here mentioned as "myOS"). The initial goal was to be able to compile a small hello world program and run it on the custom OS. In order make this happen I had to do the following steps. In the file **compiler/platform.nim** I had to add an entry

Choosing Nim out of a crowded market for systems programming languages

2022-11-25 Thread sekao
> I think in time with v2 we'll see great things from ORC. This is the crux of it. With ORC, Nim is in a different category of languages now, and got there with almost no breaking changes in the process. Pretty remarkable to think about it. The plane's engine has been swapped mid-flight. If you

Import C and Nim keyword collisions

2022-11-25 Thread ElegantBeef
Nim does allow importing fields with specific names. So you could rename the field `typ` or `kind`. As the following does. type AType {.importc: "AType", header: "somewhere.h".} = object kind {.importc: "type".}: cint # could also name this `typ` anoth

Nim 1.6.10 released

2022-11-25 Thread matkuki
To make sure, I reran the `choosenim` update just now, and it worked: PS C:\Users\matic\Desktop> choosenim update stable Updating stable Downloading Nim 1.6.10 from nim-lang.org [##] 100.0% 0kb/s Extracting nim-1.6.10

Electron in nim like Tarui and Wails v2

2022-11-25 Thread alexeypetrushin
[quote]. I look at examples and still don't quite understand how to use it... having a classical UI example, like , that would highlight how to a) create content dynamically b) handle events c) read/write state would b

Choosing Nim out of a crowded market for systems programming languages

2022-11-25 Thread Araq
Excellent post. Maybe we can/should publish it as an article on our website?

Choosing Nim out of a crowded market for systems programming languages

2022-11-25 Thread bet3lgeuse
I wrote this in a text file more/less to capture my state of mind while moving forward from a pretty rough year, professionally speaking. I hope it might be helpful for anyone who's bewildered with the choices of languages on the market right now, and is in a process of soul searching while cons

Import C and Nim keyword collisions

2022-11-25 Thread juancarlospaco
https://nim-lang.github.io/Nim/manual.html#lexical-analysis-keywords-as-identifiers

Import C and Nim keyword collisions

2022-11-25 Thread RodSteward
When you import types from C often you get name collision because of the reserved Nim keywords. typedef struct { int type; int another; }AType; Run Then when you want to import it to Nim type AType {.importc: "AType",

Best way for ipc between a rust app and Nim app?

2022-11-25 Thread Stefan_Salewski
> the UI side of things has to be in Rust. So which RUST GUI lib would you use? When I looked for Rust GUI libs, maybe six months ago, they had at least 3 native attempts, which are all very interesting, but not really ready for use. Rust people seem still to use GTK -- Rusts GTK bindings may b

Best way for ipc between a rust app and Nim app?

2022-11-25 Thread Araq
I would pick an "immature" Nim UI library over the combination "Rust + IPC + Nim", but I don't know your exact requirements for the UI library nor am I unbiased.

Type macro returning a transformed type def + other definitions

2022-11-25 Thread Hlaaftana
The only limitation of StmtListType I've noticed is that converters defined in it do not get called. Ideally in the future we have some kind of lazy symbol loading/cyclic dependency mechanism so type sections can be broken up into linear statements, and this kind of hackiness is not needed. In

Best way for ipc between a rust app and Nim app?

2022-11-25 Thread federico3
A local socket is enough. The tricky part is the serialization format. Msgpack could be an option for good performance. See

Atomic ARC option?

2022-11-25 Thread Araq
No problem. And I'm looking forward to your proposal.

Atomic ARC option?

2022-11-25 Thread Yepoleb
I will eventually when I make a proper proposal for this to be included. I just came here to provide a quick solution and argue against the notion that "sending isolated subgraphs around" is always a viable alternative to atomic reference counting. But I have not had the time to properly test an

Best way for ipc between a rust app and Nim app?

2022-11-25 Thread alexeypetrushin
Or even plain JSON (+ plain socket), if there's no need for high throughput / speed / latency.

Atomic ARC option?

2022-11-25 Thread Araq
> And this turned out to be much simpler than expected, just a handful of > touches in ARC to use atomic instructions and it works like a charm so far. Glad to hear it and I'm not surprised. You probably want to combine it with `--cursorInference:off` though as the optimizer doesn't understand t

Looking for a pair programming partner / coach

2022-11-25 Thread auxym
Also do feel free to hit up discord and ask questions or even a code review. I'd be glad to review some code once in a while, as I also think it would be great to have a high quality graph library in the Nim ecosystem.

Best way for ipc between a rust app and Nim app?

2022-11-25 Thread juancarlospaco
Posix socket.

Best way for ipc between a rust app and Nim app?

2022-11-25 Thread auxym
I second zmq, works really well. Nim has bindings maintained by araq: Plus, zmq docs are really well written.

`cast` broken?

2022-11-25 Thread amadan
Issue is the size of the datatypes is different. An int in Nim is 64 bits while a c int is 32 bits (on my system, your mileage may vary). If you instead cast to `cint` then it works since you'll be casting to the same size as the integer that you emitted

Atomic ARC option?

2022-11-25 Thread Yepoleb
`SharedPtr` is the right technical concept for this problem, but highly inconvenient for large data structures. I quickly realized I would need to eliminate all references in any data structure that could be accessed from a thread and rewrite all procedures to work with `SharedPtr` instead of re

Best way for ipc between a rust app and Nim app?

2022-11-25 Thread ingo
Is ZeroMQ supported by both languages?

Looking for a pair programming partner / coach

2022-11-25 Thread pietroppeter
> I will contact each of them to find what schedule works best for both of us > and would like to thank everyone for all the hearts on this posts. I'm so > impressed with the passion within this group. How cool would it be if we organized this as a community? you ask for a nim mentor/coach/...

`cast` broken?

2022-11-25 Thread sls1005
It seems that if you import a C type as `object`, and cast a variable of that type into another, will get some strange result. type X {.importc: "int".} = object {.emit: "int a = 10;".} var a {.importc, nodecl.}: X assert cast[ptr int](addr a)[] == 10 #suceeded assert

Best way for ipc between a rust app and Nim app?

2022-11-25 Thread nimian
I want to create a desktop application but due to the lack of mature libraries the UI side of things has to be in Rust. I'd like to use Nim for the business logic. The Nim application should be at minimum be able to pass the data to the Rust application. The best case scenario would be if it was

Electron in nim like Tarui and Wails v2

2022-11-25 Thread juancarlospaco
https://github.com/juancarlospaco/webgui

Atomic ARC option?

2022-11-25 Thread Araq
I don't burn briges and arc/orc are much less hardcoded into the compiler than the old GCs are. In fact, much of the existing codegen logic only exists in order to keep the older GCs alive. But there is a world of difference to me between "mm:atomics -- not officially supported" and "mm:atomics

Nim 1.6.10 released

2022-11-25 Thread ringabout
I have no idea, you should open an issue on the issue tracker of choosenim.

Electron in nim like Tarui and Wails v2

2022-11-25 Thread giaco
Sure. Why not?

Atomic ARC option?

2022-11-25 Thread RodSteward
> Nim version 1: Use the --gc:x that suits your program best. (And hope all > your dependencies still >work with it.) > > Nim version 2: There is only mm:orc but you can create custom pointers and > containers that are >optimal for your code. (And all your dependencies will > work because they

Type macro returning a transformed type def + other definitions

2022-11-25 Thread Vindaar
Huh, `nnkStmtListType` TIL.

Looking for a pair programming partner / coach

2022-11-25 Thread bjorn_madsen
How about you send me a wish list of the functionality you feel you need and I'll push those tasks towards the top of my todo list? In return you could review the package for ease of understanding / readability and let me know whenever I haven't explained / commented the code properly or where t

Type macro returning a transformed type def + other definitions

2022-11-25 Thread shirleyquirk
An nnkStmtListType injects definitions into the parent scope and can be used for this. This is a pretty dirty example, I've left out the logic for extracting the proc type, and since it involves these shadow types, naming them sensibly is important. I've got a similar example, but it's before I

Type macro returning a transformed type def + other definitions

2022-11-25 Thread Vindaar
The issue is that from the context of the macro call via the `{.testmacro.}` pragma you cannot generate a procedure, because the macro is called and evaluated _inside the type section_. It's important to remember that Nim macros cannot look "up" the AST or in other words generate code in a place

Looking for a pair programming partner / coach

2022-11-25 Thread dlesnoff
I am really looking forward to a graph library similar to networkx or yours in Nim. I have written this simple code that reads a graph from a file and can write to a file. I have used a hash table to get node labels and a list to get the nodes number from a label. I have not handled weights and

Type macro returning a transformed type def + other definitions

2022-11-25 Thread samdze
I tried outputting the the exact AST this code generates: type Test = object obj: int proc generatedProc(this: Test, arg: int): int = return 1 Run AST gen: nnkStmtList.newTree( nnkTypeSection.newTree( nnkTypeDef

Looking for a pair programming partner / coach

2022-11-25 Thread bjorn_madsen
I was very happy to see 5 super kind responses within a few hours. I will contact each of them to find what schedule works best for both of us and would like to thank everyone for all the hearts on this posts. I'm so impressed with the passion within this group. Thank you!

Nim 1.6.10 released

2022-11-25 Thread matkuki
Yes, that's exactly what happened: PS C:\WINDOWS\System32> nim --version Nim Compiler Version 1.6.10 [Windows: i386] Compiled at 2022-11-21 Copyright (c) 2006-2021 by Andreas Rumpf active boot switches: -d:release Run How do I switch the architectur

Type macro returning a transformed type def + other definitions

2022-11-25 Thread moigagoo
Generating he right AST can be tricky. One way to do it is to use `dumpTree` on the code you want to generate: nim> import macros nim> dumpTree: type Test = object normalProc: proc(add: int): int proc normalProcGenerated(this: Test, a

Open XML Spreadsheet (Excel) Library for Nim

2022-11-25 Thread ducdetronquito
Thanks for your answer ! I do agree, converting to another format should not be your lib responsability. Have a nice day :)