<< 26-08-2022 >>

00:00:11*derpydoo joined #nim
00:06:26FromDiscord<!Patitotective> actually, now i realize↵i could do the validation with regex :p
00:09:45FromDiscord<Elegantbeef> Please do not use regex
00:09:46FromDiscord<Elegantbeef> Please do not use regex
00:13:25*flynn joined #nim
00:13:55*flynn quit (Client Quit)
00:27:19FromDiscord<!Patitotective> then you might better give some suggestions so the code doesnt look like this mess https://github.com/Patitotective/kdl-nim
00:36:27FromDiscord<Elegantbeef> Where would you use regex?
00:37:36FromDiscord<!Patitotective> all procs preffixed with `validate`
00:38:46FromDiscord<Elegantbeef> Would regex be as auditable as this code?
00:40:03FromDiscord<Elegantbeef> Could also use npeg instead
00:40:32FromDiscord<!Patitotective> 💀
00:40:34FromDiscord<!Patitotective> dependencies
00:42:15FromDiscord<huantian> Your library already is a dependency
00:43:14FromDiscord<!Patitotective> yes but a library with no dependencies
00:43:57FromDiscord<huantian> Why does that matter
00:57:15FromDiscord<!Patitotective> ~~i-i dont know, you can make "free dependency" marketing~~
00:58:30FromDiscord<Elegantbeef> Except you cant
00:58:39FromDiscord<Elegantbeef> Cause nre and re require system libraries
00:59:05FromDiscord<!Patitotective> nre?
01:00:40FromDiscord<!Patitotective> none of these are _pUrE_? https://media.discordapp.net/attachments/371759389889003532/1012526959441494027/unknown.png
01:00:55FromDiscord<Elegantbeef> `regex` is pure but it's a dependency
01:01:32FromDiscord<!Patitotective> ok, then i wont use anything until my code breaks https://media.discordapp.net/attachments/371759389889003532/1012527181374701689/unknown.png
01:14:13FromDiscord<Rika> Just use the pegs or parse libs in standard
01:16:21FromDiscord<Elegantbeef> Who are you who are so wise in the way of sceince?
01:18:15FromDiscord<Rika> Science
01:18:29FromDiscord<Elegantbeef> Hey that's a typo i'm not an idiot
01:18:45FromDiscord<Rika> How would I know, it’s hard to tell
01:18:55FromDiscord<Elegantbeef> touche
01:19:01FromDiscord<Rika> Touché
01:19:03FromDiscord<Rika>
01:19:09FromDiscord<Elegantbeef> Touchy
01:19:20FromDiscord<Rika> Two shay
01:24:36FromDiscord<Rainbow Asteroids> In reply to @Elegantbeef "Touchy": touch wheat
01:34:29FromDiscord<!Patitotective> In reply to @Rika "Just use the pegs": i do use parse libs in standard :]
01:43:24FromDiscord<ravinder387> `proc add0(x,y: int): int =↵ return x + y`
01:43:49FromDiscord<ravinder387> add0 2,3 and add0 2:3 syntaxtically wrong
01:45:58FromDiscord<!Patitotective> not sure what you mean but
01:46:00FromDiscord<!Patitotective> !eval proc add0(x,y: int): int = return x + y; echo add0 2, 3
01:46:00FromDiscord<ravinder387> https://media.discordapp.net/attachments/371759389889003532/1012538371647746178/Screenshot_from_2022-08-26_07-15-23.png
01:46:02NimBotCompile failed: /usercode/in.nim(1, 52) Error: type mismatch: got <int literal(2)>
01:46:27FromDiscord<Elegantbeef> Command syntax has some rsemantic requirements
01:46:34FromDiscord<Elegantbeef> semantic\
01:46:45FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=48Em
01:47:07FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#procedures-command-invocation-syntax
01:47:12FromDiscord<Elegantbeef> Documents the requirements
01:48:36FromDiscord<Elegantbeef> As does the block syntax
01:49:16FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=48En
01:55:18FromDiscord<ravinder387> indentation error
01:55:19FromDiscord<ravinder387> sent a long message, see http://ix.io/48Ep
01:57:22FromDiscord<ravinder387> then echo "hello" "world"
01:57:25FromDiscord<ravinder387> why it works
01:57:38FromDiscord<Elegantbeef> More words are better
01:57:47FromDiscord<ravinder387> "hello", "world"
01:57:56FromDiscord<Rika> because echo is not an expression
01:58:22FromDiscord<Rika> expression -> returns something, cannot have more than one argument↵statement -> no return, can have more than one argument
01:58:32FromDiscord<Rika> (edit) "argument↵statement" => "argument for command syntax↵statement" | "argument for command syntax↵statement-> no return, can have more than one argument ... " added "for command syntax"
01:59:26FromDiscord<ravinder387> command syntax means
01:59:57FromDiscord<Rika> `add0 2, 3` is command syntax
02:00:28FromDiscord<Rika> if add0 returns, only one argument↵if add0 does not return, more than one argument ok
02:05:31FromDiscord<ravinder387> https://media.discordapp.net/attachments/371759389889003532/1012543283228057680/Screenshot_from_2022-08-26_07-35-07.png
02:05:39FromDiscord<Rika> In reply to @Rika "if add0 returns, only": this
02:06:55FromDiscord<Elegantbeef> `var r = ...` is a statement as such you can only pass a single parameter with the command syntax
02:07:05FromDiscord<Elegantbeef> you can do `2.add0 3` if you want to pass 2 but that's at most what you can do
02:07:11FromDiscord<ravinder387> In reply to @ravinder387 "": according to this image add0 2,3 valid expression and
02:07:19FromDiscord<ravinder387> i can save in variable then print
02:07:22FromDiscord<Elegantbeef> They're valid within a specific scenario
02:07:31FromDiscord<Elegantbeef> read the docs/messages we post
02:07:43FromDiscord<ravinder387> In reply to @Elegantbeef "you can do `2.add0": i know that
02:25:23*vicecea quit (Remote host closed the connection)
02:25:27FromDiscord<ravinder387> not working https://media.discordapp.net/attachments/371759389889003532/1012548295064813618/Screenshot_from_2022-08-26_07-55-01.png
02:26:53FromDiscord<ravinder387> i think in latest version two syntaxtically sugar is removed
02:27:35*vicecea joined #nim
02:28:09*arkurious quit (Quit: Leaving)
02:29:22FromDiscord<ravinder387> sorry my mistake it working
02:29:36*genpaku quit (Remote host closed the connection)
02:30:04FromDiscord<that_dude> You're just trying to massacre the parser with the freedom you're given huh lol
02:30:12FromDiscord<that_dude> tbf this may want to be documented as well
02:30:16FromDiscord<Rika> it is
02:30:21FromDiscord<Rika> what isnt documented here
02:30:43FromDiscord<that_dude> Oh is the way he has it mixed an match actually covered
02:31:01FromDiscord<Rika> mcs + command style?
02:31:26FromDiscord<Rika> `call arg.call call arg` is pretty valid
02:31:56FromDiscord<that_dude> Not sure what it's called tbh, but is there a way to point to what's going on with the way he's throwing in spaces
02:32:06FromDiscord<Elegantbeef> The docs do specify command invocation syntax
02:32:08FromDiscord<that_dude> because I can deff see potential confusion in the order of opperations
02:32:22FromDiscord<Rika> ?
02:32:42*genpaku joined #nim
02:33:17FromDiscord<Rika> `call1 arg1.call2 call3 arg2` equivalent to `call1(call2(arg1, call3(arg2))` ?
02:33:41FromDiscord<Rika> just add opening parens on the spaces
02:33:41FromDiscord<that_dude> Take it from the pov of someone who's not to knowledgeable to begin with
02:34:12FromDiscord<Rika> you wouldnt encounter this code if the programmer was sensible
02:34:19FromDiscord<Rika> it makes more sense with named functions and arguments
02:34:41FromDiscord<that_dude> I guess there would be commas in there that clear it up a bit
02:34:42FromDiscord<Rika> like `echo list.add transform obj`
02:34:51FromDiscord<that_dude> if it was different
02:34:58FromDiscord<Rika> different how
02:35:14FromDiscord<Rika> In reply to @Rika "like `echo list.add transform": this is nonsensical because add doesnt return, i was just thinking quickly
02:35:17FromDiscord<Elegantbeef> > because I can deff see potential confusion in the order of opperations↵In the case of ambiguity the programmer should ensure lack of confusion
02:35:32FromDiscord<that_dude> I was thinking about something like this `echo(list.add, transform, obj)`
02:35:38FromDiscord<Rika> that makes no sense
02:35:40FromDiscord<Elegantbeef> that wouldnt compile
02:35:41FromDiscord<Rika> that doesnt work
02:35:42FromDiscord<that_dude> I know
02:35:47FromDiscord<Elegantbeef> `list.add` would have to be an expression
02:35:53FromDiscord<Rika> BEEF STFU
02:35:55FromDiscord<Rika> I ALREADY SAID THAT
02:35:57FromDiscord<Rika> YOU DINGUS
02:36:10FromDiscord<that_dude> lol
02:36:18FromDiscord<Rika> REPLACE IT WITH SPAWN OR WHATEVER IF YOU WANT IT THAT HARD
02:36:22FromDiscord<Elegantbeef> You know rika i take a lot of flak from you, so i'm going to fight back! You're smelly
02:36:22FromDiscord<Rika> REEEEEEEEEEEE
02:36:27FromDiscord<Rika> not wrong
02:36:36FromDiscord<ravinder387> r u talking to me
02:36:38FromDiscord<Rika> i dont know a single person who isnt smelly in some way
02:36:53FromDiscord<Elegantbeef> In closing command syntax is documented
02:37:14FromDiscord<Elegantbeef> if you cannot understand the simple rules, read more
02:46:45FromDiscord<!Patitotective> In reply to @Rika "i dont know a": stinky https://media.discordapp.net/attachments/371759389889003532/1012553659457998889/unknown.png
02:47:15FromDiscord<Elegantbeef> Rika more like Pika cause you're an annoying rat
02:47:30FromDiscord<ravinder387> In reply to @Rika "i dont know a": is f a,b == f(a,b)
02:47:33FromDiscord<!Patitotective> thats not a rat :[
02:47:41FromDiscord<Elegantbeef> Yes
02:47:48FromDiscord<!Patitotective> its bippo
02:47:57FromDiscord<Rika> In reply to @ravinder387 "is f a,b ": only when `f` does not return anything
02:48:03FromDiscord<Elegantbeef> Pikachu is a electrified mouse patito
02:48:09FromDiscord<Rika> In reply to @Elegantbeef "Rika more like Pika": damn
02:48:11FromDiscord<Rika> ive been got
02:49:09FromDiscord<!Patitotective> In reply to @Elegantbeef "Pikachu is a electrified": hMmMMm↵im pretty sure i read somewhere pikachu was based on another animal let me search
02:49:29FromDiscord<Elegantbeef> It's pokedex entry literally says it's an electrified mouse
02:49:47FromDiscord<!Patitotective> i dont have a pokedex
02:50:06FromDiscord<!Patitotective> In reply to @Patitotective "hMmMMm im pretty sure": im pretty sure it was made up
02:50:21FromDiscord<Elegantbeef> Really pokemon were made up?
02:50:26FromDiscord<Elegantbeef> I though japan was just wild
02:50:32FromDiscord<!Patitotective> lmfao
02:50:58FromDiscord<!Patitotective> i wonder how rika programs from japan, starlink?
02:51:15FromDiscord<Elegantbeef> What you think japan doesnt have ISPs?
02:52:08FromDiscord<Elegantbeef> It's a nation of like 500k km^2
02:52:27FromDiscord<Elegantbeef> If Canada has ISPs i'm sure japan can have ISPs
02:52:33FromDiscord<Rainbow Asteroids> In reply to @Elegantbeef "It's pokedex entry literally": mouse != rat↵boom i win meaningless internet argument
02:52:35FromDiscord<!Patitotective> In reply to @Elegantbeef "It's a nation of": ²
02:52:47FromDiscord<!Patitotective> In reply to @Rainbow Asteroids "mouse != rat boom": https://media.discordapp.net/attachments/371759389889003532/1012555181050822756/unknown.png
02:52:49FromDiscord<Rika> In reply to @Rainbow Asteroids "mouse != rat boom": ownedddddddddd
02:52:56FromDiscord<Elegantbeef> Yea correct the `^2` and not the `k km`
02:53:06FromDiscord<Elegantbeef> If only there was a big M
02:53:07FromDiscord<!Patitotective> In reply to @Elegantbeef "What you think japan": ~~whats that~~
02:53:17FromDiscord<Elegantbeef> Internet service providers
02:53:31FromDiscord<Rika> i live in a city
02:53:36FromDiscord<Rika> a rural city but its still a city
02:53:42FromDiscord<Rika> its not even that rural
02:53:54FromDiscord<Rika> i think theres at least a hundred thousand people here
02:54:13FromDiscord<Elegantbeef> Unless you live in the mountains you're pretty close to life
02:54:15FromDiscord<!Patitotective> i live in a 25k town :]
02:54:27FromDiscord<Elegantbeef> I live in a town of \~8k
02:54:37FromDiscord<!Patitotective> In reply to @Elegantbeef "I live in a": how many bears?
02:54:47FromDiscord<Elegantbeef> We get them occasionally
02:55:06FromDiscord<Rainbow Asteroids> this uni has something like 35k people enrolled
02:55:12FromDiscord<Rika> wow ok
02:55:44FromDiscord<Shiba> i live in the middle of nowhere
02:56:01FromDiscord<!Patitotective> In reply to @Shiba "i live in the": pacific ocean?
02:56:02FromDiscord<Rainbow Asteroids> how's the satellite internet
02:56:22FromDiscord<Shiba> In reply to @Patitotective "pacific ocean?": sorta like desert
02:56:40FromDiscord<Shiba> there is a couple of buildings but no one lives ther
02:56:52FromDiscord<Rainbow Asteroids> In reply to @Shiba "sorta like desert": why would you put yourself through that
02:57:08FromDiscord<Shiba> i have no choice
02:57:13FromDiscord<Rainbow Asteroids> :(
02:57:34FromDiscord<Rika> tfw
02:57:43FromDiscord<Elegantbeef> Last one in town was probably 10 years ago
02:57:43FromDiscord<Elegantbeef> Where are you from again patito?
02:58:09FromDiscord<ravinder387> I'm from earth
02:58:16FromDiscord<!Patitotective> In reply to @Elegantbeef "Where are you from": dont remember you ever asked but 🇨🇴
02:58:17FromDiscord<ravinder387> wht abt u
02:58:28FromDiscord<Rainbow Asteroids> I hear that place has lots of water
02:58:46FromDiscord<Elegantbeef> You see patito i was 99% certain that was the flag of columbia
02:58:54FromDiscord<Elegantbeef> But i was also 1% certain it wasnt
02:58:59FromDiscord<!Patitotective> columbia lmao
02:59:11FromDiscord<Rika> im from the trappist 1 system
02:59:38FromDiscord<!Patitotective> In reply to @Elegantbeef "You see patito i": perhaps 🇦🇲
02:59:52FromDiscord<Rainbow Asteroids> I think I'm somewhere in the milky way. they don't exactly have google maps in space
03:00:07FromDiscord<Elegantbeef> Hey patito there is a province called British Columbia, so i'm going to spell it the way it's spelled in my english
03:00:43FromDiscord<Rainbow Asteroids> oh no. beef is bri ish and canadian at the same time
03:01:05FromDiscord<Elegantbeef> I cant be british i dont drink tea
03:02:00FromDiscord<Rika> In reply to @Rainbow Asteroids "oh no. beef is": could be worse
03:02:03FromDiscord<!Patitotective> 🇵🇪 in my english canada its spelled peru
03:02:23FromDiscord<Rainbow Asteroids> now that's just plain confusing
03:02:31FromDiscord<Elegantbeef> No maple leaf so that's just discount Canuckistan
03:02:35FromDiscord<Rainbow Asteroids> like Arkansas
03:02:47FromDiscord<!Patitotective> In reply to @Elegantbeef "I cant be british": tea more like sugar water or just hot water in case you dont use sugar
03:03:12FromDiscord<Elegantbeef> If your tea is just hot water i think you missed a very important ingredient
03:03:17FromDiscord<Rainbow Asteroids> what masochistic doesn't drink sweetened tea
03:03:22FromDiscord<Rika> In reply to @Elegantbeef "If your tea is": LMFAO
03:03:23FromDiscord<Elegantbeef> The brits
03:03:26FromDiscord<!Patitotective> In reply to @Rainbow Asteroids "what masochistic doesn't drink": tongue
03:03:33FromDiscord<Rika> i-i dont sweeten my tea
03:03:33FromDiscord<!Patitotective> In reply to @Elegantbeef "If your tea is": tongue
03:03:47FromDiscord<Elegantbeef> Patito are you ok?
03:03:49FromDiscord<Rika> In reply to @Patitotective "tongue": stop making me laugh my goodness
03:04:47FromDiscord<!Patitotective> i mean, my tongue is not very good at tasting stuff so tea and hot water are too similar
03:05:07FromDiscord<Elegantbeef> You know your tongue isnt located where you poop from right?
03:05:28FromDiscord<!Patitotective> plus heat makes pain taste
03:05:32FromDiscord<Rainbow Asteroids> as a red white and blue blooded American, we drink our tea cold
03:05:43FromDiscord<Rainbow Asteroids> if at all
03:05:47FromDiscord<!Patitotective> In reply to @Rainbow Asteroids "as a red white": tf is a blue blooded american?
03:05:59FromDiscord<Rainbow Asteroids> red white and blue
03:06:02FromDiscord<Elegantbeef> If you have blue blood i think you're dead↵(@Rainbow Asteroids)
03:06:28FromDiscord<Rainbow Asteroids> lmao
03:07:29FromDiscord<Rika> this nim conversation is very interesting
03:07:47FromDiscord<Rainbow Asteroids> umm don't worry, we'll loop back around
03:07:48FromDiscord<!Patitotective> In reply to @Rika "this nim conversation is": nim is an obscure language
03:07:49*derpydoo quit (Quit: derpydoo)
03:07:58*xet7 quit (Ping timeout: 240 seconds)
03:08:11FromDiscord<Elegantbeef> So uhh anyone got a Nim question?
03:08:21FromDiscord<Rika> whats nim
03:08:27FromDiscord<Rainbow Asteroids> how do i print text
03:08:40FromDiscord<Elegantbeef> You need some printer drivers
03:08:44FromDiscord<Elegantbeef> So get cups
03:09:01FromDiscord<Rainbow Asteroids> ok, will glass ones do?
03:09:13FromDiscord<Rainbow Asteroids> or do I need plastic ones
03:09:44FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=48EA
03:09:49FromDiscord<Rika> how many cups do we need
03:10:06FromDiscord<Rika> and why does a printer need someone to drive it
03:10:07FromDiscord<Elegantbeef> The printer drivers guys
03:10:15FromDiscord<Rainbow Asteroids> oh
03:10:24FromDiscord<Rainbow Asteroids> ill get an uber then
03:11:05FromDiscord<Rainbow Asteroids> where does the uber need to drive the printer to?
03:12:49FromDiscord<Rika> damn this is hard
03:12:52FromDiscord<huantian> beef when are you rewriting cups in nim
03:13:06FromDiscord<Elegantbeef> I cant even write a Wasm VM in Nim
03:13:06FromDiscord<!Patitotective> In reply to @Rainbow Asteroids "where does the uber": we need people to send ther ips, please
03:13:15FromDiscord<Rika> whats an ips
03:13:38FromDiscord<Elegantbeef> Internet provider services
03:13:45FromDiscord<!Patitotective> lma
03:13:45FromDiscord<!Patitotective> o
03:13:53FromDiscord<Rainbow Asteroids> ok, my IP is 10.10.63.199
03:14:04FromDiscord<Elegantbeef> Mine is 127.0.0.1 dont hack me please
03:14:14FromDiscord<Shiba> time to launch kali from my old thinkpad
03:14:18FromDiscord<huantian> mine is db66:70cf:fc99:c256:78a9:1434:ae3f:eada
03:14:28FromDiscord<Rainbow Asteroids> how old is your think pad?
03:14:33FromDiscord<Rika> is thinkpad what people call a notebook nowadays
03:14:36FromDiscord<Rainbow Asteroids> (edit) "think pad?" => "thinkpad?"
03:14:51FromDiscord<Rainbow Asteroids> i dont know how to respond to that question
03:14:52FromDiscord<!Patitotective> In reply to @Rainbow Asteroids "ok, my IP is": why are you close to me?
03:15:05FromDiscord<Rainbow Asteroids> wdym?
03:15:26FromDiscord<!Patitotective> nvm
03:15:37FromDiscord<Rainbow Asteroids> that's a LAN ip anyhow
03:15:37FromDiscord<!Patitotective> pasted wrong
03:16:01FromDiscord<!Patitotective> https://media.discordapp.net/attachments/371759389889003532/1012561024014094466/unknown.png
03:16:11FromDiscord<Rainbow Asteroids> lawsuit when
03:16:46FromDiscord<Shiba> In reply to @Rainbow Asteroids "how old is your": its thick , thats how you know
03:16:50FromDiscord<Shiba> thickpad
03:16:53FromDiscord<Rainbow Asteroids> lol
03:17:16FromDiscord<Rainbow Asteroids> what model? i have a t460p
03:20:22FromDiscord<Shiba> its not mine , so i didn't bother what model
03:20:52FromDiscord<Shiba> but i think its from 2008 cause its got "pentium inside"
03:21:00FromDiscord<Rainbow Asteroids> jesus
03:23:35FromDiscord<Rainbow Asteroids> geekbench your thinkpad vs RPI version 1
03:25:55FromDiscord<!Patitotective> 🌃
03:43:19FromDiscord<Girvo> Is there any downside to mixing async with threadpool-based threads? (desktop, not embedded here)
03:44:20FromDiscord<Rika> complexity
03:44:36FromDiscord<Elegantbeef> As long as the async is done on the thread that created the future it's fine
03:44:36FromDiscord<Elegantbeef> Generally
03:45:23FromDiscord<ravinder387> In reply to @Rika "complexity": why u like nim
03:45:49FromDiscord<Rika> i like the syntax
03:45:52FromDiscord<ravinder387> r u web, game, app developer
03:46:01FromDiscord<ravinder387> where u use
03:46:02FromDiscord<Rika> and the flexibility
03:46:09FromDiscord<Rika> backend/embedded
03:46:26FromDiscord<ravinder387> r u maintainer of discord
03:47:26FromDiscord<ravinder387> i like simple syntax to do one thing write one syntax.
03:47:57FromDiscord<Rika> discord?
03:47:59FromDiscord<ravinder387> but nim compile to c,c++,js i think it need some flexibilty
03:48:09FromDiscord<Rika> In reply to @ravinder387 "i like simple syntax": then you're using the wrong language
03:48:43FromDiscord<ravinder387> my language don't exist
03:48:52FromDiscord<Rika> go?
03:49:05FromDiscord<Elegantbeef> Swift
03:49:08FromDiscord<ravinder387> if u leanr c++ to create variable u hv 5 syntax
03:49:56FromDiscord<ravinder387> r u owner of nim discord
03:50:09FromDiscord<Elegantbeef> Rika is tom from myspace
03:50:20FromDiscord<ravinder387> ohh i see
03:50:28FromDiscord<ravinder387> i didn't know that
03:50:47FromDiscord<Elegantbeef> Well sorry rika i just accidently promoted you in this persons mind
04:00:21*nullsh quit (Ping timeout: 268 seconds)
04:13:44*nullsh joined #nim
04:14:19FromDiscord<Shiba> do you think there some stuff from the nim lib
04:14:27FromDiscord<Shiba> that i compile and never use
04:14:57FromDiscord<Rika> wtf
04:16:10FromDiscord<Shiba> (edit) "i compile and" => "gets compiled but" | "use" => "used"
04:18:21FromDiscord<Shiba> nvm , iam just obsessed with compilation speed
04:18:34FromDiscord<Shiba> (edit) removed ", iam just obsessed with compilation speed"
04:22:14*hermaes joined #nim
04:22:19hermaeshey
04:22:24hermaesanyone here?
04:24:46FromDiscord<Rika> hello
04:27:59FromDiscord<ravinder387> `<button type="button" onclick="hello()">Click Me!</button>`
04:28:15FromDiscord<ravinder387> `proc hello() {. importc .} =↵ document.write("hello world")`
04:28:18FromDiscord<ravinder387> not working
04:28:39FromDiscord<ravinder387> when i open index.html hello function not defined
04:29:59FromDiscord<ravinder387> I'm using nim since 1 day I run docs code.. it gives error
04:30:22FromDiscord<ravinder387> i didn;t even start my own code
04:30:37FromDiscord<ravinder387> is docs fully tested
04:32:34FromDiscord<ravinder387> i can design web html, css . I just wanna use nim as alternative to js
04:44:20*hermaes quit (Quit: WeeChat 3.6-dev)
05:00:06FromDiscord<Girvo> For Testament, does the `tests` folder go in `src`? How do other people structure their packages for these sorts of things
05:01:07FromDiscord<flywind> Imo, put the `tests` directory at the top level of the projects.
05:03:58FromDiscord<Girvo> Makes sense to me 🙂
05:04:15FromDiscord<Girvo> I always hated Jest's `tests` folder inside every other folder lol
05:07:49FromDiscord<Girvo> For testing a module that uses `httpclient`, is the best way still to write a "mock" httpclient and use https://nim-lang.org/docs/nimscript.html#patchFile,string,string,string ? Is there a better way to override it at test time? Short of, I dunno, dependency-injection-like stuff with concepts, is the only other thing I could think of
05:21:42*hermaes joined #nim
05:22:00hermaesim just getting into nim, anyone know a good project to start with?
05:23:30FromDiscord<ravinder387> In reply to @Girvo "For Testament, does the": i wrongly write importc . i should write exportc becoz i wanna available nim funtion to others
05:23:35FromDiscord<ravinder387> it working
05:42:35FromDiscord<Girvo> Testament or unittest? Or unittest2? Or something else lol
06:15:50FromDiscord<Girvo> Probably just use testament for now
06:22:51*kenran joined #nim
06:46:43FromDiscord<Require Support> anyone try out chronos https://github.com/status-im/nim-chronos for httpclient ? how does it compare to stdlib and asyncdispatch? wanna see if there are any known problems before making the switch. My motivation is that it doesnt require openssl
06:47:14FromDiscord<Elegantbeef> Status uses it for their network stack
06:47:16FromDiscord<Elegantbeef> So it's likely to work
06:55:36FromDiscord<Bung> In reply to @Require Support "anyone try out chronos": you might be interested in https://github.com/bung87/scorper
06:56:40FromDiscord<Bung> https://github.com/bung87/scorper/blob/devel/src/scorper/http/streamclient.nim the client part
06:58:19FromDiscord<Require Support> nice ill check it out
07:08:12FromDiscord<ricky> In reply to @Require Support "anyone try out chronos": it's sick
07:08:38FromDiscord<Rika> Damn hope it gets well soon
07:08:39FromDiscord<ricky> i use it for my `fully static stack`
07:27:35FromDiscord<Girvo> In reply to @Require Support "anyone try out chronos": As I just found it, it doesn't produce cycles unlike the default async stuff, so it should be compatible with ARC too
07:28:51FromDiscord<Elegantbeef> "Just found it" i linked it to you like 5 times now
07:30:29FromDiscord<Girvo> '_
07:30:32FromDiscord<Girvo> 😉
07:30:49FromDiscord<Girvo> Was supposed to say "just found out" but eh I'll own it haha
07:31:40FromDiscord<Elegantbeef> But yea girvo Cmake is cursed
07:32:01FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=48Fg
07:32:02FromDiscord<Elegantbeef> Like cmon cmake, what more do you want
07:38:36*CyberTailor joined #nim
08:12:20*rockcavera quit (Remote host closed the connection)
08:15:38FromDiscord<ezquerra> How comes that the gdb.exe that is installed with nim does not support python scripting?
08:16:43FromDiscord<ezquerra> I just ran `python print sys.version` on the gdb console (which I ran from ...\.nimble\bin\gdb.exe) and it says `Python scripting is not supported in this copy of GDB.`
08:27:05FromDiscord<Tanguy> Have anyone actually tried to use chronos with arc? We removed some cycles, but never actually checked that there was none remaining↵Happy to have some feedback on that!
08:35:33FromDiscord<voidwalker> can templates be used with the proc.template() notation ?
08:35:44FromDiscord<voidwalker> (edit) "notation" => "syntax"
08:41:38FromDiscord<Rika> With newer versions of Nim I believe the restrictions have been relaxed
08:41:44FromDiscord<Rika> But it’s not too clear to me
08:42:34FromDiscord<voidwalker> `echo gen_csv_import(db, fileName, tbName).timeGo()` -> `Error: expression 'gen_csv_import(db, fileName, tbName)' has no type (or is ambiguous)`
08:44:38FromDiscord<voidwalker> trying to put a timer echo to several procs with timeit packages, without writing code for it in each one.
08:44:41FromDiscord<voidwalker> https://github.com/ringabout/timeit/blob/master/src/timeitpkg/main.nim#L173
08:45:50FromDiscord<voidwalker> writing this ` timeGo(1,1,gen_csv_import(db, fileName, tbName))` or ` echo timeGo(gen_csv_import(db, fileName, tbName))` I believe impairs the code readability
08:48:27FromDiscord<Rika> Okay never mind
08:49:28FromDiscord<Rika> It’s still a limitation https://nim-lang.org/docs/manual.html#templates-limitations-of-the-method-call-syntax
08:53:33FromDiscord<voidwalker> Hm so what would be the way around this ? Ask the author to write a macro with a custom pragma for that purpose ?
09:12:00FromDiscord<sealmove> https://nim-lang.org/docs/httpclient.html why is there no `HttpRequest` type?
09:13:55*void09 quit ()
09:22:35*CyberTailor quit (Remote host closed the connection)
09:24:16*CyberTailor joined #nim
09:41:59FromDiscord<hotdog> In reply to @รєคɭ๓๏שє "https://nim-lang.org/docs/httpclient.html why is th": You pass the request params directly to the request procs
09:54:28FromDiscord<sealmove> yes I saw now, the api is different from what i am used to but I imagine it will be comfortable once you get familiar with it
09:54:31FromDiscord<Olfactory Hallucinations> In reply to @EyeCon "Tio apparently has Nim": Cool. Too bad it was an even older version. It seems like https://wandbox.org/ is running 1.6.6, and it also has some support for external files. The nice thing with Replit though, is that it not only gives you a file system, but also a shell, so it seems a bit more flexible than both Tio and Wandbox.
10:06:36FromDiscord<dom96> I wonder how much work a bearssl patch to the stdlib would be
10:07:04FromDiscord<dom96> In reply to @Tanguy "Have anyone actually tried": do you have a link to where the cycles were removed? maybe we could recreate this in stdlib async too
10:07:37FromDiscord<dom96> In reply to @Girvo "As I just found": where did you find this out? Based on what tanguy is saying it seems to be false
10:09:24FromDiscord<Tanguy> In reply to @dom96 "do you have a": https://github.com/status-im/nim-chronos/pull/243
10:12:34FromDiscord<Tanguy> sent a code paste, see https://play.nim-lang.org/#ix=48FW
10:15:57FromDiscord<dom96> I can't remember, does arc detect cycles at compile-time or only at runtime?
10:16:29FromDiscord<Tanguy> It doesn't detect cycles afaik, they just leak
10:17:36FromDiscord<dom96> ahh, so in what way does your test case fail under stdlib async?
10:17:41FromDiscord<dom96> does it just leak memory?
10:17:47FromDiscord<Tanguy> Yup, it OOM
10:18:02FromDiscord<dom96> ahh, sucks that we cannot detect this statically
10:34:30*void09 joined #nim
10:35:28*void09 quit (Client Quit)
10:37:25*void09 joined #nim
10:56:29NimEventerNew thread by NameUndefined: Using return in templates returns nil, see https://forum.nim-lang.org/t/9410
11:02:06FromDiscord<aruZeta> I have almost finished my QR generation library, only thing left is to make my stupid brain understand wth is going on here https://www.thonky.com/qr-code-tutorial/error-correction-coding https://media.discordapp.net/attachments/371759389889003532/1012678315389239296/unknown.png
11:03:40FromDiscord<aruZeta> i mean, wth https://media.discordapp.net/attachments/371759389889003532/1012678712313008228/unknown.png
11:06:48FromDiscord<Prestige> Which part do you not understand?
11:07:37FromDiscord<aruZeta> all the ecc stuff
11:08:18FromDiscord<aruZeta> i'm looking at a qr library made in C and im grasping a bit of how i can do it
11:10:02FromDiscord<aruZeta> the ec bits from the version and information areas where easier to calculate since the generator polynomial was always the same, so just a loop of xoring
11:18:35FromDiscord<auxym> maybe find some good implementation in C and translate it 1:1 to Nim with some tests?
11:18:46FromDiscord<auxym> I saw Galois Fields in that link and noped out
11:19:31FromDiscord<aruZeta> yh, galois fields
11:20:44FromDiscord<aruZeta> i was like, "oh well, I can store them in u8", and then saw that the QR code specification says to use byte-wise modulo 100011101, "oh fck"
11:21:08FromDiscord<aruZeta> (edit) "100011101," => "100011101 (285),"
11:21:53FromDiscord<aruZeta> although hmmm I think i can make a workaround
11:28:01FromDiscord<aruZeta> i could use a log-antilog lookup table with the values already calculated too
11:35:23FromDiscord<Bung> is it fine to ignore this error ? my program can continue run into next call https://media.discordapp.net/attachments/371759389889003532/1012686695419891763/2022-08-26_185259.png
11:58:28*arkurious joined #nim
12:00:07FromDiscord<Forest> Hm could the Nim compiler in it's current state, be compiled to JS?
12:00:19FromDiscord<Forest> Doubt it, but i wanna know why can't it, if that's the case
12:04:27FromDiscord<sealmove> In reply to @Forest "Doubt it, but i": Well the JS backend supports a limited set of Nim features.
12:05:34FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=48GB
12:05:42FromDiscord<sealmove> (edit) "https://play.nim-lang.org/#ix=48GB" => "https://play.nim-lang.org/#ix=48GC"
12:05:52FromDiscord<Forest> In reply to @รєคɭ๓๏שє "Well the JS backend": Ah
12:06:09FromDiscord<Forest> sent a code paste, see https://play.nim-lang.org/#ix=48GD
12:06:46FromDiscord<Rika> I mean, it depends on what you want in the string…
12:07:17FromDiscord<Forest> sent a code paste, see https://play.nim-lang.org/#ix=48GF
12:12:07FromDiscord<mratsim> In reply to @aruZeta "all the ecc stuff": If you manage to do that, we have a job proposal for you
12:12:22FromDiscord<mratsim> In reply to @auxym "I saw Galois Fields": same ^
12:13:12FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=48GJ
12:13:19FromDiscord<sealmove> some cast maybe?
12:13:54FromDiscord<sealmove> of course I want a string of length `len` that starts from `pntr`
12:14:45FromDiscord<mratsim> sent a long message, see http://ix.io/48GK
12:14:50FromDiscord<mratsim> (edit) "http://ix.io/48GK" => "http://ix.io/48GL"
12:15:25*kenran quit (Ping timeout: 268 seconds)
12:17:07*kenran joined #nim
12:18:43FromDiscord<Forest> In reply to @รєคɭ๓๏שє "yes but... I am": You'd have to implement that yourself by handling the data accordingly
12:18:55FromDiscord<Forest> So like, you can make it return len as a string maybe?
12:19:16FromDiscord<Forest> I think for accessing pointers it's `myObj.pntr[]`?
12:19:24FromDiscord<Forest> Not sure tho, haven't used pointers myself
12:19:24FromDiscord<sealmove> I am interested in how to use the pointer to access the bytes and create a string out of them
12:22:52FromDiscord<mratsim> In reply to @รєคɭ๓๏שє "I am interested in": don't use pointers on JS
12:23:21FromDiscord<sealmove> it's not JS
12:23:26FromDiscord<sealmove> it's C FFI
12:23:34FromDiscord<Rika> I think you’re mixing so conversations
12:23:35FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=48GO
12:23:37FromDiscord<Rika> Teo
12:23:42FromDiscord<Rika> Two*****
12:23:45FromDiscord<mratsim> when defined(js): stuffThatDoesn'tUsePointers else: stuffThatCanUsePointers
12:23:49FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=48GP
12:24:01FromDiscord<sealmove> In reply to @mratsim "when defined(js): stuffThatDoesn'tUsePointers else:": won't be used in JS in any case ;)
12:24:02FromDiscord<Rika> One*******
12:24:04FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=48GQ
12:24:11FromDiscord<sealmove> why not
12:24:20FromDiscord<Rika> Just set the length directly
12:24:22FromDiscord<mratsim> sent a code paste, see https://paste.rs/3g1
12:24:23FromDiscord<Rika> Since you’re doing that anyway
12:25:08FromDiscord<mratsim> In reply to @รєคɭ๓๏שє "it's C FFI": https://github.com/status-im/nim-http-utils/pull/9/files#diff-e79eea07fdbc061a2f883b340f8ff4e505f9b75d322ee1148b1c1075c9bf02baR546-R552
12:27:22FromDiscord<aruZeta> In reply to @mratsim "<@882793909246369864> <@736144909160939571> , Error": hmm
12:30:00FromDiscord<sealmove> In reply to @mratsim "https://github.com/status-im/nim-http-utils/pull/9/": this is not in stdlibs right?
12:32:40FromDiscord<mratsim> In reply to @รєคɭ๓๏שє "this is not in": no. well maybe the stdlib has something similar nowadays, I don't know
12:32:50FromDiscord<sealmove> okok thank u
12:35:35*derpydoo joined #nim
12:42:47FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=48GZ
12:43:25FromDiscord<Phil> The key thing is basically I would like to read in my JS/CSS from an SPA at compile-time to have it present in the binary
12:43:41FromDiscord<Phil> (edit) "binary" => "binary. This is for an application using webgui"
12:44:59FromDiscord<Phil> The idea is to read in the files in there with `staticRead` later so I definitely want them to be compileTime
12:45:24FromDiscord<enthus1ast> maybe walkDirRec works
12:45:31FromDiscord<enthus1ast> it complains about glob
12:45:49FromDiscord<enthus1ast> this is the default linux patter think\: foo.\
12:45:57FromDiscord<enthus1ast> or walkDir
12:46:20FromDiscord<enthus1ast> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1012704419772649523): this is the default linux patter thing\: foo.\
12:46:44FromDiscord<Phil> Yeah but `walkDir` gives you directories, not filepaths for JS/CSS files in a folder
12:47:12FromDiscord<enthus1ast> walkDirRect can set a yieldFilter
12:47:22FromDiscord<enthus1ast> so you can define what should be yielded
12:47:24FromDiscord<enthus1ast> files or dirs
12:47:34FromDiscord<sealmove> Guys I have an interesting question:↵I am writing a library where I expect the user to define a hook function which I call in my library. Ideally I want to allow him to bind it with a pragma macro. Also it would be nice to have a default implementation. Any similar examples?
12:48:15FromDiscord<enthus1ast> hook like in what?
12:48:33FromDiscord<enthus1ast> like haxxor api hooking? ↵or callback?
12:50:02FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=48H3
12:50:52FromDiscord<enthus1ast> imho it does not support Ü
12:50:52FromDiscord<enthus1ast>
12:50:54FromDiscord<enthus1ast> ...
12:50:57FromDiscord<enthus1ast>
12:51:16FromDiscord<Phil> The main reason I want to do this is that over time I'll very likely swap out the index.html, css and js files and I do not want to adjust the hard-coded file-path strings all the time when re-compiling
12:52:07FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=48H4
12:52:20FromDiscord<sealmove> (edit) "https://play.nim-lang.org/#ix=48H4" => "https://play.nim-lang.org/#ix=48H5"
12:53:36FromDiscord<Phil> walkPattern is another way of going through the file-system but it too is stuck on being only for runtime
12:54:15FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=48H7
12:57:44FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=48Ha
12:58:23FromDiscord<Phil> To say it in german: That kinda feels like "von hinten durch die Brust ins Auge"
12:58:32FromDiscord<enthus1ast> ach garnet
12:58:34FromDiscord<Phil> Though it does avoid the the glob call which isn't possible at runtime
12:58:41FromDiscord<Phil> (edit) "runtime" => "compieltime"
12:59:28FromDiscord<enthus1ast> imho its not too bad, since you have good control over what path you wanna add
13:01:42FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=48He
13:02:01FromDiscord<sealmove> (edit) "https://play.nim-lang.org/#ix=48He" => "https://play.nim-lang.org/#ix=48Hf"
13:02:28FromDiscord<sealmove> Hmm I guess the macro will generate such code?
13:02:41FromDiscord<enthus1ast> what does the hook do?
13:02:44FromDiscord<enthus1ast> so
13:02:55FromDiscord<enthus1ast> does it encapsulates the original one?
13:03:01FromDiscord<Phil> In reply to @enthus1ast "imho its not too": I kinda want to turn this into a compiletime proc but that shits harder than I gave it credit for
13:03:01FromDiscord<sealmove> yeah it probably just generates the proc call and pass in a callback
13:03:05FromDiscord<enthus1ast> or is it called instead
13:03:34FromDiscord<enthus1ast> huh this is on compiletime? Since a const↵(@Phil)
13:03:35*averell quit (Quit: .)
13:04:01FromDiscord<Phil> In reply to @enthus1ast "huh this is on": Yeah but I have to do this for multiple filetypes, once for css once for js and once... okay 2 filetypes, still want it as a proc
13:04:11FromDiscord<sealmove> the macro should be expanded to a proc call of proc named `handle` and pass the annotated proc as argument to `handle`
13:05:43FromDiscord<Phil> Hah! Wait! It worked!
13:06:14FromDiscord<Phil> sent a code paste, see https://paste.rs/uag
13:08:20FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=48Hk
13:08:58FromDiscord<Phil> What? Too fast? I'm a turtle ma dude!
13:09:04FromDiscord<enthus1ast> ^^
13:09:35FromDiscord<sealmove> how would you _prepare_ an http request but not execute it? so that you can pass it somewhere else, and allow it to be executed there?
13:09:59FromDiscord<sealmove> it's annoying that there is no `HttpRequest` type in `std/httpclient`
13:10:23FromDiscord<Phil> Sounds like a matter of writing your own type, and a proc that eats that type and fires a request
13:10:48FromDiscord<sealmove> yes but why is there not one in stdlib?
13:11:11FromDiscord<Phil> That is a really good question and my first assumption would be to reduce the amount of code in the lib
13:11:27FromDiscord<sealmove> it hinders flexibility
13:11:39FromDiscord<Phil> Its simpler to only have to deal with the immediate firing and let the user extend from that as needed
13:11:49FromDiscord<sealmove> hmm ok
13:11:51FromDiscord<Phil> Particularly if you don't have a massive team of maintainers
13:12:38FromDiscord<Phil> ~~I'm honestly mildly amazed that the std lib is as large as it is and still works decently well for me~~
13:12:55FromDiscord<dom96> I don't recall the exact reason why I implemented it this way
13:13:20FromDiscord<dom96> but having to create a HttpRequest every time I want to send a request seems painful
13:13:53FromDiscord<dom96> it's not like a request has a lot of data anyway, so it would just be an object with one or two fields
13:13:59FromDiscord<Phil> ~~I've grown mildly accustomed to sometimes just writing a wrapper layer around a lib if I find its API annoying to deal with, see norm~~
13:14:15FromDiscord<dom96> headers and things are stored in the HttpClient instance
13:15:23FromDiscord<dom96> which is a bit inflexible because there are headers which make sense to send in all requests (UserAgent) and those which it makes sense to change between requests
13:15:26FromDiscord<Forest> Is the Nim compiler able to compile itself to C++ and Objective C?
13:20:06FromDiscord<sealmove> Thanks for the insights @dom96 and @Phil. I just realized I don't even want to fire the request. I am only passing around the properties of a request that is already fired, so that the user can define how to handle it. I know what you are thinking... why not just use Jester? well... The framework for which I am trying to add Nim support works with having separate wasi/wasm binaries for each endpoint.
13:20:58FromDiscord<sealmove> So basically I have the properties of the request in a C structure and I just want a nicer interface for the user of the library.
13:22:42FromDiscord<sealmove> It could be a dsl now that I think about...
13:23:31FromDiscord<sealmove> but i'll start with something simpler
13:24:04FromDiscord<dom96> huh, you're building a framework to do CGI-like request processing in wasi/wasm?
13:25:34FromDiscord<sealmove> yes!
13:25:47FromDiscord<sealmove> an sdk to an existing framework, called Spin (by Fermyon)
13:25:57FromDiscord<dom96> cool!
13:28:09FromDiscord<sealmove> I used wit-bindgen to generate .h/.c files which implement something called "component model" for wasi, then used nimterop to wrap this code. So the low-level issues are already taken care of.
13:28:45FromDiscord<sealmove> You can track progress in this PR https://github.com/fermyon/spin/pull/716
13:30:26FromDiscord<dom96> I work at Cloudflare on Workers now, so wasi/wasm is becoming top of my mind. Would really love to see this running on workers :)
13:30:52FromDiscord<sealmove> cool! :o
13:31:55FromDiscord<sealmove> I think wrapping wit-bindgen does the trick, it's pretty easy
13:32:51FromDiscord<sealmove> ah and of course you need the correct compiler switches which I copied from ElegantBeef's project
13:33:28FromDiscord<sealmove> He was also experimenting with wasi, but I think that was some time ago and wit-bindgen wasn't a thing yet
13:34:35FromDiscord<dom96> Have you seen https://blog.cloudflare.com/announcing-wasi-on-workers/?
13:35:08FromDiscord<sealmove> No, I should read up on it
13:35:31FromDiscord<sealmove> ah actually it did catch my eye at some point but i didn't read about it
13:36:24*kenran quit (Quit: WeeChat info:version)
13:37:16FromDiscord<dom96> at least have a flick through what's possible
13:40:32FromDiscord<sealmove> a framework where you can write each endpoint-handler in a different language :D on-demand execution (no always-running containers)
13:40:43FromDiscord<sealmove> is there more to it?
13:41:12FromDiscord<sealmove> have you seen finicky whiskers? https://www.finickywhiskers.com/index.html
13:43:07FromDiscord<dom96> nope, the name is cute but I don't get the game
13:45:41FromDiscord<sealmove> not sure about the name either :D but cute demo
13:46:23FromDiscord<aruZeta> if both `-d:release` and `-d:danger` are specified, which is used?
13:46:33FromDiscord<aruZeta> ig `-d:danger`?
13:53:59FromDiscord<Phil> Self answered stack overflow question coming through!↵(Contains the entire "How do I read in a batch of files at compile-time" thing from earlier)
13:54:38FromDiscord<aruZeta> phil is in a self-answered-so-questions streak
13:55:24FromDiscord<Phil> aru, I've got like 15 nim questions, 14 of those I think I answered myself.↵I don't use SO to get answers, I use it as a knowledge repo to use for googling in 5 months when I'll inevitably have forgotten the answer xP
13:55:27FromDiscord<aruZeta> is or has? i'm doubting how this is phrased
13:55:46NimEventerNew question by Philipp Doerner: How to read in files with a specific file ending at compile time in nim?, see https://stackoverflow.com/questions/73502118/how-to-read-in-files-with-a-specific-file-ending-at-compile-time-in-nim
13:55:49FromDiscord<aruZeta> (edit) "is ... or" added "in"
13:56:01FromDiscord<aruZeta> lol
13:56:05FromDiscord<aruZeta> talking about questions
13:56:22FromDiscord<aruZeta> (edit) "questions" => "your question"
13:56:48FromDiscord<Phil> I'll likely throw in another question later about how to set up a pipeline between any frontend framework and webgui
13:56:48FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=48HG
13:56:56FromDiscord<Phil> "Later" being some time this weekend
13:56:57FromDiscord<aruZeta> xd
13:57:14FromDiscord<dom96> In reply to @Isofruit "aru, I've got like": Thanks to you Nim's popularity as measured by SO questions will sky rocket :D
13:57:38FromDiscord<aruZeta> it will increase by 10!!!
13:57:42FromDiscord<aruZeta> (but in binary)
13:57:47FromDiscord<Phil> I wish that were the case!↵There's over 500 questions and I'm only responsible for 15 of them!
13:58:01FromDiscord<Phil> A man can only do so much by himself
14:00:34FromDiscord<Nalmyth> Is there some library to wrap a synchronous blocking call to an async call?
14:01:08FromDiscord<dom96> good question
14:01:13FromDiscord<dom96> There is a PR to make that possible
14:01:19FromDiscord<dom96> in the stdlib
14:01:38FromDiscord<dom96> but for now best you can do is `spawn` a thread and poll its FlowVar
14:01:48FromDiscord<flywind> In reply to @Isofruit "I wish that were": Thank you! I expect that the ranking of the Nim language in the redmonk language rankings will increase next year.
14:01:52FromDiscord<flywind> https://media.discordapp.net/attachments/371759389889003532/1012723555865206854/image0.png
14:02:10FromDiscord<dom96> In reply to @Nalmyth "Is there some library": Like I do here https://github.com/dom96/nim-in-action-code/blob/master/Chapter3/ChatApp/src/client.nim#L42
14:03:21FromDiscord<Phil> In reply to @flywind "Thank you! I expect": ~~One of the benefits of being new to something, you run face first into problems and thus can document them well and farm all those SO points~~
14:03:33FromDiscord<Nalmyth> In reply to @dom96 "Like I do here": Oh wow so easy?
14:03:47FromDiscord<Nalmyth> That will include the return type also
14:04:05FromDiscord<flywind> In reply to @Isofruit "I wish that were": One hundred more so questions, Nim will surpass the Crystal language 😜
14:04:16FromDiscord<Phil> Well I better get to it then
14:04:29FromDiscord<dom96> In reply to @Nalmyth "Oh wow so easy?": It's a bit of a workaround, but sure, I guess it is easy. It is however not ideal performance-wise. Depends what you're doing though
14:04:33FromDiscord<Phil> There's a veritable treasure trove of macro questions one could ask
14:05:24*jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in)
14:05:26NimEventerNew Nimble package! drchaos - A powerful and easy-to-use fuzzing framework in Nim for C/C++/Obj-C targets, see https://github.com/status-im/nim-drchaos
14:07:14FromDiscord<Nalmyth> In reply to @dom96 "It's a bit of": Also what's the meaning of that `^` in your code?
14:07:38FromDiscord<dom96> https://nim-lang.org/docs/threadpool.html#%5E%2CFlowVar%5BT%5D
14:08:07FromDiscord<Nalmyth> Ah I see in the docs
14:08:16FromDiscord<Nalmyth> https://media.discordapp.net/attachments/371759389889003532/1012725168134701066/Screenshot_2022-08-26_at_18.08.10.png
14:08:18FromDiscord<dom96> this really shouldn't be an operator lol
14:09:03FromDiscord<Nalmyth> Seems to be the same as `unsafeRead`
14:09:04FromDiscord<Nalmyth> I can use that
14:09:38FromDiscord<Nalmyth> Hmm but returns a ptr
14:09:46FromDiscord<dom96> yeah, I wouldn't use it
14:13:45FromDiscord<dom96> https://github.com/nim-lang/Nim/pull/12372
14:13:59FromDiscord<dom96> I could have sworn I rebased this. But I don't see my branch
14:15:21FromDiscord<dom96> oh yes, I did https://github.com/dom96/Nim/tree/virtual-async-events-resurrected-fixes
14:16:48FromDiscord<Phil> Hmm I have an index.html file whose script-tags for loading JS and CSS I need to remove at compile-time.↵I can read in the html file at compile time no problem.↵I... kinda can't parse it to XML at compile time
14:18:05FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=48HW
14:18:27FromDiscord<Phil> Anyone have a eureka idea of removing all script-tags and link-tags from an HTML file at compile-time?
14:19:23FromDiscord<flywind> const doesn't support refs.
14:19:58FromDiscord<Phil> So parsing is straight out of the question then since that's implemented via refs
14:20:23FromDiscord<flywind> No, there is a workaround using templates. secs
14:20:55FromDiscord<dom96> In reply to @Isofruit "Anyone have a eureka": `staticExec("nim c -r myAppThatTransformsHtmlAtRuntime")` :D
14:21:13FromDiscord<Phil> But dom!
14:21:17FromDiscord<Phil> That's too easy!
14:21:40FromDiscord<dom96> ahh, so it's a challenge you're after
14:21:42FromDiscord<Phil> ~~Also means I'd need a second project to be able to do the first at which point gnaaa~~
14:21:48FromDiscord<dom96> write that app in Haskell and then `staticExec` it
14:21:54FromDiscord<Phil> Not quite, it's more that it doesn't "feel" beautiful
14:22:09FromDiscord<dom96> hehe, I know that feeling
14:22:19FromDiscord<Phil> Gut feeling says this is all part of a single task thus it should stay together
14:22:36FromDiscord<dom96> often that feeling is just a waste of time
14:22:53FromDiscord<dom96> be pragmatic and do what works unless there is an objective reason why it's problematic
14:23:01FromDiscord<Phil> So far my experience actually has been that it often leads to cleaner code in the long run
14:23:31FromDiscord<Phil> AND is a nice learning moment where you get to familiarize yourself with some quirk of the given language
14:24:18FromDiscord<Phil> I'm a bit particular about that at work as well where I insist on writing code that accurately expresses what I mean, not just that what it does coincides with what I want
14:24:56FromDiscord<flywind> In reply to @Isofruit "So parsing is straight": Sorry, I was wrong. The workaround doesn't work. See also discussions from https://github.com/nim-lang/RFCs/issues/271
14:25:31FromDiscord<aruZeta> In reply to @dom96 "often that feeling is": like the whole "spend 8h atomating something you can do in 5mins"?
14:26:23FromDiscord<dom96> In reply to @aruZeta "like the whole "spend": yep yep yep
14:26:34FromDiscord<aruZeta> funny cuz that's so me to de
14:26:35FromDiscord<aruZeta> (edit) "de" => "do"
14:26:59FromDiscord<aruZeta> my bio doesn't have "I'm just somebody who likes automating things for 8 hours when I could do it in minutes" for nothing lol
14:27:05FromDiscord<flywind> In reply to @Isofruit "So parsing is straight": Using `let xml {.compileTime.} = html.parseHtml()` probably works.
14:27:20FromDiscord<aruZeta> that could work
14:28:04FromDiscord<dom96> here is a crazy idea: let's create a macro that takes as input any Nim code, saves it to a file and compiles+runs it using `nim` at compile-time
14:28:12FromDiscord<dom96> the only downside then is compilation speed
14:28:13FromDiscord<flywind> sent a code paste, see https://play.nim-lang.org/#ix=48I5
14:28:29FromDiscord<aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=48I7
14:28:40FromDiscord<dom96> (it could even try to run the code at compile-time and only fall back to Nim if that fails)
14:29:59FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=48I8
14:30:43FromDiscord<Phil> I might just fall back to what dom suggested and make a tiny helper binary
14:31:17FromDiscord<flywind> It is strange. It works for my case:
14:31:28FromDiscord<flywind> https://media.discordapp.net/attachments/371759389889003532/1012731004710047905/unknown.png
14:32:06FromDiscord<dom96> nim version differences?
14:32:29FromDiscord<Phil> devel, 1.7.1, last updated like 2 weeks ago
14:32:49FromDiscord<flywind> works on 1.6.6 and devel too
14:32:58FromDiscord<flywind> (edit) "devel" => "devel(8/26)"
14:33:03*rockcavera joined #nim
14:33:04*rockcavera quit (Changing host)
14:33:04*rockcavera joined #nim
14:34:57FromDiscord<@bracketmaster-5a708063d73408ce4> has anybody tried parsing c files in nim?
14:36:32FromDiscord<dom96> yes, I did it using clang's parser to build https://picheta.me/obfuscator
14:39:15FromDiscord<Phil> In reply to @flywind "works on 1.6.6 and": Hmmm strange, something about the way I moved that proc to another module in an exported proc borked it somehow, running it directly in my playground made it work. I'll investigate that later, for now I'm trying to figure out how to remove those link and script tags at compile-time now
14:39:37FromDiscord<Phil> I am somewhat saddened the xmlNodes don't contain a proc to delete themselves =/
14:42:36FromDiscord<Phil> Like, in JS I could just go `htmlElement.parentElement.removeChild(index)`.↵I'm not seeing a similar parent thingy
14:47:56FromDiscord<Bung> can you assign to nil ?
15:05:40FromDiscord<sealmove> how do I get a `ptr uint8` from a `string`?
15:11:12FromDiscord<flywind> !eval var s ="123"; echo cast[ptr uint8](s[0])[]
15:11:15NimBotTraceback (most recent call last)↵/usercode/in.nim(1) in↵SIGSEGV: Illegal storage access. (Attempt to read from nil?)↵Segmentation fault (core dumped)
15:11:31FromDiscord<domosokrat> You cast a pointer to its first element\: `cast[ptr uint8](addr s[0])`.↵But what api wants a ptr uint8 for a string?
15:14:14FromDiscord<auxym> In reply to @mratsim "same ^": haha, if there was one person here whom I thought would have been into this fancy mathy number theory stuff, it would've been you!
15:15:36*xet7 joined #nim
15:17:41FromDiscord<aruZeta> im not a expert in math by any measure, and the most advandanced thing I remember being taught was what, how to solve some x y z system?
15:19:35FromDiscord<aruZeta> but galois fields kind of remind me of finite groups
15:19:44FromDiscord<aruZeta> (edit) "but galois fields kind of remind me of finite groups ... " added "in group theory"
15:20:20FromDiscord<aruZeta> where when you reach the last element you return to neutral element
15:20:44FromDiscord<aruZeta> (being in GF(256) the last element 255 and the neutral one 0)
15:24:16FromDiscord<Phil> Okay, that's it, I'm dumping the approach of parsing the HTML and just use a damn regex
15:24:26FromDiscord<aruZeta> no phil no
15:24:38FromDiscord<auxym> yeah, I never took group theory or any of that stuff. Just classic engineering "math" classes (calculus, diff eqs, linear algebra). I say "math" because they're quite different from stuff you learn in an actual math major. We rarely proved theorems for example, just learned the important ones and some useful tools and methods.
15:24:43FromDiscord<aruZeta> are you gonna parse it with regex?
15:24:48FromDiscord<aruZeta> or just search the string
15:25:00FromDiscord<Phil> I've been trying up and down to figure out how to traverse upwards in the damn XMLTree and there's no proc for it, no path whatsoever
15:25:06FromDiscord<Phil> Search and destroy the string
15:25:13FromDiscord<auxym> In reply to @Isofruit "Okay, that's it, I'm": inb4 the stack overflow chtulu cursed text post
15:25:24FromDiscord<aruZeta> In reply to @auxym "yeah, I never took": i mean, I wasn't taught anything of that, just stuff i researched cuz it's interesting
15:25:30FromDiscord<aruZeta> would like to learn more math
15:25:49FromDiscord<Phil> In reply to @auxym "inb4 the stack overflow": It's fine, regarding regex I generally know what I'm doing, it's more likely that some nim syntax around the regex starts murdering me
15:25:53FromDiscord<Nalmyth> sent a code paste, see https://play.nim-lang.org/#ix=48IR
15:25:56FromDiscord<Nalmyth> What causes `locks: <unknown>`?
15:26:13FromDiscord<Nalmyth> (edit) "https://play.nim-lang.org/#ix=48IR" => "https://play.nim-lang.org/#ix=48IS"
15:26:39FromDiscord<Nalmyth> (edit) "https://play.nim-lang.org/#ix=48IS" => "https://play.nim-lang.org/#ix=48IT"
15:26:46FromDiscord<auxym> haha. if you want to traverse upwards though, could you just traverse the tree downwards and build a reversed tree as you go?
15:28:08FromDiscord<aruZeta> regex + html is cursed
15:28:11FromDiscord<aruZeta> https://media.discordapp.net/attachments/371759389889003532/1012745278253711400/unknown.png
15:28:48FromDiscord<Phil> In reply to @auxym "haha. if you want": I'm not bothering implementing that if all I want to do is just delete all damn link and script tags
15:32:58FromDiscord<Bung> you can just use system.delete delete a element in seq
15:34:08FromDiscord<Phil> and that deletes it from the XML tree and not just my ref?
15:34:22FromDiscord<Phil> Since I'd be having a ref of that node
15:35:45FromDiscord<sealmove> hmm how to use header pragma with relative path?
15:36:27FromDiscord<Phil> Of flipping course re does not support doing anything at compiletime
15:36:40FromDiscord<Bung> I dont understand by means "my ref" , your tree is seq of node , use delete , delete a node from seq, that's it
15:36:43FromDiscord<Phil> At least it works though
15:37:21FromDiscord<Phil> I do not necessarily know where the node is.↵I do not intend to hard-code the entire index.html structure
15:37:32FromDiscord<Phil> I found the nodes originally using `findAll`
15:39:10FromDiscord<ravinder387> when will v2.0 nim released
15:39:39*CyberTailor quit (Quit: Konversation terminated!)
15:40:08*CyberTailor joined #nim
15:46:58*CyberTailor quit (Quit: Konversation terminated!)
15:47:22*CyberTailor joined #nim
15:48:11FromDiscord<Nalmyth> sent a code paste, see https://play.nim-lang.org/#ix=48J3
16:00:40FromDiscord<Phil> @dom96 Your approach of loading a secondary nim file is what I used in the end
16:00:49FromDiscord<aruZeta> hah
16:01:05FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=48J7
16:01:10FromDiscord<Phil> Combined with regex that replaces html
16:01:16FromDiscord<Phil> 😛
16:02:07FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=48J7" => "https://play.nim-lang.org/#ix=48J8"
16:02:25FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=48J8" => "https://play.nim-lang.org/#ix=48Ja"
16:05:33FromDiscord<hotdog> @Phil https://play.nim-lang.org/#ix=48Jc
16:05:35FromDiscord<hotdog> 🙂
16:06:52FromDiscord<Phil> a way of doing this, but at this point too much work for what I want to achieve
16:07:04FromDiscord<domosokrat> @Phil\: Are any of the `\` in your regex's needed?
16:07:19FromDiscord<Phil> At this point I escape anything that isn't ASCII on reflex
16:07:38FromDiscord<Phil> (edit) "ASCII" => "a basic letter"
16:08:30FromDiscord<aruZeta> unless yer using vim's search and replace, where `\(\)` is a save group but `\[\]` matches normal `[]`
16:08:49FromDiscord<domosokrat> this can bite you. There are regex engines where `\<`and `\>` match at word start / word end
16:09:17FromDiscord<aruZeta> yh
16:09:48FromDiscord<Phil> wtf, that is not part of any spec I'm aware of, you use ^and $ like any normal human being would expect
16:10:17FromDiscord<domosokrat> They match at string start / end
16:10:19FromDiscord<aruZeta> In reply to @aruZeta "unless yer using vim's": now im not sure of this one
16:10:31FromDiscord<aruZeta> at least in my emacs evil mode it works like this
16:10:49*CyberTailor quit (Quit: Konversation terminated!)
16:11:12FromDiscord<aruZeta> In reply to @Isofruit "wtf, that is not": now go search how emacs lisp regex are written 😆
16:11:14FromDiscord<domosokrat> `\<and\>` would match "and" but not "wand" or "andy"
16:11:29*CyberTailor joined #nim
16:11:36FromDiscord<Phil> I mean, that can also bite you in different ways as < and > are part of some regular expression special syntax symbols
16:13:27*xet7 quit (Ping timeout: 268 seconds)
16:14:46FromDiscord<aruZeta> oh man why could it not have been modulo 256, so it would overflow in a uint8 https://media.discordapp.net/attachments/371759389889003532/1012757001937371156/unknown.png
16:20:26FromDiscord<Rainbow Asteroids> MSB has a special meaning?
16:23:39FromDiscord<auxym> most significant bit?
16:25:03FromDiscord<aruZeta> most likely
16:26:09*xet7 joined #nim
16:26:52FromDiscord<Generic> modulo/division by a constant integer isn't that expensive
16:27:24FromDiscord<Generic> the compiler will optimise it into a long multiply which is still far faster than an arbitrary division
16:28:42FromDiscord<aruZeta> yh
16:41:50FromDiscord<gibson> @Bung does crowngui only compile under nim 1.1.1?
16:47:12FromDiscord<Forest> Highly doubt it but is there a Nim library for constructing code for programming languages?
16:47:42FromDiscord<auxym> like, parsing? there's a few libraries for that
16:48:23FromDiscord<auxym> there's also the langdev channel here for this stuff
16:51:47FromDiscord<Phil> In reply to @gibson "<@714152700920594493> does crowngui only": Dealing with the webgui package directly is pretty doable is what I can say in regards to that
16:55:34FromDiscord<gibson> Oh I didn't try that - will try that. Thanks.
16:55:58*hermaes quit (Ping timeout: 268 seconds)
16:57:10FromDiscord<Phil> I'm currently playing around with it myself (angular + webview in fact). So far I've mostly set up the necessary pipelines and basic things to ensure I always get by js and CSS applied properly, haven't checked out how it reacts to routing and the like though that should be as normal
16:57:21*hermaes joined #nim
16:57:31FromDiscord<gibson> Oh dang, it requires gtk installed on the user computer? Hmm.
16:58:09FromDiscord<gibson> @dom96 were you imagining a more wizard-like windows installer experience than this? https://github.com/ThomasTJdev/choosenim_gui
17:03:56FromDiscord<EyeCon> In reply to @Olfactory Hallucinations "Cool. Too bad it": That's a good find, thanks!
17:05:37NimEventerNew Nimble package! bitcoinlightning - Bitcoin Lightning client, see https://github.com/juancarlospaco/bitcoin-lightning
17:05:47FromDiscord<Bung> In reply to @gibson "<@714152700920594493> does crowngui only": use webgui instread, crowngui only complete macos part
17:06:31FromDiscord<aruZeta> In reply to @NimEventer "New Nimble package! bitcoinlightning": wha?, juancarlospaco is like 3 names in spanish, 2 at max LOL
17:07:12FromDiscord<aruZeta> never seen anyone with 3 names
17:07:37FromDiscord<aruZeta> (edit) "spanish, 2 at max LOL" => "spanish"
17:08:04FromDiscord<gibson> Most Americans I know have a middle name, making 3 names (first, middle, last). But yeah, juancarlospaco is as prodigious in nim as 3 people, it seems 😆
17:08:57FromDiscord<aruZeta> i mean, if he has 3 names, it would amount to 5 adding the 2 surnames
17:09:51FromDiscord<aruZeta> 2 names is not that uncommon, but 3? lol
17:11:10FromDiscord<Phil> That dude is like treeform
17:11:19FromDiscord<Phil> Except he's not in chat
17:11:30FromDiscord<aruZeta> lol
17:11:35FromDiscord<treeform> In reply to @ravinder387 "when will v2.0 nim": It's already here with the right flags 🙂
17:11:36FromDiscord<aruZeta> talking abt treeform
17:13:22FromDiscord<treeform> In reply to @Isofruit "That dude is like": He has more than 3 names like I do?
17:13:55FromDiscord<aruZeta> lol
17:14:26FromDiscord<flywind> In reply to @Isofruit "Except he's not in": Well, they are on the Discord.
17:14:41*jkl quit (Quit: Gone.)
17:14:58FromDiscord<aruZeta> yh he is called juan_carlos
17:15:07FromDiscord<aruZeta> where the paco tho
17:15:34FromDiscord<gibson> -> offtopic?
17:16:03*jkl joined #nim
17:17:58*CyberTailor quit (Quit: Konversation terminated!)
17:18:33*CyberTailor joined #nim
17:21:49FromDiscord<Matrix Administrator> https://pornro.live/ - filme porno romania
17:21:58FromDiscord<aruZeta> <@&371760044473319454> ?
17:24:46FromDiscord<Forest> In reply to @auxym "like, parsing? there's a": No, construction
17:24:59FromDiscord<Forest> I need to generate code that can be ran/compiled by other languages
17:25:07FromDiscord<Forest> Like i want to generate Java source files
17:25:13FromDiscord<Forest> (example)
17:25:52FromDiscord<Matrix Administrator> sent a long message, see http://ix.io/48JH
17:26:20FromDiscord<aruZeta> <@&371760044473319454> here too
17:27:22*vicecea quit (Remote host closed the connection)
17:28:00FromDiscord<aruZeta> In reply to @Forest "Like i want to": that's a lot of work
17:28:24FromDiscord<aruZeta> but it would be rly cool
17:28:26FromDiscord<Forest> In reply to @aruZeta "that's a lot of": Oh absolutely, it's why I'm looking for existing tools 😛
17:28:53*vicecea joined #nim
17:28:56FromDiscord<Forest> By generation i mean by me providing information such as names and it generating the final file
17:30:40FromDiscord<Forest> May make a framework for this myself, since doubt it exists, and if it does, not in pure nik
17:30:44FromDiscord<Bung> I encounter buffer too small error, when call a dll's function with PCWSTR param, the param is converted by winim.winstrConverterStringToLPWSTR , how to handle this ?
17:42:26FromDiscord<SouperZ> is odev possible in nim?
17:44:01*CyberTailor quit (Remote host closed the connection)
17:44:24FromDiscord<Phil> Odev?
17:44:29FromDiscord<SouperZ> osdev
17:45:50*CyberTailor joined #nim
17:46:29FromDiscord<Forest> Oh yeah definitely
17:46:31FromDiscord<aruZeta> In reply to @SouperZ "osdev": https://github.com/dom96/nimkernel
17:46:49FromDiscord<SouperZ> In reply to @aruZeta "https://github.com/dom96/nimkernel": i saw that, im currently making my own osdev template
17:47:20FromDiscord<SouperZ> with a better bootloader
17:47:42FromDiscord<aruZeta> nice
17:49:09FromDiscord<Rainbow Asteroids> #embedded
17:54:44FromDiscord<dom96> In reply to @gibson "<@132595483838251008> were you imagining": this is too complex for my taste
17:56:01FromDiscord<gibson> So a more streamlined standard win installer experience/wizard is what I figured you were talking about, maybe 2 screens, with Next and Back buttons.
17:56:29FromDiscord<dom96> yep
17:56:52FromDiscord<dom96> the more Windows-native it looks, the better
17:57:01FromDiscord<gibson> agreed
17:57:02FromDiscord<dom96> are you planning to work on one?
17:57:46FromDiscord<gibson> I'm looking into how much work it would entail, and what the options are, making notes etc.. So I guess I am.
17:58:16FromDiscord<dom96> awesome
17:59:17FromDiscord<dom96> remember: keep it simple. All you need to do during the install step is: 1) download choosenim 2) run it 3) add to PATH
17:59:53FromDiscord<dom96> the only complex part should be the UI
18:00:05FromDiscord<dom96> (but even that shouldn't be that difficult)
18:00:06FromDiscord<gibson> Yeah, I'm making the underlying thing a bit more general, but yes that's the ultimate goal: very simple.
18:01:21FromDiscord<aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=48JS
18:02:02FromDiscord<aruZeta> (edit) "https://play.nim-lang.org/#ix=48JS" => "https://play.nim-lang.org/#ix=48JU"
18:02:52FromDiscord<aruZeta> im rewriting something from c to nim
18:02:54FromDiscord<gibson> @aruZeta looks like yes, if param1 is destination, param2 is source.
18:03:11FromDiscord<aruZeta> yep I get that
18:03:18FromDiscord<aruZeta> it was more of the third param
18:03:32FromDiscord<aruZeta> (edit) "param" => "param, which I was guessing was the total length - 1"
18:03:51FromDiscord<gibson> You'll have to check what `resultLen` actually is.
18:03:55FromDiscord<aruZeta> is there some proc in std to do the same
18:04:09FromDiscord<aruZeta> In reply to @gibson "You'll have to check": it's the len the result array so ye
18:04:16FromDiscord<aruZeta> (edit) "In reply to @gibson "You'll have to check": it's the len ... the" added "of"
18:04:50FromDiscord<aruZeta> i found https://nim-lang.org/docs/system.html#moveMem%2Cpointer%2Cpointer%2CNatural but it's unsafe hmm
18:05:53FromDiscord<aruZeta> (im doing this in a seq btw)
18:06:52FromDiscord<aruZeta> else I could just use delete
18:07:23FromDiscord<aruZeta> (edit) "else I could just use ... deletethe" added "delete," | "delete,delete ... " added "the first elem it would shift the ones on the right 1 to the left"
18:07:36FromDiscord<aruZeta> (edit) "delete" => "deleting" | removed "it"
18:09:17FromDiscord<gibson> There are the rotate procs in `algorithm` that might fit the bill. https://nim-lang.org/docs/algorithm.html#rotateLeft%2CopenArray%5BT%5D%2Cint
18:09:52FromDiscord<SouperZ> can i create a array? without any limits
18:10:10FromDiscord<aruZeta> i think delete might be better, since I don't need the last elem (it will be set to 0)
18:10:47FromDiscord<gibson> @SouperZ I think you're only limited to the size of what you can allocate on the stack.
18:11:49FromDiscord<gibson> @aruZeta In that case, and if you don't care about order, you can use `del` .
18:13:09FromDiscord<aruZeta> i need to keep the order,
18:13:11FromDiscord<aruZeta> (edit) "order," => "order"
18:13:22FromDiscord<aruZeta> so ig delete is the best option
18:14:09FromDiscord<aruZeta> although it is decreasing the len and I will need to use add to both make the last item 0 and set the len as it should be
18:16:36FromDiscord<gibson> @aruZeta yeah, that's good. If performance is a concern you can always optimize later and write the unsafe memmove version.
18:16:48FromDiscord<aruZeta> yep
18:26:00FromDiscord<auxym> In reply to @Forest "I need to generate": oh so a compiler backed, of sorts. ask in langdev maybe
18:26:19FromDiscord<auxym> (edit) "backed," => "backend,"
18:27:08FromDiscord<Forest> In reply to @auxym "oh so a compiler": Not really, I'm doing that part myself, i just need to have a generic library that can generate the code, I don't think this fits in langdev
18:28:59FromDiscord<planetis> How libraries are supposed to make use of .since for stdlib additions, I have totally forgoten.
18:30:48FromDiscord<gibson> @planetis I don't think there is a `{.since.}` pragma...
18:31:36FromDiscord<planetis> sure there is https://nim-lang.org/docs/since.html
18:33:22FromDiscord<planetis> its `when (NimMajor, NimMinor, NimPatch) >= (1, 7, 1):` redefine the stdlib proc
18:34:42FromDiscord<gibson> Neat!
18:34:54FromDiscord<planetis> (edit) ">=" => "<"
18:48:48*CyberTailor quit (Quit: Konversation terminated!)
18:49:13*CyberTailor joined #nim
19:21:52*rockcavera quit (Remote host closed the connection)
19:23:50*CyberTailor quit (Quit: Konversation terminated!)
19:24:15*CyberTailor joined #nim
19:26:34*rockcavera joined #nim
19:26:34*rockcavera quit (Changing host)
19:26:34*rockcavera joined #nim
19:39:01*xet7 quit (Remote host closed the connection)
19:40:38*CyberTailor quit (Quit: Konversation terminated!)
19:41:09*CyberTailor joined #nim
19:47:12*kenran joined #nim
19:51:57*hermaes quit (Quit: WeeChat 3.6-dev)
19:54:40*CyberTailor quit (Quit: Konversation terminated!)
19:55:27*CyberTailor joined #nim
20:00:21FromDiscord<Forest> If i pass a custom object to a function, can it modify it?
20:01:00FromDiscord<Forest> And should it be a ref object? Is it better to do `MyRefType = ref MyType` or `MyType = ref object`?
20:01:06FromDiscord<Rainbow Asteroids> `proc foo (x: var T)`
20:01:15FromDiscord<Forest> Ah thanks!
20:02:07FromDiscord<!Patitotective> memory safe ;]
20:03:22FromDiscord<Forest> Should i also do `var Type` for defining mutable fields in an object?
20:04:07FromDiscord<Elegantbeef> No
20:04:24FromDiscord<Elegantbeef> Nim does not track mutability on a field basis
20:05:51FromDiscord<Elegantbeef> If the object is declared as `var` it's fields are mutable, if it's declared as `let` it's not
20:10:34FromDiscord<Forest> Ah okay, good to know!
20:10:38*CyberTailor quit (Quit: Konversation terminated!)
20:11:12*CyberTailor joined #nim
20:14:02FromDiscord<JSONBash> do people actually use DELETE requests for delete actions in a REST api? Or just use POST?
20:18:18FromDiscord<Forest> In reply to @JSONBash "do people actually use": Discord does DELETE so ig?
20:18:34FromDiscord<Forest> It depends on the API but I'd say using the DELETE request is probably a better idea
20:19:39*CyberTailor quit (Quit: Konversation terminated!)
20:20:02*CyberTailor joined #nim
20:25:29*CyberTailor quit (Quit: Konversation terminated!)
20:25:51*CyberTailor joined #nim
20:27:29*CyberTailor quit (Client Quit)
20:28:05*CyberTailor joined #nim
20:37:17qwrJSONBash: its pretty common to use DELETE, where it often gets funny and suprising is POST/PUT/PATCH distinction
20:39:54qwrForest: i've written quite bit nim lately, and i've used ref really rarely (basically only to create graph/tree structures and similar)
20:44:46FromDiscord<Forest> In reply to @qwr "<@909883978717204561>: i've written quite": Hm alright
20:44:52*kenran quit (Quit: WeeChat info:version)
20:45:45FromDiscord<Forest> Hm, does Java even have a distinction between ref types and normal types?
20:46:04*qwr thinks that (my) style is basically using subset of nim with mutable-value semantics...
20:46:37qwrForest: kind-of - there ref types (objects) and value types (primitives)
20:46:40FromDiscord<Rainbow Asteroids> In reply to @Forest "Hm, does Java even": primitives are on the stack, everything is on the heap iirc
20:46:47FromDiscord<Forest> Ah okay
20:50:02qwrwhere this gets a bit weird, is that java has always call-by-value, but since object types are references, only non-primitive argument modification is visible to method caller
20:55:41qwrnim on the other hand is explicit and consistent here with the ref and var keywords
21:14:40FromDiscord<Forest> Aah.
21:14:46FromDiscord<Forest> Hm, how would i solve that...
21:14:54FromDiscord<Forest> Ig a ton of getter and setter functions
21:15:00FromDiscord<Forest> Thaaaaat won't be fun to implement lmao
21:15:10FromDiscord<!Patitotective> https://github.com/ayman-albaz/etters
21:16:11FromDiscord<Forest> Probably not gonna be helpful to me
21:16:17FromDiscord<Forest> Maybe? But eh
21:19:04qwrif you need them, let macros generate them (btw, etters looks like such macro/templates)
21:20:03FromDiscord<Forest> Yeah
21:20:19FromDiscord<Forest> In reply to @qwr "if you need them,": Issue is the point of this is that it'll be generated automatically so nearly anything pure Nim would work
21:21:27FromDiscord<!Patitotective> what?
21:23:19FromDiscord<aruZeta> In reply to @Forest "Ig a ton of": that's how you explain java in a few words
21:23:27FromDiscord<aruZeta> even better "it's all boilerplate"
21:26:45qwrForest: usually exporting the fields* directly would be enough...
21:26:46FromDiscord<huantian> I wonder if `field=` with an `{.error.}` works to disable setting
21:27:34FromDiscord<aruZeta> In reply to @qwr "<@909883978717204561>: usually exporting the": and you will have encapsulation police on your back
21:28:33qwrencapsulation only because of encapsulation with exposing the same thing directly via accessors is usually nonsense
21:29:06FromDiscord<Forest> In reply to @Patitotective "what?": My goal is to make a Java backend for Nim, so it can be used on the JVM, meaning normal Nim concepts need to be adapted to work on the JVM
21:29:07qwrsuch encapsulation sometimes makes sense on stable library interfaces
21:29:24FromDiscord<Forest> In reply to @qwr "<@909883978717204561>: usually exporting the": Usually yup, but I'm thinking about a way to make it compatible with Java
21:29:30FromDiscord<Forest> I can handle it on the backend probably
21:30:52qwrForest: ok, then yeah (the java world is unfortunaly a strange cult)
21:31:18FromDiscord<Forest> Yuppp
21:31:40FromDiscord<Forest> But making a way for Nim, a non-JVM language to work in a JVM world would be epic
21:31:41FromDiscord<aruZeta> In reply to @qwr "<@909883978717204561>: ok, then yeah": oh yes it is
21:32:07FromDiscord<aruZeta> so sad when summer ends i will have to write Java again :(
21:32:24FromDiscord<aruZeta> In reply to @Forest "But making a way": if that happens I will adore you
21:32:28FromDiscord<Forest> And the thing is it'll feel so amazing compared to most JVM languages ngl
21:33:04FromDiscord<aruZeta> I have not written clojure, but as a LISP enjoyer it sure has to be a lot better than java
21:33:20FromDiscord<Forest> In reply to @aruZeta "if that happens I": It's a WIP, currently i need to serialise Nim nodes and stuff so it can be put into a format such as msgpack, and then used that parsed file to generate code for other targets
21:33:37FromDiscord<aruZeta> yep, alot of work
21:34:16FromDiscord<Forest> Reason why I'm doing it like this is because to me, it'll reduce the effort needed to maintain a backend, because I'll only need to maintain 1 thing across versions and as long as there aren't a ton of breaking changes internally, nothing will change
21:34:48FromDiscord<Forest> Obviously maintaining the Java target and other targets is definitely a good idea (obviously lmao) but it'll make it so less work is needed
21:35:28FromDiscord<aruZeta> if you can pull it off
21:35:37FromDiscord<aruZeta> nim would get some more popularity ig
21:35:59FromDiscord<aruZeta> a language which can transpile to some others
21:40:18FromDiscord<Forest> In reply to @aruZeta "a language which can": Tbf Nim can already do C, C++, Objective C and JS
21:40:38qwrbtw, if you were really lazy, then there are javascript implentations running on JVM...
21:41:20FromDiscord<Forest> In reply to @aruZeta "nim would get some": Yeah, I'd imagine being able to do something like Haxe even if it wasn't the intended purpose would be great, and we have the advantage of Nim's powerful templating and macro system
21:41:44qwralso, there is JNI
21:41:47FromDiscord<Forest> In reply to @qwr "btw, if you were": Sure, but that wouldn't give ya full java interoperability, only what you have within a JS implementation in Java
21:41:53FromDiscord<Forest> In reply to @qwr "also, there is JNI": Slow when doing many calls
21:42:03FromDiscord<Forest> I want to make a Minecraft mod in Nim, imagine how crazy that'd be
21:42:59qwrok, you're going for the hacking fun :)
21:43:09FromDiscord<!Patitotective> In reply to @Forest "Tbf Nim can already": nim doesnt transpile ;] https://peterme.net/is-nim-a-transpiler.html
21:44:00FromDiscord<Forest> In reply to @Patitotective "nim doesnt transpile ;]": I'd imagine my thing would be a transpiler tho, right?
21:44:27*qwr once wrote JVM language (Yeti), but i've mostly given up on it, in professional Java development nobody wants to hear about anything non-Java, and elsewhere I can get away without JVM
21:44:43FromDiscord<!Patitotective> In reply to @Forest "I'd imagine my thing": i dont know what you're going to do :p
21:49:20FromDiscord<aruZeta> am I perhaps ... dreaming? https://media.discordapp.net/attachments/371759389889003532/1012841198030966834/unknown.png
21:49:26FromDiscord<aruZeta> it fcking works
21:49:55FromDiscord<Rainbow Asteroids> `Hello world!`
21:49:59FromDiscord<aruZeta> oh boy
21:50:07FromDiscord<Forest> In reply to @qwr "once wrote JVM language": Fair
21:51:00FromDiscord<Forest> In reply to @Patitotective "i dont know what": Serialising all of the Nim nodes and symbols that Nim use internally to build output files, so that they can be used in a different environment to generate code for Java
21:51:08FromDiscord<Forest> (and also other languages later down the road)
21:51:27FromDiscord<Forest> @!Patitotective (ping)
21:51:33FromDiscord<Rainbow Asteroids> pong
21:51:44FromDiscord<aruZeta> man the ec codewords were the most difficult part
21:52:00FromDiscord<!Patitotective> In reply to @Forest "<@762008715162419261> (ping)": double ping
21:52:03FromDiscord<Forest> In reply to @Forest "(and also other languages": Like Lua and Python (Python is for fun, Lua is so Nim can be used in games that use Lua as a scripting language)
21:52:17FromDiscord<!Patitotective> In reply to @Forest "Serialising all of the": you mean the ast?
21:52:24FromDiscord<Forest> For me, my issue will mainly be carrying Nim semantics over to Java
21:52:24FromDiscord<aruZeta> if it was not for nayuki's qr lib it would have taken me waaaaay longe
21:52:25FromDiscord<aruZeta> (edit) "longe" => "longer"
21:52:28FromDiscord<Forest> In reply to @Patitotective "you mean the ast?": Yep
21:53:07FromDiscord<aruZeta> the worst part might be carrying custom made operators
21:53:43FromDiscord<aruZeta> although well, they can be named in a obfuscated way when put in java code
21:54:11FromDiscord<aruZeta> ie: `>` named to `ltOperator`
21:54:36qwrLua is in some ways really similar to javascript (without prototype OO), if it were to be targeted by nim, a lot of the code generator logic could probably be shared
21:57:25FromDiscord<Forest> In reply to @aruZeta "the worst part might": I can just change them to functions tbh
21:57:40FromDiscord<Forest> In reply to @qwr "Lua is in some": I'm implementing code generation completely by myself so i actually understand it
21:58:33FromDiscord<Forest> Hold on, I'll get the repo for code serialisation (it's non-working right now)
22:02:57FromDiscord<Forest> https://github.com/Mythical-Forest-Collective/Nim2IR
22:04:30FromDiscord<Forest> (For anyone wondering about the excessive use of `we`, we are a system since we have OSDD)
22:06:06FromDiscord<dom96> Gotta love a readme that tells its readers "fuck you"
22:06:29FromDiscord<dom96> why so vulgar? lol
22:07:18FromDiscord<Rika> You know I think it would be prolly be better to translate LLVM IR into these languages instead
22:07:42FromDiscord<Forest> In reply to @dom96 "why so vulgar? lol": Blame another sysmate
22:08:01FromDiscord<Forest> In reply to @Rika "You know I think": We do not understand LLVM IR soooooo
22:08:27FromDiscord<Rika> What makes you think your own custom IR would be any easier to do than that? I’m not too sure…
22:08:30FromDiscord<Forest> Also, it'd be more readable to convert Nim to Java (even if it's not the goal) over LLVM IR to Java
22:08:46FromDiscord<Rika> I guess
22:08:51FromDiscord<Forest> In reply to @Rika "What makes you think": It's just the data stored in a msgpack format rn, other formats may or may not be added buuuut eh
22:09:34FromDiscord<Forest> Mostly like Nim's AST currently but simplified
22:16:25*CyberTailor quit (Remote host closed the connection)
22:18:26*CyberTailor joined #nim
22:30:51*derpydoo quit (Ping timeout: 268 seconds)
23:24:17FromDiscord<EyeCon> In reply to @aruZeta "it fcking works": Go you! Is it online somewhere?
23:41:06*sagax joined #nim