German Tax Upload in Nim with Futhark

2023-05-30 Thread namisboss
Just as a heads up, the link doesn't work (at least for me). It asks for a login and then redirects you to an `Unauthorized` page.

German Tax Upload in Nim with Futhark

2023-05-30 Thread cmc
I just got some feedback from a developer on the tax forum who tried Nim. He thinks Nim's compiler error feedback is very good- that's great news, I used to struggle there but not so much anymore.

Why fmt doesn't work?

2023-05-30 Thread alexeypetrushin
Why string interpolation in code below fails with `Error: undeclared identifier: 'id'`? [play](https://play.nim-lang.org/#ix=4x8U) import std/strformat type Some* = object id*: string template somet(o: Some) = let id: string = o.id echo "id" & id

Why fmt doesn't work?

2023-05-30 Thread mratsim

I asked chat-gpt to write a fft function in Nim

2023-05-30 Thread ethanlewis9272
Diese Implementierung verwendet einen rekursiven Ansatz namens Cooley-Tukey FFT-Algorithmus. Die Funktion nimmt eine Eingabefolge komplexer Zahlen und teilt sie rekursiv in gerade und ungerade indizierte Elemente auf, berechnet die FFT für jede Hälfte und kombiniert dann die Ergebnisse mithilfe

Using TCC/NLVM to compile source code in a string

2023-05-30 Thread JohnAD
Can you give me a bigger-picture description of why you are wanting to do this? I suspect you will get much better responses. But, for fun, I'll take a crack at this without that knowledge. I'd think a event oriented system tied to a kubernetes cluster would work best. Works like this: A stati

Why does this operator overload fail?

2023-05-30 Thread dwhall256
I am creating two data types that represent fractions of a circle (a.k.a. angles) as 16- or 32-bit fixed point integers. I have overloaded the equality operator `'=='*` for these datatypes. My first attempt at the operator overload fails to compile and I'd like to understand why the converter ro

Using TCC/NLVM to compile source code in a string

2023-05-30 Thread Zoom
> dynamically created by a C code generator So there's something somewhere that generates C code using full spectrum of C semantics? What does it generate the code from? Is the generated code really unrestricted in any way?

Using TCC/NLVM to compile source code in a string

2023-05-30 Thread melovv
Hey @guibar. They might be exactly what I was looking for. Don’t know about the performance of the cling interpreter compared to the code compiled with clang but I’ll give it a try. Thanks a lot!

Using TCC/NLVM to compile source code in a string

2023-05-30 Thread guibar
I realized you can run C programs in memory with TinyCC (which is much thiner than Clang/LLVM but the generated code is less optimal) Setup: git clone https://github.com/TinyCC/tinycc cd tinycc ./configure make cd ../ Run See example here (tcc_run.nim,

Atlas shrugged...

2023-05-30 Thread Araq
Update: Now supports `atlas env` for virtual environments and a pattern matching engine for URL rewrites/package overrides. Soon: Clone from the "file://" protocol so that we can write integration tests and fix the foolishly naive dependency resolution algorithm.

Using TCC/NLVM to compile source code in a string

2023-05-30 Thread guibar
[Cling](https://github.com/root-project/cling) (LLVM-based) does something like you described. See the [demo](https://github.com/root-project/cling/tree/master/tools/demo). In particular see the function [useSymbolAddress](https://github.com/root-project/cling/blob/f23f0ed9ca38f27c5f9fbbb54e13f

Using TCC/NLVM to compile source code in a string

2023-05-30 Thread melovv
Thanks @mratsim and @dlesnoff for your kind replies. I'll try to make it more clear and direct. I hope it's better now and I'm happy clarify it more if needed. I'm looking for a way to compile and call a C source code passed as a string. It has to be compiled while the program is running becaus

German Tax Upload in Nim with Futhark

2023-05-30 Thread zembrowski
Great PoC @cmc. Props for advocating `Nim` on the official forum of the ELSTER API of the German Tax Authorities. I allowed myself to [fork your gist](https://gist.github.com/zembrowski/658dc0047e1f3855019ae08d85508b78/revisions) and add an important functionality of generating a PDF-Preview. I

Alternative to powmod in Nim

2023-05-30 Thread mratsim
I have finished implementing a new arbitrary-precision backend in Constantine for powmod i.e. different from the fixed precision `BigInt[256]` or `BigInt[1024]`, it can deal with runtime sizes. PR: Benchmarks show that perf is within 85% to 140%

Using TCC/NLVM to compile source code in a string

2023-05-30 Thread dlesnoff
« hence why » is always grammatically inappropriate. « Hence » already means « that is the reason why ». While we do not want to constrain others with strict grammar rules on this forum, I would advise checking your grammar (potentially with bots like Grammarly) and making your future texts as c

Any fuzzy or trigram substring search library, with index, so it's instant?

2023-05-30 Thread Colins
There is no built-in fuzzy or trigram substring search library in Nim. However, it is possible to implement one using the following steps: Create a data structure to store the documents. This data structure could be a simple array, a hash table, or a more complex data structure such as a trie.

Teach you to write nim code comfortably use vim if you like vim you must try :)

2023-05-30 Thread gulberg
That's great! I recently began using VS Code myself, mainly because it has the best Nim plugin available. However, I must admit that my preference still lies with Vim/Neovim. There's just something about the simplicity and flexibility of Vim that I find incredibly appealing. But it's wonderful t

Bloom filter comparisson

2023-05-30 Thread PMunch
Tried another approach, similar to what you're proposing here. Essentially I used a Rabin-Karp rolling hash to calculate the hashes of each of the trigraphs. The implementation let me easily select how many bits the hash should be, so I matched it to a 4Kb block and simply set a single bit for

Atlas shrugged...

2023-05-30 Thread Araq
I don't believe in SemVer nor in git submodules.