00:00:11 | * | derpydoo joined #nim |
00:06:26 | FromDiscord | <!Patitotective> actually, now i realize↵i could do the validation with regex :p |
00:09:45 | FromDiscord | <Elegantbeef> Please do not use regex |
00:09:46 | FromDiscord | <Elegantbeef> Please do not use regex |
00:13:25 | * | flynn joined #nim |
00:13:55 | * | flynn quit (Client Quit) |
00:27:19 | FromDiscord | <!Patitotective> then you might better give some suggestions so the code doesnt look like this mess https://github.com/Patitotective/kdl-nim |
00:36:27 | FromDiscord | <Elegantbeef> Where would you use regex? |
00:37:36 | FromDiscord | <!Patitotective> all procs preffixed with `validate` |
00:38:46 | FromDiscord | <Elegantbeef> Would regex be as auditable as this code? |
00:40:03 | FromDiscord | <Elegantbeef> Could also use npeg instead |
00:40:32 | FromDiscord | <!Patitotective> 💀 |
00:40:34 | FromDiscord | <!Patitotective> dependencies |
00:42:15 | FromDiscord | <huantian> Your library already is a dependency |
00:43:14 | FromDiscord | <!Patitotective> yes but a library with no dependencies |
00:43:57 | FromDiscord | <huantian> Why does that matter |
00:57:15 | FromDiscord | <!Patitotective> ~~i-i dont know, you can make "free dependency" marketing~~ |
00:58:30 | FromDiscord | <Elegantbeef> Except you cant |
00:58:39 | FromDiscord | <Elegantbeef> Cause nre and re require system libraries |
00:59:05 | FromDiscord | <!Patitotective> nre? |
01:00:40 | FromDiscord | <!Patitotective> none of these are _pUrE_? https://media.discordapp.net/attachments/371759389889003532/1012526959441494027/unknown.png |
01:00:55 | FromDiscord | <Elegantbeef> `regex` is pure but it's a dependency |
01:01:32 | FromDiscord | <!Patitotective> ok, then i wont use anything until my code breaks https://media.discordapp.net/attachments/371759389889003532/1012527181374701689/unknown.png |
01:14:13 | FromDiscord | <Rika> Just use the pegs or parse libs in standard |
01:16:21 | FromDiscord | <Elegantbeef> Who are you who are so wise in the way of sceince? |
01:18:15 | FromDiscord | <Rika> Science |
01:18:29 | FromDiscord | <Elegantbeef> Hey that's a typo i'm not an idiot |
01:18:45 | FromDiscord | <Rika> How would I know, it’s hard to tell |
01:18:55 | FromDiscord | <Elegantbeef> touche |
01:19:01 | FromDiscord | <Rika> Touché |
01:19:03 | FromDiscord | <Rika> |
01:19:09 | FromDiscord | <Elegantbeef> Touchy |
01:19:20 | FromDiscord | <Rika> Two shay |
01:24:36 | FromDiscord | <Rainbow Asteroids> In reply to @Elegantbeef "Touchy": touch wheat |
01:34:29 | FromDiscord | <!Patitotective> In reply to @Rika "Just use the pegs": i do use parse libs in standard :] |
01:43:24 | FromDiscord | <ravinder387> `proc add0(x,y: int): int =↵ return x + y` |
01:43:49 | FromDiscord | <ravinder387> add0 2,3 and add0 2:3 syntaxtically wrong |
01:45:58 | FromDiscord | <!Patitotective> not sure what you mean but |
01:46:00 | FromDiscord | <!Patitotective> !eval proc add0(x,y: int): int = return x + y; echo add0 2, 3 |
01:46:00 | FromDiscord | <ravinder387> https://media.discordapp.net/attachments/371759389889003532/1012538371647746178/Screenshot_from_2022-08-26_07-15-23.png |
01:46:02 | NimBot | Compile failed: /usercode/in.nim(1, 52) Error: type mismatch: got <int literal(2)> |
01:46:27 | FromDiscord | <Elegantbeef> Command syntax has some rsemantic requirements |
01:46:34 | FromDiscord | <Elegantbeef> semantic\ |
01:46:45 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=48Em |
01:47:07 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#procedures-command-invocation-syntax |
01:47:12 | FromDiscord | <Elegantbeef> Documents the requirements |
01:48:36 | FromDiscord | <Elegantbeef> As does the block syntax |
01:49:16 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=48En |
01:55:18 | FromDiscord | <ravinder387> indentation error |
01:55:19 | FromDiscord | <ravinder387> sent a long message, see http://ix.io/48Ep |
01:57:22 | FromDiscord | <ravinder387> then echo "hello" "world" |
01:57:25 | FromDiscord | <ravinder387> why it works |
01:57:38 | FromDiscord | <Elegantbeef> More words are better |
01:57:47 | FromDiscord | <ravinder387> "hello", "world" |
01:57:56 | FromDiscord | <Rika> because echo is not an expression |
01:58:22 | FromDiscord | <Rika> expression -> returns something, cannot have more than one argument↵statement -> no return, can have more than one argument |
01:58:32 | FromDiscord | <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:26 | FromDiscord | <ravinder387> command syntax means |
01:59:57 | FromDiscord | <Rika> `add0 2, 3` is command syntax |
02:00:28 | FromDiscord | <Rika> if add0 returns, only one argument↵if add0 does not return, more than one argument ok |
02:05:31 | FromDiscord | <ravinder387> https://media.discordapp.net/attachments/371759389889003532/1012543283228057680/Screenshot_from_2022-08-26_07-35-07.png |
02:05:39 | FromDiscord | <Rika> In reply to @Rika "if add0 returns, only": this |
02:06:55 | FromDiscord | <Elegantbeef> `var r = ...` is a statement as such you can only pass a single parameter with the command syntax |
02:07:05 | FromDiscord | <Elegantbeef> you can do `2.add0 3` if you want to pass 2 but that's at most what you can do |
02:07:11 | FromDiscord | <ravinder387> In reply to @ravinder387 "": according to this image add0 2,3 valid expression and |
02:07:19 | FromDiscord | <ravinder387> i can save in variable then print |
02:07:22 | FromDiscord | <Elegantbeef> They're valid within a specific scenario |
02:07:31 | FromDiscord | <Elegantbeef> read the docs/messages we post |
02:07:43 | FromDiscord | <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:27 | FromDiscord | <ravinder387> not working https://media.discordapp.net/attachments/371759389889003532/1012548295064813618/Screenshot_from_2022-08-26_07-55-01.png |
02:26:53 | FromDiscord | <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:22 | FromDiscord | <ravinder387> sorry my mistake it working |
02:29:36 | * | genpaku quit (Remote host closed the connection) |
02:30:04 | FromDiscord | <that_dude> You're just trying to massacre the parser with the freedom you're given huh lol |
02:30:12 | FromDiscord | <that_dude> tbf this may want to be documented as well |
02:30:16 | FromDiscord | <Rika> it is |
02:30:21 | FromDiscord | <Rika> what isnt documented here |
02:30:43 | FromDiscord | <that_dude> Oh is the way he has it mixed an match actually covered |
02:31:01 | FromDiscord | <Rika> mcs + command style? |
02:31:26 | FromDiscord | <Rika> `call arg.call call arg` is pretty valid |
02:31:56 | FromDiscord | <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:06 | FromDiscord | <Elegantbeef> The docs do specify command invocation syntax |
02:32:08 | FromDiscord | <that_dude> because I can deff see potential confusion in the order of opperations |
02:32:22 | FromDiscord | <Rika> ? |
02:32:42 | * | genpaku joined #nim |
02:33:17 | FromDiscord | <Rika> `call1 arg1.call2 call3 arg2` equivalent to `call1(call2(arg1, call3(arg2))` ? |
02:33:41 | FromDiscord | <Rika> just add opening parens on the spaces |
02:33:41 | FromDiscord | <that_dude> Take it from the pov of someone who's not to knowledgeable to begin with |
02:34:12 | FromDiscord | <Rika> you wouldnt encounter this code if the programmer was sensible |
02:34:19 | FromDiscord | <Rika> it makes more sense with named functions and arguments |
02:34:41 | FromDiscord | <that_dude> I guess there would be commas in there that clear it up a bit |
02:34:42 | FromDiscord | <Rika> like `echo list.add transform obj` |
02:34:51 | FromDiscord | <that_dude> if it was different |
02:34:58 | FromDiscord | <Rika> different how |
02:35:14 | FromDiscord | <Rika> In reply to @Rika "like `echo list.add transform": this is nonsensical because add doesnt return, i was just thinking quickly |
02:35:17 | FromDiscord | <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:32 | FromDiscord | <that_dude> I was thinking about something like this `echo(list.add, transform, obj)` |
02:35:38 | FromDiscord | <Rika> that makes no sense |
02:35:40 | FromDiscord | <Elegantbeef> that wouldnt compile |
02:35:41 | FromDiscord | <Rika> that doesnt work |
02:35:42 | FromDiscord | <that_dude> I know |
02:35:47 | FromDiscord | <Elegantbeef> `list.add` would have to be an expression |
02:35:53 | FromDiscord | <Rika> BEEF STFU |
02:35:55 | FromDiscord | <Rika> I ALREADY SAID THAT |
02:35:57 | FromDiscord | <Rika> YOU DINGUS |
02:36:10 | FromDiscord | <that_dude> lol |
02:36:18 | FromDiscord | <Rika> REPLACE IT WITH SPAWN OR WHATEVER IF YOU WANT IT THAT HARD |
02:36:22 | FromDiscord | <Elegantbeef> You know rika i take a lot of flak from you, so i'm going to fight back! You're smelly |
02:36:22 | FromDiscord | <Rika> REEEEEEEEEEEE |
02:36:27 | FromDiscord | <Rika> not wrong |
02:36:36 | FromDiscord | <ravinder387> r u talking to me |
02:36:38 | FromDiscord | <Rika> i dont know a single person who isnt smelly in some way |
02:36:53 | FromDiscord | <Elegantbeef> In closing command syntax is documented |
02:37:14 | FromDiscord | <Elegantbeef> if you cannot understand the simple rules, read more |
02:46:45 | FromDiscord | <!Patitotective> In reply to @Rika "i dont know a": stinky https://media.discordapp.net/attachments/371759389889003532/1012553659457998889/unknown.png |
02:47:15 | FromDiscord | <Elegantbeef> Rika more like Pika cause you're an annoying rat |
02:47:30 | FromDiscord | <ravinder387> In reply to @Rika "i dont know a": is f a,b == f(a,b) |
02:47:33 | FromDiscord | <!Patitotective> thats not a rat :[ |
02:47:41 | FromDiscord | <Elegantbeef> Yes |
02:47:48 | FromDiscord | <!Patitotective> its bippo |
02:47:57 | FromDiscord | <Rika> In reply to @ravinder387 "is f a,b ": only when `f` does not return anything |
02:48:03 | FromDiscord | <Elegantbeef> Pikachu is a electrified mouse patito |
02:48:09 | FromDiscord | <Rika> In reply to @Elegantbeef "Rika more like Pika": damn |
02:48:11 | FromDiscord | <Rika> ive been got |
02:49:09 | FromDiscord | <!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:29 | FromDiscord | <Elegantbeef> It's pokedex entry literally says it's an electrified mouse |
02:49:47 | FromDiscord | <!Patitotective> i dont have a pokedex |
02:50:06 | FromDiscord | <!Patitotective> In reply to @Patitotective "hMmMMm im pretty sure": im pretty sure it was made up |
02:50:21 | FromDiscord | <Elegantbeef> Really pokemon were made up? |
02:50:26 | FromDiscord | <Elegantbeef> I though japan was just wild |
02:50:32 | FromDiscord | <!Patitotective> lmfao |
02:50:58 | FromDiscord | <!Patitotective> i wonder how rika programs from japan, starlink? |
02:51:15 | FromDiscord | <Elegantbeef> What you think japan doesnt have ISPs? |
02:52:08 | FromDiscord | <Elegantbeef> It's a nation of like 500k km^2 |
02:52:27 | FromDiscord | <Elegantbeef> If Canada has ISPs i'm sure japan can have ISPs |
02:52:33 | FromDiscord | <Rainbow Asteroids> In reply to @Elegantbeef "It's pokedex entry literally": mouse != rat↵boom i win meaningless internet argument |
02:52:35 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "It's a nation of": ² |
02:52:47 | FromDiscord | <!Patitotective> In reply to @Rainbow Asteroids "mouse != rat boom": https://media.discordapp.net/attachments/371759389889003532/1012555181050822756/unknown.png |
02:52:49 | FromDiscord | <Rika> In reply to @Rainbow Asteroids "mouse != rat boom": ownedddddddddd |
02:52:56 | FromDiscord | <Elegantbeef> Yea correct the `^2` and not the `k km` |
02:53:06 | FromDiscord | <Elegantbeef> If only there was a big M |
02:53:07 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "What you think japan": ~~whats that~~ |
02:53:17 | FromDiscord | <Elegantbeef> Internet service providers |
02:53:31 | FromDiscord | <Rika> i live in a city |
02:53:36 | FromDiscord | <Rika> a rural city but its still a city |
02:53:42 | FromDiscord | <Rika> its not even that rural |
02:53:54 | FromDiscord | <Rika> i think theres at least a hundred thousand people here |
02:54:13 | FromDiscord | <Elegantbeef> Unless you live in the mountains you're pretty close to life |
02:54:15 | FromDiscord | <!Patitotective> i live in a 25k town :] |
02:54:27 | FromDiscord | <Elegantbeef> I live in a town of \~8k |
02:54:37 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "I live in a": how many bears? |
02:54:47 | FromDiscord | <Elegantbeef> We get them occasionally |
02:55:06 | FromDiscord | <Rainbow Asteroids> this uni has something like 35k people enrolled |
02:55:12 | FromDiscord | <Rika> wow ok |
02:55:44 | FromDiscord | <Shiba> i live in the middle of nowhere |
02:56:01 | FromDiscord | <!Patitotective> In reply to @Shiba "i live in the": pacific ocean? |
02:56:02 | FromDiscord | <Rainbow Asteroids> how's the satellite internet |
02:56:22 | FromDiscord | <Shiba> In reply to @Patitotective "pacific ocean?": sorta like desert |
02:56:40 | FromDiscord | <Shiba> there is a couple of buildings but no one lives ther |
02:56:52 | FromDiscord | <Rainbow Asteroids> In reply to @Shiba "sorta like desert": why would you put yourself through that |
02:57:08 | FromDiscord | <Shiba> i have no choice |
02:57:13 | FromDiscord | <Rainbow Asteroids> :( |
02:57:34 | FromDiscord | <Rika> tfw |
02:57:43 | FromDiscord | <Elegantbeef> Last one in town was probably 10 years ago |
02:57:43 | FromDiscord | <Elegantbeef> Where are you from again patito? |
02:58:09 | FromDiscord | <ravinder387> I'm from earth |
02:58:16 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "Where are you from": dont remember you ever asked but 🇨🇴 |
02:58:17 | FromDiscord | <ravinder387> wht abt u |
02:58:28 | FromDiscord | <Rainbow Asteroids> I hear that place has lots of water |
02:58:46 | FromDiscord | <Elegantbeef> You see patito i was 99% certain that was the flag of columbia |
02:58:54 | FromDiscord | <Elegantbeef> But i was also 1% certain it wasnt |
02:58:59 | FromDiscord | <!Patitotective> columbia lmao |
02:59:11 | FromDiscord | <Rika> im from the trappist 1 system |
02:59:38 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "You see patito i": perhaps 🇦🇲 |
02:59:52 | FromDiscord | <Rainbow Asteroids> I think I'm somewhere in the milky way. they don't exactly have google maps in space |
03:00:07 | FromDiscord | <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:43 | FromDiscord | <Rainbow Asteroids> oh no. beef is bri ish and canadian at the same time |
03:01:05 | FromDiscord | <Elegantbeef> I cant be british i dont drink tea |
03:02:00 | FromDiscord | <Rika> In reply to @Rainbow Asteroids "oh no. beef is": could be worse |
03:02:03 | FromDiscord | <!Patitotective> 🇵🇪 in my english canada its spelled peru |
03:02:23 | FromDiscord | <Rainbow Asteroids> now that's just plain confusing |
03:02:31 | FromDiscord | <Elegantbeef> No maple leaf so that's just discount Canuckistan |
03:02:35 | FromDiscord | <Rainbow Asteroids> like Arkansas |
03:02:47 | FromDiscord | <!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:12 | FromDiscord | <Elegantbeef> If your tea is just hot water i think you missed a very important ingredient |
03:03:17 | FromDiscord | <Rainbow Asteroids> what masochistic doesn't drink sweetened tea |
03:03:22 | FromDiscord | <Rika> In reply to @Elegantbeef "If your tea is": LMFAO |
03:03:23 | FromDiscord | <Elegantbeef> The brits |
03:03:26 | FromDiscord | <!Patitotective> In reply to @Rainbow Asteroids "what masochistic doesn't drink": tongue |
03:03:33 | FromDiscord | <Rika> i-i dont sweeten my tea |
03:03:33 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "If your tea is": tongue |
03:03:47 | FromDiscord | <Elegantbeef> Patito are you ok? |
03:03:49 | FromDiscord | <Rika> In reply to @Patitotective "tongue": stop making me laugh my goodness |
03:04:47 | FromDiscord | <!Patitotective> i mean, my tongue is not very good at tasting stuff so tea and hot water are too similar |
03:05:07 | FromDiscord | <Elegantbeef> You know your tongue isnt located where you poop from right? |
03:05:28 | FromDiscord | <!Patitotective> plus heat makes pain taste |
03:05:32 | FromDiscord | <Rainbow Asteroids> as a red white and blue blooded American, we drink our tea cold |
03:05:43 | FromDiscord | <Rainbow Asteroids> if at all |
03:05:47 | FromDiscord | <!Patitotective> In reply to @Rainbow Asteroids "as a red white": tf is a blue blooded american? |
03:05:59 | FromDiscord | <Rainbow Asteroids> red white and blue |
03:06:02 | FromDiscord | <Elegantbeef> If you have blue blood i think you're dead↵(@Rainbow Asteroids) |
03:06:28 | FromDiscord | <Rainbow Asteroids> lmao |
03:07:29 | FromDiscord | <Rika> this nim conversation is very interesting |
03:07:47 | FromDiscord | <Rainbow Asteroids> umm don't worry, we'll loop back around |
03:07:48 | FromDiscord | <!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:11 | FromDiscord | <Elegantbeef> So uhh anyone got a Nim question? |
03:08:21 | FromDiscord | <Rika> whats nim |
03:08:27 | FromDiscord | <Rainbow Asteroids> how do i print text |
03:08:40 | FromDiscord | <Elegantbeef> You need some printer drivers |
03:08:44 | FromDiscord | <Elegantbeef> So get cups |
03:09:01 | FromDiscord | <Rainbow Asteroids> ok, will glass ones do? |
03:09:13 | FromDiscord | <Rainbow Asteroids> or do I need plastic ones |
03:09:44 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=48EA |
03:09:49 | FromDiscord | <Rika> how many cups do we need |
03:10:06 | FromDiscord | <Rika> and why does a printer need someone to drive it |
03:10:07 | FromDiscord | <Elegantbeef> The printer drivers guys |
03:10:15 | FromDiscord | <Rainbow Asteroids> oh |
03:10:24 | FromDiscord | <Rainbow Asteroids> ill get an uber then |
03:11:05 | FromDiscord | <Rainbow Asteroids> where does the uber need to drive the printer to? |
03:12:49 | FromDiscord | <Rika> damn this is hard |
03:12:52 | FromDiscord | <huantian> beef when are you rewriting cups in nim |
03:13:06 | FromDiscord | <Elegantbeef> I cant even write a Wasm VM in Nim |
03:13:06 | FromDiscord | <!Patitotective> In reply to @Rainbow Asteroids "where does the uber": we need people to send ther ips, please |
03:13:15 | FromDiscord | <Rika> whats an ips |
03:13:38 | FromDiscord | <Elegantbeef> Internet provider services |
03:13:45 | FromDiscord | <!Patitotective> lma |
03:13:45 | FromDiscord | <!Patitotective> o |
03:13:53 | FromDiscord | <Rainbow Asteroids> ok, my IP is 10.10.63.199 |
03:14:04 | FromDiscord | <Elegantbeef> Mine is 127.0.0.1 dont hack me please |
03:14:14 | FromDiscord | <Shiba> time to launch kali from my old thinkpad |
03:14:18 | FromDiscord | <huantian> mine is db66:70cf:fc99:c256:78a9:1434:ae3f:eada |
03:14:28 | FromDiscord | <Rainbow Asteroids> how old is your think pad? |
03:14:33 | FromDiscord | <Rika> is thinkpad what people call a notebook nowadays |
03:14:36 | FromDiscord | <Rainbow Asteroids> (edit) "think pad?" => "thinkpad?" |
03:14:51 | FromDiscord | <Rainbow Asteroids> i dont know how to respond to that question |
03:14:52 | FromDiscord | <!Patitotective> In reply to @Rainbow Asteroids "ok, my IP is": why are you close to me? |
03:15:05 | FromDiscord | <Rainbow Asteroids> wdym? |
03:15:26 | FromDiscord | <!Patitotective> nvm |
03:15:37 | FromDiscord | <Rainbow Asteroids> that's a LAN ip anyhow |
03:15:37 | FromDiscord | <!Patitotective> pasted wrong |
03:16:01 | FromDiscord | <!Patitotective> https://media.discordapp.net/attachments/371759389889003532/1012561024014094466/unknown.png |
03:16:11 | FromDiscord | <Rainbow Asteroids> lawsuit when |
03:16:46 | FromDiscord | <Shiba> In reply to @Rainbow Asteroids "how old is your": its thick , thats how you know |
03:16:50 | FromDiscord | <Shiba> thickpad |
03:16:53 | FromDiscord | <Rainbow Asteroids> lol |
03:17:16 | FromDiscord | <Rainbow Asteroids> what model? i have a t460p |
03:20:22 | FromDiscord | <Shiba> its not mine , so i didn't bother what model |
03:20:52 | FromDiscord | <Shiba> but i think its from 2008 cause its got "pentium inside" |
03:21:00 | FromDiscord | <Rainbow Asteroids> jesus |
03:23:35 | FromDiscord | <Rainbow Asteroids> geekbench your thinkpad vs RPI version 1 |
03:25:55 | FromDiscord | <!Patitotective> 🌃 |
03:43:19 | FromDiscord | <Girvo> Is there any downside to mixing async with threadpool-based threads? (desktop, not embedded here) |
03:44:20 | FromDiscord | <Rika> complexity |
03:44:36 | FromDiscord | <Elegantbeef> As long as the async is done on the thread that created the future it's fine |
03:44:36 | FromDiscord | <Elegantbeef> Generally |
03:45:23 | FromDiscord | <ravinder387> In reply to @Rika "complexity": why u like nim |
03:45:49 | FromDiscord | <Rika> i like the syntax |
03:45:52 | FromDiscord | <ravinder387> r u web, game, app developer |
03:46:01 | FromDiscord | <ravinder387> where u use |
03:46:02 | FromDiscord | <Rika> and the flexibility |
03:46:09 | FromDiscord | <Rika> backend/embedded |
03:46:26 | FromDiscord | <ravinder387> r u maintainer of discord |
03:47:26 | FromDiscord | <ravinder387> i like simple syntax to do one thing write one syntax. |
03:47:57 | FromDiscord | <Rika> discord? |
03:47:59 | FromDiscord | <ravinder387> but nim compile to c,c++,js i think it need some flexibilty |
03:48:09 | FromDiscord | <Rika> In reply to @ravinder387 "i like simple syntax": then you're using the wrong language |
03:48:43 | FromDiscord | <ravinder387> my language don't exist |
03:48:52 | FromDiscord | <Rika> go? |
03:49:05 | FromDiscord | <Elegantbeef> Swift |
03:49:08 | FromDiscord | <ravinder387> if u leanr c++ to create variable u hv 5 syntax |
03:49:56 | FromDiscord | <ravinder387> r u owner of nim discord |
03:50:09 | FromDiscord | <Elegantbeef> Rika is tom from myspace |
03:50:20 | FromDiscord | <ravinder387> ohh i see |
03:50:28 | FromDiscord | <ravinder387> i didn't know that |
03:50:47 | FromDiscord | <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:19 | FromDiscord | <Shiba> do you think there some stuff from the nim lib |
04:14:27 | FromDiscord | <Shiba> that i compile and never use |
04:14:57 | FromDiscord | <Rika> wtf |
04:16:10 | FromDiscord | <Shiba> (edit) "i compile and" => "gets compiled but" | "use" => "used" |
04:18:21 | FromDiscord | <Shiba> nvm , iam just obsessed with compilation speed |
04:18:34 | FromDiscord | <Shiba> (edit) removed ", iam just obsessed with compilation speed" |
04:22:14 | * | hermaes joined #nim |
04:22:19 | hermaes | hey |
04:22:24 | hermaes | anyone here? |
04:24:46 | FromDiscord | <Rika> hello |
04:27:59 | FromDiscord | <ravinder387> `<button type="button" onclick="hello()">Click Me!</button>` |
04:28:15 | FromDiscord | <ravinder387> `proc hello() {. importc .} =↵ document.write("hello world")` |
04:28:18 | FromDiscord | <ravinder387> not working |
04:28:39 | FromDiscord | <ravinder387> when i open index.html hello function not defined |
04:29:59 | FromDiscord | <ravinder387> I'm using nim since 1 day I run docs code.. it gives error |
04:30:22 | FromDiscord | <ravinder387> i didn;t even start my own code |
04:30:37 | FromDiscord | <ravinder387> is docs fully tested |
04:32:34 | FromDiscord | <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:06 | FromDiscord | <Girvo> For Testament, does the `tests` folder go in `src`? How do other people structure their packages for these sorts of things |
05:01:07 | FromDiscord | <flywind> Imo, put the `tests` directory at the top level of the projects. |
05:03:58 | FromDiscord | <Girvo> Makes sense to me 🙂 |
05:04:15 | FromDiscord | <Girvo> I always hated Jest's `tests` folder inside every other folder lol |
05:07:49 | FromDiscord | <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:00 | hermaes | im just getting into nim, anyone know a good project to start with? |
05:23:30 | FromDiscord | <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:35 | FromDiscord | <ravinder387> it working |
05:42:35 | FromDiscord | <Girvo> Testament or unittest? Or unittest2? Or something else lol |
06:15:50 | FromDiscord | <Girvo> Probably just use testament for now |
06:22:51 | * | kenran joined #nim |
06:46:43 | FromDiscord | <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:14 | FromDiscord | <Elegantbeef> Status uses it for their network stack |
06:47:16 | FromDiscord | <Elegantbeef> So it's likely to work |
06:55:36 | FromDiscord | <Bung> In reply to @Require Support "anyone try out chronos": you might be interested in https://github.com/bung87/scorper |
06:56:40 | FromDiscord | <Bung> https://github.com/bung87/scorper/blob/devel/src/scorper/http/streamclient.nim the client part |
06:58:19 | FromDiscord | <Require Support> nice ill check it out |
07:08:12 | FromDiscord | <ricky> In reply to @Require Support "anyone try out chronos": it's sick |
07:08:38 | FromDiscord | <Rika> Damn hope it gets well soon |
07:08:39 | FromDiscord | <ricky> i use it for my `fully static stack` |
07:27:35 | FromDiscord | <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:51 | FromDiscord | <Elegantbeef> "Just found it" i linked it to you like 5 times now |
07:30:29 | FromDiscord | <Girvo> '_ |
07:30:32 | FromDiscord | <Girvo> 😉 |
07:30:49 | FromDiscord | <Girvo> Was supposed to say "just found out" but eh I'll own it haha |
07:31:40 | FromDiscord | <Elegantbeef> But yea girvo Cmake is cursed |
07:32:01 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=48Fg |
07:32:02 | FromDiscord | <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:38 | FromDiscord | <ezquerra> How comes that the gdb.exe that is installed with nim does not support python scripting? |
08:16:43 | FromDiscord | <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:05 | FromDiscord | <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:33 | FromDiscord | <voidwalker> can templates be used with the proc.template() notation ? |
08:35:44 | FromDiscord | <voidwalker> (edit) "notation" => "syntax" |
08:41:38 | FromDiscord | <Rika> With newer versions of Nim I believe the restrictions have been relaxed |
08:41:44 | FromDiscord | <Rika> But it’s not too clear to me |
08:42:34 | FromDiscord | <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:38 | FromDiscord | <voidwalker> trying to put a timer echo to several procs with timeit packages, without writing code for it in each one. |
08:44:41 | FromDiscord | <voidwalker> https://github.com/ringabout/timeit/blob/master/src/timeitpkg/main.nim#L173 |
08:45:50 | FromDiscord | <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:27 | FromDiscord | <Rika> Okay never mind |
08:49:28 | FromDiscord | <Rika> It’s still a limitation https://nim-lang.org/docs/manual.html#templates-limitations-of-the-method-call-syntax |
08:53:33 | FromDiscord | <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:00 | FromDiscord | <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:59 | FromDiscord | <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:28 | FromDiscord | <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:31 | FromDiscord | <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:36 | FromDiscord | <dom96> I wonder how much work a bearssl patch to the stdlib would be |
10:07:04 | FromDiscord | <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:37 | FromDiscord | <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:24 | FromDiscord | <Tanguy> In reply to @dom96 "do you have a": https://github.com/status-im/nim-chronos/pull/243 |
10:12:34 | FromDiscord | <Tanguy> sent a code paste, see https://play.nim-lang.org/#ix=48FW |
10:15:57 | FromDiscord | <dom96> I can't remember, does arc detect cycles at compile-time or only at runtime? |
10:16:29 | FromDiscord | <Tanguy> It doesn't detect cycles afaik, they just leak |
10:17:36 | FromDiscord | <dom96> ahh, so in what way does your test case fail under stdlib async? |
10:17:41 | FromDiscord | <dom96> does it just leak memory? |
10:17:47 | FromDiscord | <Tanguy> Yup, it OOM |
10:18:02 | FromDiscord | <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:29 | NimEventer | New thread by NameUndefined: Using return in templates returns nil, see https://forum.nim-lang.org/t/9410 |
11:02:06 | FromDiscord | <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:40 | FromDiscord | <aruZeta> i mean, wth https://media.discordapp.net/attachments/371759389889003532/1012678712313008228/unknown.png |
11:06:48 | FromDiscord | <Prestige> Which part do you not understand? |
11:07:37 | FromDiscord | <aruZeta> all the ecc stuff |
11:08:18 | FromDiscord | <aruZeta> i'm looking at a qr library made in C and im grasping a bit of how i can do it |
11:10:02 | FromDiscord | <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:35 | FromDiscord | <auxym> maybe find some good implementation in C and translate it 1:1 to Nim with some tests? |
11:18:46 | FromDiscord | <auxym> I saw Galois Fields in that link and noped out |
11:19:31 | FromDiscord | <aruZeta> yh, galois fields |
11:20:44 | FromDiscord | <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:08 | FromDiscord | <aruZeta> (edit) "100011101," => "100011101 (285)," |
11:21:53 | FromDiscord | <aruZeta> although hmmm I think i can make a workaround |
11:28:01 | FromDiscord | <aruZeta> i could use a log-antilog lookup table with the values already calculated too |
11:35:23 | FromDiscord | <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:07 | FromDiscord | <Forest> Hm could the Nim compiler in it's current state, be compiled to JS? |
12:00:19 | FromDiscord | <Forest> Doubt it, but i wanna know why can't it, if that's the case |
12:04:27 | FromDiscord | <sealmove> In reply to @Forest "Doubt it, but i": Well the JS backend supports a limited set of Nim features. |
12:05:34 | FromDiscord | <sealmove> sent a code paste, see https://play.nim-lang.org/#ix=48GB |
12:05:42 | FromDiscord | <sealmove> (edit) "https://play.nim-lang.org/#ix=48GB" => "https://play.nim-lang.org/#ix=48GC" |
12:05:52 | FromDiscord | <Forest> In reply to @รєคɭ๓๏שє "Well the JS backend": Ah |
12:06:09 | FromDiscord | <Forest> sent a code paste, see https://play.nim-lang.org/#ix=48GD |
12:06:46 | FromDiscord | <Rika> I mean, it depends on what you want in the string… |
12:07:17 | FromDiscord | <Forest> sent a code paste, see https://play.nim-lang.org/#ix=48GF |
12:12:07 | FromDiscord | <mratsim> In reply to @aruZeta "all the ecc stuff": If you manage to do that, we have a job proposal for you |
12:12:22 | FromDiscord | <mratsim> In reply to @auxym "I saw Galois Fields": same ^ |
12:13:12 | FromDiscord | <sealmove> sent a code paste, see https://play.nim-lang.org/#ix=48GJ |
12:13:19 | FromDiscord | <sealmove> some cast maybe? |
12:13:54 | FromDiscord | <sealmove> of course I want a string of length `len` that starts from `pntr` |
12:14:45 | FromDiscord | <mratsim> sent a long message, see http://ix.io/48GK |
12:14:50 | FromDiscord | <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:43 | FromDiscord | <Forest> In reply to @รєคɭ๓๏שє "yes but... I am": You'd have to implement that yourself by handling the data accordingly |
12:18:55 | FromDiscord | <Forest> So like, you can make it return len as a string maybe? |
12:19:16 | FromDiscord | <Forest> I think for accessing pointers it's `myObj.pntr[]`? |
12:19:24 | FromDiscord | <Forest> Not sure tho, haven't used pointers myself |
12:19:24 | FromDiscord | <sealmove> I am interested in how to use the pointer to access the bytes and create a string out of them |
12:22:52 | FromDiscord | <mratsim> In reply to @รєคɭ๓๏שє "I am interested in": don't use pointers on JS |
12:23:21 | FromDiscord | <sealmove> it's not JS |
12:23:26 | FromDiscord | <sealmove> it's C FFI |
12:23:34 | FromDiscord | <Rika> I think you’re mixing so conversations |
12:23:35 | FromDiscord | <sealmove> sent a code paste, see https://play.nim-lang.org/#ix=48GO |
12:23:37 | FromDiscord | <Rika> Teo |
12:23:42 | FromDiscord | <Rika> Two***** |
12:23:45 | FromDiscord | <mratsim> when defined(js): stuffThatDoesn'tUsePointers else: stuffThatCanUsePointers |
12:23:49 | FromDiscord | <sealmove> sent a code paste, see https://play.nim-lang.org/#ix=48GP |
12:24:01 | FromDiscord | <sealmove> In reply to @mratsim "when defined(js): stuffThatDoesn'tUsePointers else:": won't be used in JS in any case ;) |
12:24:02 | FromDiscord | <Rika> One******* |
12:24:04 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=48GQ |
12:24:11 | FromDiscord | <sealmove> why not |
12:24:20 | FromDiscord | <Rika> Just set the length directly |
12:24:22 | FromDiscord | <mratsim> sent a code paste, see https://paste.rs/3g1 |
12:24:23 | FromDiscord | <Rika> Since you’re doing that anyway |
12:25:08 | FromDiscord | <mratsim> In reply to @รєคɭ๓๏שє "it's C FFI": https://github.com/status-im/nim-http-utils/pull/9/files#diff-e79eea07fdbc061a2f883b340f8ff4e505f9b75d322ee1148b1c1075c9bf02baR546-R552 |
12:27:22 | FromDiscord | <aruZeta> In reply to @mratsim "<@882793909246369864> <@736144909160939571> , Error": hmm |
12:30:00 | FromDiscord | <sealmove> In reply to @mratsim "https://github.com/status-im/nim-http-utils/pull/9/": this is not in stdlibs right? |
12:32:40 | FromDiscord | <mratsim> In reply to @รєคɭ๓๏שє "this is not in": no. well maybe the stdlib has something similar nowadays, I don't know |
12:32:50 | FromDiscord | <sealmove> okok thank u |
12:35:35 | * | derpydoo joined #nim |
12:42:47 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=48GZ |
12:43:25 | FromDiscord | <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:41 | FromDiscord | <Phil> (edit) "binary" => "binary. This is for an application using webgui" |
12:44:59 | FromDiscord | <Phil> The idea is to read in the files in there with `staticRead` later so I definitely want them to be compileTime |
12:45:24 | FromDiscord | <enthus1ast> maybe walkDirRec works |
12:45:31 | FromDiscord | <enthus1ast> it complains about glob |
12:45:49 | FromDiscord | <enthus1ast> this is the default linux patter think\: foo.\ |
12:45:57 | FromDiscord | <enthus1ast> or walkDir |
12:46:20 | FromDiscord | <enthus1ast> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1012704419772649523): this is the default linux patter thing\: foo.\ |
12:46:44 | FromDiscord | <Phil> Yeah but `walkDir` gives you directories, not filepaths for JS/CSS files in a folder |
12:47:12 | FromDiscord | <enthus1ast> walkDirRect can set a yieldFilter |
12:47:22 | FromDiscord | <enthus1ast> so you can define what should be yielded |
12:47:24 | FromDiscord | <enthus1ast> files or dirs |
12:47:34 | FromDiscord | <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:15 | FromDiscord | <enthus1ast> hook like in what? |
12:48:33 | FromDiscord | <enthus1ast> like haxxor api hooking? ↵or callback? |
12:50:02 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=48H3 |
12:50:52 | FromDiscord | <enthus1ast> imho it does not support Ü |
12:50:52 | FromDiscord | <enthus1ast> ● |
12:50:54 | FromDiscord | <enthus1ast> ... |
12:50:57 | FromDiscord | <enthus1ast> ● |
12:51:16 | FromDiscord | <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:07 | FromDiscord | <sealmove> sent a code paste, see https://play.nim-lang.org/#ix=48H4 |
12:52:20 | FromDiscord | <sealmove> (edit) "https://play.nim-lang.org/#ix=48H4" => "https://play.nim-lang.org/#ix=48H5" |
12:53:36 | FromDiscord | <Phil> walkPattern is another way of going through the file-system but it too is stuck on being only for runtime |
12:54:15 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=48H7 |
12:57:44 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=48Ha |
12:58:23 | FromDiscord | <Phil> To say it in german: That kinda feels like "von hinten durch die Brust ins Auge" |
12:58:32 | FromDiscord | <enthus1ast> ach garnet |
12:58:34 | FromDiscord | <Phil> Though it does avoid the the glob call which isn't possible at runtime |
12:58:41 | FromDiscord | <Phil> (edit) "runtime" => "compieltime" |
12:59:28 | FromDiscord | <enthus1ast> imho its not too bad, since you have good control over what path you wanna add |
13:01:42 | FromDiscord | <sealmove> sent a code paste, see https://play.nim-lang.org/#ix=48He |
13:02:01 | FromDiscord | <sealmove> (edit) "https://play.nim-lang.org/#ix=48He" => "https://play.nim-lang.org/#ix=48Hf" |
13:02:28 | FromDiscord | <sealmove> Hmm I guess the macro will generate such code? |
13:02:41 | FromDiscord | <enthus1ast> what does the hook do? |
13:02:44 | FromDiscord | <enthus1ast> so |
13:02:55 | FromDiscord | <enthus1ast> does it encapsulates the original one? |
13:03:01 | FromDiscord | <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:01 | FromDiscord | <sealmove> yeah it probably just generates the proc call and pass in a callback |
13:03:05 | FromDiscord | <enthus1ast> or is it called instead |
13:03:34 | FromDiscord | <enthus1ast> huh this is on compiletime? Since a const↵(@Phil) |
13:03:35 | * | averell quit (Quit: .) |
13:04:01 | FromDiscord | <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:11 | FromDiscord | <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:43 | FromDiscord | <Phil> Hah! Wait! It worked! |
13:06:14 | FromDiscord | <Phil> sent a code paste, see https://paste.rs/uag |
13:08:20 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=48Hk |
13:08:58 | FromDiscord | <Phil> What? Too fast? I'm a turtle ma dude! |
13:09:04 | FromDiscord | <enthus1ast> ^^ |
13:09:35 | FromDiscord | <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:59 | FromDiscord | <sealmove> it's annoying that there is no `HttpRequest` type in `std/httpclient` |
13:10:23 | FromDiscord | <Phil> Sounds like a matter of writing your own type, and a proc that eats that type and fires a request |
13:10:48 | FromDiscord | <sealmove> yes but why is there not one in stdlib? |
13:11:11 | FromDiscord | <Phil> That is a really good question and my first assumption would be to reduce the amount of code in the lib |
13:11:27 | FromDiscord | <sealmove> it hinders flexibility |
13:11:39 | FromDiscord | <Phil> Its simpler to only have to deal with the immediate firing and let the user extend from that as needed |
13:11:49 | FromDiscord | <sealmove> hmm ok |
13:11:51 | FromDiscord | <Phil> Particularly if you don't have a massive team of maintainers |
13:12:38 | FromDiscord | <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:55 | FromDiscord | <dom96> I don't recall the exact reason why I implemented it this way |
13:13:20 | FromDiscord | <dom96> but having to create a HttpRequest every time I want to send a request seems painful |
13:13:53 | FromDiscord | <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:59 | FromDiscord | <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:15 | FromDiscord | <dom96> headers and things are stored in the HttpClient instance |
13:15:23 | FromDiscord | <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:26 | FromDiscord | <Forest> Is the Nim compiler able to compile itself to C++ and Objective C? |
13:20:06 | FromDiscord | <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:58 | FromDiscord | <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:42 | FromDiscord | <sealmove> It could be a dsl now that I think about... |
13:23:31 | FromDiscord | <sealmove> but i'll start with something simpler |
13:24:04 | FromDiscord | <dom96> huh, you're building a framework to do CGI-like request processing in wasi/wasm? |
13:25:34 | FromDiscord | <sealmove> yes! |
13:25:47 | FromDiscord | <sealmove> an sdk to an existing framework, called Spin (by Fermyon) |
13:25:57 | FromDiscord | <dom96> cool! |
13:28:09 | FromDiscord | <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:45 | FromDiscord | <sealmove> You can track progress in this PR https://github.com/fermyon/spin/pull/716 |
13:30:26 | FromDiscord | <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:52 | FromDiscord | <sealmove> cool! :o |
13:31:55 | FromDiscord | <sealmove> I think wrapping wit-bindgen does the trick, it's pretty easy |
13:32:51 | FromDiscord | <sealmove> ah and of course you need the correct compiler switches which I copied from ElegantBeef's project |
13:33:28 | FromDiscord | <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:35 | FromDiscord | <dom96> Have you seen https://blog.cloudflare.com/announcing-wasi-on-workers/? |
13:35:08 | FromDiscord | <sealmove> No, I should read up on it |
13:35:31 | FromDiscord | <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:16 | FromDiscord | <dom96> at least have a flick through what's possible |
13:40:32 | FromDiscord | <sealmove> a framework where you can write each endpoint-handler in a different language :D on-demand execution (no always-running containers) |
13:40:43 | FromDiscord | <sealmove> is there more to it? |
13:41:12 | FromDiscord | <sealmove> have you seen finicky whiskers? https://www.finickywhiskers.com/index.html |
13:43:07 | FromDiscord | <dom96> nope, the name is cute but I don't get the game |
13:45:41 | FromDiscord | <sealmove> not sure about the name either :D but cute demo |
13:46:23 | FromDiscord | <aruZeta> if both `-d:release` and `-d:danger` are specified, which is used? |
13:46:33 | FromDiscord | <aruZeta> ig `-d:danger`? |
13:53:59 | FromDiscord | <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:38 | FromDiscord | <aruZeta> phil is in a self-answered-so-questions streak |
13:55:24 | FromDiscord | <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:27 | FromDiscord | <aruZeta> is or has? i'm doubting how this is phrased |
13:55:46 | NimEventer | New 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:49 | FromDiscord | <aruZeta> (edit) "is ... or" added "in" |
13:56:01 | FromDiscord | <aruZeta> lol |
13:56:05 | FromDiscord | <aruZeta> talking about questions |
13:56:22 | FromDiscord | <aruZeta> (edit) "questions" => "your question" |
13:56:48 | FromDiscord | <Phil> I'll likely throw in another question later about how to set up a pipeline between any frontend framework and webgui |
13:56:48 | FromDiscord | <sealmove> sent a code paste, see https://play.nim-lang.org/#ix=48HG |
13:56:56 | FromDiscord | <Phil> "Later" being some time this weekend |
13:56:57 | FromDiscord | <aruZeta> xd |
13:57:14 | FromDiscord | <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:38 | FromDiscord | <aruZeta> it will increase by 10!!! |
13:57:42 | FromDiscord | <aruZeta> (but in binary) |
13:57:47 | FromDiscord | <Phil> I wish that were the case!↵There's over 500 questions and I'm only responsible for 15 of them! |
13:58:01 | FromDiscord | <Phil> A man can only do so much by himself |
14:00:34 | FromDiscord | <Nalmyth> Is there some library to wrap a synchronous blocking call to an async call? |
14:01:08 | FromDiscord | <dom96> good question |
14:01:13 | FromDiscord | <dom96> There is a PR to make that possible |
14:01:19 | FromDiscord | <dom96> in the stdlib |
14:01:38 | FromDiscord | <dom96> but for now best you can do is `spawn` a thread and poll its FlowVar |
14:01:48 | FromDiscord | <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:52 | FromDiscord | <flywind> https://media.discordapp.net/attachments/371759389889003532/1012723555865206854/image0.png |
14:02:10 | FromDiscord | <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:21 | FromDiscord | <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:33 | FromDiscord | <Nalmyth> In reply to @dom96 "Like I do here": Oh wow so easy? |
14:03:47 | FromDiscord | <Nalmyth> That will include the return type also |
14:04:05 | FromDiscord | <flywind> In reply to @Isofruit "I wish that were": One hundred more so questions, Nim will surpass the Crystal language 😜 |
14:04:16 | FromDiscord | <Phil> Well I better get to it then |
14:04:29 | FromDiscord | <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:33 | FromDiscord | <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:26 | NimEventer | New 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:14 | FromDiscord | <Nalmyth> In reply to @dom96 "It's a bit of": Also what's the meaning of that `^` in your code? |
14:07:38 | FromDiscord | <dom96> https://nim-lang.org/docs/threadpool.html#%5E%2CFlowVar%5BT%5D |
14:08:07 | FromDiscord | <Nalmyth> Ah I see in the docs |
14:08:16 | FromDiscord | <Nalmyth> https://media.discordapp.net/attachments/371759389889003532/1012725168134701066/Screenshot_2022-08-26_at_18.08.10.png |
14:08:18 | FromDiscord | <dom96> this really shouldn't be an operator lol |
14:09:03 | FromDiscord | <Nalmyth> Seems to be the same as `unsafeRead` |
14:09:04 | FromDiscord | <Nalmyth> I can use that |
14:09:38 | FromDiscord | <Nalmyth> Hmm but returns a ptr |
14:09:46 | FromDiscord | <dom96> yeah, I wouldn't use it |
14:13:45 | FromDiscord | <dom96> https://github.com/nim-lang/Nim/pull/12372 |
14:13:59 | FromDiscord | <dom96> I could have sworn I rebased this. But I don't see my branch |
14:15:21 | FromDiscord | <dom96> oh yes, I did https://github.com/dom96/Nim/tree/virtual-async-events-resurrected-fixes |
14:16:48 | FromDiscord | <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:05 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=48HW |
14:18:27 | FromDiscord | <Phil> Anyone have a eureka idea of removing all script-tags and link-tags from an HTML file at compile-time? |
14:19:23 | FromDiscord | <flywind> const doesn't support refs. |
14:19:58 | FromDiscord | <Phil> So parsing is straight out of the question then since that's implemented via refs |
14:20:23 | FromDiscord | <flywind> No, there is a workaround using templates. secs |
14:20:55 | FromDiscord | <dom96> In reply to @Isofruit "Anyone have a eureka": `staticExec("nim c -r myAppThatTransformsHtmlAtRuntime")` :D |
14:21:13 | FromDiscord | <Phil> But dom! |
14:21:17 | FromDiscord | <Phil> That's too easy! |
14:21:40 | FromDiscord | <dom96> ahh, so it's a challenge you're after |
14:21:42 | FromDiscord | <Phil> ~~Also means I'd need a second project to be able to do the first at which point gnaaa~~ |
14:21:48 | FromDiscord | <dom96> write that app in Haskell and then `staticExec` it |
14:21:54 | FromDiscord | <Phil> Not quite, it's more that it doesn't "feel" beautiful |
14:22:09 | FromDiscord | <dom96> hehe, I know that feeling |
14:22:19 | FromDiscord | <Phil> Gut feeling says this is all part of a single task thus it should stay together |
14:22:36 | FromDiscord | <dom96> often that feeling is just a waste of time |
14:22:53 | FromDiscord | <dom96> be pragmatic and do what works unless there is an objective reason why it's problematic |
14:23:01 | FromDiscord | <Phil> So far my experience actually has been that it often leads to cleaner code in the long run |
14:23:31 | FromDiscord | <Phil> AND is a nice learning moment where you get to familiarize yourself with some quirk of the given language |
14:24:18 | FromDiscord | <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:56 | FromDiscord | <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:31 | FromDiscord | <aruZeta> In reply to @dom96 "often that feeling is": like the whole "spend 8h atomating something you can do in 5mins"? |
14:26:23 | FromDiscord | <dom96> In reply to @aruZeta "like the whole "spend": yep yep yep |
14:26:34 | FromDiscord | <aruZeta> funny cuz that's so me to de |
14:26:35 | FromDiscord | <aruZeta> (edit) "de" => "do" |
14:26:59 | FromDiscord | <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:05 | FromDiscord | <flywind> In reply to @Isofruit "So parsing is straight": Using `let xml {.compileTime.} = html.parseHtml()` probably works. |
14:27:20 | FromDiscord | <aruZeta> that could work |
14:28:04 | FromDiscord | <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:12 | FromDiscord | <dom96> the only downside then is compilation speed |
14:28:13 | FromDiscord | <flywind> sent a code paste, see https://play.nim-lang.org/#ix=48I5 |
14:28:29 | FromDiscord | <aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=48I7 |
14:28:40 | FromDiscord | <dom96> (it could even try to run the code at compile-time and only fall back to Nim if that fails) |
14:29:59 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=48I8 |
14:30:43 | FromDiscord | <Phil> I might just fall back to what dom suggested and make a tiny helper binary |
14:31:17 | FromDiscord | <flywind> It is strange. It works for my case: |
14:31:28 | FromDiscord | <flywind> https://media.discordapp.net/attachments/371759389889003532/1012731004710047905/unknown.png |
14:32:06 | FromDiscord | <dom96> nim version differences? |
14:32:29 | FromDiscord | <Phil> devel, 1.7.1, last updated like 2 weeks ago |
14:32:49 | FromDiscord | <flywind> works on 1.6.6 and devel too |
14:32:58 | FromDiscord | <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:57 | FromDiscord | <@bracketmaster-5a708063d73408ce4> has anybody tried parsing c files in nim? |
14:36:32 | FromDiscord | <dom96> yes, I did it using clang's parser to build https://picheta.me/obfuscator |
14:39:15 | FromDiscord | <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:37 | FromDiscord | <Phil> I am somewhat saddened the xmlNodes don't contain a proc to delete themselves =/ |
14:42:36 | FromDiscord | <Phil> Like, in JS I could just go `htmlElement.parentElement.removeChild(index)`.↵I'm not seeing a similar parent thingy |
14:47:56 | FromDiscord | <Bung> can you assign to nil ? |
15:05:40 | FromDiscord | <sealmove> how do I get a `ptr uint8` from a `string`? |
15:11:12 | FromDiscord | <flywind> !eval var s ="123"; echo cast[ptr uint8](s[0])[] |
15:11:15 | NimBot | Traceback (most recent call last)↵/usercode/in.nim(1) in↵SIGSEGV: Illegal storage access. (Attempt to read from nil?)↵Segmentation fault (core dumped) |
15:11:31 | FromDiscord | <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:14 | FromDiscord | <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:41 | FromDiscord | <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:35 | FromDiscord | <aruZeta> but galois fields kind of remind me of finite groups |
15:19:44 | FromDiscord | <aruZeta> (edit) "but galois fields kind of remind me of finite groups ... " added "in group theory" |
15:20:20 | FromDiscord | <aruZeta> where when you reach the last element you return to neutral element |
15:20:44 | FromDiscord | <aruZeta> (being in GF(256) the last element 255 and the neutral one 0) |
15:24:16 | FromDiscord | <Phil> Okay, that's it, I'm dumping the approach of parsing the HTML and just use a damn regex |
15:24:26 | FromDiscord | <aruZeta> no phil no |
15:24:38 | FromDiscord | <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:43 | FromDiscord | <aruZeta> are you gonna parse it with regex? |
15:24:48 | FromDiscord | <aruZeta> or just search the string |
15:25:00 | FromDiscord | <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:06 | FromDiscord | <Phil> Search and destroy the string |
15:25:13 | FromDiscord | <auxym> In reply to @Isofruit "Okay, that's it, I'm": inb4 the stack overflow chtulu cursed text post |
15:25:24 | FromDiscord | <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:30 | FromDiscord | <aruZeta> would like to learn more math |
15:25:49 | FromDiscord | <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:53 | FromDiscord | <Nalmyth> sent a code paste, see https://play.nim-lang.org/#ix=48IR |
15:25:56 | FromDiscord | <Nalmyth> What causes `locks: <unknown>`? |
15:26:13 | FromDiscord | <Nalmyth> (edit) "https://play.nim-lang.org/#ix=48IR" => "https://play.nim-lang.org/#ix=48IS" |
15:26:39 | FromDiscord | <Nalmyth> (edit) "https://play.nim-lang.org/#ix=48IS" => "https://play.nim-lang.org/#ix=48IT" |
15:26:46 | FromDiscord | <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:08 | FromDiscord | <aruZeta> regex + html is cursed |
15:28:11 | FromDiscord | <aruZeta> https://media.discordapp.net/attachments/371759389889003532/1012745278253711400/unknown.png |
15:28:48 | FromDiscord | <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:58 | FromDiscord | <Bung> you can just use system.delete delete a element in seq |
15:34:08 | FromDiscord | <Phil> and that deletes it from the XML tree and not just my ref? |
15:34:22 | FromDiscord | <Phil> Since I'd be having a ref of that node |
15:35:45 | FromDiscord | <sealmove> hmm how to use header pragma with relative path? |
15:36:27 | FromDiscord | <Phil> Of flipping course re does not support doing anything at compiletime |
15:36:40 | FromDiscord | <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:43 | FromDiscord | <Phil> At least it works though |
15:37:21 | FromDiscord | <Phil> I do not necessarily know where the node is.↵I do not intend to hard-code the entire index.html structure |
15:37:32 | FromDiscord | <Phil> I found the nodes originally using `findAll` |
15:39:10 | FromDiscord | <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:11 | FromDiscord | <Nalmyth> sent a code paste, see https://play.nim-lang.org/#ix=48J3 |
16:00:40 | FromDiscord | <Phil> @dom96 Your approach of loading a secondary nim file is what I used in the end |
16:00:49 | FromDiscord | <aruZeta> hah |
16:01:05 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=48J7 |
16:01:10 | FromDiscord | <Phil> Combined with regex that replaces html |
16:01:16 | FromDiscord | <Phil> 😛 |
16:02:07 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=48J7" => "https://play.nim-lang.org/#ix=48J8" |
16:02:25 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=48J8" => "https://play.nim-lang.org/#ix=48Ja" |
16:05:33 | FromDiscord | <hotdog> @Phil https://play.nim-lang.org/#ix=48Jc |
16:05:35 | FromDiscord | <hotdog> 🙂 |
16:06:52 | FromDiscord | <Phil> a way of doing this, but at this point too much work for what I want to achieve |
16:07:04 | FromDiscord | <domosokrat> @Phil\: Are any of the `\` in your regex's needed? |
16:07:19 | FromDiscord | <Phil> At this point I escape anything that isn't ASCII on reflex |
16:07:38 | FromDiscord | <Phil> (edit) "ASCII" => "a basic letter" |
16:08:30 | FromDiscord | <aruZeta> unless yer using vim's search and replace, where `\(\)` is a save group but `\[\]` matches normal `[]` |
16:08:49 | FromDiscord | <domosokrat> this can bite you. There are regex engines where `\<`and `\>` match at word start / word end |
16:09:17 | FromDiscord | <aruZeta> yh |
16:09:48 | FromDiscord | <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:17 | FromDiscord | <domosokrat> They match at string start / end |
16:10:19 | FromDiscord | <aruZeta> In reply to @aruZeta "unless yer using vim's": now im not sure of this one |
16:10:31 | FromDiscord | <aruZeta> at least in my emacs evil mode it works like this |
16:10:49 | * | CyberTailor quit (Quit: Konversation terminated!) |
16:11:12 | FromDiscord | <aruZeta> In reply to @Isofruit "wtf, that is not": now go search how emacs lisp regex are written 😆 |
16:11:14 | FromDiscord | <domosokrat> `\<and\>` would match "and" but not "wand" or "andy" |
16:11:29 | * | CyberTailor joined #nim |
16:11:36 | FromDiscord | <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:46 | FromDiscord | <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:26 | FromDiscord | <Rainbow Asteroids> MSB has a special meaning? |
16:23:39 | FromDiscord | <auxym> most significant bit? |
16:25:03 | FromDiscord | <aruZeta> most likely |
16:26:09 | * | xet7 joined #nim |
16:26:52 | FromDiscord | <Generic> modulo/division by a constant integer isn't that expensive |
16:27:24 | FromDiscord | <Generic> the compiler will optimise it into a long multiply which is still far faster than an arbitrary division |
16:28:42 | FromDiscord | <aruZeta> yh |
16:41:50 | FromDiscord | <gibson> @Bung does crowngui only compile under nim 1.1.1? |
16:47:12 | FromDiscord | <Forest> Highly doubt it but is there a Nim library for constructing code for programming languages? |
16:47:42 | FromDiscord | <auxym> like, parsing? there's a few libraries for that |
16:48:23 | FromDiscord | <auxym> there's also the langdev channel here for this stuff |
16:51:47 | FromDiscord | <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:34 | FromDiscord | <gibson> Oh I didn't try that - will try that. Thanks. |
16:55:58 | * | hermaes quit (Ping timeout: 268 seconds) |
16:57:10 | FromDiscord | <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:31 | FromDiscord | <gibson> Oh dang, it requires gtk installed on the user computer? Hmm. |
16:58:09 | FromDiscord | <gibson> @dom96 were you imagining a more wizard-like windows installer experience than this? https://github.com/ThomasTJdev/choosenim_gui |
17:03:56 | FromDiscord | <EyeCon> In reply to @Olfactory Hallucinations "Cool. Too bad it": That's a good find, thanks! |
17:05:37 | NimEventer | New Nimble package! bitcoinlightning - Bitcoin Lightning client, see https://github.com/juancarlospaco/bitcoin-lightning |
17:05:47 | FromDiscord | <Bung> In reply to @gibson "<@714152700920594493> does crowngui only": use webgui instread, crowngui only complete macos part |
17:06:31 | FromDiscord | <aruZeta> In reply to @NimEventer "New Nimble package! bitcoinlightning": wha?, juancarlospaco is like 3 names in spanish, 2 at max LOL |
17:07:12 | FromDiscord | <aruZeta> never seen anyone with 3 names |
17:07:37 | FromDiscord | <aruZeta> (edit) "spanish, 2 at max LOL" => "spanish" |
17:08:04 | FromDiscord | <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:57 | FromDiscord | <aruZeta> i mean, if he has 3 names, it would amount to 5 adding the 2 surnames |
17:09:51 | FromDiscord | <aruZeta> 2 names is not that uncommon, but 3? lol |
17:11:10 | FromDiscord | <Phil> That dude is like treeform |
17:11:19 | FromDiscord | <Phil> Except he's not in chat |
17:11:30 | FromDiscord | <aruZeta> lol |
17:11:35 | FromDiscord | <treeform> In reply to @ravinder387 "when will v2.0 nim": It's already here with the right flags 🙂 |
17:11:36 | FromDiscord | <aruZeta> talking abt treeform |
17:13:22 | FromDiscord | <treeform> In reply to @Isofruit "That dude is like": He has more than 3 names like I do? |
17:13:55 | FromDiscord | <aruZeta> lol |
17:14:26 | FromDiscord | <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:58 | FromDiscord | <aruZeta> yh he is called juan_carlos |
17:15:07 | FromDiscord | <aruZeta> where the paco tho |
17:15:34 | FromDiscord | <gibson> -> offtopic? |
17:16:03 | * | jkl joined #nim |
17:17:58 | * | CyberTailor quit (Quit: Konversation terminated!) |
17:18:33 | * | CyberTailor joined #nim |
17:21:49 | FromDiscord | <Matrix Administrator> https://pornro.live/ - filme porno romania |
17:21:58 | FromDiscord | <aruZeta> <@&371760044473319454> ? |
17:24:46 | FromDiscord | <Forest> In reply to @auxym "like, parsing? there's a": No, construction |
17:24:59 | FromDiscord | <Forest> I need to generate code that can be ran/compiled by other languages |
17:25:07 | FromDiscord | <Forest> Like i want to generate Java source files |
17:25:13 | FromDiscord | <Forest> (example) |
17:25:52 | FromDiscord | <Matrix Administrator> sent a long message, see http://ix.io/48JH |
17:26:20 | FromDiscord | <aruZeta> <@&371760044473319454> here too |
17:27:22 | * | vicecea quit (Remote host closed the connection) |
17:28:00 | FromDiscord | <aruZeta> In reply to @Forest "Like i want to": that's a lot of work |
17:28:24 | FromDiscord | <aruZeta> but it would be rly cool |
17:28:26 | FromDiscord | <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:56 | FromDiscord | <Forest> By generation i mean by me providing information such as names and it generating the final file |
17:30:40 | FromDiscord | <Forest> May make a framework for this myself, since doubt it exists, and if it does, not in pure nik |
17:30:44 | FromDiscord | <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:26 | FromDiscord | <SouperZ> is odev possible in nim? |
17:44:01 | * | CyberTailor quit (Remote host closed the connection) |
17:44:24 | FromDiscord | <Phil> Odev? |
17:44:29 | FromDiscord | <SouperZ> osdev |
17:45:50 | * | CyberTailor joined #nim |
17:46:29 | FromDiscord | <Forest> Oh yeah definitely |
17:46:31 | FromDiscord | <aruZeta> In reply to @SouperZ "osdev": https://github.com/dom96/nimkernel |
17:46:49 | FromDiscord | <SouperZ> In reply to @aruZeta "https://github.com/dom96/nimkernel": i saw that, im currently making my own osdev template |
17:47:20 | FromDiscord | <SouperZ> with a better bootloader |
17:47:42 | FromDiscord | <aruZeta> nice |
17:49:09 | FromDiscord | <Rainbow Asteroids> #embedded |
17:54:44 | FromDiscord | <dom96> In reply to @gibson "<@132595483838251008> were you imagining": this is too complex for my taste |
17:56:01 | FromDiscord | <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:29 | FromDiscord | <dom96> yep |
17:56:52 | FromDiscord | <dom96> the more Windows-native it looks, the better |
17:57:01 | FromDiscord | <gibson> agreed |
17:57:02 | FromDiscord | <dom96> are you planning to work on one? |
17:57:46 | FromDiscord | <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:16 | FromDiscord | <dom96> awesome |
17:59:17 | FromDiscord | <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:53 | FromDiscord | <dom96> the only complex part should be the UI |
18:00:05 | FromDiscord | <dom96> (but even that shouldn't be that difficult) |
18:00:06 | FromDiscord | <gibson> Yeah, I'm making the underlying thing a bit more general, but yes that's the ultimate goal: very simple. |
18:01:21 | FromDiscord | <aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=48JS |
18:02:02 | FromDiscord | <aruZeta> (edit) "https://play.nim-lang.org/#ix=48JS" => "https://play.nim-lang.org/#ix=48JU" |
18:02:52 | FromDiscord | <aruZeta> im rewriting something from c to nim |
18:02:54 | FromDiscord | <gibson> @aruZeta looks like yes, if param1 is destination, param2 is source. |
18:03:11 | FromDiscord | <aruZeta> yep I get that |
18:03:18 | FromDiscord | <aruZeta> it was more of the third param |
18:03:32 | FromDiscord | <aruZeta> (edit) "param" => "param, which I was guessing was the total length - 1" |
18:03:51 | FromDiscord | <gibson> You'll have to check what `resultLen` actually is. |
18:03:55 | FromDiscord | <aruZeta> is there some proc in std to do the same |
18:04:09 | FromDiscord | <aruZeta> In reply to @gibson "You'll have to check": it's the len the result array so ye |
18:04:16 | FromDiscord | <aruZeta> (edit) "In reply to @gibson "You'll have to check": it's the len ... the" added "of" |
18:04:50 | FromDiscord | <aruZeta> i found https://nim-lang.org/docs/system.html#moveMem%2Cpointer%2Cpointer%2CNatural but it's unsafe hmm |
18:05:53 | FromDiscord | <aruZeta> (im doing this in a seq btw) |
18:06:52 | FromDiscord | <aruZeta> else I could just use delete |
18:07:23 | FromDiscord | <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:36 | FromDiscord | <aruZeta> (edit) "delete" => "deleting" | removed "it" |
18:09:17 | FromDiscord | <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:52 | FromDiscord | <SouperZ> can i create a array? without any limits |
18:10:10 | FromDiscord | <aruZeta> i think delete might be better, since I don't need the last elem (it will be set to 0) |
18:10:47 | FromDiscord | <gibson> @SouperZ I think you're only limited to the size of what you can allocate on the stack. |
18:11:49 | FromDiscord | <gibson> @aruZeta In that case, and if you don't care about order, you can use `del` . |
18:13:09 | FromDiscord | <aruZeta> i need to keep the order, |
18:13:11 | FromDiscord | <aruZeta> (edit) "order," => "order" |
18:13:22 | FromDiscord | <aruZeta> so ig delete is the best option |
18:14:09 | FromDiscord | <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:36 | FromDiscord | <gibson> @aruZeta yeah, that's good. If performance is a concern you can always optimize later and write the unsafe memmove version. |
18:16:48 | FromDiscord | <aruZeta> yep |
18:26:00 | FromDiscord | <auxym> In reply to @Forest "I need to generate": oh so a compiler backed, of sorts. ask in langdev maybe |
18:26:19 | FromDiscord | <auxym> (edit) "backed," => "backend," |
18:27:08 | FromDiscord | <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:59 | FromDiscord | <planetis> How libraries are supposed to make use of .since for stdlib additions, I have totally forgoten. |
18:30:48 | FromDiscord | <gibson> @planetis I don't think there is a `{.since.}` pragma... |
18:31:36 | FromDiscord | <planetis> sure there is https://nim-lang.org/docs/since.html |
18:33:22 | FromDiscord | <planetis> its `when (NimMajor, NimMinor, NimPatch) >= (1, 7, 1):` redefine the stdlib proc |
18:34:42 | FromDiscord | <gibson> Neat! |
18:34:54 | FromDiscord | <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:21 | FromDiscord | <Forest> If i pass a custom object to a function, can it modify it? |
20:01:00 | FromDiscord | <Forest> And should it be a ref object? Is it better to do `MyRefType = ref MyType` or `MyType = ref object`? |
20:01:06 | FromDiscord | <Rainbow Asteroids> `proc foo (x: var T)` |
20:01:15 | FromDiscord | <Forest> Ah thanks! |
20:02:07 | FromDiscord | <!Patitotective> memory safe ;] |
20:03:22 | FromDiscord | <Forest> Should i also do `var Type` for defining mutable fields in an object? |
20:04:07 | FromDiscord | <Elegantbeef> No |
20:04:24 | FromDiscord | <Elegantbeef> Nim does not track mutability on a field basis |
20:05:51 | FromDiscord | <Elegantbeef> If the object is declared as `var` it's fields are mutable, if it's declared as `let` it's not |
20:10:34 | FromDiscord | <Forest> Ah okay, good to know! |
20:10:38 | * | CyberTailor quit (Quit: Konversation terminated!) |
20:11:12 | * | CyberTailor joined #nim |
20:14:02 | FromDiscord | <JSONBash> do people actually use DELETE requests for delete actions in a REST api? Or just use POST? |
20:18:18 | FromDiscord | <Forest> In reply to @JSONBash "do people actually use": Discord does DELETE so ig? |
20:18:34 | FromDiscord | <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:17 | qwr | JSONBash: its pretty common to use DELETE, where it often gets funny and suprising is POST/PUT/PATCH distinction |
20:39:54 | qwr | Forest: 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:46 | FromDiscord | <Forest> In reply to @qwr "<@909883978717204561>: i've written quite": Hm alright |
20:44:52 | * | kenran quit (Quit: WeeChat info:version) |
20:45:45 | FromDiscord | <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:37 | qwr | Forest: kind-of - there ref types (objects) and value types (primitives) |
20:46:40 | FromDiscord | <Rainbow Asteroids> In reply to @Forest "Hm, does Java even": primitives are on the stack, everything is on the heap iirc |
20:46:47 | FromDiscord | <Forest> Ah okay |
20:50:02 | qwr | where 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:41 | qwr | nim on the other hand is explicit and consistent here with the ref and var keywords |
21:14:40 | FromDiscord | <Forest> Aah. |
21:14:46 | FromDiscord | <Forest> Hm, how would i solve that... |
21:14:54 | FromDiscord | <Forest> Ig a ton of getter and setter functions |
21:15:00 | FromDiscord | <Forest> Thaaaaat won't be fun to implement lmao |
21:15:10 | FromDiscord | <!Patitotective> https://github.com/ayman-albaz/etters |
21:16:11 | FromDiscord | <Forest> Probably not gonna be helpful to me |
21:16:17 | FromDiscord | <Forest> Maybe? But eh |
21:19:04 | qwr | if you need them, let macros generate them (btw, etters looks like such macro/templates) |
21:20:03 | FromDiscord | <Forest> Yeah |
21:20:19 | FromDiscord | <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:27 | FromDiscord | <!Patitotective> what? |
21:23:19 | FromDiscord | <aruZeta> In reply to @Forest "Ig a ton of": that's how you explain java in a few words |
21:23:27 | FromDiscord | <aruZeta> even better "it's all boilerplate" |
21:26:45 | qwr | Forest: usually exporting the fields* directly would be enough... |
21:26:46 | FromDiscord | <huantian> I wonder if `field=` with an `{.error.}` works to disable setting |
21:27:34 | FromDiscord | <aruZeta> In reply to @qwr "<@909883978717204561>: usually exporting the": and you will have encapsulation police on your back |
21:28:33 | qwr | encapsulation only because of encapsulation with exposing the same thing directly via accessors is usually nonsense |
21:29:06 | FromDiscord | <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:07 | qwr | such encapsulation sometimes makes sense on stable library interfaces |
21:29:24 | FromDiscord | <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:30 | FromDiscord | <Forest> I can handle it on the backend probably |
21:30:52 | qwr | Forest: ok, then yeah (the java world is unfortunaly a strange cult) |
21:31:18 | FromDiscord | <Forest> Yuppp |
21:31:40 | FromDiscord | <Forest> But making a way for Nim, a non-JVM language to work in a JVM world would be epic |
21:31:41 | FromDiscord | <aruZeta> In reply to @qwr "<@909883978717204561>: ok, then yeah": oh yes it is |
21:32:07 | FromDiscord | <aruZeta> so sad when summer ends i will have to write Java again :( |
21:32:24 | FromDiscord | <aruZeta> In reply to @Forest "But making a way": if that happens I will adore you |
21:32:28 | FromDiscord | <Forest> And the thing is it'll feel so amazing compared to most JVM languages ngl |
21:33:04 | FromDiscord | <aruZeta> I have not written clojure, but as a LISP enjoyer it sure has to be a lot better than java |
21:33:20 | FromDiscord | <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:37 | FromDiscord | <aruZeta> yep, alot of work |
21:34:16 | FromDiscord | <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:48 | FromDiscord | <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:28 | FromDiscord | <aruZeta> if you can pull it off |
21:35:37 | FromDiscord | <aruZeta> nim would get some more popularity ig |
21:35:59 | FromDiscord | <aruZeta> a language which can transpile to some others |
21:40:18 | FromDiscord | <Forest> In reply to @aruZeta "a language which can": Tbf Nim can already do C, C++, Objective C and JS |
21:40:38 | qwr | btw, if you were really lazy, then there are javascript implentations running on JVM... |
21:41:20 | FromDiscord | <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:44 | qwr | also, there is JNI |
21:41:47 | FromDiscord | <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:53 | FromDiscord | <Forest> In reply to @qwr "also, there is JNI": Slow when doing many calls |
21:42:03 | FromDiscord | <Forest> I want to make a Minecraft mod in Nim, imagine how crazy that'd be |
21:42:59 | qwr | ok, you're going for the hacking fun :) |
21:43:09 | FromDiscord | <!Patitotective> In reply to @Forest "Tbf Nim can already": nim doesnt transpile ;] https://peterme.net/is-nim-a-transpiler.html |
21:44:00 | FromDiscord | <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:43 | FromDiscord | <!Patitotective> In reply to @Forest "I'd imagine my thing": i dont know what you're going to do :p |
21:49:20 | FromDiscord | <aruZeta> am I perhaps ... dreaming? https://media.discordapp.net/attachments/371759389889003532/1012841198030966834/unknown.png |
21:49:26 | FromDiscord | <aruZeta> it fcking works |
21:49:55 | FromDiscord | <Rainbow Asteroids> `Hello world!` |
21:49:59 | FromDiscord | <aruZeta> oh boy |
21:50:07 | FromDiscord | <Forest> In reply to @qwr "once wrote JVM language": Fair |
21:51:00 | FromDiscord | <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:08 | FromDiscord | <Forest> (and also other languages later down the road) |
21:51:27 | FromDiscord | <Forest> @!Patitotective (ping) |
21:51:33 | FromDiscord | <Rainbow Asteroids> pong |
21:51:44 | FromDiscord | <aruZeta> man the ec codewords were the most difficult part |
21:52:00 | FromDiscord | <!Patitotective> In reply to @Forest "<@762008715162419261> (ping)": double ping |
21:52:03 | FromDiscord | <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:17 | FromDiscord | <!Patitotective> In reply to @Forest "Serialising all of the": you mean the ast? |
21:52:24 | FromDiscord | <Forest> For me, my issue will mainly be carrying Nim semantics over to Java |
21:52:24 | FromDiscord | <aruZeta> if it was not for nayuki's qr lib it would have taken me waaaaay longe |
21:52:25 | FromDiscord | <aruZeta> (edit) "longe" => "longer" |
21:52:28 | FromDiscord | <Forest> In reply to @Patitotective "you mean the ast?": Yep |
21:53:07 | FromDiscord | <aruZeta> the worst part might be carrying custom made operators |
21:53:43 | FromDiscord | <aruZeta> although well, they can be named in a obfuscated way when put in java code |
21:54:11 | FromDiscord | <aruZeta> ie: `>` named to `ltOperator` |
21:54:36 | qwr | Lua 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:25 | FromDiscord | <Forest> In reply to @aruZeta "the worst part might": I can just change them to functions tbh |
21:57:40 | FromDiscord | <Forest> In reply to @qwr "Lua is in some": I'm implementing code generation completely by myself so i actually understand it |
21:58:33 | FromDiscord | <Forest> Hold on, I'll get the repo for code serialisation (it's non-working right now) |
22:02:57 | FromDiscord | <Forest> https://github.com/Mythical-Forest-Collective/Nim2IR |
22:04:30 | FromDiscord | <Forest> (For anyone wondering about the excessive use of `we`, we are a system since we have OSDD) |
22:06:06 | FromDiscord | <dom96> Gotta love a readme that tells its readers "fuck you" |
22:06:29 | FromDiscord | <dom96> why so vulgar? lol |
22:07:18 | FromDiscord | <Rika> You know I think it would be prolly be better to translate LLVM IR into these languages instead |
22:07:42 | FromDiscord | <Forest> In reply to @dom96 "why so vulgar? lol": Blame another sysmate |
22:08:01 | FromDiscord | <Forest> In reply to @Rika "You know I think": We do not understand LLVM IR soooooo |
22:08:27 | FromDiscord | <Rika> What makes you think your own custom IR would be any easier to do than that? I’m not too sure… |
22:08:30 | FromDiscord | <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:46 | FromDiscord | <Rika> I guess |
22:08:51 | FromDiscord | <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:34 | FromDiscord | <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:17 | FromDiscord | <EyeCon> In reply to @aruZeta "it fcking works": Go you! Is it online somewhere? |
23:41:06 | * | sagax joined #nim |