<< 03-03-2021 >>

00:01:11giacothank!
00:01:13giacos!
00:01:56*rockcavera quit (Read error: Connection reset by peer)
00:02:27*rockcavera joined #nim
00:06:40*xet7 joined #nim
00:15:53*spiderstew quit (Ping timeout: 245 seconds)
00:16:03*spiderstew joined #nim
00:16:48*antranigv quit (Ping timeout: 245 seconds)
00:17:26*antranigv joined #nim
00:18:30*nxnl[m] quit (Ping timeout: 244 seconds)
00:19:26*alex[m]28 quit (Ping timeout: 240 seconds)
00:19:27*vycb[m] quit (Ping timeout: 240 seconds)
00:19:32*retroedgetech[m] quit (Ping timeout: 244 seconds)
00:19:35*romes[m] quit (Ping timeout: 240 seconds)
00:19:42*Clonkk[m] quit (Ping timeout: 258 seconds)
00:21:44*nxnl[m] joined #nim
00:22:40*vycb[m] joined #nim
00:22:40*alex[m]28 joined #nim
00:23:32*retroedgetech[m] joined #nim
00:27:33*j-james[m] joined #nim
00:28:20*Clonkk[m] joined #nim
00:28:57*romes[m] joined #nim
00:43:44giacofew days ago I read about a std proc/template used to turn an inplace proc into a return value one. It was into a discussion about adding all "*ed" function to std for each inplace version, but I can't remember the name of it or where is it
00:45:02FromDiscord<konsumlamm> `sugar.dup`
00:45:08FromDiscord<konsumlamm> it's a macro actually
00:45:36FromDiscord<konsumlamm> https://nim-lang.github.io/Nim/sugar.html#dup.m%2CT%2Cvarargs%5Buntyped%5D
00:46:20giacothanks!
00:50:32giacoI have set of chars and I want to remove from a string all chars inside the set. I could do mystr.filterIt(it notin myset).join, but I think multiReplace would be a better choice. How can I create the proper input for multireplace starting from my char set?
00:52:01giacowhat's the proper way to turn my set into something I can use as "replacements" for -> proc multiReplace(s: string; replacements: varargs[(string, string)]): string
00:54:39FromDiscord<Yardanico> if you want to use multiReplace, you can do something like that I guess
00:54:46FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2Ru0
00:56:22FromDiscord<Yardanico> `const` ensures that `replacements` gets created at compile-time so that you don't spend runtime time doing `mapIt`
00:56:53FromDiscord<Yardanico> basically mapIt to create a tuple where the first element is char converted to string and second one is an empty string
00:57:24*teasea quit (Quit: Ping timeout (120 seconds))
00:57:48*teasea joined #nim
00:59:05FromDiscord<Yardanico> @giaco ^
00:59:16giacoyeah! I was trying to use the wrong tool to map the set into a tuple list. Thanks. Which one would you use: the filterIt at runtime, or the multiReplace?
01:00:02*lkjasdf quit (Quit: WeeChat 3.0.1)
01:00:46FromDiscord<Yardanico> i personally would've used multiReplace I guess
01:01:13FromDiscord<Yardanico> I just benchmarked and filterIt is slower than multiReplace, but not by much
01:01:27FromDiscord<Yardanico> but those benchmarks depend on a lot of stuff
01:01:51FromDiscord<Yardanico> in most cases you don't have to optimize the code to the brim, so stuff like that is ok
01:02:04FromDiscord<Yardanico> you might also be interested in https://github.com/zero-functional/zero-functional
01:03:54FromDiscord<Yardanico> or also https://nim-lang.org/docs/sugar.html#collect.m%2Cuntyped%2Cuntyped
01:08:40giacothis is a silver bullet to solve multi loop procedures into single one! I've been using stuff like this in python and C#, didn't know they were already available in nim. Thanks!
01:08:41FromDiscord<Yardanico> yeah, nim had somewhat pythonish list comprehensions before, but they didn't work well
01:08:41FromDiscord<Yardanico> back when the sugar module was named "future" :P
01:08:41FromDiscord<Yardanico> https://nim-lang.org/0.18.0/future.html
01:08:45FromDiscord<Yardanico> compared to `lc`, `collect` fits "nim style" much better
01:13:31giacois collect optimizing loops like zero-functional? I've learned a bit of clojure months ago, I really like functional style, but yet achieved almost zero productivity out of it. Is it worth using collect and zero-functional in nim, or is just "sugar"?
01:14:20FromDiscord<Yardanico> It's certainly worth using zero-functional over sequtils when you chain a lot of sequtils calls like mapIt filterIt etc
01:17:22FromDiscord<Yardanico> of course you can also refactor those sequtils calls into a collect call
01:17:39*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
01:17:58*njoseph joined #nim
01:19:03FromDiscord<Yardanico> collect is just a thin macro over actual for loops
01:19:06FromDiscord<Yardanico> it doesn't do much "magic"
01:21:38giacoso natural progression would be sequtils -> collect -> zero-functional
01:21:53FromDiscord<Yardanico> I'd say you could always just start with collect :P
01:23:56giacothanks!
01:25:14*ee7[m] joined #nim
01:51:31FromDiscord<konsumlamm> many things are "just sugar", but that doesn't mean they're not worth using
01:53:09giacokonsumlamm sure, but intention was about to discriminate a more performant solution to a one just more idiomatic. There's no doubt about that the fact that it is worth preferring it in both cases.
01:55:18giacoif I want to reuse a string inside a for loop, is it correct to use "mystr.delete(mystr.low, mystr.high)" considering the fact that I don't know the length of the next string in advance?
01:58:35FromDiscord<Yardanico> Use setLen instead
01:59:23FromDiscord<Yardanico> https://nim-lang.org/docs/system.html#setLen%2Cstring%2CNatural
01:59:29FromDiscord<Yardanico> mystr.setLen(0)
01:59:53FromDiscord<Yardanico> And it's okay if you don't know the length of the next string
02:04:08giacosetLen! I somehow missed it while skimming the docs. Thanks!
02:04:47FromDiscord<Yardanico> It might not be obvious that it doesn't deallocate I guess
02:09:05FromDiscord<Yardanico> You might be interested in http://ssalewski.de/nimprogramming.html
02:09:32FromDiscord<Yardanico> It covers a lot of topics in more depth
02:13:20giacoYardanico: I'm already on it after "nim in action", but I dediced to stop for a while to write some real code before continuing
02:14:37giacois there a function to get the number of digits of an integer without converting it to string?
02:17:36giacoI'm writing it myself, but I think all the parse functions must be doing it internally
02:24:55*asdflkj quit (Ping timeout: 240 seconds)
02:28:15*lritter quit (Ping timeout: 240 seconds)
02:28:18*sz0_ joined #nim
02:29:16*lritter joined #nim
02:29:58*unclechu quit (*.net *.split)
02:29:59*sz0 quit (*.net *.split)
02:30:02*sz0_ is now known as sz0
02:31:56giaconevermind, I wrote mine
02:33:18*unclechu joined #nim
02:42:56giacowell this is actually better, didn't know this trick "1234567.toFloat.log10.ceil.toInt"
02:52:06*abm quit (Read error: Connection reset by peer)
02:55:11*quantimnot quit (Quit: Connection closed)
02:56:15*lritter quit (Quit: Leaving)
02:59:02*lmariscal joined #nim
03:07:18FromDiscord<exelotl> Hehe nice
03:10:28*lmariscal quit (Quit: q)
03:15:18FromDiscord<hamidb80> hey
03:17:33FromDiscord<hamidb80> `Error: 'sleep' proc is not available on the NimScript/js target`
03:17:48FromDiscord<hamidb80> (edit) "`Error: 'sleep' proc is not available on the NimScript/js target` ... " added "πŸ˜•"
03:18:34FromDiscord<Yardanico> Are you trying to use `sleep` with JS?
03:18:51FromDiscord<hamidb80> In reply to @Yardanico "Are you trying to": i wanna use nimscript
03:18:56FromDiscord<hamidb80> (edit) "In reply to @Yardanico "Are you trying to": i wanna use ... nimscript" added "it with"
03:19:06FromDiscord<Yardanico> Well, as the error says, `sleep` is not available in NimScript :P
03:23:34*rockcavera quit (Remote host closed the connection)
03:25:50*muffindrake quit (Ping timeout: 264 seconds)
03:27:19*muffindrake joined #nim
03:43:34FromDiscord<hamidb80> sent a code paste, see https://play.nim-lang.org/#ix=2Rvi
03:43:47FromDiscord<hamidb80> ` Error: 'export' is only allowed at top level11`
03:44:00FromDiscord<hamidb80> (edit) "level11`" => "level` :: proc wsChannel_reader() ..."
03:45:56FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2Rvj
03:46:07FromDiscord<Yardanico> You can't implement pragmas only with templates like that (unless for some purpose), generally you'd use macros to implement them
03:46:57FromDiscord<hamidb80> In reply to @Yardanico "Are you sure you": i don't know - i just did like that https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers#decorators
03:47:52FromDiscord<hamidb80> oh
03:48:18FromDiscord<Yardanico> The code shown in that example will call the code from the template _outside_ the proc
03:48:36FromDiscord<Yardanico> the `body` you get in the template if it's a pragma is the whole proc, not just its body
03:48:46FromDiscord<hamidb80> i get it, tnx
03:51:58FromDiscord<Yardanico> You can do it with a macro like this:
03:52:21FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2Rvk
03:52:28FromDiscord<Yardanico> But don't forget - order of pragma declaration can matter
03:52:57FromDiscord<Yardanico> In this case, if you put the `async` pragma before `asyncLoop` the code won't compile, because `async` is the macro that understands all the "await" statements and later transforms them
03:53:20FromDiscord<Yardanico> (edit) "declaration" => "declarations"
03:53:42FromDiscord<flywind> Do we have some performance tutorial like this? https://crystal-lang.org/reference/guides/performance.html
03:55:12FromDiscord<Yardanico> I don't think so
03:55:40FromDiscord<flywind> Ok, thanks
03:56:49saemI think someone wrote a blog post, I think it related to lessons they learned writing a ray tracer in nim
03:57:42saemThis: https://blog.johnnovak.net/2017/04/22/nim-performance-tuning-for-the-uninitiated/
03:57:43FromDiscord<flywind> I will make one, then I hope beginners won't ask why Nim is much slower than Python(`-d:danger`) πŸ™‚
03:58:04FromDiscord<flywind> And this one https://github.com/nim-lang/RFCs/issues/188
03:58:04saemAlso there is the but at the end of the compiler manual
03:58:04FromDiscord<Yardanico> Yes but it's quite specific and already 4 years old :)
03:58:24FromDiscord<Yardanico> I mean the tuning article
04:04:10*WilhelmVonWeiner quit (Ping timeout: 276 seconds)
04:04:29*NimBot joined #nim
04:15:42*WilhelmVonWeiner joined #nim
04:16:05*WilhelmVonWeiner is now known as Guest20418
04:25:50*spiderstew_ joined #nim
04:26:55*spiderstew quit (Ping timeout: 240 seconds)
04:41:05FromDiscord<hamidb80> `tuple[InteractableTerminal, proc(l: string)]`
04:41:14FromDiscord<hamidb80> Error: ':' or '=' expected, but got 'keyword proc'
04:42:47FromDiscord<ElegantBeef> `tuple[]` is for named tuples, you need to provide a name for each field there
04:43:15FromDiscord<ElegantBeef> If you want an anonymous tuple you'd just do `(InteractableTerminal, proc(l: string))`
04:44:11FromDiscord<ElegantBeef> https://nim-lang.org/docs/manual.html#types-tuples-and-object-types
04:45:59FromDiscord<hamidb80> i wish there a macro to extract `proc`s arguments type
04:46:37FromDiscord<hamidb80> `createThread` would be so easier
04:46:50FromDiscord<ElegantBeef> I mean it's not overly complex to do
04:46:57FromDiscord<Rika> There are but the api is messy IMO
05:06:58*sz0 quit (Quit: Connection closed for inactivity)
05:16:10FromGitter<gogolxdong> Is it Nim suitable for smart contract language?
05:32:30*narimiran joined #nim
05:41:38FromDiscord<Hi02Hi> I'm not an expert, but I have heard smart contracts in the context of cryprocurrency, and https://github.com/status-im is an Ethereum client that uses Nim
05:44:13FromGitter<gogolxdong> yes, https://github.com/status-im/nimbus-eth1 https://github.com/status-im/nimbus-eth2 can interact with Ethereum.
05:45:51FromGitter<gogolxdong> They seek blockchain interoperability.
05:51:39FromDiscord<gogolxdong> People want blockchain interoperability.
05:57:45*vicfred quit (Quit: Leaving)
06:08:13*haxscramper joined #nim
06:12:34ForumUpdaterBotNew thread by Halloleo: Yeay! Finally I udnerstand how to write a "Makefile" in Nim!, see https://forum.nim-lang.org/t/7575
06:34:36ForumUpdaterBotNew thread by Dponyatov: Relative "based/biased" long pointers and data structures over it, see https://forum.nim-lang.org/t/7576
07:05:11*krux02 joined #nim
07:16:40ForumUpdaterBotNew thread by Halloleo: How to have the generated executables in a bin directory out of the way when using testament, see https://forum.nim-lang.org/t/7577
07:20:15*waleee-cl quit (Quit: Connection closed for inactivity)
07:33:11*kenran joined #nim
07:35:42*wasted_youth2 quit (Quit: Leaving)
07:38:08*letto quit (Quit: Konversation terminated!)
07:40:22*letto joined #nim
08:02:29*^Q-Master^ joined #nim
08:04:34*Q-Master quit (Ping timeout: 260 seconds)
08:15:37*PMunch joined #nim
08:48:24FromDiscord<Larry&10K> I'm not an expert, but I have heard smart contracts in the context of cryprocurrency, and https://github.com/status-im is an Ethereum client that (partially) uses Nim
09:34:30PMunchHmm, I think I should finally replace my poor parser with npeg in protobuf..
09:37:59FromDiscord<GreenFork> is there an efficient CSV writer in Nim? I only see parser
09:41:11FromDiscord<mratsim> CSV is really easy to write.
09:41:32FromDiscord<mratsim> I doubt you can even make it efficient.
09:41:56FromDiscord<mratsim> you'll be bottlenecked by disk
09:43:31FromDiscord<GreenFork> okay, thanks
09:45:44PMunchI mean the rules for CSV and escaping are a bit iffy
09:45:52PMunchBut apart from that it's pretty trivial
09:48:22FromDiscord<mratsim> Time format is the most iffy thing
09:48:50FromDiscord<mratsim> and encoding. Because Excel can't open UTF-8 CSV without jumping through hops.
09:49:00PMunchEh, time format isn't part of CSV
09:49:10*JustASlacker joined #nim
09:49:11PMunchWait, really?
09:49:40FromDiscord<Rika> if i'm copying something from the nim repo, do i have to put the exact text of copying.txt as the license of the repo/file, or only the MIT part (incl ar_q's name)?
09:50:47FromDiscord<flywind> the license name + author name putting in the front of codes I think.
10:15:45*sz0 joined #nim
10:21:10krux02recently somebody posted a link to a website similar to the programming language benchmark game, but with the difference to actually include languages (like Nim)
10:21:16krux02do you recall the name?
10:22:08krux02I would like to reference that in favor of the old website as it is to exclusive for my taste to serve a meaningful purpose.
10:26:42PMunchSomeone was sharing code-golf stuff the other day, if that's what you are talking about?
10:43:56krux02not talking about short programs, I mean performance.
11:27:34*JustASlacker quit (Quit: Leaving)
11:27:47*JustASlacker joined #nim
11:28:17*Vladar joined #nim
11:29:25*qwertfisch quit (Read error: Connection reset by peer)
11:31:30*qwertfisch joined #nim
11:42:27FromDiscord<mratsim> kostya?
12:08:33FromDiscord<Rika> is `=destroy` not supposed to call on signal?
12:09:59*asdflkj joined #nim
12:12:30*romes[m] left #nim ("User left")
12:14:56FromDiscord<Clyybber> nim doesn't do much for signals out of the box
12:14:58FromDiscord<Clyybber> https://nim-lang.github.io/Nim/nimc#signal-handling-in-nim
12:18:34*rockcavera joined #nim
12:31:21FromDiscord<Rika> nim's std/openssl wrapper is incomplete?
12:31:41FromDiscord<flywind> yeah
12:56:13PMunchIt's pretty annoying..
12:56:25PMunchIt seems people have just added the bits and pieces they needed
12:56:41PMunchBut to be fair that's exactly what I did when I noticed it was missing some things I needed..
13:00:22FromDiscord<Rika> https://github.com/genotrance/nimssl is confusing to use...
13:07:16FromDiscord<Rika> ah basepath is wrong...
13:09:11JustASlackercan nimssl work with x509 files @Rika?
13:10:09JustASlackerdoesnt look its doint much
13:11:07FromDiscord<Rika> it wraps basically all of openssl so
13:11:14FromDiscord<mratsim> It exposes the whole OpenSSL but you have to ask genotrance to generate the corresponding doc API because you can find it from the Nim code
13:11:22FromDiscord<mratsim> genotrance/shashlick
13:11:38FromDiscord<Rika> nimterop is failing to understand bio.h and i dont understand why
13:11:40FromDiscord<mratsim> which is my main grip with nimterop wrappers
13:11:41FromDiscord<Yardanico> Can someone make a new nimble package so it gets merged and we'll see if the bot will post an update? :D
13:11:51FromDiscord<mratsim> leftpad?
13:13:52FromDiscord<Rika> https://github.com/openssl/openssl/blob/OpenSSL_1_1_1/include/openssl/bio.h#L97 this line produces this in nimterop it seems (ignore the fucked highlighting) https://media.discordapp.net/attachments/371759389889003532/816659639978557470/unknown.png
13:15:31JustASlackersounds funky
13:16:49JustASlackerand crazy
13:18:04FromDiscord<Rika> `/home/deodex/.cache/nim/nimterop/toastCache/nimterop_3227009606.nim(9, 19) Error: redefinition of 'std_time_t'; previous declaration here: /home/deodex/.choosenim/toolchains/nim-1.0.10/lib/std/time_t.nim(1, 2)`
13:18:05FromDiscord<Rika> ...
13:18:33FromDiscord<Rika> christ
13:21:18FromDiscord<Rika> this error doesnt actually make sense, what
13:31:15FromDiscord<Rika> oh -_- cimport includes
13:32:03*m4r35n357 joined #nim
13:34:50FromDiscord<Rika> nah i dont got a clue what this means
13:36:36m4r35n357can anyone point me to a reference to syntax for passing (and receiving) procedures by name? I have tried the manual and "by example" and come up with nothing. without a type I get the error message "Error: typeless parameters are obsolete".
13:37:46FromDiscord<Rika> `proc a(procparam: proc(param: int): retType)`
13:38:33FromDiscord<Rika> pass is by just putting the name of the proc as the argument
13:39:06liblq-dev"typeless parameters are obsolete" is such a terrible error message. when were they obsoleted? why should i care if they have been deprecated since before 1.0?
13:40:23m4r35n357IOW what does a formal parameter look like for a procedure?
13:41:01liblq-devformal parameters are the ones in regular parentheses ()
13:41:14m4r35n357OK I saw an old github issue that claimed to be removing the need to procparam . . .
13:41:19liblq-devso eg. `proc abc(a: int, b: float, c: string)` has the formal parameters `a: int, b: float, c: string`
13:42:05m4r35n357liblq-dev, I mean the formal parameter in the procedure _receiving_ the procedure
13:42:24liblq-devwell
13:42:33liblq-devit's still the thing in between the parentheses
13:42:36m4r35n357or, what does the type in "typeless" look like?
13:42:38FromDiscord<Rika> `proc(param: int): retType` is the type of the parameter `procparam` from the procedure `a`
13:42:52liblq-devm4r3n357: `proc abc(a, b, c)`
13:42:58liblq-devbasically it's a relict of the past
13:43:08m4r35n357FromDiscord, OK tha, what if the procedure does not return a value?
13:43:20liblq-dev`proc (param: int)`
13:44:22m4r35n357liblq-dev, so "param" is a keyword?
13:44:30liblq-devno
13:44:35liblq-devit's a normal identifier
13:44:46liblq-devit could just as well be `a`, `hello`, or whatever
13:45:25m4r35n357Here is my "receiving" procedure, proc solve(proc uq, proc up) =
13:45:44m4r35n357what should it look like if uq and up are "void functions"
13:45:48FromDiscord<Rika> `proc solve(uq: proc(), up: proc())`
13:46:01liblq-devfrick, rika was faster
13:46:03FromDiscord<Rika> void functions as in no params and no return?
13:46:14FromDiscord<Rika> as i wrote
13:46:15liblq-devi think that's what they mean
13:46:19m4r35n357FromDiscord, ah OK that looks better, couldn't find that in the manual
13:46:38liblq-devalso it's not FromDiscord, that's the bot that relays discord messages to IRC
13:46:43liblq-devthe username is Rika
13:46:45FromDiscord<Rika> well just know that the type of a proc looks like the signature, just without the name
13:47:00FromDiscord<Rika> so if you want to pass a `proc dkajs()` the type would be `proc()`
13:47:27m4r35n357FromDiscord, that works thanks.
13:48:15m4r35n357shame it is so hard to find stuff like that in the docs, lots of useful snippets, but little guidance to putting something more complete together
13:49:15m4r35n357Rika I mean thanks to you!
13:49:51*Vladar quit (Quit: Leaving)
13:50:30FromDiscord<Rika> πŸ‘Œ
13:53:28liblq-devm4r35n357: it's possible that you were looking for the wrong terms, here's the relevant section in the manual https://nim-lang.org/docs/manual.html#types-procedural-type
13:56:35m4r35n357liblq-dev, yes that looks like the right place, I was looking at "procedures" (amongst many other places!). So, if the passed procedure returns a value does that need to be stated in the formal parameter?
13:56:54liblq-devyes
13:57:13liblq-devand it'd look like `x: proc (): int`
13:57:20FromDiscord<Rika> nimterop is interpreting a lot of things in openssl incorrectly...
13:57:27m4r35n357liblq-dev, OK I was about to ask how ;)
13:58:40m4r35n357don't think that info is in there, but I am happy now!
13:59:22m4r35n357liblq-dev, thx
13:59:31liblq-devnp
14:01:04m4r35n357this porting is tricky, but I like the procedure overloading in nim
14:03:09Oddmongernot possible to have ptr on seq elements ?
14:03:26Oddmongercompiler says Β«maybe unsafeAddrΒ»
14:03:30FromDiscord<Rika> ?
14:03:32FromDiscord<Rika> wdym
14:03:38FromDiscord<Rika> what are you doing exactly
14:04:33Oddmongeri search a pattern in objects stored in a seq
14:04:45Oddmongerif i find it, i return the seq entry
14:04:54Oddmongerand if i don't find it, i return nil
14:05:08FromDiscord<Rika> seq[ptr T]?
14:05:24Oddmongermeh
14:05:27FromDiscord<Rika> if not, cant return nil
14:05:43FromDiscord<Rika> because return type of only T is not-nillable
14:05:47FromDiscord<Rika> use options module
14:05:56Oddmongeryes i see only options here
14:06:03FromDiscord<Rika> return none(T) instead
14:06:29Oddmongerok i do that
14:06:33Oddmongerthank you
14:13:36*tane joined #nim
14:16:29Oddmongeri have missed something with options : https://play.nim-lang.org/#ix=2RxZ
14:16:41Oddmongerah sh*t
14:16:43Oddmongerfound
14:16:57OddmongerOption[Foo] as return type
14:17:48Oddmongerthinking of all the time spent for this little snippet and just found when posted :')
14:24:48*abm joined #nim
14:28:11*superbia joined #nim
14:29:48PMunchOddmonger, classic rubber ducking
14:33:37*sacredfrog quit (Quit: ZNC 1.8.2 - https://znc.in)
14:33:54*sacredfrog joined #nim
14:34:25Oddmongerah , it's a little penguin plush in my case (i've used IRC because i was sleeping now)
14:43:59m4r35n357I think I have misunderstood operator overloading in a major way! I thought that redefining e.g. '+' would only apply if the supplied arguments match my overload, but from the error I see now it looks like it redefines _all_ uses of '+'
14:44:24PMunchUhm, I don't think it should
14:44:31m4r35n357. . . match the _types_ in my overload, I mean
14:45:10m4r35n357PMunch, I am getting an error for multiplying and int64 and a float64, and I haven't overloaded that combination
14:45:59FromDiscord<Solitude> operator overloading is the same as any procedure overloading
14:46:12m4r35n357PMunch, so did my expectation sound correct?
14:46:14narimiranm4r35n357: show us your code
14:46:22PMunchYou can't do that multiplication by default
14:46:42m4r35n357PMunch, it seem to work though, I tested it!
14:47:06FromDiscord<Solitude> test it again
14:47:07*beatmox quit (Read error: Connection reset by peer)
14:47:08m4r35n357narimiran, stand by . .
14:47:15PMunchAs you can see you're not allowed to do that: https://play.nim-lang.org/#ix=2Ry9
14:47:17FromDiscord<Rika> defining mult for int and float will not define it for float and int
14:47:44PMunchm4r35n357, and yes your expectation sounds correct
14:48:26PMunchWhat can happen though is that your error message changes (probably because Nim tries to pick the most likely error, you can see them all by --verbose), but it shouldn't disallow previously allowed things
14:48:27m4r35n357https://pastebin.com/4LDt6v33
14:48:35m4r35n357BTW it is my first day ;)
14:48:49m4r35n357I have left the tests at the bottom
14:49:53*beatmox joined #nim
14:50:38FromDiscord<haxscramper> Is it possible to disable style-insensetivity for an identifier somehow? Stropping does not work - `ec` and `eC` are still the same
14:51:36FromDiscord<haxscramper> I need to find a way to map C style-sensetive identifiers to nim, and I really don't want to add another layer of bookkeeping for wrapper generator to track all renames
14:52:16FromDiscord<haxscramper> I'm talking about wrapping things like `enum C { ec, eC };`
14:52:46FromDiscord<gogolxdong> Is there any way to prevent save as event in Windows application?
14:54:34PMunchm4r35n357, this works: https://play.nim-lang.org/#ix=2Rye
14:54:36narimiranm4r35n357: you're multiplying `step`, which is int, and `h`, which is float
14:54:48PMunchAnd I cleaned up the code in various ways and made it a bit more royale
14:55:21narimiranPMunch: and i, for one, thank you for that :)
14:55:24PMunch@haxscramper, I don't think there is..
14:55:34PMunchnarimiran, huh?
14:55:39*Vladar joined #nim
14:55:47narimiranPMunch: thanks for cleaning it up
14:55:50PMunchOh :P
14:55:57FromDiscord<konsumlamm> who defines an enum with `ec` and `eC` variants lol
14:56:03narimiranyou could have also clean up `h: float64 = 0.01`, but ok :P
14:56:15PMunchOh good catch
14:56:31narimiranand `float64` == `float`
14:56:35m4r35n357narimiran, most languages accept multiplying ints and floats ;) I don't think I understand your point
14:56:44narimiranm4r35n357: nim doesn't
14:56:49m4r35n357wow
14:56:55PMunchThere: https://play.nim-lang.org/#ix=2Ryg
14:57:02m4r35n357didn't see that coming!
14:57:05FromDiscord<haxscramper> In reply to @konsumlamm "who defines an enum": Actual one was `ROFF_bp` and `ROFF_BP`, so it does make sense
14:57:15PMunchm4r35n357, Nim, unlike most other languages, is actually type-safe
14:57:21PMunchWho'da thunk!
14:57:26m4r35n357PM so I need to do some "casting"
14:57:34FromDiscord<Solitude> converting
14:57:39FromDiscord<konsumlamm> there is `lenientops` if you really want that
14:57:48narimiranyep, converting would be more precise
14:57:50FromDiscord<konsumlamm> https://nim-lang.github.io/Nim/lenientops.html it also explains why it's often a bad idea
14:58:19FromDiscord<konsumlamm> does Nim have any formal type system specification?
14:59:13m4r35n357PMunch, narimiran OK thanks I need to absorb all this!
14:59:18narimiranm4r35n357, PMunch: why is `cos` defined as ```func `cos` ```?
14:59:47PMunchI replaced `proc {.noSideEffects.}` with `func` which is cleaner
15:00:04narimirani meant backticks around 'cos' (stropping)
15:00:05m4r35n357PMunch, in what way is func cleaner?
15:00:08PMunchThe `sin` and `cos` instead of sin and cos where yours :P
15:00:23PMunchBecause they are functions and not procedures
15:00:34m4r35n357narimiran, I am redefining sin and cos for dual numbers
15:00:34PMunchAnd you don't have to type {.noSideEffects.} everywhere..
15:00:51m4r35n357PMunch, I am only copying bits from the docs ;)
15:01:03narimiranm4r35n357: but you don't need backticks for them, like you don't need them for: update_q, plot, solve, etc.
15:01:19PMunchAh, func is a new-ish addition, so the docs are probably outdated
15:01:34m4r35n357ah OK I see they are functons notoperators
15:01:54m4r35n357narimiran, the fog of a new language ;)
15:02:19PMunch`func` is just syntactic sugar for `{.noSideEffects.}`
15:02:30narimiranm4r35n357: you're doing fine for your first day, don't worry :)
15:02:30m4r35n357this stuff has gone from Vala, to Python, to Fortran(!) and is currently in c
15:02:33PMunchWell they are operators, but not procedures
15:02:41m4r35n357PMunch, that is useful to know
15:03:18PMunchoperators are just anything that's a combination of the "operator characters": https://nim-lang.org/docs/manual.html#lexical-analysis-operators
15:03:22m4r35n357OK thanks all, I think I can progress further on this now, some interesting gotchas in here ;)
15:04:12PMunchThey can be called like `a + b` instead of `+(a, b)` or `a.+(b)` or `a.+ b` or `+ a b`
15:04:48PMunchfunctions are mathematically pure, no side effect functions, similar to what you expect from a function from functional languages
15:05:16FromDiscord<konsumlamm> ~~no side effects except through their parameters~~
15:05:21PMunchprocedures are what most imperative languages erroneously calls functions and are things that has side effects
15:05:40FromDiscord<konsumlamm> or rather can have side effects, they don't have to
15:05:41PMunch@konsumlamm, I left out that part to simplify :P
15:05:50m4r35n357PMunch, yes I get the idea Nim is stricter, and I like that
15:06:07m4r35n357too much "pragmatism" in programming these days IMO ;)
15:06:08PMunchBut yes, they can modify stuff that's passed to them through `var`, a pointer, or a reference
15:06:59PMunchAnd yes, procedures can not have side effects, but Nim will then automatically realise that it's actually a function. But tagging it with `func` means the compiler will complain if you accidentally add a side-effect.
15:07:51PMunchThe interesting thing with Nim is that it's stricter, but it still manages to feel easy to use compared to many less strict langugaes
15:08:21PMunche.g. C/C++ feels a lot more clunky to me, but Nim is stricter in a lot of ways
15:09:28FromDiscord<konsumlamm> i don't think C/C++ feels clunky to you because of the type system though
15:10:48FromDiscord<haxscramper> I think C++ would be a fine language if it just dropped legacy parts
15:11:21m4r35n357OK cheers all, I need to act on all this before I forget it!
15:13:21FromDiscord<haxscramper> One the things that is missing from C++ (and basically any other C-derived language, except rust) is `distinct`. It is so useful, and yet for some reason nobody has it
15:13:41FromDiscord<Firefell> Anybody has tested this library with Nim ? -> https://justine.lol/cosmopolitan/index.html?source=korben.info
15:18:38FromDiscord<Yardanico> This was brought up some times before - you'd need to adapt parts of Nim stdlib for that since it has a different libc
15:19:24FromDiscord<Yardanico> Also it uses freestanding mode which means that you won't get access to a lot of APIs easily
15:20:52FromDiscord<Yardanico> It's a cool PoC but I don't consider it to be useful for actual real programs
15:20:56FromDiscord<Firefell> In reply to @Yardanico "This was brought up": ok thank you. Made a multiplatform binary is very interested for my project.
15:21:34FromDiscord<Yardanico> Why not just compile different binaries for different platforms? Then you'll have access to all APIs for each platform
15:21:49*D_ quit (Remote host closed the connection)
15:24:36FromDiscord<Yardanico> Even the author says "Please note this is intended for people who don't care about desktop GUIs, and just want stdio and sockets without devops toil."
15:24:56FromDiscord<Firefell> Because I am a lazy man πŸ™‚ It's interested for a tiny command line project. It is a project to be followed
15:25:33FromDiscord<Yardanico> But as soon as you want anything more complex than simple stdio and some data processing, you'll be limited by it
15:25:42FromDiscord<Yardanico> E.g. no SSL
15:26:01FromDiscord<Firefell> I agree with you
15:26:23*D_ joined #nim
15:27:05FromDiscord<Yardanico> Some people for some reason think that Cosmopolitan is the silver bullet for cross-conpilation, but it's certainly not
15:27:43FromDiscord<Yardanico> You should be able to compile Nim with it though, start with --os:any -d:posix -d:useMalloc --gc:arc
15:27:49FromDiscord<Yardanico> Not sure how much stuff you'll need to patch
15:28:49FromDiscord<fenrave> unless he has some os specific libraries, it should be cross compatible if its a tiny command line project
15:31:19FromDiscord<Yardanico> It really depends on what is "tiny" :P
15:32:07FromDiscord<Firefell> Parse JSON file and extract values for example
15:42:08FromDiscord<CAA> I'm using the emacs major mode for nim. Should I be concerned about errors like "error in process filter: Wrong type argument: stringp, nil"? Because it still compiles.
15:43:29FromDiscord<Solitude> In reply to @CAA "I'm using the emacs": thats emacs error, not nim error
15:45:10FromDiscord<CAA> What does the error even mean? Because nim-mode is part of the official github repo.
15:53:53FromDiscord<fenrave> its a predication error from what i can tell, i don't use emacs though
15:54:13FromDiscord<fenrave> it seems to be an issue related to C that carried over to nim, if it compiled and works that is
15:57:35FromDiscord<CAA> I have reason to believe that "string-match("/bin/[a-z]sh\\'" nil)" is what is causing the problem
15:58:05*dsrw_ quit (Remote host closed the connection)
15:58:05FromDiscord<fenrave> the error just seems to be related to the compiler expecting one thing and getting another
15:58:11FromDiscord<fenrave> or emacs itself
15:58:34FromDiscord<CAA> Looks like I"ll have to do some debugging.
15:58:43FromDiscord<fenrave> if its working its probably not an issue
15:58:48*kenran quit (Ping timeout: 245 seconds)
16:10:13*rockcavera quit (Ping timeout: 276 seconds)
16:11:37FromDiscord<CAA> It works perfectly fine If I send a shell command via M (alt key) - ! rather than use the compile command that nim-mode offers. It's just an issue with nim-mode rather than emacs and I can just send a shell command for compilation rather than use nim-mode to compile.
16:14:10*vicfred joined #nim
16:17:48asdflkjuse `backticks` (below tilda normally) to keep Discord from interpreting special characters as formatting (eg. `*` as *italics*) btw
16:18:18asdflkjtilde*
16:19:52asdflkjout of curiousity, how does the Discord bridge handle markdown syntax in IRC messages?
16:21:07FromDiscord<Yardanico> it passes it as-is and discord converts it into formatting :)
16:22:02asdflkjgood to know
16:23:40FromDiscord<Yardanico> That said, the bridge tries to translate IRC formatting to markdown too
16:23:51FromDiscord<Yardanico> But almost no one uses IRC formatting nowadays
16:24:08asdflkjeg. this is bold?
16:24:14FromDiscord<Yardanico> Yes
16:24:45asdflkjI use it from time to time, but many channels have it disable via +c
16:24:52asdflkjdisabled*
16:25:56asdflkjI assume the formatting includes adding opengraph metadata to links unless IRC users surround them with `<>`?
16:29:36*sagax joined #nim
16:30:36superbiahow would one reliably get the center of the pupil from already isolated photo of eye https://imgur.com/a/ITJmRxr
16:32:54*rockcavera joined #nim
16:36:07FromDiscord<ache of head> 😳
16:36:10FromDiscord<ache of head> that sounds suspicious
16:37:53FromDiscord<Yardanico> @asdflkj yes
16:38:23FromDiscord<Yardanico> Sadly I can't disable those via the bridge, the only way is to <> in the bridge itself
16:39:11*haxscramper quit (Remote host closed the connection)
16:39:28*haxscramper joined #nim
16:39:37asdflkjI don't really see that as a problem
16:40:04asdflkj(to have the thumbnails and titles)
16:42:12asdflkjI just have to remember to put `<>` around <https://www.youtube.com/watch?v=dQw4w9WgXcQ> <https://www.youtube.com/watch?v=jzwMjOl8Iyo> and <https://www.youtube.com/watch?v=Uf3ouaeB6UQ>
16:42:32*haxscramper left #nim (#nim)
16:49:42FromDiscord<Yardanico> I remember the first URL :)
16:51:06asdflkjI haven't memorized it yet but IIRC there are browser extensions that recognize it, so that's where the other two and Invidious become handy
16:51:52FromDiscord<Yardanico> dQw is really unique
16:52:00FromDiscord<Yardanico> just remember those 3 and you're set
16:52:06asdflkjthanks
16:59:59ForumUpdaterBotNew post on r/nim by Unaimend: Bioinformatics package for nim, see https://reddit.com/r/nim/comments/lwymab/bioinformatics_package_for_nim/
17:01:04*vicfred quit (*.net *.split)
17:01:05*junland quit (*.net *.split)
17:01:05*blackpawn quit (*.net *.split)
17:01:05*tribly quit (*.net *.split)
17:01:05*Jesin quit (*.net *.split)
17:01:05*Amun_Ra quit (*.net *.split)
17:01:05*mwbrown quit (*.net *.split)
17:01:05*nisstyre quit (*.net *.split)
17:01:42*superbia quit (Ping timeout: 256 seconds)
17:02:24asdflkjhopefully now even <https://vid.puffyan.us/watch?v=dQw4w9WgXcQ&autoplay=1&dark_mode=true> shouldn't get me (unfortunately it looks like some extensions would catch that too: <https://github.com/rangermattos/Rickroll-Detector/blob/master/data/detector.js>)
17:03:31*superbia joined #nim
17:05:21*vicfred joined #nim
17:07:04*junland joined #nim
17:07:04*blackpawn joined #nim
17:07:04*tribly joined #nim
17:07:04*Jesin joined #nim
17:07:04*Amun_Ra joined #nim
17:07:04*mwbrown joined #nim
17:07:04*nisstyre joined #nim
17:20:49*waleee-cl joined #nim
17:28:54ForumUpdaterBotNew Nimble package! onnxruntime - onnxruntime C Api wrapped for nim, see https://github.com/YesDrX/onnxruntime-nim/
17:29:08FromDiscord<Yardanico> it works!
17:29:34narimiran@Yardanico will it work if a new package is somewhere in the middle of the json?
17:29:43FromDiscord<Yardanico> of course, it's not that stupid :P
17:29:50narimiran:)
17:29:51FromDiscord<Yardanico> it'll also work if you merge multiple PRs in under 2 minutes
17:30:17FromDiscord<Yardanico> on the start of the bot I fetch pkg list and save all package names into a hashset, then on update I fetch it again, and check if there's a package that is not in the hashet
17:30:25FromDiscord<Yardanico> if it's not in a hashset - it's a new package
17:30:27narimirannoice
17:30:33FromDiscord<mratsim> Why not strtab?
17:30:49FromDiscord<Yardanico> wdym?
17:30:52FromDiscord<mratsim> ah you don't need the tables
17:30:57FromDiscord<Yardanico> I just need to remember which packages are already there, yeah
17:30:59FromDiscord<mratsim> it's optimized for strings
17:31:08FromDiscord<mratsim> not sure what that means though.
17:31:13FromDiscord<Yardanico> xd
17:38:30FromDiscord<Avatarfighter> hello hello everyone nice to see you all πŸ™‚
17:38:39narimiranyou can see us??
17:38:50FromDiscord<Avatarfighter> indeed, pull your pants up πŸ˜›
17:38:55narimiranshit.
17:38:59narimiranyou indeed see me
17:39:50narimiranbetter now?
17:40:06FromDiscord<Avatarfighter> perfect 😩
17:45:52FromDiscord<Yardanico> πŸ₯΄
17:50:24*tane quit (Quit: Leaving)
18:02:01FromDiscord<ache of head> 😳
18:03:50FromDiscord<Unaimend> In reply to @narimiran "better now?": i liked it better the other way
18:04:24narimiranme too @Unaimend, me too.... but we have some minors here, so i cannot do it anymore.... :'(
18:04:40FromDiscord<Unaimend> hmm, too bad
18:11:19FromDiscord<Yardanico> the chat's getting too hot
18:11:46*JustASlacker quit (Ping timeout: 276 seconds)
18:13:46*xet7 quit (Quit: Leaving)
18:14:52*xet7 joined #nim
18:16:30*xet7 quit (Remote host closed the connection)
18:18:10*kenran joined #nim
18:19:01*wasted_youth2 joined #nim
18:19:34*rockcavera quit (Ping timeout: 276 seconds)
18:20:58idfamazing
18:25:20*xet7 joined #nim
18:30:37*kenran quit (Ping timeout: 276 seconds)
18:35:54*rockcavera joined #nim
18:37:01FromDiscord<Unaimend> In reply to @narimiran "me too <@287576619718279178>, me": πŸ”₯
18:47:03FromDiscord<Yardanico> ok since so many people want to try cosmopolitan I'll do it for their sake
18:47:11FromDiscord<Yardanico> i'll try to do nim hello world with cosmopolitan
19:02:33*gpanders quit (Remote host closed the connection)
19:02:51*gpanders joined #nim
19:08:55FromDiscord<Yardanico> well, it works
19:09:09FromDiscord<Yardanico> although I had to strip all includes from nim-compiled C files (and compile them manually with GCC)
19:11:18FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/816749590660907038/unknown.png
19:14:29FromDiscord<Yardanico> oh nice, I just made stub headers and made it compile with no modifications to Nim files (and with Nim itself without manually calling GCC)
19:14:35FromDiscord<Yardanico> time to make a blog post out of this
19:19:36FromDiscord<Yardanico> i mean on my blog :P
19:20:35FromDiscord<haxscramper> @Yardanico is it possibly to add custom infix operators to mathexpr? I need to evaluate C++ enums, and they can contain things like `(1 << 7 )` and so on
19:20:39FromDiscord<haxscramper> (edit) "possibly" => "possible"
19:21:17FromDiscord<Yardanico> sadly no, you can only define new custom functions. that said, the code is pretty simple so you can extend it to your needs pretty easily
19:21:35FromDiscord<Yardanico> just add it with needed precedence here https://media.discordapp.net/attachments/371759389889003532/816752178671910952/unknown.png
19:21:49FromDiscord<Varriount> In reply to @Yardanico "sadly no, you can": Did you test whether it runs on Windows?
19:22:16FromDiscord<Yardanico> lets see
19:22:45PMunchWhat's the best way to wrap stuff like `#define LED_ON┃ ┃ (PORTD |= (1<<6))` in Nim?
19:22:53FromDiscord<Yardanico> do you have windows right now @Varriount ?
19:23:10FromDiscord<Varriount> Just, it would be a bit embarrassing if a blog post was put up, but the result didn't actually work as a portable executable.↡And yes, I do.
19:23:10FromDiscord<Yardanico> wine says that it can't run the thing because dosbox is not installed, but cosmopolitan says that it should generally run fine on Windows
19:23:21FromDiscord<Yardanico> ok one sec
19:23:36FromDiscord<haxscramper> In reply to @Yardanico "just add it with": It is easier for me to just eval ast directly from C++, I just wondered if there is a built-in support for custom operators that I missed
19:23:45FromDiscord<Yardanico> oh okay fine then
19:23:51PrestigePMunch: do you mean like creating a const?
19:24:03PMunchNah, those aren't consts
19:24:08PMunchIt's like a template thing
19:24:11FromDiscord<Varriount> \waits while Yardanico creates a virus\
19:24:22FromDiscord<Yardanico> hehe
19:24:41Prestigeoh, idk. Thought that was a const you could calculate at compile time
19:25:41FromDiscord<haxscramper> PMunch: create a template then, or just directly `{.emit.}` C code in wrapper proc
19:25:42asdflkjcosmopolitan seems super useful for malware (which has already been written in Nim)
19:25:56FromDiscord<Varriount> Also GUI applications
19:26:04PMunchhaxscramper, that's what I'm trying to do..
19:26:24PMunchBut I'm getting weird errors like this: `@mblinky.nim.c:47:32: error: expected ')' before '=' token`
19:26:45FromDiscord<Yardanico> @Varriount cosmopolitan for GUI is almost unusable
19:26:55FromDiscord<Yardanico> you can make a simple win32 gui, yes
19:27:09FromDiscord<Yardanico> but even the developer said that it's not feasible to try to run wxwidgets/gtk/qt/etc
19:27:24FromDiscord<Yardanico> since it compiles in its own "environment" and doesn't use any shared libraries
19:27:30FromDiscord<Yardanico> remember, it can be booted from BIOS
19:27:50FromDiscord<Yardanico> its mainly for command-line apps
19:27:53FromDiscord<Varriount> In reply to @asdflkj "cosmopolitan seems super useful": Does it allow loading from DLLs?
19:28:16asdflkjIDK, but IDK if malware usually needs to
19:29:19FromDiscord<Yardanico> run at your own discretion (but I compiled and ran it myself, so there shouldn't be any viruses here) :P https://media.discordapp.net/attachments/371759389889003532/816754131443384370/hello.com
19:29:23FromDiscord<Recruit_main707> it usually does, at least a decent part of it
19:29:32FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/816754179816685618/unknown.png
19:29:48FromDiscord<Recruit_main707> https://tenor.com/view/doubt-press-x-press-la-noire-gif-18717264
19:29:49FromDiscord<Yardanico> it writes to a file called "testing" by the way
19:29:54PrestigePMunch: Sounds like a bug. On a side note, I'm having a strange issue with event processing with the selector solution you showed me. If you have any time to talk this week/weekend I could use some help
19:30:12Prestigesome events seem to be stuck in the queue, I think. Flushing didn't help
19:31:42PMunchHmm, that sounds strange
19:32:00PMunchI can probably find some time where I'm able to talk
19:32:15PrestigeYeah, it's weird. Have spent a few days trying to figure out what's happening
19:32:50FromDiscord<Yardanico> @Varriount are you ok? :D
19:32:57FromDiscord<Yardanico> what happened, you went silent
19:34:36asdflkjIIUC almost all malware targets Android and Windows… now in theory you can just pass a couple extra compiler flags w/ cosmopolitan and it will at least try to run on most OSs β€” which would be a no-brainer if there was no disadvantage to it on the main targets, but if it disables all dynamic linking I guess there is
19:34:52PMunchYou're selecting on a web socket and the X11 socket right?
19:34:52ForumUpdaterBotNew thread by Niminem: Full-time Nim developer rates for new software company, see https://forum.nim-lang.org/t/7578
19:34:59PMunchPrestige *
19:35:28PrestigePMunch: yeah
19:35:42Prestigeer, a unix socket
19:36:03Prestigehttps://github.com/avahe-kellenberger/nimdow/blob/master/src/nimdow.nim#L74
19:37:08PMunchI would move all of this below the IPC bit: https://github.com/avahe-kellenberger/nimdow/blob/master/src/nimdow.nim#L86-L89
19:37:13FromDiscord<Yardanico> jesus christ
19:37:21FromDiscord<Yardanico> even httpclient (non-ssl obviously) works
19:37:26FromDiscord<Yardanico> had to patch 1 line in nativesockets.nim though
19:37:27PMunchAnd make the IPC a `if event.fd == ipcSocketFd`
19:37:41PrestigeI tried that as well but it didn't change the outcome
19:38:10PMunchThat way you're sure no X11 events that are received while handling the unix socket are lost
19:38:11Prestigeadding the XSync after handleCommand seems to have made more of the events get processed, but not all of them (I think)
19:38:39Prestigeoh you mean no elif?
19:39:10PrestigeI'll try that tonight, good idea...
19:39:35FromDiscord<dom96> In reply to @Yardanico "even httpclient (non-ssl obviously)": is this cosmopolitan?
19:39:38FromDiscord<Yardanico> ye
19:39:45FromDiscord<dom96> would be awesome to get it as a NIm target
19:39:51PMunchPrestige, something like this: https://play.nim-lang.org/#ix=2RzS
19:39:54FromDiscord<dom96> like `nim c --os:cosmo blah.nim` or something πŸ˜„
19:39:56FromDiscord<Yardanico> it doesn't need a separate target though :)
19:40:21FromDiscord<dom96> alternatively a wrapper around `nim` that does all the steps for you
19:40:41PrestigePMunch: good call, hopefully that works out. I thought the events would just be enqueued though. Would it just not trigger the selector, maybe?
19:40:45FromDiscord<Yardanico> the only manual step rn is `objcopy`
19:41:06PMunchPrestige, exactly
19:41:09FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/816757105860149259/unknown.png
19:41:19Prestigeahh that must be it. Thanks PMunch
19:41:22PMunchConversely you might have the same problem with the IPC though I think..
19:41:25FromDiscord<Yardanico> `stubs` is just empty include files nim expects from a normal libc
19:42:22PrestigePMunch: Hm it seems very weird to me that the check on the selector wouldn't be fired if I tried `select` after something was sent to it. But if that's the behavior, I need to restructure things
19:42:50PMunchI'm not 100% sure
19:42:56PMunchMight be a red herring..
19:43:07PrestigeIf that's the behavior, I would always miss something (I think)
19:44:25*natrys joined #nim
19:48:06PMunchYeah that would be a pretty silly system..
19:48:29PMunchHmm, anyone knows why Nim adds -ldl to the linker stage and what I need to get it to not do that?
19:50:39FromDiscord<mratsim> dynamic loading
19:50:46FromDiscord<mratsim> dynlibOverride
19:50:52FromDiscord<mratsim> maybe
19:50:55PMunchYeah I know what -ldl does..
19:51:09FromDiscord<Solitude> os:any/standalone?
19:51:16PMunchBut I'm trying to compile for a Teensy2 chip, so I can't really use it
19:51:23PMunchI already have os:any
19:51:29PMunchAnd I've tried os:standalone as well
19:56:19PMunchI've used Nim with arduino chips before and this hasn't been an issue..
19:57:30Prestige"A file descriptor is considered ready if it is possible to perform a corresponding I/O operation (e.g., read(2), or a sufficiently small write(2)) without blocking." I think this means that if there's something that has been written to the socket, select will still work if it's invoked afterward
19:58:26FromDiscord<Yardanico> I'm trying to somehow make asynchttpserver work
20:05:56FromDiscord<Yardanico> I MADE IT WORK AHHAHA
20:06:04FromDiscord<Yardanico> rip poor nim stdlib
20:06:11FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/816763402990780446/unknown.png
20:06:27FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/816763467713347624/unknown.png
20:06:42FromDiscord<Yardanico> I had to when false a lot of ipv6 code
20:07:01PMunchPrestige, hmm, yeah it should work
20:07:23asdflkjtoday *BSD, tomorrow the WORLD! and next year Hurd!
20:07:38FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/816763768834752522/hello.com
20:07:40FromDiscord<Yardanico> if you want to try
20:07:46FromDiscord<Yardanico> starts a webserver on localhost:8080
20:07:52FromDiscord<Yardanico> (default asynchttpserver example)
20:07:59PMunchHmm --verbosity:n crashes the compiler..
20:08:04PrestigePMunch: makes me want to try xcb or just port this WM to wayland, lol
20:08:13PMunchHaha :P
20:08:16PMunchBit drastic
20:08:27PrestigeProbably
20:08:38PrestigeI've been wanting to do a partial rewrite anyway
20:09:16FromDiscord<Yardanico> so yeah basically I needed to `when false` a lot of ipv6 related code (Sockaddr_in6, etc)
20:09:22FromDiscord<Yardanico> make nim use ioselectors_poll
20:09:28FromDiscord<Yardanico> and also make it think that this is a "BSD" platform
20:10:23asdflkjoh oops, I already forgot how Discord messes with formatting
20:10:38asdflkjtoday \*BSD, tomorrow the WORLD! and next year Hurd!
20:10:51FromDiscord<Yardanico> wdym?
20:10:55FromDiscord<Yardanico> I've seen your first message just fine
20:10:59FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/816764612389109770/unknown.png
20:11:03FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/816764628755152926/unknown.png
20:11:17FromDiscord<Yardanico> i need windows testers
20:11:42asdflkjyour message was all italicized after the first quote for me
20:12:08FromDiscord<Yardanico> ah I understand why
20:12:16FromDiscord<Yardanico> it's a bug, sry :(
20:12:46asdflkjnp, I knew what it meant
20:13:16FromDiscord<Varriount> @Yardanico Had an appointment. Did you send me something?
20:13:22PMunchAnyone else watching Starship SN10?
20:13:23FromDiscord<Yardanico> I managed to run asynchttpserver
20:13:29FromDiscord<Yardanico> try to run the 228kb bin pls
20:13:33FromDiscord<Yardanico> In reply to @Yardanico "": ^
20:13:39FromDiscord<Yardanico> should start a webserver on localhost:8080
20:16:45*kenran joined #nim
20:17:16*haxscramper joined #nim
20:17:50*haxscramper quit (Remote host closed the connection)
20:19:38*natrys quit (Quit: natrys)
20:25:47FromDiscord<Varriount> Yardanico: Didn't work.
20:25:49FromDiscord<Varriount> > ResourceUnavailable: Program 'hello.com' failed to run: The specified executable is not a valid application for this OS platform.At line:1 char:1
20:27:13FromDiscord<dom96> @Yardanico how is it just a case of running `objcopy`? Isn't there other setup necessary?
20:27:32FromDiscord<Yardanico> @Varriount how did you launch it?
20:27:34FromDiscord<dom96> and where does `objcopy` come from?
20:27:41FromDiscord<Yardanico> it's a part of binutils
20:27:58FromDiscord<Yardanico> And other setup is required, yes, check the nim.cfg file I screenshoted before (I'll push all files to a repo now)
20:28:13FromDiscord<Yardanico> https://github.com/Yardanico/cosmonim
20:28:34FromDiscord<Varriount> Yardanico: If you've run the executable on Linux already, keep in mind that it re-writes the executable in order to run it on Linux
20:28:39FromDiscord<Yardanico> ah right
20:28:47FromDiscord<Yardanico> hm, I need to remove the binary files from git history so the repo is much smaller to clone
20:28:59FromDiscord<Yardanico> on my first commit I added cosmopolitan files accidentally
20:29:05FromDiscord<Varriount> It would be nice if there was a workaround for that...
20:32:51FromDiscord<dom96> In reply to @Yardanico "And other setup is": right, so a `cosmopolitan` target would remove the need for this set up
20:33:20FromDiscord<Yardanico> It's still a fast-moving target, we should definitely wait a bit before considering adding it as a target :P
20:35:32FromDiscord<Yardanico> ok removed the binary from the git history
20:36:43FromDiscord<Yardanico> (Used https://rtyley.github.io/bfg-repo-cleaner/ for that)
20:37:17asdflkjIt would be nice if it could be added in master just as alpha support for a target. it could catch the cosmopolitan wave of hype on HN, which is how where me and IIUC many others learned of Nim
20:44:13federico3weird...
20:50:54FromDiscord<Yardanico> @Varriount try again https://media.discordapp.net/attachments/371759389889003532/816774657188823078/asyncserv.com
20:51:09FromDiscord<Yardanico> also now I `git reset --hard`'d the nim repo and managed to patch stdlib with less LOC changed
20:51:18FromDiscord<Yardanico> and only with cosmLibc defines
20:51:25FromDiscord<Yardanico> although it's still dirty
20:58:02FromDiscord<Yardanico> Added the diff required to compile asynchttpserver - https://github.com/Yardanico/cosmonim/blob/master/asyncserv.diff
20:58:25FromDiscord<Yardanico> its really dirty for now, yes
21:00:44*kenran quit (Quit: leaving)
21:06:06FromDiscord<Yardanico> ah wait
21:07:22FromDiscord<Yardanico> nvm it's fine, was an issue on my end
21:11:21*narimiran quit (Ping timeout: 246 seconds)
21:11:22FromDiscord<Varriount> @Yardanico Hm, antivirus removed it.
21:11:30FromDiscord<Yardanico> well, I didn't put any virus inside :P
21:14:55FromDiscord<dom96> In reply to @Yardanico "It's still a fast-moving": fyi the author of cosmopolitan is considering implementing it as a target for zig
21:15:03FromDiscord<dom96> so I disagree with you that we should wait πŸ˜‰
21:15:31FromDiscord<Yardanico> zig is a very fast moving target too, they don't have a stable release :)
21:18:57FromDiscord<dom96> I don't think so
21:19:38*JustASlacker joined #nim
21:19:41*JustASlacker quit (Client Quit)
21:19:47*gangstacat quit (Ping timeout: 272 seconds)
21:20:32*gangstacat joined #nim
21:30:45FromDiscord<enthus1ast> T
21:33:38*blueberrypie quit (*.net *.split)
21:33:38*ddevault quit (*.net *.split)
21:33:38*Kaivo quit (*.net *.split)
21:33:38*dddddd quit (*.net *.split)
21:33:38*revere quit (*.net *.split)
21:33:38*kali_ quit (*.net *.split)
21:33:38*fredsted quit (*.net *.split)
21:33:38*dgb quit (*.net *.split)
21:33:39*federico3 quit (*.net *.split)
21:33:39*shashlick quit (*.net *.split)
21:34:44*fredsted joined #nim
21:34:44*blueberrypie joined #nim
21:34:44*ddevault joined #nim
21:34:44*Kaivo joined #nim
21:34:44*dddddd joined #nim
21:34:44*revere joined #nim
21:34:44*kali_ joined #nim
21:34:44*dgb joined #nim
21:34:44*federico3 joined #nim
21:34:44*shashlick joined #nim
21:47:21FromDiscord<treeform> So you are telling me soon I could compile nim to run on every operating system?
21:47:33FromDiscord<Yardanico> TUI only mostly
21:47:50FromDiscord<Yardanico> for win32 you can have GUI with cosmopolitan, but generally only TUI
21:48:17FromDiscord<treeform> even console only could be a big step
21:48:28FromDiscord<Yardanico> also only x86_64, but yeah, it's nice
22:01:20*^Q-Master^ quit (Read error: Connection reset by peer)
22:01:36*Q-Master joined #nim
22:21:57FromDiscord<Unaimend> sent a code paste, see https://play.nim-lang.org/#ix=2RAM
22:23:31FromDiscord<treeform> yes?
22:24:03FromDiscord<Unaimend> ok, then i must be doing sth. really funny in my code πŸ˜‚
22:24:10FromDiscord<treeform> if code complies and you have not overloaded `and` with some thing else...
22:26:14FromDiscord<Unaimend> sent a code paste, see https://play.nim-lang.org/#ix=2RAN
22:26:37FromDiscord<Unaimend> (edit) "https://play.nim-lang.org/#ix=2RAN" => "https://play.nim-lang.org/#ix=2RAO"
22:27:01FromDiscord<Unaimend> It must be sth. really fcking obvious
22:27:52FromDiscord<Unaimend> (edit)
22:28:25FromDiscord<Unaimend> (edit) "https://play.nim-lang.org/#ix=2RAQ" => "https://play.nim-lang.org/#ix=2RAP"
22:37:49FromDiscord<Unaimend> Omg i think I got it wtf
22:49:52FromDiscord<tinygiant> sent a long message, see http://ix.io/2RAZ
22:50:08FromDiscord<tinygiant> (edit) "http://ix.io/2RAZ" => "http://ix.io/2RB0"
22:50:10FromDiscord<tinygiant> (edit) "http://ix.io/2RB0" => "http://ix.io/2RB1"
23:07:09FromDiscord<Varriount> In reply to @tinygiant "npeg question for the": Do you have a link to the complete grammer?
23:07:33*superbia quit (Ping timeout: 246 seconds)
23:09:56FromDiscord<tinygiant> https://play.nim-lang.org/#ix=2RB9
23:17:13*Vladar quit (Quit: Leaving)
23:31:14*PMunch quit (Quit: leaving)
23:34:40FromDiscord<Clyybber> In reply to @dom96 "right, so a `cosmopolitan`": no need for a seperate target IMO, config system is flexible enough
23:35:21FromDiscord<Clyybber> like --os:any and a define to trigger stdlib workarounds should be enough I think
23:40:52*muffindrake quit (Quit: muffindrake)
23:42:35FromDiscord<Varriount> @tinygiant `(1 - parR[1]) nl (1 - parR[1])`
23:42:52FromDiscord<Varriount> (edit) "@tinygiant `(1 - parR[1]) nl ... (1" added ""
23:43:45FromDiscord<Varriount> I'd also recommend writing for readability, rather than terseness, similar to https://github.com/Varriount/commandant/blob/master/commandant/lexer.nim
23:44:12FromDiscord<tinygiant> @Varriount Thanks, I'll give it a shot.
23:44:40FromDiscord<tinygiant> And thanks for the link, I'm trying to build something similar (but simpler)
23:49:46FromDiscord<Clyybber> @Yardanico wouldn't --os:any be a better fit?
23:49:53FromDiscord<Yardanico> probably yes
23:50:10FromDiscord<Yardanico> but cosmopolitan is actually based on assumptions that you're targeting linux in your code
23:50:16FromDiscord<Clyybber> oh
23:50:39FromDiscord<Clyybber> like linux specifically or just posix?
23:51:06asdflkjlinux specifically IIUC
23:51:26FromDiscord<Yardanico> yeah, cosmopolitan has a lot of APIs embedded
23:51:28FromDiscord<Yardanico> even zlib
23:53:23*krux02 quit (Remote host closed the connection)