How to easy create and init a large array? Its have values

2024-01-19 Thread Angluca
I'm newbie T_T, I just think converters tend to breed a lot of errors so that's why I try to use the converter as little as possible ... Maybe T_T # xxx.nim ... converter nb(n: int): bool = n != 0 # myapp.nim import xxx var x, x2: int b, b2,

How to easy create and init a large array? Its have values

2024-01-18 Thread Angluca
I think nim can add a new func parameter type `array[typed]` or upgrade `UncheckArray[typed]` let it can use, Because UncheckArray[typed]/openArray[typed]/varargs[typed] can't used in this func xxx( [11.cint, 22, 33] ) # proc xxx( a: array[cint] ) # Ideally with this parameter

How to easy create and init a large array? Its have values

2024-01-15 Thread Angluca
Yeah, Your are right If want shallow copy them add 'var' is better ... It's ok now! Thank u tell me :) can use {.global.} when you want define global var in local, Like c (static int n)

How to easy create and init a large array? Its have values

2024-01-14 Thread Angluca
Oh yeah, mui lib and mui-sokol example well now :) <https://github.com/Angluca/mui>

How to easy create and init a large array? Its have values

2024-01-14 Thread Angluca
@sls1005 Your methods all work well, That's awesome, Thank you !! :)

How to easy create and init a large array? Its have values

2024-01-14 Thread Angluca
This array is global value, It's at save to data segment not stack segment, data segment spaces > 2g ( c language ) I think nim the same to so use global array, Of cause c example all use global array

How to easy create and init a large array? Its have values

2024-01-14 Thread Angluca
yeah, I want compile time create this array, looks like well !

How to easy create and init a large array? Its have values

2024-01-14 Thread Angluca
atlas_texture_src( array[128*120,byte] ) is a tmp value, copy array[128*120] bytes to array[128*128, byte] value, I don't know better way just to copy values to altals_texture( array:[128*128,byte] ) Because wan create a array[128*128, byte] and have values If It's len haven't 128*128 will cras

How to easy create and init a large array? Its have values

2024-01-14 Thread Angluca
ation, I've use converter, but converter have bug, can't use ptr type, if have ptr myint, cant converter Run Who can tell me have a good idea? <https://github.com/Angluca/mui/blob/master/mui.nim#L287> <https://github.com/Angluca/mui/blob/master/demo/mui-sokol/main.nim#

Absytree: Text editor (and tree based language framework) in Nim

2024-01-07 Thread Angluca
Nice ! Like vim opt!

Wishlist: Ideal UI library for Nim

2024-01-02 Thread Angluca
https://github.com/lvgl/lvgl

Maybe nappgui is best cross platform gui lib for nim

2024-01-02 Thread Angluca
lvgl looks like well.

Maybe nappgui is best cross platform gui lib for nim

2024-01-02 Thread Angluca

Wishlist: Ideal UI library for Nim

2024-01-02 Thread Angluca

Maybe 'Atlas' can learn from 'Bake'

2023-12-21 Thread Angluca
Bake is good for managing code projects.

How to easy get a object !??? member name all too longer!!!

2023-06-23 Thread Angluca
Yeah... Have more game engine in nimble, Because this library is very efficient, So I want to try this library and learn opengl, Hope the code written in the future can be better :)

How to easy get a object !??? member name all too longer!!!

2023-06-23 Thread Angluca
It look like well, I can often easy get object when I use importc pragma and c language struct all small, So many people want to simply get object even without "importc pragma" can easy get object too type xxx = object {.importc "...".} a,b,c:int f: float var x =

How to easy get a object !??? member name all too longer!!!

2023-06-23 Thread Angluca
I use sokol-nim, more object and member name are too longer , var passAction = PassAction( colors: [ ColorAttachmentAction( loadAction: loadActionClear, storeAction: storeActionStore, clearValue: (1, 0, 0, 0)), ColorAttachmentAction( loadAction: loadActionClear,

How doeas NIM differ from Mojo programming language?

2023-06-13 Thread Angluca
For non-programmers, the same , It's all words

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

2023-05-20 Thread Angluca
You can test [vim-easycomplete](https://github.com/jayli/vim-easycomplete) If you want use vim write nim language Works well, can autocomplete functions variables macros ... How to install Plug 'jayli/vim-easycomplete' # vim plugs nimble install nimlsp # nimble # OK, you ca

Can I quick get table last key value use like at(idx) function?

2023-05-01 Thread Angluca
The problem is complete I am using table[unicode: value] to save many value All this is done in the initialization function at once I use a few variables to save can solve it Not a difficult problem :) Thank you all for your replies

Can I quick get table last key value use like at(idx) function?

2023-04-25 Thread Angluca
I write func print unicode font must O(1) speed, unicode cjk have 0 ~ 195103, Of cource haven't all char It's to large( So only have 18000+ zh, jp ,kr .. fonts: table[Rune, Rect(x,y,w,h)] get pixel fonts on png) I think use hash table is best way maybe... Is there have better type structure to u

Can I quick get table last key value use like at(idx) function?

2023-04-24 Thread Angluca
Yes u are right, It's not this simple, loop all not last keyval, Maybe I use a rune var save last key name in myproject code is best method, Thx all reply

Can I quick get table last key value use like at(idx) function?

2023-04-24 Thread Angluca
I see source iterator, t.data[^1] can get it, But t.data is private let L = len(t) for h in 0 .. high(t.data): if isFilled(t.data[h].hcode): yield (t.data[h].key, t.data[h].val) Run Add this funtion maybe can use idx get key value templat

Can I quick get table last key value use like at(idx) function?

2023-04-24 Thread Angluca
# table key : ¢£¬ ̄¦¥₩→�, � is last key If table["�"] is last key , I forget � key name, but I want get this table key's val (like seq[^1])

Can I quick get table last key value use like at(idx) function?

2023-04-24 Thread Angluca
A table has 1+ rune (use table['x'] get value) , I don't know what is last key name(table[?]), But I want quickly use idx num get table value( like seq[^1] | seq[0] ) I'm a newble, Who can tell how to do it?

Maybe can add a pragma let nim proc/func easy call cproc/cfunc

2023-04-01 Thread Angluca
I didn't know this function existed !! Well, I'll test use it, Thx ;)

Maybe can add a pragma let nim proc/func easy call cproc/cfunc

2023-03-31 Thread Angluca
Because call c func (cint cstring cfloat ...) must convert variant type very cumbersome. Have to write many nim templates/func yourself everytime to reduce the trouble, Relatively find yourself writing these templates is the trouble Think maybe add pragma let us easier to use c functions

TIGR - tiny graphics library for nim

2023-03-29 Thread Angluca
tigr + mui maybe can make more ui, They are to small portable . <https://github.com/Angluca/mui>

TIGR - tiny graphics library for nim

2023-03-29 Thread Angluca
OK, prefix it now, I forgot it before :)

TIGR - tiny graphics library for nim

2023-03-28 Thread Angluca
tput using bitmap fonts. > * Mouse, touch and keyboard input. > * PNG loading and saving. > * Easy pixel shader access. > You can use make ui, image or game graphics `<https://github.com/Angluca/tigr-nim>`

Must add array quick assignment init method

2023-03-27 Thread Angluca
Macro looks like so cool !!

Must add array quick assignment init method

2023-03-26 Thread Angluca
var sz: array[64, byte] = [ 1,2,3,4] # add this init array method pls ... # want 4 byte after all zero but I only have 30 byte val want set it. # really dont like manual copy input var [1,2,3,4,0,0,0,0,0,0,0,0,0,0,0 ...] # - # ↓ I use this method in proj, looks lik

Looks like c-nim ?

2023-03-21 Thread Angluca
This lib looks like c nim language ?_?