<< 28-10-2020 >>

00:00:21FromDiscord<ElegantBeef> It doesnt hang, it just doesnt work
00:00:50FromDiscord<ElegantBeef> Like there is no error or anything it just runs the code flawlessly until i attempt to conver back from a string
00:01:57FromDiscord<Clyybber> can you echo the string?
00:02:01FromDiscord<ElegantBeef> Yea
00:02:15FromDiscord<Clyybber> might be worth putting echos there
00:02:22FromDiscord<Clyybber> to find out when exactly it begins to fail
00:02:51FromDiscord<ElegantBeef> It fails after the nim code is called but before returning to nimscript
00:03:58FromDiscord<ElegantBeef> Line 45 shows where it's not working
00:04:09FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=2Cfb
00:10:05FromDiscord<ElegantBeef> The interpreter just seems to silently fail
00:11:07FromDiscord<Clyybber> you sure its getInt ? Maybe its the type conversion
00:12:12FromDiscord<ElegantBeef> Yes without the conversion it also errors
00:13:34FromDiscord<ElegantBeef> Just double checked, doing `echo getInt(buff, pos)` results in the same behaviour
00:13:50*sealmove joined #nim
00:14:10FromDiscord<Clyybber> its probably the var param
00:14:58FromDiscord<ElegantBeef> It's being passed to a proc that isnt a var, though
00:15:24FromDiscord<Clyybber> I mean `pos` being a var param
00:15:37FromDiscord<Clyybber> maybe making it a local var fixes it
00:18:50FromDiscord<ElegantBeef> Nope
00:19:43FromDiscord<ElegantBeef> Replacing those with `0.T` doesnt crash
00:20:03FromDiscord<Clyybber> wdym?
00:20:24FromDiscord<ElegantBeef> replacing the `result = getInt` with `result = 0.T` works
00:20:39FromDiscord<ElegantBeef> So it's something with the VM calls was just ensuring that
00:20:59FromDiscord<Clyybber> is that playground example supposed to demonstrate the bug?
00:21:04FromDiscord<Clyybber> because it works fine for me
00:21:07FromDiscord<ElegantBeef> No
00:21:15FromDiscord<ElegantBeef> It relies on nimscripter
00:21:18FromDiscord<Clyybber> ok
00:21:23*mmohammadi9812 joined #nim
00:21:29FromDiscord<ElegantBeef> If you want to check it out i'll push this and you can clone the branch
00:21:37FromDiscord<Clyybber> aight
00:22:29FromDiscord<ElegantBeef> https://github.com/beef331/nimscripter/tree/speed
00:22:33FromDiscord<ElegantBeef> Dere you go
00:22:59FromDiscord<ElegantBeef> `nim c -r ./src/nimscripter` will run the `test.nims` file
00:23:14FromDiscord<ElegantBeef> And if you want to see the generated nimscript you can do `nim c -d:debugScript`
00:24:47*krux02 quit (Remote host closed the connection)
00:26:37FromDiscord<Clyybber> 141 is the line?
00:26:57FromDiscord<ElegantBeef> Yea
00:27:22FromDiscord<ElegantBeef> It's where as far as i can tell the VM silently fails
00:30:04FromDiscord<Clyybber> weird, getInt itself seems to get executed until the end
00:31:55FromDiscord<Clyybber> or am I stupid
00:32:04FromDiscord<ElegantBeef> I concur it runs to completion
00:32:22FromDiscord<ElegantBeef> The result seems ot be the issue
00:32:57FromDiscord<Clyybber> yeah discard works fine
00:33:16FromDiscord<ElegantBeef> hmm?
00:33:47FromDiscord<Clyybber> discard getInt(buf, pos)
00:34:03FromDiscord<Clyybber> it exits as soon as we pass its result to something else
00:34:07FromDiscord<Clyybber> like the type conversion
00:34:10FromDiscord<Clyybber> or echo
00:34:15FromDiscord<Clyybber> or assign it
00:40:18FromDiscord<ElegantBeef> Nothing stands out as obviously incorrect to me
00:41:02FromDiscord<Clyybber> maybe go into vm.nim and inspect the value there
00:41:13FromDiscord<Clyybber> I gotta get some sleep, cya
00:41:17FromDiscord<ElegantBeef> Buh bye
00:41:23FromDiscord<ElegantBeef> Thanks for the help anywho
00:46:49FromDiscord<ElegantBeef> @Clyybber Well thanks turns out there is a VmArgs.setResult for all the primitives
00:47:04FromDiscord<ElegantBeef> Didnt notice that previously and that works
01:00:42*mbomba quit (Ping timeout: 256 seconds)
01:02:22*D__ joined #nim
01:03:11*D_ quit (Remote host closed the connection)
01:07:49*D__ quit (Remote host closed the connection)
01:08:25*rockcavera quit (Killed (kornbluth.freenode.net (Nickname regained by services)))
01:08:26*rockcavera joined #nim
01:08:36*D_ joined #nim
01:11:01*Sembei quit (Read error: Connection reset by peer)
01:12:50*rockcavera quit (Ping timeout: 256 seconds)
01:14:37*TomDotTom quit (Ping timeout: 264 seconds)
01:26:19*Tanger joined #nim
01:32:03disruptekfighter: you finished your bot?
01:36:08*Sembei joined #nim
01:41:12FromGitter<iffy> I have a thread running an asyncdispatch loop and other stuff is happening in another thread (worker). If I want the worker thread to cause things to happen in my asyncdispatch loop, is this a good architecture? Share a channel (or channels) between threads. Main thread registers an AsyncEvent and worker thread triggers the event when there's something in the channel for main to read.
01:43:27FromGitter<iffy> Or skip the AsyncEvent and just call tryRecv on the channel each time I poll()?
01:51:30*abm quit (Read error: Connection reset by peer)
01:51:30*sealmove quit (Read error: Connection reset by peer)
01:51:53jonjitsu[m]Are there any open source projects out there using jester or some other web framework? I'd like to see how they do things.
01:53:58go|dfishjonjitsu[m]: the forum? https://github.com/nim-lang/nimforum#features
01:55:32jonjitsu[m]shoulda thought of that I suppose :)
02:18:39*apahl quit (Ping timeout: 272 seconds)
02:20:16*apahl joined #nim
02:36:07FromDiscord<himu> quick query. how to do `let c: char = 'z'; var a: int = c - 'a';` in nim?
02:37:56*mbomba joined #nim
02:38:37FromDiscord<shashlick> just `var a = c.int - 'a'.int` should do it
02:39:02FromDiscord<shashlick> or you could see if {.borrow.} works
02:40:29FromDiscord<smallgram> For the JavaScript backend, is importjs and importcpp pragma basically the same?
02:48:35PrestigeHm if I create an object and write procs for + - * / does nim still evaluate equations correctly, or will they just be evaluated in left to right order?
02:55:24FromDiscord<Rika> afaik evaluation order does not change
02:55:33FromDiscord<Rika> theres a chart in the manual i think
03:07:37*mbomba quit (Quit: WeeChat 2.9)
03:09:24*mbomba joined #nim
03:10:54*rockcavera joined #nim
03:11:02FromDiscord<impbox> Yeah evaluation order is defined by the symbol
03:12:41*NimBot joined #nim
03:19:52*muffindrake quit (Ping timeout: 260 seconds)
03:21:40*muffindrake joined #nim
03:21:55*fowl quit (Ping timeout: 244 seconds)
03:22:30*sirn quit (Read error: Connection reset by peer)
03:22:48*kwilczynski quit (Ping timeout: 260 seconds)
03:22:49*sirn joined #nim
03:23:22*fowl joined #nim
03:24:19*kwilczynski joined #nim
03:26:58voltistGee I haven't checked IRC for a while. How's everyone doing?
03:27:45Prestigehey voltist, I'm doing well. Was sick this morning and skipped work, but doing better now :) How are you?
03:28:55voltistYeah not to bad myself thanks
03:57:31*mbomba quit (Quit: WeeChat 2.9)
03:59:44*mmohammadi9812 quit (Quit: Quit)
04:00:00*mmohammadi9812 joined #nim
04:02:28*a_chou joined #nim
04:06:01*supakeen quit (Quit: WeeChat 2.9)
04:06:38*supakeen joined #nim
04:08:37*waleee-cl quit (Quit: Connection closed for inactivity)
04:11:48*a_chou quit (Remote host closed the connection)
04:19:24*apahl quit (Ping timeout: 240 seconds)
04:20:31*apahl joined #nim
04:46:41AxiomaticIf I find a wee bug in the documentation's code example, who do I sent that to, or what's the procedure?
04:46:59disruptekfix it and send a pr; you can do this directly from the github ui.
04:48:03AxiomaticI see, the web docs are in Github you're saying
04:49:56Axiomaticoic, yeah, nvermind it's supposed to fail. Nevermind me
04:58:08*mmohammadi9812 quit (Ping timeout: 256 seconds)
04:59:07*gangstacat quit (Quit: ฤœis!)
05:00:22*mmohammadi9812 joined #nim
05:21:25*gangstacat joined #nim
05:33:19*solitudesf joined #nim
06:06:05*Tanger is now known as the_serf
06:14:12*narimiran joined #nim
06:43:38*BarrOff joined #nim
07:20:22*mwbrown quit (Ping timeout: 256 seconds)
07:22:19*mwbrown joined #nim
07:29:24*mwbrown quit (Ping timeout: 240 seconds)
07:44:36*natrys joined #nim
07:58:04*BarrOff quit (Ping timeout: 240 seconds)
08:08:30*mwbrown joined #nim
08:17:06*voidpi quit (Ping timeout: 256 seconds)
08:17:46*voidpi joined #nim
08:20:43*the_serf quit (Quit: Leaving)
08:23:43*mwbrown quit (Ping timeout: 246 seconds)
08:25:13*krux02 joined #nim
08:38:57*mwbrown joined #nim
08:48:12*mwbrown quit (Ping timeout: 256 seconds)
08:50:54*mwbrown joined #nim
08:51:52ForumUpdaterBotNew thread by Clonk: Testament failure with reNimcCrash, see https://forum.nim-lang.org/t/6999
08:59:11*hnOsmium0001 quit (Quit: Connection closed for inactivity)
09:01:19Yardanico!status
09:01:21FromDiscordUptime - 1 week, 13 hours, and 24 minutes
09:04:32Yardanico7000th forum thread next
09:08:55FromDiscord<Idefau> https://forum.nim-lang.org/t/6969 funny number hehe
09:10:28FromDiscord<kaletaa> nerd
09:12:50FromDiscord<ElegantBeef> Cmon yard lacking on the options for which english to use
09:13:03FromDiscord<ElegantBeef> Clearly the best english is the on that includes Canada in it ๐Ÿ˜„
09:15:31FromDiscord<Idefau> Romanian English
09:17:40FromDiscord<kaletaa> the documentation should be in australian slang
09:18:02FromDiscord<ElegantBeef> Nah the issue with that is there would be more cunts than useful information
09:18:19FromDiscord<kaletaa> possibly
09:18:32*mbomba joined #nim
09:19:01*mmohammadi9812 quit (Ping timeout: 246 seconds)
09:19:38FromDiscord<Idefau> but cunt is an useful information
09:20:26FromDiscord<ElegantBeef> Well it's useful to know if the writer likes you but not to understand the code
09:20:56FromDiscord<Idefau> sent a code paste, see https://play.nim-lang.org/#ix=2CgI
09:21:26FromDiscord<ElegantBeef> oi cunt, a for loop is like when you go to maccas, but instead of going once you go once for each item
09:21:47FromDiscord<Idefau> yes lets add that
09:26:14*PMunch joined #nim
09:29:52FromDiscord<kaletaa> pro cunt
09:29:58FromDiscord<kaletaa> https://tenor.com/view/turkey-turkey-man-shades-talk-gif-17016152
09:30:05*mmohammadi9812 joined #nim
09:31:29FromDiscord<Idefau> POV you are living in constantinopole in the year 1453
09:32:18Yardanicothis is main channel idf
09:32:34FromDiscord<Idefau> huh
09:32:35FromDiscord<Idefau> oh
09:34:24FromDiscord<kaletaa> hello yard more like fard hahah i am incredibly funny
10:14:04*lritter joined #nim
10:16:56*mbomba quit (Quit: WeeChat 2.9)
10:31:10FromGitter<gogolxdong> What's the equivalent operation in Nim for pointer sum in c?
10:32:05PMunchPointer sum?
10:32:15Yardanicosee e.g. https://gist.github.com/oltolm/1738289b5ac866ec6a7e4ef20095178e
10:32:19mipricast the ptr to a ptr UncheckedArray[T] of an appropriate T and then index into it
10:32:23Yardanicoor this^
10:32:37Yardanicothe thing I linked is pretty old
10:34:08FromDiscord<ShalokShalom> Can I replace keywords in Nim?
10:34:20PMunchWhat do you mean?
10:34:25PMunchLike rename `if`?
10:34:30FromDiscord<ShalokShalom> So use function instead of func and so on
10:34:37FromDiscord<ShalokShalom> Yes
10:34:51FromDiscord<ShalokShalom> With macros?
10:34:53PMunchI mean you can do this: https://nim-lang.org/docs/filters.html#available-filters-replace-filter
10:36:39FromGitter<gogolxdong> the link looks crazy.
10:37:17PMunchhttps://play.nim-lang.org/#ix=2Ch3
10:37:24FromDiscord<ShalokShalom> Thanks
10:38:34PMunchThey're not really intended for that feature
10:39:28PMunchYou might also run into things like this: https://play.nim-lang.org/#ix=2Ch4
10:40:03*opal quit (Ping timeout: 240 seconds)
10:40:55FromDiscord<haxscramper> How to unsee this - now I can't tell people nim doesn't have preprocessor
10:41:20PMunchHaha :P
10:43:51FromDiscord<ShalokShalom> Thats superb
10:44:18FromDiscord<ShalokShalom> I am sure, it can be made without this side effect and it is non-lethal anyway ๐Ÿ˜Š
10:45:17*opal joined #nim
10:46:04FromDiscord<ShalokShalom> @PMunch How can I find the special comment annotation, the docs arent giving my anything?
10:46:14FromDiscord<ShalokShalom> (edit) "@PMunch" => "PMunch"
10:46:30FromGitter<gogolxdong> Can pointer addition be treated as seq truncation?
10:46:36PMunchSpecial comment annotation?
10:46:42FromDiscord<ShalokShalom> https://media.discordapp.net/attachments/371759389889003532/770961733773688832/Screenshot_2020-10-28-11-46-32-32_3aea4af51f236e4932235fdada7d1643.jpg
10:46:55FromDiscord<ShalokShalom> The first line in your example
10:46:56PMunchOh, it's in the link I sent
10:47:08miprithat whole page of the documentation is about those
10:47:11miprithat was linked
10:47:53FromDiscord<ShalokShalom> oO
10:48:27FromDiscord<ShalokShalom> PMunch the sub and by keywords are explained
10:48:37FromDiscord<ShalokShalom> But I mean the #?replace thingy
10:49:00miprihttps://nim-lang.org/docs/filters.html <- the whole page is about that
10:49:00PMunchScroll up?
10:49:37FromDiscord<ShalokShalom> Ah, now I see. Thanks
10:50:43FromGitter<gogolxdong> that is treating a pointer type as a seq[T], I know char * is could be treated as string, which is seq[char]
10:50:55YardanicoPMunch: it's not hard to do something like that by hooking to Nim's lexer
10:50:59YardanicoI mean replaces like that
10:51:11Yardanicoit'll be a bit error-prone too, but less than replace
10:51:39mipriyou can't treat a random pointer as a seq[T], seqs have more than just their contents
10:52:06mipricstring -> string isn't free either
10:52:31FromDiscord<ShalokShalom> Yardanico How so less error prone?
10:52:50FromDiscord<ShalokShalom> How how does this look in the lexer?
10:52:52Yardanico@ShalokShalom if you use compiler's lexer, you can only replace occurences where it's actually a symbol and not a string literal
10:53:03Yardanicoe.g check out https://github.com/Yardanico/nuglifier where I replace stuff
10:53:08mipriyou can make it as 'good' as the C preprocessor at least
10:53:16Yardanicohttps://github.com/Yardanico/nuglifier/blob/master/src/nuglifier.nim#L57
10:53:24Yardanicobut of course the only real way is to modify nim's parser ;)
10:53:33Yardanico*syntax skins flashbacks*
10:55:55FromDiscord<ShalokShalom> Syntax skins existed in Nim?
10:56:16Yardanicoyes
10:56:48Yardanicothere was only one additional "skin" - braces
10:56:55Yardanicobut it was removed in 2017 because no one really used it
10:57:11Yardanicoand it increases the cost of the maintenance of the parser
10:57:16FromDiscord<Rika> ehem
10:57:39miprihttps://forum.nim-lang.org/t/2811 has an example
10:57:44FromDiscord<ShalokShalom> Same as in FSharp
10:57:55FromDiscord<ShalokShalom> They also offer both, keywords and indentation
10:58:01FromDiscord<ShalokShalom> And nobody uses the first.
11:00:02FromGitter<gogolxdong> I think it can't be treated as anything else when interoperating when C/C++ because memory layout, what about in pure Nim, I am not having any interoperability, just trying to translate pointer addition into native Nim operation, which produce the same result.
11:00:38Yardanico@gogolxdong just use UncheckedArray then
11:00:52Yardanicoyou know that C's "indexing operators" are just sugar over pointers, right?
11:01:07FromDiscord<ShalokShalom> I am a beginner and I find it hard to understand types in function declarations.
11:01:14Yardanico@ShalokShalom ??
11:01:22FromDiscord<ShalokShalom> Not in constants and such, just in proc and func and so on
11:01:32FromGitter<gogolxdong> yes , I know C pointer.
11:01:34Yardanicostill don't get it
11:01:45Yardanicoyou mean in "proc a(x: int)" it's hard to understand int?
11:01:53FromDiscord<ShalokShalom> Like, I don't know how to understand which types will come up and such.
11:01:59Yardanicowaty
11:02:00Yardanicowat*
11:02:16FromDiscord<ShalokShalom> I dont know how to define types pre-advance in types.
11:02:23FromDiscord<ShalokShalom> (edit) "types." => "functions."
11:02:30Yardanicoi don't get you at all, sorry
11:02:32FromDiscord<Rika> i dont understand what you mean
11:02:43PMunchI'm lost as well..
11:02:50miprihttps://play.nim-lang.org/#ix=2Che
11:02:54FromDiscord<Rika> maybe we dont understand because we are too used to doing it
11:03:05FromDiscord<haxscramper> Can you show what you are trying to do? Like maybe `F` code that you need to convert to nim?
11:03:16FromDiscord<haxscramper> Or nim code you are having troubles with
11:03:16FromDiscord<Rika> F-asterisk
11:03:16Yardanicowell nim isn't really unique in terms of procedures or proc argument
11:03:17Yardanicos
11:03:18FromDiscord<Rika> lol
11:03:33Yardanicoit's not really different from most other statically typed languages
11:03:44FromDiscord<ShalokShalom> In F# I dont need to specify them
11:03:51FromDiscord<ShalokShalom> This is my main issue here
11:04:03Yardanicowell, you'll need to get used to it :)
11:04:06FromDiscord<haxscramper> @Rika actually `F` does exist too. But let's assume it is just glob for language names
11:04:09FromDiscord<ShalokShalom> F# has complet type inferrence.
11:04:24FromDiscord<ShalokShalom> (edit) "complet" => "complete" | "inferrence." => "inference."
11:04:36FromDiscord<haxscramper> Well, you write function that operates on some kind of data, right? Generally speaking
11:04:40FromDiscord<Rika> you can just use `auto` everywhere
11:04:43FromDiscord<Rika> i guess
11:04:46Yardanicodon't
11:04:48FromDiscord<ShalokShalom> Oho?
11:04:51FromDiscord<haxscramper> No
11:04:52Yardanicoit's better to learn than to use auto
11:04:56FromDiscord<Rika> its not a great ide
11:04:57FromDiscord<Rika> (edit) "ide" => "idea"
11:04:58FromDiscord<ShalokShalom> Sad ๐Ÿ˜”
11:05:06FromDiscord<Rika> its a code smell and everyone's gonna hate you for it
11:05:07FromDiscord<Rika> lol
11:05:10FromDiscord<lqdev> this discussion again?
11:05:14Yardanicoyes
11:05:23Yardanicoidk, the concept of types seems very natural to me
11:05:24FromDiscord<haxscramper> Auto is basically `func [T0, T1, T2, T3]( ... )`
11:05:41FromDiscord<ShalokShalom> This all doesnt help
11:05:50FromDiscord<ShalokShalom> How to think about it?
11:05:50FromDiscord<Rika> well
11:05:59FromDiscord<Rika> its basically "just get used to it" i guess...
11:06:13FromDiscord<Rika> you can leave the types empty until you finish writing the function body
11:06:18FromDiscord<Rika> then add them
11:06:34Yardanico@ShalokShalom well, it's really natural
11:06:47FromDiscord<haxscramper> Idk, maybe you just need example of how to rewrite ML-like to nim? To understand the difference
11:06:53FromDiscord<Rika> most of us here already know what types should go onto parameters before we even know what the function body should look like so we really cant help
11:06:55FromDiscord<haxscramper> E.g. example
11:07:04miprigive the language a chance, as it is, and see how you like it after a bit. starting with how you can change the language to be more like one you already know is, at the least, delaying your learning the language as it is. and at the worst you'll run into crazy problems that only occur in your new variant of the language
11:07:12FromDiscord<ShalokShalom> @Rika And how do you know that?
11:07:16miprilike, maybe auto-everywhere Nim has really horrible compiler performance. who would know?
11:07:19FromDiscord<Rika> i dont know, experience?
11:07:23FromDiscord<ShalokShalom> @mipri I already tried three times
11:07:26FromDiscord<Rika> programming for years needing to put the types?
11:07:40FromDiscord<ShalokShalom> So how to start?
11:07:47Yardanicoby simple programs
11:07:53Yardanicomake a procedure to sum two INTEGERS
11:07:54Yardanicotwo numbers
11:07:58Yardanicomathematical functions etc
11:08:02Yardanicostrings
11:08:21FromDiscord<ShalokShalom> I dont like to think about that pre-advance
11:08:25Yardanicoyou don't have to
11:08:29FromDiscord<ShalokShalom> I can think about it later
11:08:31Yardanicoyou can write the function and then the types
11:08:39FromDiscord<ShalokShalom> Aha, ok?
11:08:47FromDiscord<ShalokShalom> And substitute with auto?
11:08:48FromDiscord<haxscramper> http://loup-vaillant.fr/tutorials/earley-parsing/parser.ml -> https://play.nim-lang.org/#ix=2yDb basically 1:1 rewrite of ocaml to nim
11:08:50Yardanicono
11:08:56Yardanico@ShalokShalom write the function, and then place types
11:09:04FromDiscord<Rika> thats what i said....
11:09:10Yardanicoit's not uncommon to change arguments of a function while you're writing it
11:09:19FromDiscord<ShalokShalom> Ah, ok
11:09:19FromDiscord<ShalokShalom> Super
11:09:20FromDiscord<Rika> > you can leave the types empty until you finish writing the function body
11:09:22FromDiscord<Rika> ๐Ÿ˜ฆ
11:10:19FromDiscord<ShalokShalom> Ah, I can make untyped? ๐Ÿฅณ
11:10:24FromDiscord<ShalokShalom> And add later.
11:10:59FromDiscord<Rika> you cant run it without types of course
11:11:20FromDiscord<ShalokShalom> What is the benefit of choosing C++ as compilation target instead C?
11:11:31FromDiscord<Rika> exceptions are faster AFAIK
11:11:45FromDiscord<ShalokShalom> I dont seem to find any docs on auto and untyped yet.
11:11:48FromDiscord<Rika> i dont know any other benefits other than that but i think there are more
11:12:13ForumUpdaterBotNew thread by Foldl: Signal processing in Nim?, see https://forum.nim-lang.org/t/7000
11:12:21FromDiscord<haxscramper> @ShalokShalom https://nim-lang.org/docs/manual.html#templates-typed-vs-untyped-parameters https://nim-lang.org/docs/manual.html#types-auto-type
11:12:35FromDiscord<ShalokShalom> Thanks a lot
11:12:37FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=2Chg
11:12:37FromDiscord<haxscramper> ~manual is just good to Ctrl+F in cases like this
11:12:38miprictrl-f untyped on the manual as well to get to "lazy type resolution for untyped"
11:12:38disbotmanual: 11the Nim Manual is https://nim-lang.org/docs/manual.html
11:12:38disbotmanual: 11just good to Ctrl+F in cases like this
11:12:42*TomDotTom joined #nim
11:12:46FromDiscord<Rika> bruh
11:12:47FromDiscord<Rika> lmao
11:12:48FromDiscord<haxscramper> shit
11:12:50FromDiscord<Rika> HAHAHAHAHA
11:12:56FromDiscord<haxscramper> But actually
11:13:11FromDiscord<haxscramper> I just don't know how to delete
11:13:16FromDiscord<Rika> ask disruptek
11:13:18FromDiscord<Rika> when theyre here
11:13:26FromDiscord<haxscramper> I think he will leave it as is
11:13:28FromDiscord<Idefau> no dont you will unleash chaos
11:15:22FromDiscord<Yardanico> 7000th forum thread yess
11:15:43FromDiscord<ShalokShalom> Is the forum stable now?
11:15:48FromDiscord<Yardanico> ??
11:15:50FromDiscord<Yardanico> it's always been "stable"
11:15:55FromDiscord<ShalokShalom> I experienced couple of issues about a year ago
11:16:03FromDiscord<ShalokShalom> With sites not loading and so on.
11:16:15FromDiscord<ShalokShalom> So hiccup free now?
11:16:17*TomDotTom quit (Client Quit)
11:16:32*TomDotTom joined #nim
11:16:43FromDiscord<Rika> nothing is truly hiccup free
11:17:02miprishit happens. Shit hasn't happened recently.
11:18:03FromDiscord<ShalokShalom> Is Nim suitable as a first language?
11:19:01FromDiscord<haxscramper> I think yes, it is good enough as a first language
11:19:34FromDiscord<haxscramper> Also see: https://www.reddit.com/r/nim/comments/jdcu21/is_nim_good_for_beginner_programmers/
11:19:53FromDiscord<rc-05> @ShalokShalom Well yes, it has python-like syntax so it's readable unlike Rust and C++
11:20:02FromDiscord<Rika> i think its still hard if you have no one to ask questions to
11:22:42miprithe single most beneficial quality for a language being good as a first language, is it having a community that will look at your entire pasted program and tell you that you had a typo, or who can read the compiler's error message back to you with emphasis.
11:23:05mipriNim has play.nim-lang.org and these chats, so it suffices.
11:23:56FromDiscord<Rika> well most people wont check the chats
11:24:10mipripeople debating the finer points of a language being good/bad are fooling themselves about how difficult programming is overall.
11:26:19FromDiscord<rc-05> @Rika There's still the manual if you are not sure for how something is done and luckily IDE integration is not bad for Nim
11:26:38FromDiscord<ShalokShalom> I like all of this
11:30:13FromGitter<gogolxdong> Does UncheckedArray need alloc and free memory manually?
11:30:27miprino, neither
11:30:28FromDiscord<Rika> yes
11:30:31FromDiscord<Rika> wait huh?
11:30:38FromDiscord<Rika> oh you mean converting to UA? no
11:31:08mipriyeah casting to it for ptr arithmetic, as in https://play.nim-lang.org/#ix=2Che
11:32:32FromDiscord<Rika> yeah dont dealloc it
11:33:28FromGitter<gogolxdong> Will an UncheckedArray[T] field of object type grow/shrink or just used as casting?
11:33:43mipriit's unchecked, it doesn't even know what its length is
11:33:47FromDiscord<Rika> just use for casting
11:34:04FromDiscord<Rika> its like pointer used as array in c
11:34:05mipriwith experimental view types you can have openArray[T] in a field with a length
11:35:17FromGitter<gogolxdong> sizeof an object with UncheckedArray field is 1.
11:36:14FromDiscord<Rika> because its a pointer
11:36:16FromDiscord<warcrimecommiter1337> piss and fart
11:36:21FromDiscord<Rika> oh, 1
11:36:23FromDiscord<Rika> thats weird
11:36:23mipriyou probably want a ptr UncheckedArray[T] field. that'll have a sizeof of 8
11:36:27*luis_ joined #nim
11:36:28FromDiscord<ShalokShalom> Hnn, there are a lot of examples in the documentation who dont run since they are incorrectly indented.
11:36:34FromDiscord<Yardanico> for example?
11:36:36FromDiscord<Rika> @ShalokShalom examples?
11:36:53FromDiscord<ShalokShalom> https://nim-lang.org/docs/options.html#some%2CT
11:37:07FromDiscord<Rika> its not incorrectly indented
11:37:08FromDiscord<Yardanico> how is it incorrectly indented?
11:37:20FromDiscord<Yardanico> it's actually being checked, it's a runnableExamples - https://github.com/nim-lang/Nim/blob/version-1-4/lib/pure/options.nim#L108
11:37:22FromDiscord<warcrimecommiter1337> shit, even
11:37:28FromDiscord<ShalokShalom> https://play.nim-lang.org/#ix=2ync
11:37:29FromDiscord<Rika> https://play.nim-lang.org/#ix=2Chk
11:37:30FromDiscord<Rika> works here
11:37:41FromDiscord<Yardanico> @ShalokShalom ??
11:37:50FromDiscord<Yardanico> your snippet wrosk
11:37:51FromDiscord<Yardanico> (edit) "wrosk" => "works"
11:37:57FromDiscord<Rika> yes
11:38:20FromDiscord<ShalokShalom> Oh, this is after I edited it
11:38:24FromDiscord<ShalokShalom> Wait a second
11:38:46miprijust point to the example in the documentation
11:40:12mipriwhat you might be running into is that "incorrect indentation" is an answer you'll readily get from indentation-unrelated syntax errors. If you're pasting a bunch of examples into the same file, you might've broken syntax earlier, or the examples may not all work right next to each other.
11:40:38FromDiscord<Yardanico> yeah, sometimes the compiler gives you "incorrect indentation" errors when you have invalid code
11:40:40mipribut it's definitely not the case that there are lots of examples in the docs that don't work because they're incorrectly indented.
11:40:42FromDiscord<Yardanico> but not invalid indentation
11:40:53FromDiscord<Yardanico> yeah, most examples nowadays are checked with runnableExamples
11:40:55FromDiscord<Yardanico> so they're tested
11:41:10FromDiscord<ShalokShalom> @Yardanico runnableExamples gets checked when the website gets build?
11:41:15FromDiscord<Yardanico> when docs are built
11:41:37FromDiscord<Yardanico> and it's a part of CI
11:41:41FromDiscord<Yardanico> so it's checked for every commit
11:42:00FromDiscord<ShalokShalom> Now it works
11:42:11FromDiscord<ShalokShalom> I think its an issue with the new mobile Firefox
11:42:25*luis_ quit (Remote host closed the connection)
11:42:34FromDiscord<ShalokShalom> It has a new renderer and makes a lot of issues in online code editors
11:43:09FromDiscord<ShalokShalom> Can I saw that I want the type inference in bindings happen to be left associated?
11:44:23FromDiscord<ShalokShalom> const name = 1 becomes type 'name'
11:44:29FromDiscord<Yardanico> what
11:44:30FromDiscord<ShalokShalom> (edit) "becomes" => "โ†ตbecomes"
11:44:39FromGitter<gogolxdong> https://play.nim-lang.org/#ix=2Chm can this auto-generated snippet be replaced with a native operation, I think it essentially grows an buffer, and add p_payload by delta.
11:44:48FromDiscord<ShalokShalom> !eval name = 1
11:44:50NimBotCompile failed: /usercode/in.nim(1, 1) Error: undeclared identifier: 'name'
11:45:00FromDiscord<ShalokShalom> !eval const name = 1
11:45:07NimBot<no output>
11:45:21FromDiscord<ShalokShalom> I want that to be the type of the key, automatically
11:45:28FromDiscord<Yardanico> i don'
11:45:31FromDiscord<Yardanico> (edit) "don'" => "don't get you again :("
11:45:32FromDiscord<ShalokShalom> Instead the primitive on the right side.
11:45:53mipri!eval const name = 1; echo name.typeof
11:45:55NimBotint
11:46:02FromDiscord<ShalokShalom> Yeah
11:46:16PMunchAnd what type do you want it?
11:46:19FromDiscord<ShalokShalom> Can I auto-infer this as type name instead int?
11:46:31FromDiscord<Yardanico> AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
11:46:36FromDiscord<Rika> no, you have to explicitly declare distinct types
11:46:38FromDiscord<ShalokShalom> I want to precise my types, so to not use a lot of ints
11:46:46FromDiscord<ShalokShalom> @Rika I want to change that.
11:46:57FromDiscord<ShalokShalom> Like, by default always the left side.
11:47:02PMunchYou can set up a macro for it
11:47:04miprithis is, at least, something that a template can probably do for you.
11:47:07FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2Chn
11:47:19FromDiscord<ShalokShalom> ๐Ÿฅณ
11:47:30FromDiscord<ShalokShalom> Thats really amazing
11:47:51FromDiscord<Rika> it's not as easy as F# sure, but its at least doable ๐Ÿ˜›
11:48:05FromDiscord<ShalokShalom> Nim is way more flexible than F#
11:48:10FromDiscord<Rika> i think in some languages its much more janky to do than in nim
11:48:21FromDiscord<ShalokShalom> Its just less capable on the issue of type inference.
11:48:35mipridoes F# really have anything like this? OCaml doesn't have it
11:48:39FromDiscord<ShalokShalom> The flexibility of Nim is unmatched
11:49:03FromDiscord<ShalokShalom> No, I dont think so, macros are not really a thing in FSharp I think
11:49:34FromDiscord<ShalokShalom> Lisp comes close to Nim, but I have yet to find another language that is so capable with its macro system
11:49:42FromDiscord<Rika> @ShalokShalom its matched (actually beaten) by lisp afaik, but you tell me how fun you find programming in lisp :PPP
11:50:15FromDiscord<ShalokShalom> Yeah, I know lisp a little bit
11:50:28FromDiscord<ShalokShalom> And actually, the new version of Racket will be indentation based.
11:50:34FromDiscord<Rika> that's funky
11:50:38FromDiscord<Rika> radical change
11:50:42FromDiscord<Rika> feel like many lispers will hate on it
11:50:42FromDiscord<ShalokShalom> Yeah ๐Ÿ˜Ž
11:51:21FromDiscord<ShalokShalom> So, I have seen a video of one of the maintainers, who explains it
11:51:33FromDiscord<rc-05> @Rika Hey don't you like all these parenthesis?
11:51:37FromDiscord<ShalokShalom> Racket is always an educational language, so they justify it by that.
11:52:15FromDiscord<Rika> lmao
11:52:29FromDiscord<Rika> most people say its abstracted away by the IDE and i get it
11:52:45FromDiscord<Rika> but its not uncommon for many programmers to edit on stock vim
11:52:51FromDiscord<ShalokShalom> Yeah, but you need to get used to it
11:53:01FromDiscord<ShalokShalom> They say, after 6 months, you dont see it anymore
11:53:07FromDiscord<Rika> thats a long time...
11:53:18FromDiscord<ShalokShalom> But first: I dont like to go through these 6 months, exactly
11:53:41PMunch@ShalokShalom: https://play.nim-lang.org/#ix=2Chp
11:53:49FromDiscord<ShalokShalom> And second: Why put them there, when you dont see them afterwards, and this is a desirable thing
11:54:13FromDiscord<Rika> pmunch: cant you also move the type definition into the macro?
11:54:16FromDiscord<Rika> or is that not gonna work
11:54:25PMunchSure
11:54:31FromDiscord<Rika> i guess its more work
11:54:37PMunchNot really
11:54:44FromDiscord<Rika> i guess its "implementation is up to the reader"
11:54:49FromDiscord<Rika> ๐Ÿ˜›
11:54:57PMunchhttps://play.nim-lang.org/#ix=2Chq
11:55:00FromDiscord<ShalokShalom> This is awesome
11:55:10FromDiscord<ShalokShalom> I still like to have that build in
11:55:23FromDiscord<ShalokShalom> Without specifying it always
11:55:33FromDiscord<ShalokShalom> Just evaluate the type according to the name
11:55:44FromDiscord<ShalokShalom> I guess this takes a more invasive approach?
11:55:47PMunchOr if you want to allow all types, not just distinct ints: https://play.nim-lang.org/#ix=2Chr
11:55:53FromDiscord<Rika> not sure what you mean by invasive
11:56:08PMunchIf it was the default pretty much all Nim code would break :P
11:56:17FromDiscord<Rika> and its not really desired
11:56:18FromDiscord<ShalokShalom> Well, changing actually the type inference
11:56:25PMunchlet x = 10, 10 would now be a distinct int named x
11:56:31FromDiscord<Rika> i dont think a lot of us nimions want something like this
11:56:32FromDiscord<ShalokShalom> @PMunch Yeah, but just for me, like with a build trigger
11:56:37FromDiscord<Yardanico> @Rika exactly
11:56:45FromDiscord<ShalokShalom> I want distinctive tyoes
11:56:54FromDiscord<Rika> most of us dont which is why its not in the stdlib
11:57:07FromDiscord<Rika> but hey, you have this macro now
11:57:08FromDiscord<Yardanico> @ShalokShalom so declare them explicitly :)
11:57:12FromDiscord<Rika> you can just put this in a util file and use it
11:57:13FromDiscord<ShalokShalom> I dont see the sense in 40 different string types, which are not supposed to be mixed, but its still possible to do so
11:58:08FromDiscord<ShalokShalom> @Yardanico I do like this in my code without noise.
11:58:15PMunchBut now you need to name your variables the same as whatever the arguments of your procedures accept
11:58:17FromDiscord<ShalokShalom> @Rika util file?
11:58:19FromDiscord<Yardanico> "noise" is very subjective
11:58:20PMunchWhich can get confusing
11:58:38FromDiscord<ShalokShalom> @PMunch Sure?
11:58:40miprithere will be noise though, because once you use these distinct types you're going to be constantly stripping the type
11:58:44FromDiscord<ShalokShalom> I havnt done this yet.
11:58:58mipriit's going to be name.int, thing.int, something.int all over
11:59:09FromDiscord<ShalokShalom> Isnt mixing dozens of different ints potentially dangerous?
11:59:15FromDiscord<Rika> @ShalokShalom like in whatever library you're developing, you'd put this in some file called "util.nim" that everything else imports, or something like that
11:59:24FromDiscord<Rika> > Isnt mixing dozens of different ints potentially dangerous?โ†ตnot necessarily
11:59:27FromDiscord<Rika> to a point it is
12:00:03FromDiscord<Rika> but if you're careful enough it wont, like using distinct ints for not literally all variables, but only for distinctly different variables
12:00:24FromDiscord<Rika> so something like measurements in metres can be one distinct int and inches can be another
12:00:33FromDiscord<Rika> many vars can be in metres, same for inches
12:00:36FromDiscord<ShalokShalom> Aah, ok
12:00:40FromDiscord<Rika> but its fatal to mix them
12:00:44FromDiscord<ShalokShalom> So I can name this how I want.
12:01:06PMunchI mean I could get behind implicitly creating distinct types when you define a type with a variable that doesn't exist
12:01:15FromDiscord<ShalokShalom> @mipri Thats confusing indeed.โ†ตโ†ตIs there a way around this?
12:01:19FromDiscord<Yardanico> no
12:01:21FromDiscord<Yardanico> it's intended
12:01:25FromDiscord<Yardanico> Nim has a strict type system
12:01:27FromDiscord<Rika> that's the point of distinct ints
12:01:29PMunchSo `var distance: Meter = 10` creates Meter if it doesn't already exist
12:01:31FromDiscord<Yardanico> you can work around it with converters
12:01:37FromDiscord<Rika> so you dont just mix it with another int
12:01:38FromDiscord<Yardanico> but then you lose the whole point in distinct types
12:01:48FromDiscord<ShalokShalom> And why do primitive types that not?
12:01:51FromDiscord<Yardanico> ?
12:02:00FromDiscord<Rika> > And why do primitive types that not?โ†ตwdym? i didnt understand
12:02:17FromDiscord<ShalokShalom> Can I not infer strings and such as what they are, and then put my distinctive type over it?
12:02:26FromDiscord<Rika> i uh
12:02:30FromDiscord<Rika> dont get it still
12:02:31FromDiscord<Rika> sorry
12:02:46FromDiscord<Rika> i assume its hard for us who didnt come from highly functional languages
12:02:52FromDiscord<Rika> to understand, i mean
12:03:27miprimy internal time-series graphs of "what on EARTH are you talking about" are getting pretty entertaining to look at
12:03:33FromDiscord<Yardanico> exactly
12:03:52mipriFP langs don't use a lot of distinct types, that's more of an Ada thing
12:04:05FromDiscord<Yardanico> @ShalokShalom maybe you should just accept that nim is an imperative language at its core
12:04:12FromDiscord<ShalokShalom> Nooooo
12:04:28FromDiscord<Yardanico> of course you can do functional and stuff, but the language isn't made specifically for that
12:04:30FromDiscord<Rika> mipri: i mean nim is kinda inspired by ada i think..... xd
12:04:35FromDiscord<ShalokShalom> func is pure
12:04:43FromDiscord<ShalokShalom> Not even F# has that
12:04:43FromDiscord<Idefau> same
12:04:49FromDiscord<ShalokShalom> Almost no language does
12:04:55FromDiscord<ShalokShalom> So, fresh from the start
12:05:05FromDiscord<ShalokShalom> int, string and so on are primitive types
12:05:18FromDiscord<Yardanico> "func" is not 100% pure either ;)
12:05:24FromDiscord<ShalokShalom> Appearently, they behave differently in certain cases
12:05:26FromDiscord<Yardanico> you can do "var int" just fine
12:05:28FromDiscord<Idefau> func is useful for math stuff but its not like it makes nim functional
12:05:30FromDiscord<Yardanico> in afunc
12:05:34FromDiscord<Yardanico> @Idefau exactly
12:05:36FromDiscord<ShalokShalom> @Yardanico 1.4 catched the last edge case?
12:05:46FromDiscord<Yardanico> @ShalokShalom no, "var int" and similar is allowed
12:05:46FromDiscord<ShalokShalom> I got told.
12:05:48FromDiscord<Yardanico> explicitly
12:06:02*supakeen quit (Quit: WeeChat 2.9)
12:06:02FromDiscord<ShalokShalom> Within a func?
12:06:03FromDiscord<Yardanico> 1.4 with strictFuncs is for deep immutability with refs unless you specify that you want to mutate them explicitly
12:06:10FromDiscord<Yardanico> @ShalokShalom yes
12:06:15FromDiscord<Yardanico> I mean in the arguments
12:06:17FromDiscord<ShalokShalom> Yeah, and I heard this is the last edge case
12:06:21FromDiscord<Yardanico> it's not an edge case
12:06:25FromDiscord<Yardanico> it's explicitly allowed
12:06:28FromDiscord<ShalokShalom> ๐Ÿ™„
12:06:33*supakeen joined #nim
12:06:40miprivar in func has nothing to do with the purity of the function, but with the FPness of it
12:07:10mipriyou can write an imperative loop that mutates an index across an array
12:07:23mipribut it doesn't have side effects.
12:07:48FromDiscord<ShalokShalom> Thats fine
12:07:52FromDiscord<ShalokShalom> puh
12:07:58FromDiscord<ShalokShalom> I just want it pure
12:08:12FromDiscord<ShalokShalom> So, fresh: primitive types are dangerous
12:08:17FromDiscord<ShalokShalom> (To me)
12:08:17FromDiscord<Rika> you can always not make it var anyway
12:08:22FromDiscord<ShalokShalom> I dont wanna mix that
12:08:35FromDiscord<Rika> > So, fresh: primitive types are dangerousโ†ตhow so...
12:08:36FromDiscord<ShalokShalom> And I dont see the sense in a type system, that encourages us to do so
12:08:41Yardanicoaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
12:08:42FromDiscord<Idefau> i am primitive
12:09:07FromDiscord<Yardanico> @ShalokShalom efficiency is the main Nim's goal
12:09:16FromDiscord<Yardanico> primitive types are the best for performant code
12:09:24FromDiscord<Rika> im really sorry but i think a lot of us have a different opinion from you
12:09:25FromDiscord<ShalokShalom> @Rika Since mixing types is dangerous whenever that is unintentional
12:09:26FromDiscord<Yardanico> not some boxed ints, but pure ints
12:09:39FromDiscord<ShalokShalom> How is mixing two completely unrelated numbers senseful?
12:09:41FromDiscord<Yardanico> @ShalokShalom the compiler just won't compile if you're "mixing types" when you can't do that
12:09:46FromDiscord<ShalokShalom> That counters the sense of types
12:09:47FromDiscord<Yardanico> @ShalokShalom they're both numbers
12:10:00narimiranend of 2020 and you guys still feed trolls? c'mon
12:10:09FromDiscord<Rika> i dont think he's a troll
12:10:14FromDiscord<Idefau> i am troll food
12:10:17FromDiscord<Rika> just someone with a massive difference in opinion
12:10:19FromDiscord<ShalokShalom> But age and the amount of money on my bank account is supposed to be mixed?
12:10:20mipriI think he is, but don't worry about it.
12:10:29FromDiscord<Yardanico> @ShalokShalom you can use distinct types for this
12:10:33FromDiscord<Rika> you can do it
12:10:35FromDiscord<Rika> just explicitly
12:10:36FromDiscord<Yardanico> but you don't want to use them for EVERYTHING
12:10:43FromDiscord<Rika> also can always do it with a macro
12:10:45FromDiscord<Rika> but yeah
12:10:52FromDiscord<Rika> its not a great idea to do it for everything
12:10:56FromDiscord<ShalokShalom> Why is it not helpful?
12:10:59FromDiscord<Rika> there should be a limit to it
12:11:12FromDiscord<Idefau> make a DSL that is entirely functional
12:11:17FromDiscord<Idefau> somehow
12:11:19FromDiscord<Idefau> B)
12:11:21FromDiscord<ShalokShalom> Isnt that like saying I dont want static types always and dynamic ones are a good default?
12:11:25FromDiscord<Rika> i have to go, i really dont want to get stressed over a conversation again, sorry again
12:11:34mipri"oh you're adding apples and oranges there. it doesn't make sense." -> "ok fine, I am now adding apples.fruit and oranges.fruit, and getting a fruit. Now it makes sense." the end result is a lot of noise that makes it easy for actual, serious bugs to slip through because the code is physically harder to follow.
12:11:35FromDiscord<Yardanico> yeah me too :P
12:11:36FromDiscord<Clyybber> @ShalokShalom sup, whats the question?
12:11:42FromDiscord<ShalokShalom> Hi
12:12:27FromDiscord<ShalokShalom> So, I am not a troll
12:12:50FromDiscord<ShalokShalom> I am just interested into what I think makes sense and strict type systems are that, as an example
12:12:57FromDiscord<Yardanico> but your phrasing is very very very hard to understand for other people
12:13:00FromDiscord<Yardanico> and your arguments as well
12:13:04FromDiscord<ShalokShalom> I have the feeling primitive types counter that idea.
12:13:13FromDiscord<Idefau> same
12:13:18FromDiscord<ShalokShalom> Yeah, probably because I dont have the experience
12:13:21FromDiscord<ShalokShalom> Not on purpose
12:13:29FromDiscord<Yardanico> @ShalokShalom when needed, you can use "distinct int"
12:13:38FromDiscord<Yardanico> but in most cases "int" is just enough
12:14:00FromDiscord<ShalokShalom> But isnt it that in large code bases, its easy to mix types unintentionally
12:14:03miprior you can lean on range types, to be more like Ada
12:14:13FromDiscord<ShalokShalom> And isnt this, why we have compile time type checking
12:14:18FromDiscord<Yardanico> @ShalokShalom you can't mix int with a distinct int
12:14:23FromDiscord<ShalokShalom> @mipri Range types?
12:14:32FromDiscord<Yardanico> yes, range types
12:14:35FromDiscord<Yardanico> the manual exists :)
12:14:44FromDiscord<ShalokShalom> @Yardanico Yeah, but why cant I use distinctive types by default?
12:14:47FromDiscord<Yardanico> https://nim-lang.org/docs/manual.html#types-subrange-types
12:14:58FromDiscord<ShalokShalom> I thought that is a concept
12:14:59FromDiscord<Clyybber> @ShalokShalom distinct types by default don't make sense
12:15:03narimiranuse them by default, who's stopping you? :D
12:15:11narimiran(in your code, that is)
12:15:18FromDiscord<ShalokShalom> Not an actual implementation
12:15:24FromDiscord<Clyybber> I know what you are getting at, since last time you wanted each variable to have its own type
12:15:30narimiranlol
12:15:36FromDiscord<Yardanico> and previously he wanted to not have types at all :)
12:15:38FromDiscord<Idefau> lol you pinged someone else
12:15:45FromDiscord<ShalokShalom> @mipri I actually love that ๐Ÿ‘€
12:15:49Yardanico@idf: old
12:15:53Yardanicoidk why it pinged in this case though
12:15:55FromDiscord<ShalokShalom> It shows exactly, what it is doing.
12:15:56Yardanicothe new rule is pretty clear
12:16:00Yardanicotest yardanico
12:16:00FromDiscord<ShalokShalom> I like that
12:16:01mipri!eval var x: range[0..5]; echo (x.typeof.low, x.typeof.high)
12:16:04NimBot(0, 5)
12:16:28FromDiscord<Clyybber> @ShalokShalom IMO you are confusing a type system with a symbol system
12:16:45FromDiscord<Clyybber> Computation is mixing different symbols in most languages
12:16:50FromDiscord<ShalokShalom> @Yardanico No, I wanted proper type inference that covers all the code.
12:17:18FromDiscord<Yardanico> yes, and "type annotations are bad"
12:17:18FromDiscord<Clyybber> take a look at crystal, it has global type inference
12:17:18FromDiscord<ShalokShalom> @YOU@narimiran I dont know how
12:17:31narimiranstart by reading the manual and tutorials
12:17:32FromDiscord<Yardanico> maybe learn Nim a bit first? :)
12:17:35FromDiscord<Clyybber> but no language that I know of has implemented "each symbol has its own type"
12:17:43narimiranand leave worries for later
12:17:47FromDiscord<ShalokShalom> @Yardanico Thanks. I am more looking for something else, I think
12:17:48FromDiscord<Clyybber> because its a unneccessary sophistication
12:17:52mipritype annotations in function signatures help a lot to prevent errors, meanwhile.
12:18:49FromDiscord<ShalokShalom> @Clyybber I would then default to specify those, which I like to have a different type
12:18:59FromDiscord<ShalokShalom> So its just a default.
12:19:10FromDiscord<Clyybber> So var a has type A
12:19:13FromDiscord<Clyybber> and var b has type B
12:19:15narimiranmaybe you need some other language....
12:19:33FromDiscord<Clyybber> whats the purpose
12:19:40miprinarimiran: not many languages allow this though: https://play.nim-lang.org/#ix=2Chp
12:19:45FromDiscord<ShalokShalom> @Clyybber No, they dont have a complete type inference either. And they also lack indendation based block building and Godot bindings, as well as compiling to C
12:20:05narimiranmipri: yeah, but nothing is good enough for him
12:20:11FromDiscord<ShalokShalom> @Yardanico I just prefer to read them in my IDE and F# does that successfully
12:20:12narimiran*them
12:20:18FromDiscord<Clyybber> @ShalokShalom there is no complete type inference
12:20:28FromDiscord<ShalokShalom> Tons of researchers and mathematics use it that way.
12:20:32FromDiscord<Clyybber> at some point you have to tell the programm a type
12:20:39FromDiscord<ShalokShalom> Type annotations are entirely optional
12:20:42FromDiscord<Yardanico> @ShalokShalom no
12:20:49FromDiscord<Yardanico> somewhere in the stdlib types are actually there
12:21:04FromDiscord<Yardanico> but for user code it might be "optional" because the compiler can figure it out based on other libraries you're using
12:21:07FromDiscord<Yardanico> which HAVE type annotations
12:21:43narimiranyeah yeah, type annotations are noise, but stuff like "System.IO.File.ReadAllText" is not
12:21:43mipriand if F# is like OCaml in this respect, modules still have types, and module definitions get pretty detailed
12:21:46FromDiscord<Idefau> see all these problems come from the very definition of a variableโ†ตjust use stacks for everthing
12:21:53FromDiscord<Idefau> (edit) "stacks" => "the stack"
12:22:02FromDiscord<ShalokShalom> @Clyybber FSharp makes type annotations completely optional and so does any other ML and Haskell like language, most of them just choose to do them as a convention.
12:22:02narimiran"Array.filter" is not noise
12:22:27narimiran"Seq.sort >> System.String.Concat" is not noise
12:22:27FromDiscord<Yardanico> @ShalokShalom but it knows that number is a number
12:22:28FromDiscord<Yardanico> and not a string
12:22:32FromDiscord<Clyybber> @ShalokShalom Because you are providing literals, which the types trickle down from
12:22:37FromDiscord<ShalokShalom> @mipri Modules are at least not higher order in F#, idk how else they are different
12:23:09FromDiscord<Clyybber> but I'm not sure what your proposal is
12:23:26miprinot as a 'convention', but as a practical consideration. If there were no explicit types at all anywhere in the language, then a newly introduced bug that you just typed could result in an error message, not in your code, but deep in some core stdlib library
12:23:33FromDiscord<ShalokShalom> @Yardanico No. You really dont know what a HM type system is.
12:23:40FromDiscord<Yardanico> I do
12:23:46FromDiscord<Yardanico> and it still some kind of a source
12:23:52narimiranend of 2020 and you guys still feed trolls? c'mon
12:24:07mipri2020 isn't over yet. This is at least not as hellish as the outdoors.
12:24:11FromDiscord<Yardanico> yeah sorry i'll stop
12:24:45FromDiscord<Idefau> when 2020 ends i will restart it for my own pleasure
12:24:51mipriI just hope I won't be saying in a few years, "don't worry, the decade will be over one day"
12:25:01miprilet's keep this shit fully contained in 2020
12:25:04FromDiscord<ShalokShalom> @Clyybber I dont propose anything
12:25:12narimiranthis decade ends in ~2 months ;)
12:25:24mipriwhat, are you counting from 1? heretic
12:25:31FromDiscord<Idefau> why yes the month 0
12:25:36narimiranyes, discussing about year 0 and year 1 is more productive than the stuff above
12:25:53FromDiscord<Clyybber> !echo 0x2b or not 0x2b
12:25:55narimiranmipri: so, you're still in 2019?
12:26:10FromDiscord<Clyybber> !eval echo 0x2b or not 0x2b
12:26:12NimBot-1
12:26:17FromDiscord<Clyybber> thanks idf
12:26:20FromDiscord<Idefau> np
12:26:39FromDiscord<Idefau> !eval echo 0x2be or not 0x2be
12:26:41miprihmm ... there was some language that recently removed the ability to change which index arrays start at ...
12:26:41NimBot-1
12:27:24FromDiscord<ShalokShalom> sent a long message, see http://ix.io/2Chy
12:27:35FromDiscord<ShalokShalom> These two ints are not meant to be mixed.
12:27:37FromDiscord<Idefau> const birthday: DateInt
12:27:39FromDiscord<Clyybber> you give them different types
12:27:41FromDiscord<Yardanico> @ShalokShalom we answered
12:27:43FromDiscord<Yardanico> use distinct ints
12:27:47FromDiscord<Yardanico> what else do you want? :)
12:27:53FromDiscord<Clyybber> type Date = int
12:27:53narimiranyour attention.
12:27:55FromDiscord<ShalokShalom> Use them by default
12:28:01FromDiscord<Clyybber> type Money = int
12:28:05FromDiscord<Yardanico> we don't think that it's good to use them by default
12:28:06FromDiscord<ShalokShalom> Thats all
12:28:08narimiranuse them by default, who's stopping you? :D
12:28:09FromDiscord<Yardanico> that's all
12:28:19FromDiscord<Clyybber> @ShalokShalom No, you can't infer distinct types
12:28:20FromDiscord<ShalokShalom> @Yardanico And I did not asked, if you think it is a good idea
12:28:21PMunchBut how would Nim know which types to give them?
12:28:23mipriah it was Perl. Perl no longer allows any first index to arrays but zero.
12:28:23FromDiscord<ShalokShalom> I asked, how to do that.
12:28:26FromDiscord<Idefau> but tbh if you dont store dates in unix time why even make it just int
12:28:30miprihttps://perldoc.perl.org/5.30.0/perldelta#Assigning-non-zero-to-$%5B-is-fatal
12:28:33FromDiscord<Yardanico> @ShalokShalom you can't.
12:28:36FromDiscord<Yardanico> that's the answer
12:28:40FromDiscord<Yardanico> nim stdlib DOESN'T use them in most cases
12:28:44FromDiscord<Yardanico> it uses plain simple ints
12:28:44FromDiscord<Clyybber> @ShalokShalom In the end you still want each variable to have by default its own type
12:28:45FromDiscord<ShalokShalom> @PMunch Always the name, so birthday and account_balance in this case
12:28:54PMunchThen use the macro I sent you
12:28:55FromDiscord<Clyybber> No language does that, thats why you are viewed as trollish by some
12:29:01FromDiscord<ShalokShalom> @Yardanico Fine, that too quite a long time
12:29:09FromDiscord<Clyybber> Its still possible in Nim tho
12:29:15FromDiscord<ShalokShalom> @PMunch I will try, thanks
12:29:28narimiranshow us the example in F# where you can do those and they are different type without any extra annotations
12:29:40FromDiscord<ShalokShalom> @Clyybber No language did tons of things that are common in Nim.
12:29:46FromDiscord<ShalokShalom> That alone is no argument
12:29:57FromDiscord<Idefau> sent a code paste, see https://play.nim-lang.org/#ix=2Chz
12:29:58FromDiscord<Idefau> i am a genius
12:29:59FromDiscord<ShalokShalom> @narimiran I did not say, that F# can do that
12:30:01miprionce you get used to saying snowflakevar.int, snowflakevar.int all the time as you use these variables, you'll end up adding money to time anyway, after explicitly .int'ing them, and you'll get the same bug you would've got with unsafe primitive types. Your code will just be harder to read.
12:30:58FromDiscord<ShalokShalom> @Idefau This is interesting and it confused me a bit. Does this happen due to the PascalCase or how?
12:31:24miprithere's nothing special with the types in that code.
12:31:36FromDiscord<Idefau> wrong its a secret feature
12:31:53FromDiscord<ShalokShalom> @Clyybber But then I do have to specify every one of them. I want exactly that, just infered. :)
12:32:03FromDiscord<Clyybber> yes but it doesn't make sense
12:32:09FromDiscord<Clyybber> it gives each variable its own type
12:32:28FromDiscord<ShalokShalom> Yes, by default
12:32:31FromDiscord<ShalokShalom> I like that
12:32:32FromDiscord<Clyybber> read mipri's argument
12:32:38FromDiscord<Clyybber> as to why it doesn't make sense
12:32:39FromDiscord<ShalokShalom> I can still choose to use other types
12:32:44FromDiscord<Clyybber> or idf04's why it doesn't
12:32:51FromDiscord<Clyybber> @ShalokShalom well, you can do that in nim
12:32:56FromDiscord<Clyybber> with a macro
12:33:15FromDiscord<Clyybber> but you have to create that yourself, nobody is interested in this "feature" :P
12:33:34FromDiscord<ShalokShalom> @mipri And I did already ask half an hour ago, why I need to specify it like that and primitives apparently do not?
12:33:47Yardanicobecause "int" is just "int"
12:33:49Yardanicotwo ints are of same type
12:34:05Yardanicobut "type Money = distinct int" and "type Time = distinct int" are of different types
12:34:26FromDiscord<Clyybber> how do you add a type A and a type B
12:34:33FromDiscord<Clyybber> you convert them to int and add them
12:34:51FromDiscord<ShalokShalom> So, I fully accept that, but this reads to me like dynamic typing, to an extend.
12:35:04FromDiscord<Clyybber> its not
12:35:05FromDiscord<ShalokShalom> To use int all over the place, to make mixing easier
12:35:09FromDiscord<ShalokShalom> I know
12:35:14FromDiscord<Clyybber> like not at all
12:35:15FromDiscord<ShalokShalom> Its just the same motivation
12:35:18FromDiscord<Clyybber> no its not.
12:35:35FromDiscord<Clyybber> What you are proposing is mixing the type system into the symbolic system
12:35:47FromDiscord<Clyybber> which provides nothing but additional sophistication
12:35:51FromDiscord<ShalokShalom> @Clyybber https://play.nim-lang.org/#ix=2Chr
12:36:04FromDiscord<ShalokShalom> It got already created for me, thanks.
12:36:10FromDiscord<Clyybber> nice :D
12:36:38ForumUpdaterBotNew thread by JPLRouge: Help use mq posix , see https://forum.nim-lang.org/t/7001
12:37:15FromDiscord<ShalokShalom> @Clyybber Well, I accept that this is not good. But I don't see the difference between my idea and specifying distinctive types
12:37:27FromDiscord<ShalokShalom> Its just the default behavior that is turned upside down.
12:37:41FromDiscord<Clyybber> yes
12:37:49FromDiscord<ShalokShalom> So either I specify the types when I want them different or I do the opposite
12:38:02FromDiscord<ShalokShalom> And specify them, when I like them the same.
12:38:03FromDiscord<Clyybber> but this will never be an option because it doesn't make sense
12:38:08FromDiscord<Clyybber> feel free to use that macro tho
12:38:17FromDiscord<ShalokShalom> So I dont see, why I am such an evil person
12:38:23FromDiscord<Clyybber> nobody said that?
12:38:33FromDiscord<Idefau> i am eating banana
12:38:38FromDiscord<ShalokShalom> I got accused of trolling.
12:38:43FromDiscord<ShalokShalom> Two times.
12:39:05FromDiscord<Clyybber> people have opinions and different fuse lengths :)
12:39:27FromDiscord<Clyybber> your idea is very alien because it makes no sense to almost everyone :D
12:39:40FromDiscord<Clyybber> thats why its written off as trolling naturally
12:39:57FromDiscord<Clyybber> but hey, you got a solution now, go use it :)
12:40:14FromDiscord<ShalokShalom> So, I like to change this behavior and switch the default. And you mean that this makes no sense. Now, I assume you say that, because you mean that the current behavior favors, what is used more often, yes?
12:40:35FromDiscord<Clyybber> it favors what makes sense when coding
12:40:50FromDiscord<ShalokShalom> @Clyybber Trolling is something totally different and you all are very aware about that
12:40:52narimiranit favors real programmers, not trolls
12:41:00FromDiscord<Yardanico> @ShalokShalom not really
12:41:08FromDiscord<Clyybber> because types are not intended to be oneshots usually
12:41:08FromDiscord<Yardanico> you just haven't seen other trolls in this channel before :)
12:41:21FromDiscord<Clyybber> but with your default types are by default oneshots
12:41:27FromDiscord<haxscramper> @ShalokShalom try Idris and dependent type systems, might be interesting for you. Hypothetically
12:41:32FromDiscord<ShalokShalom> https://en.m.wikipedia.org/wiki/Internet_troll
12:41:36FromDiscord<Yardanico> yes
12:41:50PMunchTBH I kinda like his idea
12:41:50FromDiscord<Yardanico> "Application of the term troll is subjective."
12:41:51narimiranwhy do i have to manually have to type "troll", why it can't be inferred automatically?
12:42:16FromDiscord<ShalokShalom> @haxscramper Yeah, I thought about it. Scala 3 also has dependent types but I look for a language that has actively maintained bindings to Godot.
12:42:20FromDiscord<ShalokShalom> Thanks though
12:42:28miprion the one hand, the compiler should infer all trolls for me automatically, but on the other hand, every single variable should have its own incompatible type of troll and any conversion needs to be explicit
12:42:46FromDiscord<Yardanico> @ShalokShalom btw, do you know that your idea wouldn't make sense with Godot bindings?
12:42:57narimiran*anything
12:43:21FromDiscord<ShalokShalom> @Yardanico How you mean?
12:43:32FromDiscord<Yardanico> you'll have to do all the ".int" conversions again
12:43:38FromDiscord<Yardanico> because godot bindings aren't written in your style
12:43:44FromDiscord<Yardanico> they use normal primitive types
12:43:56FromDiscord<ShalokShalom> Yes, I understand that.
12:44:29FromDiscord<ShalokShalom> Does this change, when there is simple a type declaration over it?
12:44:40FromDiscord<ShalokShalom> As with the type keyword
12:44:42FromDiscord<Idefau> just cast everything when you are bored of its type
12:44:48FromDiscord<Idefau> thats what i do, keeps the code spicy
12:44:52narimiran:D
12:45:02FromDiscord<ShalokShalom> So far as I understand does that just overlay the actual type
12:45:23FromDiscord<Yardanico> yes, and makes it impossible to mix a distinct type with the base type without explicit conversions
12:45:52narimiranif only we could have a possibility to somehow write down some code and see if and how it works
12:46:03Yardanicowho needs to write code, we can just talk about it instead
12:46:23FromDiscord<Idefau> !eval echo cast[float64]("hello world")
12:46:25NimBot6.924719417612215e-310
12:46:30narimiransometimes even just talking has lots of bugs
12:46:31FromDiscord<Idefau> see, spicy
12:46:46PMunch-_-
12:47:14FromDiscord<ShalokShalom> @Yardanico But this counts only, when I specifically interact with the Godot API, so I can write the whole entire logic without conversions, so long as I dont interact with Godot code, yes?
12:47:25Yardanicoyes if you actually write code, then yes
12:47:36Yardanicobut maybe when you'll start using your idea in code you'll see why it's not always the best
12:47:52FromDiscord<lqdev> i wouldn't say you're a troll, you're just very vocal about your opinions :p
12:47:53Yardanico!eval import random; randomize(); let true = bool(random(0 .. 1)); echo true
12:47:57NimBotCompile failed: /usercode/in.nim(1, 45) Error: undeclared identifier: 'random'
12:48:03Yardanico!eval import random; randomize(); let true = bool(rand(0 .. 1)); echo true
12:48:07NimBotfalse
12:48:10Yardaniconice
12:48:11FromDiscord<ShalokShalom> @narimiran Have this feeling since an hour
12:48:20FromDiscord<ShalokShalom> Thanks a lot you all.
12:48:24FromDiscord<Idefau> no problem
12:48:25FromDiscord<Idefau> anytime
12:49:01FromDiscord<haxscramper> @ShalokShalom what is your real-world use case? Not hypothetical musing about "40 distinct atrihnd", that might or might not be related to anything. What non-imaginary problem are you trying to solve? IDK, it might be useful to ask questions like that to yourself
12:49:13FromDiscord<ShalokShalom> @haxscramper There is no chance for such types in Nim, yes?
12:49:29Yardanicoyou. can. make. them. yourself
12:49:34Yardanicoin nim
12:49:40FromDiscord<haxscramper> There is work on "not nil", but they is different
12:49:44FromDiscord<Idefau> or just use the trick i told you
12:49:56FromDiscord<haxscramper> E.g. dataflow-dependent types
12:50:21FromDiscord<haxscramper> I don't exactly know correct term for this kind of thing, but it is more closely related to static analysis
12:50:33FromDiscord<ShalokShalom> @haxscramper I see the type system and its purpose served by it, its simply a disciple to prevent mixing types without intention to do so
12:50:36FromDiscord<haxscramper> Of data flow in code, not just types
12:50:42FromDiscord<ShalokShalom> Same cause for types in the first place
12:51:02mipria+b is intention to add a and b. a.int+b.int is also intention to add a and b.
12:51:36FromDiscord<ShalokShalom> @Idefau Oh, thanks for reminding me. I did ask, if this is requiring me to use capital letters, as you did?
12:51:40FromDiscord<Idefau> yes
12:51:41Yardanicomipri: but what if a doesn't like to be added!
12:51:45mipriby the code itself, neither the compiler nor a reader who doesn't understand more of the program can say whether the code aligns with some grander intention, like to not mix time and bank accounts
12:51:54YardanicoVariablesOpinionsMatter
12:52:12narimiranYardanico: `proc areYouWilling(a: a): aBool`
12:52:22FromDiscord<ShalokShalom> @Idefau Can you show me where this is described in the manual? Or how is it named, at least?
12:52:30FromDiscord<Idefau> its not described in the manual its a secret feature
12:52:35*mmohammadi9812 quit (Quit: Quit)
12:52:43miprithe ways to add this ability, to check intentions beyond whether your code merely type checks, are tests (famously) and theorem proving (developing)
12:52:48*mmohammadi9812 joined #nim
12:52:51FromDiscord<haxscramper> @ShalokShalom the question is just where "prevent mixing types" start to hinder productivity and for the sake of solving non-existent issues. Most languages don't have any kind of "distinct" types, except for wrapping everything in classes. Nim has distinct, but this is opt-in
12:53:20FromDiscord<haxscramper> But if you make it opt-out it just took annoying for 99% of the code
12:53:21FromDiscord<ShalokShalom> Yes, I just try to figure this out for myself
12:53:24miprialso, less automatically: documentation, comments, an easy to understand program layout
12:53:32FromDiscord<ShalokShalom> @haxscramper Ok, I understand
12:53:39FromDiscord<Clyybber> @ShalokShalom hes joking, its not a secret feature, you can use any capitalisation you want
12:53:50miprithere is no degree of type shit that you can pull that will make some variant of a+b "self checking".
12:53:51FromDiscord<ShalokShalom> @Clyybber Yeah, I guessed.
12:53:55FromDiscord<Clyybber> :D
12:53:58narimiran...but be sure to use something that nobody else uses
12:54:00FromDiscord<ShalokShalom> But then its not working the way he described it
12:54:44FromDiscord<Idefau> !eval const StringHello="Hello World"; echo StringHello.type
12:54:46NimBotstring
12:54:50FromDiscord<Idefau> see?
12:54:58FromDiscord<ShalokShalom> @mipri But could we not say the same about static types in general then?โ†ตโ†ตCould we not replace them with all those things?
12:55:01narimirantl;dr of last hour or so here: "can i do this?" "yes", "how?" "like this", "but i can't do it" "you can", "can you show me how?" "like this", "but i can't use it" "you can"
12:55:42FromDiscord<ShalokShalom> @haxscramper where is the difference between 'destinct' and 'type'?
12:55:47narimiranhttps://nim-lang.github.io/Nim/manual.html#types-distinct-type
12:55:56narimiraneven has examples!
12:55:58FromDiscord<Idefau> the difference is that `destinct` doesn't exist and `type` does
12:56:05miprisure yeah, you could all type checking and just have a NASA-tier spec. NASA put Forth into space after all.
12:56:36narimiranbut it has two currencies, not one currency and one birthday, so it must not be the thing asked for!
12:56:39mipriI'm not saying types aren't useful, just that you're wanting more from them than they can provide on their own.
12:56:42FromDiscord<ShalokShalom> @mipri I love domain modeling made functional, that is a technique that Scott Wlaschkin developmed and that uses pipes and option types, to do that.
12:56:50FromDiscord<ShalokShalom> Types in Nim are nominal, yeah?
12:56:55FromDiscord<ShalokShalom> Not structured?
12:57:00FromDiscord<Clyybber> theres concepts
12:57:04FromDiscord<Clyybber> but objects are nominal
12:57:23FromDiscord<ShalokShalom> Concepts?
12:57:27narimirannooooooooo
12:57:47FromDiscord<Idefau> the concept of a concept is well defined in the concept of a manual of a conceptual real world programming language
12:57:55FromDiscord<Clyybber> @ShalokShalom https://nim-lang.github.io/Nim/manual_experimental.html#concepts
12:58:07Yardaniconarimiran: :(((((((((((((9
12:58:07FromDiscord<ShalokShalom> @narimiran thanks a lot
12:58:44FromDiscord<lqdev> you know what? i'd just suggest that you stop complaining and asking about what nim is and just start programming in it.
12:59:02FromDiscord<lqdev> read the manual, understand language concepts
12:59:19FromDiscord<lqdev> and THEN share your opinions :)
13:01:07*abm joined #nim
13:01:15*abm quit (Remote host closed the connection)
13:03:45FromDiscord<ShalokShalom> I ask first, since it helps me to understand if I am interested to invest so many hours into it
13:05:25FromDiscord<haxscramper> I highly recommend
13:05:29FromDiscord<ShalokShalom> I think especially the type annotations everywhere make the otherwise very reasonable and readable syntax very confusing
13:05:31FromDiscord<haxscramper> ~manual
13:05:32disbotmanual: 11the Nim Manual is https://nim-lang.org/docs/manual.html
13:05:32disbotmanual: 11just good to Ctrl+F in cases like this -- haxscramper
13:05:41FromDiscord<haxscramper> Top to bottom, about 2-3 hours
13:05:44FromDiscord<ShalokShalom> I already looked through that multiple times.
13:06:06FromDiscord<ShalokShalom> And its well written, definitely the most helpful part of the documentation to me
13:07:04FromDiscord<haxscramper> Then, next question: what problem are you trying to solve with nim? Sometimes specific or just learning imperative programming in general?
13:07:38FromDiscord<haxscramper> If it the latter just do exercim or something, no amount of words can give good feeling for the language
13:07:44FromDiscord<haxscramper> Without writing code
13:08:21FromDiscord<ShalokShalom> Godot
13:10:21FromDiscord<Clyybber> btw godot uses variants a lot, essentially dynamic typing
13:12:37FromDiscord<ShalokShalom> @mipri I think this helps me a lot. Now I can see that I was constantly on the search to the mentioned domain modeling, that actually does that for me. So since pipes and option types are available in Nim, is this possible for me here. I am still annoyed by that type annotations ๐Ÿ˜‚
13:12:55FromDiscord<ShalokShalom> But it offers me so much more, like the macros and pure func.
13:13:03FromDiscord<ShalokShalom> Thats why I am annoying ๐Ÿ˜‹
13:14:13FromDiscord<ShalokShalom> @Clyybber Godot gets static typing truly in 4.0 and if you like it purely for the type checking (and not for the performance increase) is it already ready for that. It has also constants.
13:14:42FromDiscord<ShalokShalom> @Clyybber How you mean?
13:15:28FromDiscord<Clyybber> its C++/C api uses variants
13:15:37FromDiscord<ShalokShalom> Idk what that is.
13:15:49FromDiscord<Clyybber> I doubt they are gonna change that just because GDScript got static typing
13:15:55FromDiscord<ShalokShalom> Yes, yes
13:16:00FromDiscord<ShalokShalom> I misread that first.
13:16:06FromDiscord<ShalokShalom> Sorry
13:16:20FromDiscord<Clyybber> @ShalokShalom think of it as every object having an enum that indicates what it is
13:16:33FromDiscord<Clyybber> so if it is a Camera
13:16:36FromDiscord<Clyybber> or a Collider
13:16:54FromDiscord<Clyybber> and that information is not available at compile time
13:24:32*narimiran quit (Ping timeout: 260 seconds)
13:30:45ForumUpdaterBotNew thread by Vitreo12: Printing compilation string with color highlighting, see https://forum.nim-lang.org/t/7002
13:40:16*lbart quit (Ping timeout: 256 seconds)
13:48:57planetis[m]narimiran: Could you please add hacktoberfest tag to nim-lang/fusion? thanks
14:03:42blackbeard420when calling a nim library from c is simply calling 'NimMain' before the proc enough?
14:04:10PMunchIIRC that should be enough yeah
14:04:25blackbeard420thanks. it does work, i was just curious if i was missing anything
14:05:45PMunchAnd IIRC that is only required to initialise global variables
14:05:51PMunchAnd perhaps initialise the GC
14:06:44PMunchHmm, doesn't seem like it
14:07:07PMunchI don't call NimMain anywhere in my Nim DLL (or from the importing C code)
14:07:24PMunchOh wait, it might be run by some DLL hooks or something
14:13:06*voidpi quit (Quit: leaving)
14:14:41FromDiscord<Yardanico> yes
14:14:56FromDiscord<Yardanico> if you do --app:gui, nim will do the main stuff on dll attach
14:16:23PMunchWhat is "std" supposed to be?
14:16:52PMunchAs in the folder lib/std
14:18:27PMunchOops, gotta go
14:18:28*PMunch quit (Quit: leaving)
14:28:46*natrys quit (Ping timeout: 246 seconds)
14:41:52*natrys joined #nim
14:48:49*voidpi joined #nim
15:38:04*natrys quit (Ping timeout: 246 seconds)
15:39:29FromDiscord<Mimi_Sec> howdy all late to the nim game, is the windows module no longer a thing (saw the docs version was for 0.11.0)? was trying to import it for tinkering but no dice.
15:40:42FromDiscord<Mimi_Sec> Im aware of the winim library but was looking for good references for tinkering with windows apis
15:40:57miprino, that was moved to nimble, oldwinapi
15:41:09miprithere's still winlean and registry modules for windows
15:41:31miprihttps://github.com/nim-lang/oldwinapi
15:41:37FromDiscord<Mimi_Sec> yea i was messing around with winlean a bit, and was digging into the windows module when i noticed that its outdated
15:41:51FromDiscord<Mimi_Sec> oh sweet thanks
15:51:05FromDiscord<Yardanico> @Mimi_Sec you should also try out winim
15:51:10FromDiscord<Yardanico> it's generally better structured and stuff
15:51:11FromDiscord<Yardanico> !repo winim
15:51:12disbothttps://github.com/khchen/winim -- 9winim: 11Nim's Windows API and COM Library 15 137โญ 10๐Ÿด 7& 1 more...
15:51:13*hnOsmium0001 joined #nim
15:51:18*natrys joined #nim
15:54:37FromGitter<gogolxdong> Could `inc` be `proc inc*[T,O: Ordinal](x: var T, y:O = 1) {.magic: "Inc", noSideEffect.}` and etc. to make life easier
15:54:54FromDiscord<Yardanico> wdym?
15:55:07FromDiscord<Yardanico> ah, you mean the second arg
15:55:19FromDiscord<Yardanico> well then you can as well just use += :)_
15:56:23FromDiscord<lqdev> `inc` does have a second arg tho
15:56:31FromGitter<gogolxdong> include +=
15:56:46FromDiscord<Yardanico> @lqdev yes
15:56:48FromDiscord<Yardanico> but it's int
15:56:52FromDiscord<Yardanico> not the same type as the first arg
15:56:54FromDiscord<lqdev> ohh
15:57:06FromDiscord<lqdev> but that makes sense
15:57:12FromDiscord<Yardanico> at least that's how I understood @gogolxdong
15:57:15FromDiscord<Yardanico> @lqdev yeah IMO ti does
15:57:15FromDiscord<lqdev> why would you pass an enum there
15:57:17FromDiscord<Yardanico> (edit) "ti" => "it"
15:57:26FromDiscord<lqdev> you don't increment fruitApple by fruitBanana
15:57:28FromDiscord<lqdev> what does that even mean
15:57:49FromGitter<gogolxdong> `proc `+=`*T: SomeInteger (x: var T, y: T)` is for the same type
15:59:20FromGitter<gogolxdong> it makes code generated from c hard to work with. all I did is convert between cint, int32, uint64, int64 ...
15:59:52miprihttps://play.nim-lang.org/#ix=2CiS
16:00:23*oculux quit (Ping timeout: 258 seconds)
16:01:49FromGitter<iffy> I have an Android app (Java) and am using JNI to call Nim functions. Java calls `initNim()` which calls `NimNain()` and `someThreadMakingCode()`. I'm encountering a crashing race condition when trying to create a thread in Nim. I'm using `--gc:orc`.
16:02:31FromGitter<iffy> JNI claims to be fine with native/C code starting its own threads, and indeed if the thread has been created before `initNim()` returns, everything works, but if Nim starts the thread after `initNim()` returns, the app crashes.
16:03:16FromGitter<iffy> Is there something special in the way Nim makes threads that is incompatible with standard system/pthread threads?
16:05:42*lbart joined #nim
16:05:43*lbart quit (Changing host)
16:05:43*lbart joined #nim
16:08:08FromGitter<gogolxdong> arithmetic operator conduct on only the same type
16:09:56FromDiscord<lqdev> import lenientops
16:14:54FromGitter<gogolxdong> the best part may be you jump to the definition of the object field on assignment everytime.
16:27:21ForumUpdaterBotNew post on r/nim by dsrw: Enu 0.1 Demo. Open Source 3D live coding with Nim and Godot., see https://youtu.be/upg77dMBGDE
16:31:12FromDiscord<Idefau> enu is nice
16:33:26*NimBot joined #nim
16:34:30FromDiscord<Yardanico> wait
16:34:31FromDiscord<Yardanico> wrong link
16:34:31FromDiscord<Yardanico> lol
16:34:37FromDiscord<Yardanico> https://reddit.com/r/nim
16:34:45FromDiscord<Yardanico> https://www.reddit.com/r/nim/comments/jjqyqw/enu_01_demo_open_source_3d_live_coding_with_nim/
16:37:53*xace_ quit (Ping timeout: 260 seconds)
16:54:36*xace joined #nim
17:00:40*natrys quit (Ping timeout: 246 seconds)
17:00:42*letto_ quit (Ping timeout: 256 seconds)
17:08:21Prestigethat's pretty cool
17:10:32*narimiran joined #nim
17:11:47*natrys joined #nim
17:13:09ForumUpdaterBotNew question by Deno: Where to program with NIM (linux)?, see https://stackoverflow.com/questions/64577974/where-to-program-with-nim-linux
17:31:18FromDiscord<Avatarfighter> What's good everyone
17:43:02disruptekwho knows how native sets work in memory?
17:44:34disruptekugh.
17:44:44miprilib/system/sets.nim says they're array[0..4*2048-1, uint8]
17:44:55mipri!eval let x = {1,2,3}; echo x.sizeof
17:44:57NimBot8192
17:46:29disrupteki'm looking at bitsets.
17:46:48disrupteki need to encode this shit in the packed ast.
17:46:59mipri!eval let x = {1.char, 2.char, 3.char}; echo x.sizeof
17:47:03NimBot32
17:47:08mipriwrong anyway
17:47:18FromDiscord<Rika> wdym wrong?
17:47:40*tane joined #nim
17:47:51disruptek!eval echo {0..63}.sizeof
17:47:53NimBot8192
17:48:34disruptek!eval echo {0.int16 ..63}.sizeof
17:48:35NimBotCompile failed: /usercode/in.nim(1, 8) Error: attempting to call routine: 'int16'
17:49:24disruptekjust gonna use a bitfield i guess.
18:09:26*BarrOff joined #nim
18:12:23*Kaivo quit (Ping timeout: 260 seconds)
18:14:08*letto_ joined #nim
18:14:37*Kaivo joined #nim
18:17:57*BarrOff quit (Quit: leaving)
18:19:04*letto_ quit (Ping timeout: 240 seconds)
18:27:03*waleee-cl joined #nim
18:31:13FromGitter<iffy> In my Java+JNI+Nim app, calling `asyncdispatch.drain()` is raising an error with the message "index 64 not in 0 .. 63". I'm guessing that comes from https://github.com/nim-lang/Nim/blob/a156484553d7fa9b3b174f8371159af81574f77c/lib/pure/asyncdispatch.nim#L1320-L1324 Any idea why keys is hard-coded to 64? Or does my code have a leak of some kind?
18:44:59FromDiscord<tinygiant> sent a code paste, see https://play.nim-lang.org/#ix=2CjW
18:45:52FromDiscord<tinygiant> (edit) "https://play.nim-lang.org/#ix=2CjW" => "https://play.nim-lang.org/#ix=2CjX"
18:46:43FromDiscord<tinygiant> Also tried peg captures, but couldn't always identify which capture was which when one or the other optional sections were missing.
18:48:22FromDiscord<tinygiant> (edit) "missing." => "missing, since the captured tokens could be any valid characters."
18:54:55FromDiscord<haxscramper> https://play.nim-lang.org/#ix=2Ck4 something like that
18:55:43FromDiscord<lqdev> what does this error mean? `Error: cannot instantiate: 'loadStaticProgram[Vertex]'; got 1 typeof(s) but expected 3`
18:55:48FromDiscord<haxscramper> As usual - assuming no cases like `@xxx:aaa["[[[bbb"]` etc.
18:56:19FromDiscord<haxscramper> @lqdev can you show whole procedure prototype?
18:56:38FromDiscord<lqdev> proc loadStaticProgram[T](window: Window, fragment, vertex: static string): Program[T]
18:57:26FromDiscord<lqdev> turning it into a template seems to have worked
18:58:18FromDiscord<haxscramper> This is probably a bug with static - I've seen similar case - https://play.nim-lang.org/#ix=2AjS ,
18:58:22solitudesfpretty sure it can be fixed if you add the typedesc argument
18:58:36FromDiscord<haxscramper> Generic type + static parameter + explicitly specified type argument gives this error
18:58:38FromDiscord<tinygiant> @haxscramper Awesome, that worked perfectly. Don't know why yet as I never woldn't come up with that, but I'll dig into and figure out how it works. Thanks!
19:17:55FromDiscord<nikki> for the same type, does nim definitely generate the same C struct across translation units?
19:18:18FromDiscord<nikki> (edit) "for the same ... type," added "Nim"
19:18:45FromDiscord<nikki> asking mostly bc. i may use a C++ template fn that assigns ids to types (by storing it as a static local per instantiation)
19:19:30FromDiscord<nikki> https://github.com/skypjack/entt/blob/82946e2372d012971731ca09152576e4709af98b/src/entt/core/type_info.hpp#L65
19:19:31FromDiscord<nikki> this
19:27:15FromDiscord<g5becks> sent a long message, see http://ix.io/2Ckh
19:27:27FromDiscord<g5becks> the nim jsffi module has a require proc
19:27:40FromDiscord<g5becks> but it returns a jsObject
19:28:18FromDiscord<g5becks> In javascript, the default export is often times a function
19:28:52FromDiscord<g5becks> So im not sure how this nim code
19:28:53FromDiscord<g5becks> import jsffiโ†ตโ†ตlet print = require("print")
19:28:59FromGitter<iffy> Why is my proc not GC safe? Maybe I'm not using locks right? https://play.nim-lang.org/#ix=2Cki Or more likely I'm misunderstanding something...
19:29:12FromDiscord<g5becks> actually would translate
19:30:04FromDiscord<lqdev> iffy: `string`s are GC'd
19:31:20FromDiscord<dom96> iffy: it's not enough to just guard a var, you need to make it into a threadvar
19:31:45leorize@g5becks check out https://github.com/alaviss/setup-nim/tree/ng/src/private
19:32:20FromGitter<iffy> If I mark it `{.threadvar.}` then won't each thread have its own value for the var?
19:32:40FromDiscord<lqdev> yeah
19:32:56FromGitter<iffy> What if I want to safely share a global between threads?
19:33:12FromDiscord<dom96> then you cannot use the GC, you need to use allocShared
19:33:22leorizeor --gc:arc/orc
19:33:31FromGitter<iffy> (and this is a simplified case -- I'm actually sharing an object, not a string)
19:33:35FromGitter<iffy> I'm using --gc:orc
19:33:49FromDiscord<dom96> yeah, --gc:orc should really be made to work here
19:33:56*mmohammadi9812 quit (Read error: Connection reset by peer)
19:34:06*mmohammadi9812 joined #nim
19:34:06FromGitter<iffy> Search for/File an issue?
19:34:25leorizewell the issue you will have here is still the gc
19:34:52leorizewe have shared heap but no atomic refcounting, so it's not very safe
19:35:04FromGitter<iffy> I think I'm mixing up thread-safe and gc-safe in my head. They're different, right?
19:35:13leorizehowever since you have a lock, feel free to use `{.gcsafe.}` blocks to override the analysis
19:35:42FromDiscord<dom96> hmm, I'm not sure that's safe
19:35:53FromDiscord<brainproxy> sent a code paste, see https://play.nim-lang.org/#ix=2Ckj
19:36:07FromDiscord<brainproxy> (edit) "https://play.nim-lang.org/#ix=2Ckj" => "https://play.nim-lang.org/#ix=2Ckk"
19:36:10FromDiscord<dom96> the memory is still only allocated in one thread's heap
19:36:31FromDiscord<dom96> you cannot just access it from another thread
19:36:47FromGitter<iffy> Even with {.global.} on the var?
19:36:55FromDiscord<brainproxy> basically I'd like to translate `foo()` to `foo(nil)` but trying to do that I run into compiler errors
19:37:02FromDiscord<dom96> what does {.global.} do?
19:37:15leorize@dom96 arc/orc uses a global heap by default
19:37:26leorizeshared*
19:37:44FromDiscord<dom96> leorize: if that's the case then gc safety analysis should be disabled for that gc
19:38:10FromDiscord<dom96> the fact that it's not means that either A) it doesn't use a global heap B) it's there in case you use a different gc
19:38:12FromGitter<iffy> Hmm... apparently {.global.} is only for *inside* procs: https://nim-lang.org/docs/manual.html#pragmas-global-pragma
19:38:31leorize@dom96: it's because we're not doing atomic refcounting
19:39:03FromDiscord<dom96> okay, well, what's the plan here?
19:39:10FromDiscord<dom96> Are we going to get atomic refcounting?
19:39:11leorizeso you have two choices: make sure that there are no aliases to the variable, then employ a lock and override gcsafe analysis
19:39:28leorizeor employ a channel-based system to move the reference between threads, which is now possible
19:39:41leorizethe latter is being implemented, and Isolated[T] is the first step
19:40:04FromDiscord<dom96> if we're not then this should definitely be a reported issue, because we should take the `guard` into consideration
19:40:11FromDiscord<dom96> in the gc safety analysis
19:44:33FromDiscord<nikki> @brainproxy can you just call foo(bar) from foo()?
19:45:47FromDiscord<brainproxy> yes, but the special to use for calling foo(bar) from foo shouldn't be of MyType
19:46:11FromDiscord<nikki> maybe you just need a different impl foo(thing: OtherType) then?
19:46:28FromDiscord<nikki> or just some common internal code that both foo() and foo(bar) use
19:46:57*mmohammadi9812 quit (Read error: Connection reset by peer)
19:47:23*mmohammadi9812 joined #nim
19:47:26leorize@dom96 we also have atomic refs in fusion btw
19:53:57FromDiscord<dom96> leorize: oh?
19:54:03FromDiscord<dom96> is that the smartptrs module? https://github.com/nim-lang/fusion/blob/master/src/fusion/smartptrs.nim
19:54:22leorizeyep
19:54:48leorizedestructors are so flexible you can make your own refs now :P
19:57:26FromDiscord<brainproxy> @nikki `import options` provided me with a nice solution
19:57:27*Eeep joined #nim
19:57:48FromGitter<iffy> so should I report any issue? or just use gcsafe overrides and consider it done
19:58:59EeepI need to to pass values into a JSON object and then send the whole thing over an HTTP get request as a string. What's the best way to do that?
19:59:17Eeep*HTTP Post
20:01:04FromDiscord<dom96> Eeep: var client = newHttpClient(); client.post(url, body = $(myJsonObj)); # something like this
20:01:42EeepThank you so much, I'm still getting used to the syntax for all this.
20:01:56*enthus1ast quit (Quit: WeeChat 2.3)
20:02:45*vesper quit (Ping timeout: 256 seconds)
20:04:00*lritter quit (Quit: Leaving)
20:08:07*Eeep quit (Remote host closed the connection)
20:09:28FromDiscord<alehander42> oi
20:09:42FromDiscord<alehander42> we are creating a bulgarian channel as well
20:09:46FromDiscord<alehander42> i hope this is fine
20:11:15FromDiscord<alehander42> actually ..
20:11:19FromDiscord<alehander42> how can we do that
20:11:54FromDiscord<alehander42> i can't see a `+` or something
20:12:25leorizeask Yardanico or dom I guess?
20:13:47FromDiscord<alehander42> ok, so the mega and admin roles
20:13:57FromDiscord<alehander42> i'll move to offtopic
20:14:09*nuxdie_ joined #nim
20:14:47*nuxdie_ quit (Client Quit)
20:17:26*nuxdie joined #nim
20:21:08Zevv"There are other async implementations in development that donโ€™t introduce cycles."
20:21:11Zevvwhich are those
20:21:38*vesper11 joined #nim
20:27:13*vesper joined #nim
20:28:13*narimiran quit (Ping timeout: 246 seconds)
20:29:52*natrys quit (Quit: natrys)
20:30:38*vesper11 quit (Ping timeout: 272 seconds)
20:48:02*vesper11 joined #nim
20:48:08*vesper quit (Ping timeout: 260 seconds)
20:51:01FromDiscord<nikki> Zevv: does disruptek/cps count?
20:52:13Zevvno
20:52:20Zevvwe didn't work on that for two months I think
21:01:26FromDiscord<dom96> huh, I thought that was the point of this cps thing
21:04:35Zevvnah, it was just for the fun of it
21:05:23Zevvand clyybber just _keeps_ _refusing_ to fix this bug, you know
21:06:04disruptekrude.
21:06:12Zevvyes, I am
21:07:12disrupteki don't know why he hates us so much.
21:07:32Zevvwe could ask him
21:07:48disruptekclyybber: why do you hate zevv so much?
21:08:09Zevvyeah clyybber, why is that
21:08:31Zevvwhat did disruptek ever do to you?!
21:08:58FromDiscord<alehander42> guys push me
21:09:03FromDiscord<alehander42> to work on the nil stuff
21:09:10PrestigeDO IT!!
21:09:14FromDiscord<alehander42> i am behind and Araq is probably angry
21:09:14ZevvARE YOU DONE YET?
21:09:23FromDiscord<alehander42> DONT TELL ME WHAT TO DO
21:09:28Zevvoh he is. he was raning about that the other day like mad
21:09:39FromDiscord<alehander42> runs into the room and starts listening to nullable riot"
21:09:50FromDiscord<alehander42> right
21:09:57FromDiscord<alehander42> i don't want to get sent to the army
21:09:59Prestigenilable riot
21:10:02FromDiscord<alehander42> writing ada and cobol
21:10:08FromDiscord<alehander42> in the barracks
21:10:13FromDiscord<alehander42> actually i kinda do
21:10:17FromDiscord<alehander42> sounds as a lot of fun
21:10:22Prestigeit isn't
21:10:30Prestigethey'll make you use python!
21:10:37FromDiscord<alehander42> ew
21:10:40FromDiscord<alehander42> that's not army grad
21:10:42FromDiscord<alehander42> (edit) "grad" => "grade"
21:11:21PrestigeDepends on the country :P
21:11:33FromDiscord<alehander42> did you write python in the army
21:11:44PrestigeAnd java
21:11:45Zevvanyway, Nim is the laughing stock of new language design
21:11:50Zevvbecuase Nim still nils
21:11:59FromDiscord<alehander42> that's true man
21:12:20FromDiscord<alehander42> they found out in the 70s
21:12:23FromDiscord<alehander42> this is bad
21:12:37Zevvand it's your fault
21:12:43FromDiscord<alehander42> we're stuck in our own european ways
21:12:55FromDiscord<alehander42> typical commie backwater people
21:13:10FromDiscord<alehander42> born into a world without Option<>s
21:13:19Zevvand it's all your fault
21:13:31Zevvare you done yet?
21:13:35FromDiscord<alehander42> hey man
21:13:43Zevvpushing!
21:13:45FromDiscord<alehander42> we can make a new async implementation and call Future `Dream`
21:14:01FromDiscord<alehander42> as if promise isn't very romantic already
21:14:02Zevvwhere we're going we don't need futures
21:14:05FromDiscord<nikki> that actually sounds kinda nice
21:14:06Zevvnor promises
21:14:31Zevvfutures and promises are like rubber bands and hot glue
21:14:35FromDiscord<alehander42> and we can return `Past` from databases
21:14:50FromDiscord<alehander42> because they contain stuff about the past right
21:14:58FromDiscord<nikki> @alehander42 where's teh nil stuff at ๐Ÿ˜ฎ got a link to the branch?
21:14:58FromDiscord<alehander42> think symmetrically
21:15:07Zevvprocastinator
21:15:14FromDiscord<alehander42> zevv i need to optimize things
21:15:21Zevvdon't we all
21:15:21FromDiscord<alehander42> but i need to google for kitten pants first
21:15:34Zevvor "the worst ladder"
21:15:36FromDiscord<alehander42> not even kidding my wife is like "google this"
21:15:59FromDiscord<alehander42> oh man i mean our cat started pooping in random places
21:16:03FromDiscord<alehander42> this really came out wrong
21:16:16Zevvand then the roomba drove straight over it, right
21:16:18FromDiscord<nikki> are the pants nil
21:16:25FromDiscord<alehander42> exactly man no nil checking
21:16:30FromDiscord<alehander42> and the cat poops now in the bed
21:16:37FromDiscord<nikki> maybe if u land nil checking, the cat problem will be solved
21:16:40FromDiscord<alehander42> it's called nia btw
21:16:50Zevvnot nil?
21:16:58FromDiscord<nikki> lol my local directory where i am coding "nim in action" projects is called "nia"
21:17:18FromDiscord<Idefau> nya~
21:17:23FromDiscord<alehander42> https://github.com/nim-lang/Nim/pull/15287
21:17:24disbotโžฅ Nil type check implementation
21:17:34FromDiscord<nikki> i kinda want to check in the generated C source from nim to the repo of my project too
21:17:36FromDiscord<alehander42> but i have another branch
21:17:41FromDiscord<nikki> so that whenever i commit i can see the diff in the generated output ๐Ÿ‘€
21:17:41FromDiscord<alehander42> with some newer experiments
21:17:44ForumUpdaterBotNew thread by Niminem: Nim videos and tutorials survey, see https://forum.nim-lang.org/t/7003
21:17:54FromDiscord<alehander42> ~nia is cat
21:17:55disbotnia: 11cat
21:17:56FromDiscord<nikki> "oh this changed added all of this extra code before and after your function: see!"
21:18:04*oculux joined #nim
21:18:10FromDiscord<alehander42> hmmm sounds interesting
21:18:27FromDiscord<nikki> maybe not actually but maybe i'd keep a different repo for the cache so i can just look at diffs
21:18:40*TomDotTom quit (Ping timeout: 260 seconds)
21:18:57FromDiscord<nikki> the generated C code is really followable esp. if you get compile flags for it working with your lsp
21:19:14FromDiscord<nikki> (yes, disruptek. i know you have a mangling branch)
21:19:18Zevvespecially if you use disrupteks branch
21:19:22Zevvwe all know
21:19:34Zevvhe should merge that shit
21:19:36Zevvlaze man
21:19:40Zevvy
21:19:55FromDiscord<nikki> lol maybe it should be changed to be instead of a branch, a program that you can give your nim cache dir
21:19:56FromDiscord<alehander42> zevv dont cancel me
21:20:01FromDiscord<nikki> and it rewrites all the symbols in the output to be nicer
21:20:07Zevvwe dont have futures, so no cancelling
21:20:07FromDiscord<nikki> so that it's not blocked on being merged into nim itslef
21:20:08FromDiscord<nikki> xD
21:20:14FromDiscord<alehander42> btw
21:20:19FromDiscord<alehander42> guys i keep getting ideas
21:20:20FromDiscord<alehander42> from rust
21:20:26FromDiscord<alehander42> so why dont we have a cookbook
21:20:27FromDiscord<nikki> yoooooooo it's how it gets u man
21:20:32FromDiscord<lqdev> just how well-tested are hash sets
21:20:37FromDiscord<alehander42> https://rust-lang-nursery.github.io/rust-cookbook/
21:20:38FromDiscord<lqdev> do they handle hash collisions properly?
21:20:42FromDiscord<alehander42> seems very useful
21:20:49FromDiscord<alehander42> for ppl that are like
21:20:59disruptekfutures are cancel'able if you buy your futures from status.
21:21:01FromDiscord<nikki> @alehander42 i did some rust stuff but it never actually panned out to better results in practice. mostly cuz i just do personal gamedev and don't care about stuff crashing lol
21:21:05FromDiscord<alehander42> we have something similar
21:21:10FromDiscord<alehander42> ys
21:21:17FromDiscord<nikki> also bc. the compiletime is worse than c++ lol
21:21:18FromDiscord<alehander42> i did implement cancellation btw
21:21:22FromDiscord<alehander42> on asyncdispatch based on tokens
21:21:24Zevvhmm. thinking of cancelation. How do we ever cancel a continuation?!
21:21:33Zevvthese things are just not cancellable
21:21:39*oculuxe joined #nim
21:21:40FromDiscord<alehander42> but i didn't have time to improve it or to prepare a PR/rfc
21:22:05Zevvit is called a "continuation" for a reason. it. must. continue.
21:22:21FromDiscord<dom96> you can cancel things in Nim's async
21:22:23FromDiscord<dom96> just close the fd ๐Ÿ˜‰
21:22:24*oculux quit (Ping timeout: 240 seconds)
21:24:14FromDiscord<nikki> @lqdev afaict from `rawGetKnownHCImpl` in 'hashcommon.nim': yeah checks collisions
21:25:27FromDiscord<alehander42> @dom96 is there interest in submitting the PR as it is
21:25:43disruptekyou cancel a continuation by simply not running it.
21:25:58FromDiscord<dom96> @alehander42 hrm? what PR?
21:26:29FromDiscord<alehander42> i did implement asyncdispatch based cancel sugar support (+ tokens, so one can cancel groups of stuff)
21:26:39FromDiscord<alehander42> while i worked with zah
21:27:12FromDiscord<alehander42> it's probably not some kinf of high quality thing but maybe it would be interesting to comment on
21:32:29FromGitter<iffy> How do I get the value a pointer points to as a pointer? I have `let p1 = cast[pointer](obj.unsafeAddr)` and it points to another pointer.
21:33:43solitudesfcast[pointer](obj[])?
21:35:44FromGitter<iffy> it's already a pointer, right? (anyway, that doesn't work -- I end up with the same p1)
21:35:57Zevvdisruptek: but you *must* run it
21:36:01Zevvotherwise it can't continue
21:36:25FromGitter<jrfondren> iffy: what are you doing that isn't https://play.nim-lang.org/#ix=2CkT ?
21:36:51FromDiscord<lqdev> i managed to find a bug with excl'ing elements from a set during iteration: http://ix.io/2CkS/nim
21:37:00FromGitter<jrfondren> Your question reads as a request for the identity function
21:37:23FromDiscord<lqdev> the program gets stuck at (x: 22, y: 1)
21:37:29FromDiscord<lqdev> in an infinite loop
21:37:36FromGitter<jrfondren> oh is 'pointer' something special?
21:37:44FromDiscord<lqdev> ^C'ing led me to this loop: https://github.com/nim-lang/Nim/blob/version-1-4/lib/pure/collections/sets.nim#L624
21:38:14FromGitter<iffy> I'm literally using 'pointer' and not 'ptr'
21:38:31FromGitter<iffy> I don't know the difference between them
21:39:07FromDiscord<lqdev> `pointer` is a pointer to something
21:39:10FromGitter<jrfondren> since 'pointer' doesn't have a following type, I'm guessing it's void*
21:39:21FromDiscord<lqdev> `ptr T` is a pointer to `T`
21:39:40FromDiscord<lqdev> yes `pointer` is the same as `void ` in C
21:40:16*vicfred quit (Quit: Leaving)
21:40:22FromGitter<jrfondren> so just call .pointer on your `ptr T`
21:40:37FromGitter<iffy> I don't have a `ptr T`, I start with a `pointer`
21:41:12FromGitter<iffy> And that pointer points to a value. I want to get that value (the value is a pointer itself)
21:41:13FromGitter<jrfondren> https://play.nim-lang.org/#ix=2CkV
21:41:22FromDiscord<nikki> probs need to cast
21:41:26FromGitter<jrfondren> cast it to a ptr TypeOfTheValue
21:41:47FromGitter<jrfondren> that playground link goes ptr ptr int <-> pointer
21:42:03*opal quit (Ping timeout: 240 seconds)
21:45:24*opal joined #nim
21:46:55FromGitter<iffy> If you run this: https://play.nim-lang.org/#ix=2Cl0 you will see that I print out a string's addr, then use `.cstring` to get the address where the actual data is stored. I'm trying to do the same for the object. The first memory dump of the object shows that the pointer points to a null pointer.
21:48:06FromGitter<iffy> The second `..pointer:` shows that the var `a` now points to a non-null address. I want to get that address.
21:51:17FromGitter<iffy> aha! this works: `let i = cast[ptr int](p1); let p2 = cast[pointer](i[])` but shouldn't that be the same as `ptr ptr int`, @jrfondren ?
21:51:35FromGitter<iffy> or maybe not because I deference `i` first
21:51:43FromGitter<iffy> anyway, thank you all!
21:52:04mipriyou're getting the address as an int and then casting it to a pointer
21:53:37FromGitter<iffy> yes
21:53:52mipriwhat's the point of that?
21:54:13miprilet i = cast[ptr pointer](p1); let p2 = i[]; done
21:55:29FromGitter<iffy> gitter is messing up the formatting on what you wrote. I'm starting with `var obj = MyObj()` then do `p1 = cast[pointer](obj.unsafeAddr)`
21:56:26FromGitter<iffy> My goal is to dump out the memory of an object. That's all I'm really trying to do. Anyway bbl
21:56:50*luis_ joined #nim
21:56:56*solitudesf quit (Ping timeout: 260 seconds)
21:57:40FromDiscord<lqdev> could somebody look into why this ordered set program script thing is freezing? http://ix.io/2Cl1
21:58:54FromGitter<jrfondren> if you click the ... button to the right of the broken line, you can quote it to get the original code
21:59:16*dv^_^ quit (*.net *.split)
21:59:16*idxu quit (*.net *.split)
21:59:16*voltist quit (*.net *.split)
21:59:16*rayman22201 quit (*.net *.split)
21:59:33*rayman22201 joined #nim
21:59:35*voltist joined #nim
21:59:35*idxu joined #nim
21:59:36*dv^_^ joined #nim
21:59:55FromGitter<ynfle> Distruptek: does dust install with the latest nim? I get `dust/boring.nim(101, 58) Error: undeclared field: 'mainCommand'` When installing with nimble
22:00:19FromGitter<ynfle> 1) disruptek
22:00:41disruptekno.
22:00:52disruptekaraq broke it for us.
22:00:58disrupteki'll fix it once i finish ic.
22:03:01FromDiscord<nikki> @lqdev i'm not sure you're allowed to modify a set while iterating over it
22:03:13FromDiscord<lqdev> the docs don't state that
22:03:24FromDiscord<lqdev> it also doesn't trigger an assertion
22:03:32FromDiscord<lqdev> so i assumed it would work
22:04:04FromDiscord<nikki> seems like it doesn't ๐Ÿ˜…
22:04:20FromDiscord<nikki> well in this case, one way to go about it is to just do while !set.empty(): let elem = set.getSomething()
22:04:28FromDiscord<lqdev> then the docs should be updatedโ€ฆ
22:04:31FromDiscord<nikki> i'm a noob at nim so idk what those procs are actually called lol
22:04:44*mmohammadi9812 quit (Ping timeout: 240 seconds)
22:05:46FromDiscord<lqdev> i'm filing an issue anyways
22:06:04FromGitter<ynfle> disruptek It doesn't even work on 1.2.6 What's the latest that you got it to compile it you?
22:06:17FromDiscord<nikki> @lqdev i think that's a good idea
22:06:36FromDiscord<nikki> is there a standard name for a 'get some element' proc for a set-like?
22:06:38FromDiscord<nikki> ah pop
22:06:44FromDiscord<nikki> (removes too)
22:07:08FromDiscord<nikki> um jk pop doesn't work on ordered set?
22:09:50luis_How large can an int integer be in nim? Any documentation on this?
22:09:51FromDiscord<lqdev> https://github.com/nim-lang/Nim/issues/15767
22:09:53disbotโžฅ HashSet misses elements when excl'ing while iterating over it ; snippet at 12https://play.nim-lang.org/#ix=2Clb
22:10:00FromDiscord<lqdev> luis_: 64-bits max
22:10:13luis_ok, thanks
22:10:18FromGitter<ynfle> @luis, int64, int32, int16, int8
22:10:40FromDiscord<lqdev> @nikki it doesn't matter for me if the set is ordered or not, i only swapped it out to an OrderedSet for easier debugging in my code
22:10:48FromDiscord<nikki> ah cool
22:11:01FromDiscord<nikki> yeah i actuallly used a difference piece of code for iterating and got it to work
22:11:02FromDiscord<lqdev> still doesn't change the fact that sets clearly can't handle excl'ing while iterating over them
22:11:11FromDiscord<nikki> sent a code paste, see https://play.nim-lang.org/#ix=2Clc
22:11:21FromDiscord<nikki> because i couldn't figure out a way to just ... pop ... so i just had to loop and break lol
22:11:58*luis_ quit (Quit: luis_)
22:12:42FromDiscord<lqdev> yea using `pop` combined with a `while` loop seems to work
22:12:51FromDiscord<nikki> nice
22:17:27*luis_ joined #nim
22:22:48disruptekynfle: you probably need the earlier devel, figure like a couple weeks ago.
22:23:48disruptekynfle: araq's change is easy to detect; he removed mainCommand. search for that and you'll find the working stuff.
22:25:25disruptekynfle: also, dust changes according to my needs. some hacking may be necessary for your particular task.
22:25:53*tane quit (Quit: Leaving)
22:27:02FromDiscord<Avatarfighter> what is dust used for>
22:28:20disruptekit performs exhaustive reduction of ast while reproducing semantic errors.
22:28:32disruptek!repo dust
22:28:32disbothttps://github.com/disruptek/dust -- 9dust: 11DUST is Unattended Syntax Truncation 15 4โญ 0๐Ÿด 7& 1 more...
22:28:42disruptekvery crude.
22:28:48FromDiscord<Avatarfighter> Oh wow that sounds super useful
22:31:01disruptekthere are some major drawbacks to both the impl and the interface to the compiler. that said, it /can/ work...
22:34:11disruptekynfle: or, just fix it to work again. it shouldn't be too hard.
22:42:24*luis_ quit (Ping timeout: 240 seconds)
22:48:44*mmohammadi9812 joined #nim
23:01:53*tiorock joined #nim
23:01:54*rockcavera quit (Killed (beckett.freenode.net (Nickname regained by services)))
23:01:54*tiorock is now known as rockcavera
23:01:54*rockcavera quit (Changing host)
23:01:54*rockcavera joined #nim
23:02:16*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
23:07:24*Lord_Nightmare joined #nim
23:46:06*luis_ joined #nim
23:46:44*whaletechno joined #nim