Seq of procs

2023-12-01 Thread nimnam
I just spend like 6+ hours to try it on Nixos Linux also Windows with 2.0.0 compiling myself using nimchooser and 1.6.6 and wihth --mm:rfc using samples from doc and internet (opengl gist).. But I always ran into segfault, or some function missing .. I wanted to reload some code, that's why I lo

Which might be the best way to store complex data in MySQL

2023-04-18 Thread nimnam
I wrote a library in TypeScript which stores patch sets (changes of values based on keys). So a document is a final states (key value array) and a changelog. I use JSON(P) because because PG and TS can easily handle it. Now Nim can handle JSON but you loose all typing guarantees. Using Nim data

Future of typing ?

2023-04-05 Thread nimnam
In TS i started to use pattern like tihs: const create_api = (options) => { const dosth = () => xy const domore = () => { dosth(); dosth(); } return { dosth, domore } } It allows to reuse things from scope easily minimizing passing arguments. And from my point of view its fine if the co

Future of typing ?

2023-04-05 Thread nimnam
I wrote some simple code like this: var v = 100 proc build_fun(a: int): proc (): int = var b = 20 proc foo(): int = b = b + 1 result = a + b result = foo var f = build_fun(10) f2 = build_fun(

Nested macro expansion order

2023-03-10 Thread nimnam
Can you use a macro in a macro? like macro sqr(x: typed): quote: `x * x` macro do(): quote `sqr(2)`

Macros and interfacing with the world ?

2023-03-09 Thread nimnam
Sometimes I am just to lazy to do my work thus macros could be doing them. Examples: Get version from git repository and add it in version Use maxima/Python's math libraries to solve equations and turn the result into code like Now

anonymous records / subtyping ?

2023-03-02 Thread nimnam
I worked on projects having like 10 joins. So matching with 10 objects is more painful than just using PHP's row["foo"] and be done. And we use alias.* a lot to be done. So matching with tuples means knowing the order. And I don't like things going wrong. But I understood how tuples in Nim work

anonymous records / subtyping ?

2023-03-02 Thread nimnam
found this talking about tuples vs anonymous objects. So looks like while verbose they might get it done. I wrote a lot code like SELECT a, (SELECT count from other WHERE id = m.id) as b FROM m as m. Unsure how such would fit ORM. Looking at the examples whic

anonymous records / subtyping ?

2023-03-01 Thread nimnam
>From my point of view the benefits of ORM are: > * you will not have typos (cause it fits the type system) > * you can add additional simple checks like age < 100 > * no need to worry about order such eg INSERT .. (id, name) VALUES (..) > How about querying ? SQL is very flexible. Eg win

anonymous records / subtyping ?

2023-02-28 Thread nimnam
You don't want row = db.query('SELECT * FROM user ') echo row[3] // what is this ? you want echo row['lastname'] Because it's human writing code and you eventually do not want to depend or column order of db.

Transpile Nim to Dart/Flutter?

2023-02-28 Thread nimnam
? Unsure how they do it. Found it by accident. About Haxe. I tried it in the past. Also have seen individuals asking for help cause they had crashes (app) they couldn't find. The main awakening was caused by Haxe wanting to implement inlining objcects but never having done so

anonymous records / subtyping ?

2023-02-28 Thread nimnam
I somewhat have the vision of something like var user_id = 20 var row = sql: FROM user WHERE id = nim: user_id and the dev system understanding id is primary thus row is a Record. -> search anonymous records. With JS/TS you can just do query as Promise and

Transpile Nim to Dart/Flutter?

2022-12-11 Thread nimnam
There are more options: 1. dart has introspection API. maybe interfacing with it would be enough 2. tanslating dart to nim so that nim only could be used (hot reloading gone) working on the graphic engine directly. Is another similar project. G