<< 14-07-2022 >>

00:02:34FromDiscord<TryAngle> In reply to @Elegantbeef "I mean yes it": I agree, working together is better than reinventing the wheel, I just didn't consider it because it looks to be specificially made for opengl but looking through the source code I agree it's not much
00:07:04FromDiscord<voidwalker> I am trying to write a proc that takes any csv file and imports it into a db, as it is, same columns. I tried something like this to start with: ` dbsql.exec(sql"INSERT OR REPLACE INTO ? (?) VALUES (?,?,?)", fileName, tsv.headers, id, votes, rating)`
00:07:39FromDiscord<voidwalker> getting `Error: cannot convert seq[string] to varargs[string]`
00:08:17FromDiscord<Elegantbeef> one of your arguments seems to be a `seq[string]`
00:08:35FromDiscord<voidwalker> yes, tsv.headers, which holds the column names, that i want as the db column names
00:08:59FromDiscord<Elegantbeef> `fileName & tsv.headers & [id, votes, rating]`
00:09:04FromDiscord<Elegantbeef> It's not ideal but yea
00:10:56FromDiscord<TryAngle> In reply to @TryAngle "I agree, working together": otherwise windy looks reallly solid, the easy polling ofbuttons looks really nice to use and not depending on GLFW is also a huge plus
00:12:35*noeontheend joined #nim
00:13:44FromDiscord<voidwalker> ` dbsql.exec(sql"INSERT OR REPLACE INTO ? (?) VALUES (?,?)", fileName & tsv.headers & [id, votes])` like this ?
00:13:57FromDiscord<Elegantbeef> Might need `[filename]`
00:14:24FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=44iv
00:14:29FromDiscord<Elegantbeef> I guess `@[]`
00:14:30FromDiscord<voidwalker> for `dbsql.exec(sql"INSERT OR REPLACE INTO ? (?) VALUES (?,?)", [fileName] & tsv.headers & [id, votes])`
00:14:49FromDiscord<Elegantbeef> Point is you need to pass either strings or a single collection
00:15:23FromDiscord<voidwalker> doesn't work :[
00:15:43FromDiscord<Elegantbeef> `@[fileName] & tsv.headers & @[id, votes]`?
00:16:02FromDiscord<voidwalker> ` dbsql.exec(sql"INSERT OR REPLACE INTO ? (?) VALUES (?,?)", @[fileName] & tsv.headers & @[id, votes])`
00:16:21FromDiscord<Elegantbeef> are they all strings?
00:16:24FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=44iw
00:16:31FromDiscord<Elegantbeef> You need strings
00:16:37FromDiscord<Elegantbeef> so it should be `$id` and `$votes`
00:18:59FromDiscord<voidwalker> if I want the query separate, so I can debug easier: ` let sqlq = sql"INSERT OR REPLACE INTO ? (?) VALUES (?,?)", @[fileName] & tsv.headers & @[id, votes]` I get ` Error: invalid indentation`
00:19:26FromDiscord<voidwalker> Hm if I wrap it in () it works
00:19:54FromDiscord<Elegantbeef> Yea i know nothing of sql so have fun
00:26:55FromDiscord<voidwalker> I need a db enthusiast :\
00:30:23FromDiscord<!Patitotective> doesnt phil use sql
00:33:39FromDiscord<voidwalker> hah lol.. i just realised what i did, wrapping it in (), made it a tuple
00:33:44FromDiscord<voidwalker> Error: type mismatch: got <DbConn, (SqlQuery, string, seq[string], seq[string])>
00:36:28FromDiscord<voidwalker> `let sqlString = "INSERT OR REPLACE INTO ? (?) VALUES (?,?,?)", fileName,` ... the ? value replacement does not work for strings.. right ?
00:36:31FromDiscord<voidwalker> `All db_ modules support the same form of parameter substitution. That is, using the ? (question mark) to signify the place where a value should be placed. For example:`
00:37:38FromDiscord<Elegantbeef> the value replacement is due to the `exec`
00:37:56FromDiscord<Elegantbeef> `exec(mySqlStr, replacements)`
00:38:21FromDiscord<Elegantbeef> so it should be `exec(yourSqlString, @[fileName] & tsv.headers & @[$id, $votes])`
00:38:30FromDiscord<voidwalker> oh, so I cannot prepare an sqlQuery type with the substution , before exec ?
00:38:57FromDiscord<Elegantbeef> Cause of how Nim's varargs work you either need to pass them all as a collection or all as single entries
00:39:04FromDiscord<Elegantbeef> So you just need to make a seq of the values you want
00:40:44FromDiscord<voidwalker> oh so the sqlQuery type is just a special string
00:40:55FromDiscord<voidwalker> distinct string
00:41:01FromDiscord<Elegantbeef> Yes
00:42:01FromDiscord<voidwalker> and the exec has the varargs thing.. so no way I can prepare it before exec right ?
00:42:13FromDiscord<Elegantbeef> You can prepare the args before
00:42:22FromDiscord<Elegantbeef> you can do `var args = @[fileName] & tsv.headers & @[$id, $votes]`
00:42:46FromDiscord<voidwalker> the sqlQuery I mean, in one line
00:43:03FromDiscord<Elegantbeef> No fucking clue
00:45:16FromDiscord<voidwalker> is there no better (easier) 3rd party wrapper for db access I wonder
00:45:51FromDiscord<Elegantbeef> I mean this is quite easy
00:52:54FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=44iD if you really want to skip the manual creation
00:56:00FromDiscord<whee> @voidwalker you can construct it like any other string and then convert it to the sql type before exec
00:56:30FromDiscord<voidwalker> yeah but there is no value substitution defining possible before exec
00:56:33FromDiscord<voidwalker> that's what I meant
00:56:46FromDiscord<voidwalker> so you can prepare the string, and the varargs: string
00:56:48FromDiscord<whee> you mean the ? handling?
00:56:51FromDiscord<voidwalker> yes
00:57:05FromDiscord<whee> that part should get handled by the sql exec because it needs to be a prepared statement
00:57:21FromDiscord<Elegantbeef> Does the sql string just get formatted if so you could look at strutils `%`
00:57:49FromDiscord<Elegantbeef> But i'm fairly certain that's an unsafe operation
00:58:14FromDiscord<whee> you'd have to count the arguments and produce a string of "?" of the correct count, then the sql exec will do the substitution safely
01:00:01FromDiscord<voidwalker> Guess I should start with the table schema string generation first
01:00:51FromDiscord<voidwalker> I mean something like this could be of use somewhere in the libs, I am sure it's a common operation. csv/tsv/structured text -> sqlX
01:08:22FromDiscord<whee> everything I've done with CSV to sqlite hasn't been a generic solution, I don't think I found a nice generic one. I ended up hardcoding the columns
01:15:50*noeontheend quit (Ping timeout: 240 seconds)
01:29:59*noeontheend joined #nim
01:34:56FromDiscord<mattrb> sent a long message, see http://ix.io/44iJ
01:39:41FromDiscord<Elegantbeef> II get a `cannot open file `easywave\`
01:41:58FromDiscord<Elegantbeef> @mattrb
01:42:13FromDiscord<mattrb> Ah, maybe need a nimble install
01:42:41FromDiscord<mattrb> I added a couple dependencies for the meantime while resampling is broken
01:43:05FromDiscord<mattrb> Using that one to write the samples to a wav file
01:43:10FromDiscord<Elegantbeef> Also any follow up conversation about those bitsets 😛
01:45:31FromDiscord<mattrb> I'm leaning towards leaving the bitfields since I still need them in most places. I prefer keeping it consistent over updating just a couple. I really appreciate your suggestions though!!
01:45:42FromDiscord<Elegantbeef> Even for input?!
01:45:48FromDiscord<Elegantbeef> Did you see my followup comment for input
01:46:17FromDiscord<TryAngle> In reply to @Elegantbeef "Also any follow up": do u mean set[T] vs bits in int
01:47:09FromDiscord<Generic> I feel like I plugged this already a dozen times, but I'm using my own bitfield macro in my emulator
01:47:26FromDiscord<Generic> which is a lot more flexible than C bitfields
01:48:07FromDiscord<Generic> it allows things like overlapping and parameterised fields
01:48:30FromDiscord<Generic> it also allows tagging members so they can be set at once from one value
01:48:33FromDiscord<mattrb> In reply to @Elegantbeef "Did you see my": Ah I didn't see that. That definitely could be a nice abstraction when I add remappable keys
01:48:41FromDiscord<Generic> it's a bit hard to describe, but super useful in emulators
01:49:05FromDiscord<Generic> https://github.com/RSDuck/hocuspocube/blob/master/hocuspocube/dsp/dsp.nim#L32-L45
01:49:16FromDiscord<mattrb> @Generic I'll have to take a look! I think I saw them briefly earlier when I looked up your gc emulator
01:49:30FromDiscord<Generic> e.g. in this register a lot of fields are tagged mutable
01:49:59FromDiscord<Generic> https://github.com/RSDuck/hocuspocube/blob/master/hocuspocube/dsp/dsp.nim#L372
01:50:53FromDiscord<Generic> so with `field.mutable = value` you can do a masked write into all these members
01:51:06FromDiscord<Generic> from a packed value
01:52:44FromDiscord<TryAngle> `eventLoop.run(proc(event: Event, target: EventLoopWindowTarget, controlFlow: var ControlFlow) = discard)`↵can I make this `run` proc somehow into a template so I don't have to write the proc but still have access to the parameters?
01:53:29FromDiscord<Generic> yes, though it might not be a good idea, if run is a larger proc
01:53:59FromDiscord<Elegantbeef> It's odd matt even `bus.read(gba.bus, ...)` doesnt work
01:54:00FromDiscord<Generic> or if what you're currently passing as a function is called more than once
01:54:26FromDiscord<TryAngle> the anonymous proc is repeatitly called
01:54:51FromDiscord<TryAngle> run is slightly bigger yes but I can still keep it as a proc and call it "from the template" no?
01:55:24FromDiscord<Generic> sent a code paste, see https://play.nim-lang.org/#ix=44iR
01:55:45FromDiscord<mattrb> In reply to @Elegantbeef "It's odd matt even": I'm glad this also seems kinda weird to you.. I'm over here feeling like I don't know anything about nim imports lol
01:56:10FromDiscord<Generic> (edit) "https://play.nim-lang.org/#ix=44iR" => "https://paste.rs/WU3"
01:56:25FromDiscord<Generic> (edit) "https://play.nim-lang.org/#ix=44iU" => "https://play.nim-lang.org/#ix=44iT"
01:57:11FromDiscord<Generic> In reply to @TryAngle "run is slightly bigger": yeah something like this is totally doable
01:57:28FromDiscord<TryAngle> How does that work with nesting?
01:57:28FromDiscord<TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=44iV
01:57:47FromDiscord<TryAngle> (edit) "How does that work with nesting?" => "what is the beahaviour if I do scroping?"
01:58:04FromDiscord<Elegantbeef> Oh wait
01:58:30FromDiscord<Generic> In reply to @TryAngle "ah ok so if": yes, see https://nim-lang.org/docs/manual.html#templates-hygiene-in-templates
01:58:32FromDiscord<Elegantbeef> Nope `bind` didnt solve it
01:59:16FromDiscord<Elegantbeef> Oh recursive dep issue
01:59:34FromDiscord<Elegantbeef> bus -\> mmio -\>apu -\>dma
02:00:55FromDiscord<mattrb> Bus needs to access the apu and dma controllers, and the apu needs to trigger dma when it runs out of samples
02:01:16FromDiscord<Elegantbeef> Welcome to cyclical hell
02:01:26FromDiscord<mattrb> Every time I have a recursive dep issue I get one step closer to putting everything in a single file lol
02:01:29FromDiscord<Generic> welcome from me too
02:01:38FromDiscord<Generic> it's only pain from here on
02:01:44FromDiscord<Arathanis> i know this probably doesnt help
02:02:12FromDiscord<Arathanis> but nearly every time I have encountered a circular dependency issue, in any language, its been indicative of a design flaw
02:02:28FromDiscord<Arathanis> and I have to go back and do big refactoring
02:02:40FromDiscord<Generic> some things are just inherently circular
02:02:46FromDiscord<Arathanis> > nearly
02:02:48FromDiscord<Arathanis> 😉
02:03:01FromDiscord<Generic> the problem with emulators is that we don't make the rules
02:03:21FromDiscord<Elegantbeef> Nims inability of handling cyclical dependencies is most annoying with gamedev
02:03:47FromDiscord<Elegantbeef> X and Y talk to eachother but there is no way to do it without some weird import/control
02:04:03FromDiscord<Generic> if everything is connected to the same bus in almost every system
02:04:26FromDiscord<mattrb> Any suggestion for my specific case, beef? Any idea why it works without that one line in dma.nim? That's what seems especially weird to me..
02:05:10FromDiscord<Elegantbeef> Cause it's a generic proc
02:05:29FromDiscord<Elegantbeef> Generic procedures are not fully semantically checked until instantiation
02:05:53FromDiscord<Elegantbeef> I mean you can do delayed imports
02:06:00FromDiscord<Elegantbeef> But it's a complex thing
02:06:22FromDiscord<Elegantbeef> I've explained this before but Nim's cyclical imports work "predictibly"
02:06:34FromDiscord<Elegantbeef> In that you have access to everything in a module until an import statement
02:06:59FromDiscord<Arathanis> oh, is it like python?
02:07:19FromDiscord<Elegantbeef> How would I know
02:07:20FromDiscord<mattrb> You've helped me fix a cyclic import before, and I tried to recreate it here to no avail. I figure I just don't actually understand the behavior
02:07:45FromDiscord<Arathanis> In reply to @Elegantbeef "How would I know": in python as long as the circular import comes after the other modules deps its fine
02:07:51FromDiscord<Arathanis> so you can import later in the file and it works
02:08:00FromDiscord<Elegantbeef> Then sure
02:08:38FromDiscord<TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=44j0
02:08:52FromDiscord<Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=44j1
02:09:01FromDiscord<Arathanis> (edit) "https://play.nim-lang.org/#ix=44j1" => "https://play.nim-lang.org/#ix=44j2"
02:09:10FromDiscord<Generic> yeah it's kind of like that in Nim too
02:09:16FromDiscord<Arathanis> it works
02:09:19FromDiscord<Arathanis> and makes you feel dirty
02:09:21FromDiscord<Arathanis> at the same time!
02:09:24FromDiscord<TryAngle> ah nvm it doesn't work
02:09:26FromDiscord<TryAngle> XD
02:10:01FromDiscord<Generic> sent a code paste, see https://play.nim-lang.org/#ix=44j3
02:10:01FromDiscord<Generic> var cannot be captured?
02:10:29FromDiscord<Generic> ah no, I think you misunderstood me or I wasn't clear enough
02:10:53FromDiscord<Generic> the function pointer is to be replaced completely by the template
02:11:05FromDiscord<TryAngle> In reply to @Generic "ah no, I think": nah my run method just doesn't work like that, I'm not passing the injectables into it
02:11:36FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44j4
02:11:42FromDiscord<Generic> yeah I'm doing that
02:11:45FromDiscord<Elegantbeef> Though i ran into a bug i think where it thinks the `bus.[]=` is delayed
02:12:02FromDiscord<Generic> though I've come to a point where the Nim compiler started emitting invalid C code
02:12:19FromDiscord<Generic> so I'm using importc/exportc in a few cases now
02:13:22FromDiscord<Elegantbeef> I did have a swanky error from a silly macro
02:14:17FromDiscord<Elegantbeef> Nothing crazy though
02:15:40FromDiscord<mattrb> In reply to @Elegantbeef "You might be able": Looks like this specifically doesn't work, but I'll play around with it a bit to see what works..
02:15:48FromDiscord<Elegantbeef> It helps
02:16:05FromDiscord<Elegantbeef> you then can forward declare inside of bus
02:16:21FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44j5
02:16:22FromDiscord<Elegantbeef> It then compiles in Nim but in cgen it dies
02:17:20FromDiscord<mattrb> Oh, that's a neat error haha
02:18:22FromDiscord<mattrb> I gotta go cook dinner. When I get back, maybe I should just write a program to rearrange all of my imports and procs randomly until it compiles
02:18:30FromDiscord<Elegantbeef> Lol
02:18:43FromDiscord<Elegantbeef> I'm going to use a debug compiler to see what the problem actually is
02:18:59FromDiscord<mattrb> Sweet, thanks so much. Really appreciate the hel
02:19:00FromDiscord<mattrb> (edit) "hel" => "help"
02:19:01FromDiscord<Elegantbeef> Might be able to make a PR to make it atleast compile in devel
02:25:36FromDiscord<Elegantbeef> I'm thinking the the forward declare + delayed import in this just creates a proper endless loop and it doesnt get to the `[]=` procedure's definition
02:31:18*xet7 quit (Ping timeout: 240 seconds)
02:48:10*noeontheend quit (Ping timeout: 260 seconds)
03:45:15*noeontheend joined #nim
04:20:49FromDiscord<ripluke> sent a code paste, see https://play.nim-lang.org/#ix=44jk
04:22:40*noeontheend quit (Ping timeout: 260 seconds)
04:22:43FromDiscord<Elegantbeef> No
04:22:51FromDiscord<ripluke> Lol why not
04:22:51FromDiscord<Elegantbeef> You need a macro to do this
04:22:56FromDiscord<ripluke> Ah
04:23:00FromDiscord<Elegantbeef> Import must be a top level statement
04:23:52FromDiscord<ripluke> Ah
04:23:59FromDiscord<ripluke> A safety thing?
04:24:13FromDiscord<Elegantbeef> No a language requirement
04:24:42FromDiscord<ripluke> Oh
04:25:08FromDiscord<ripluke> And I suspect I can’t just use a for loop in a macro XD
04:26:31FromDiscord<Elegantbeef> An ugly reference
04:26:32FromDiscord<Elegantbeef> https://github.com/GaryMcWhorter/GDGW-Maverick-Bot/blob/master/src/nimcordbot/utils.nim#L1-L21
04:27:54FromDiscord<ripluke> Ah ok thx for the help
04:54:58*arkurious quit (Quit: Leaving)
05:00:25*CyberTailor joined #nim
05:02:30*rockcavera quit (Read error: Connection reset by peer)
05:04:01*rockcavera joined #nim
05:04:01*rockcavera quit (Changing host)
05:04:01*rockcavera joined #nim
05:07:50FromDiscord<xflywind> shallowCopy doesn't work in the global scope?
05:08:03FromDiscord<xflywind> sent a long message, see http://ix.io/44jq
05:08:40FromDiscord<xflywind> sent a long message, see http://ix.io/44jr
05:19:02FromDiscord<Rika> Eval doesn’t work with line breaks
05:20:55*wallabra quit (Ping timeout: 244 seconds)
05:24:21FromDiscord<xflywind> !eval var x = "1234"; var y: string; shallowCopy(y, x); y[0] = 'Q'; doAssert x == "Q234"; doAssert y == "Q234"
05:24:25NimBot/usercode/in.nim(1) in↵/playground/nim/lib/system/assertions.nim(38) failedAssertImpl↵/playground/nim/lib/system/assertions.nim(28) raiseAssert↵/playground/nim/lib/system/fatal.nim(53) sysFatal↵Error: unhandled exception: /usercode/in.nim(1, 72) `x == "Q234"` [AssertionDefect]
05:26:04*wallabra joined #nim
05:38:28*rockcavera quit (Read error: Connection reset by peer)
05:38:52*rockcavera joined #nim
05:38:52*rockcavera quit (Changing host)
05:38:52*rockcavera joined #nim
06:14:26*_________ quit (*.net *.split)
06:14:26*Goodbye_Vincent quit (*.net *.split)
06:14:26*tanami quit (*.net *.split)
06:14:26*rwb quit (*.net *.split)
06:14:26*genpaku quit (*.net *.split)
06:14:26*djanatyn1 quit (*.net *.split)
06:14:26*termer quit (*.net *.split)
06:14:27*joast quit (*.net *.split)
06:14:27*mal`` quit (*.net *.split)
06:15:48FromDiscord<dain> sent a long message, see http://ix.io/44jz
06:17:42*_________ joined #nim
06:17:42*Goodbye_Vincent joined #nim
06:17:42*tanami joined #nim
06:17:42*rwb joined #nim
06:17:42*genpaku joined #nim
06:17:42*djanatyn1 joined #nim
06:17:42*termer joined #nim
06:17:42*joast joined #nim
06:17:42*mal`` joined #nim
06:18:22*rwb quit (Max SendQ exceeded)
06:18:22*_________ quit (Max SendQ exceeded)
06:18:41*_________ joined #nim
06:19:09*rwb joined #nim
06:19:15FromDiscord<Elegantbeef> No cause nims templates are hygenic by default
06:19:45FromDiscord<xflywind> In reply to @dain "im a little confused": No, templates by default will generate a unique symbol for varaibles within it like ``result`gensym1``, ``result`gensym2 ``.
06:19:49FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44jA
06:20:22FromDiscord<xflywind> (edit) removed "a" | "symbol" => "symbols"
06:24:38FromDiscord<dain> ah okay
06:25:10FromDiscord<dain> also what does the `typeof(items(seq1), typeOfIter)` mean? as in the second argument
06:25:27FromDiscord<dain> i know that we need to get the type of the items of the seq but what is `typeofIter` doing
06:26:12FromDiscord<Rika> !eval typeof(items(@[1]))
06:26:15NimBotCompile failed: /usercode/in.nim(1, 7) Error: expression 'typeof(items(@[1]))' is of type 'typedesc[int]' and has to be used (or discarded)
06:26:16FromDiscord<Rika> Fuck
06:26:23FromDiscord<Rika> !eval echo typeof(items(@[1]))
06:26:27NimBotint
06:26:34FromDiscord<Rika> Not sure I forgot
06:26:59FromDiscord<Elegantbeef> It probably is just to tell the compiler "consider iterators"
06:27:14FromDiscord<Elegantbeef> Yep that's what it is
06:27:39FromDiscord<Elegantbeef> Cause iterators are specialised you need to tell the compiler "i want the iterator call type"
06:28:15FromDiscord<Rika> Why does it work normally without
06:28:26FromDiscord<Elegantbeef> Default parameter is iterator
06:28:45FromDiscord<Elegantbeef> https://nim-lang.org/docs/system.html#typeof%2Cuntyped
06:29:19FromDiscord<Elegantbeef> I assume the reason is "Well duh most people want the `typeof` to return the result of iterators and procs alike"
06:29:33FromDiscord<demotomohiro> !eval echo typeof(1..2, typeOfIter); echo typeof(1..2, typeOfProc)
06:29:36FromDiscord<Elegantbeef> The downside is this prefers iterators so if you have a proc that returns a `seq[T]` and a iterator that returns `T` you get an issue
06:29:37NimBotint↵HSlice[system.int, system.int]
06:29:48FromDiscord<Elegantbeef> There we go demo putting in work 😛
06:30:30FromDiscord<demotomohiro> That is why typeof needs 2nd argument.
06:38:20FromDiscord<Rika> I knew about it but I thought proc was default
06:52:03FromDiscord<dain> what should be my mental model for understanding when the `=>` sugar will work and when it won't
06:52:10FromDiscord<dain> i try to use it in places, sometimes it works, sometimes the compiler can't figure out the types, and i never know ahead of time which it will be
07:15:00FromDiscord<dain> sent a code paste, see https://play.nim-lang.org/#ix=44jE
07:15:30FromDiscord<dain> (edit) "https://play.nim-lang.org/#ix=44jE" => "https://play.nim-lang.org/#ix=44jF"
07:15:57FromDiscord<Elegantbeef> Why are you using a template here?
07:16:26FromDiscord<dain> because i want to?
07:16:32FromDiscord<dain> idk i thought it needed to
07:16:39FromDiscord<Elegantbeef> No you dont need it
07:16:55FromDiscord<dain> bc i thought i need to get the type of the pairs
07:17:02FromDiscord<dain> so it has to be a metaprogramming not a proc
07:17:18FromDiscord<Elegantbeef> No it can be inside a generic
07:17:30FromDiscord<dain> im doing it by analogy to this https://github.com/nim-lang/Nim/blob/version-1-4/lib/pure/algorithm.nim#L476
07:17:35FromDiscord<dain> it uses a template
07:18:00FromDiscord<Elegantbeef> It uses a template for the `it` syntax
07:18:31FromDiscord<dain> oh
07:19:01FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44jI
07:19:04FromDiscord<enthus1ast> I think every time `auto` is valid as well https://github.com/nim-lang/Nim/blob/9508b06513b170ffbe91cfcfcd7ca09fa9b675cc/lib/pure/sugar.nim#L55↵(@dain)
07:22:23FromDiscord<enthus1ast> You could check with \`expandMacros\` how the macros is expanded to nim code
07:25:20FromDiscord<dain> i can't get it to work with generics
07:25:40FromDiscord<dain> sent a code paste, see https://play.nim-lang.org/#ix=44jK
07:25:45FromDiscord<Elegantbeef> I just showed you it with generics! 😛
07:26:04FromDiscord<dain> oh
07:26:09FromDiscord<dain> sent a code paste, see https://play.nim-lang.org/#ix=44jM
07:26:15FromDiscord<dain> i didnt know you could use typeof in a proc signature
07:26:22FromDiscord<Elegantbeef> `: Orderable`
07:26:22FromDiscord<dain> why won't my version work
07:26:42FromDiscord<Elegantbeef> Lefout `var` and you had `Orderable`
07:26:50FromDiscord<dain> same thing happens if i change Orderable to int
07:26:58FromDiscord<Rika> You still need the car
07:27:02FromDiscord<Rika> Var part
07:27:04FromDiscord<Elegantbeef> It needs to be a `var OrderdTable`
07:27:39FromDiscord<Elegantbeef> But you can see why i used the lazy generic, it was easier
07:28:01FromDiscord<dain> omg omg it works thankyou
07:28:44FromDiscord<dain> sent a code paste, see https://play.nim-lang.org/#ix=44jN
07:31:03FromDiscord<dain> i had no idea you could use typeof like that
07:31:36FromDiscord<dain> when is it best to use that vs the generics syntax with the square brackets
07:31:39FromDiscord<Elegantbeef> Of course you can generic procedures are generic
07:31:48FromDiscord<Elegantbeef> When you want to be more explicit
07:32:24FromDiscord<Elegantbeef> If you're lazy the autos and generic typeclass is the way t ogo
07:32:44FromDiscord<Elegantbeef> When you have heavily generic procedures the typeclass and autos are nice
07:33:01FromDiscord<dain> well it wasnt obvious to me 😆
07:41:32FromDiscord<dain> does `->` not work for generic types?
07:41:34FromDiscord<dain> sent a code paste, see https://play.nim-lang.org/#ix=44jO
07:41:56FromDiscord<Elegantbeef> No clue
07:42:07FromDiscord<Elegantbeef> I use type aliases over `->`
07:42:30FromDiscord<Elegantbeef> So i'd do `type SortProc[T, U] = proc(t: T, u: U): Orderable`
07:42:44FromDiscord<Elegantbeef> then `f: SortProc[T, U]`
07:50:58FromDiscord<dain> oh wait a minute, the `->` does work, I just forgot that it takes a single parameter that is a 2-tuple, not two parameters
07:51:40FromDiscord<dain> `((T, U)) -> Orderable` works
07:55:22*rockcavera quit (Remote host closed the connection)
07:59:58FromDiscord<Tuatarian> How does one create a cust allocator?
08:00:20FromDiscord<Elegantbeef> https://forum.nim-lang.org/t/7588
08:01:13FromDiscord<Tuatarian> That was an incredible combination of mistype and autocorrect lmao
08:01:22FromDiscord<Tuatarian> Meant custom operator
08:01:50FromDiscord<Tuatarian> If I just wrap proc name in backticks I can't seem to use it as an infix operator
08:01:56FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44jT
08:02:05FromDiscord<Tuatarian> That doesn't work for words
08:02:14FromDiscord<Elegantbeef> Of course not you cannot make word operators
08:02:20FromDiscord<Tuatarian> Only symbols or overloads of existing word.operators
08:02:26FromDiscord<Tuatarian> That's unfortunate
08:03:00FromDiscord<Elegantbeef> we have command syntax for unary and we have method call for binary
08:03:20FromDiscord<Tuatarian> Words are often better than inscrutable symbols imo, eg % vs sgnmod for signed modulo
08:03:24FromDiscord<Elegantbeef> So you pretty much only have at most an `.`
08:03:50FromDiscord<Tuatarian> Makes sense I guess
08:04:16FromDiscord<Tuatarian> Is it possible to make this functionality with macro/pragma?
08:04:54FromDiscord<Elegantbeef> kinda but you'd need a block above the code that has the "operator"
08:05:14FromDiscord<Tuatarian> Yeah that's not better
08:05:30FromDiscord<Elegantbeef> Just use method call and command syntax
08:05:37FromDiscord<Elegantbeef> Like what's the operator you're wanting to implement?
08:05:41FromDiscord<Tuatarian> Could you somehow make it into a pragma you can annotate a "custom operator" proc with?
08:05:49FromDiscord<Elegantbeef> No
08:05:56FromDiscord<Tuatarian> sgnmod
08:05:59FromDiscord<Tuatarian> That's unfortunate
08:06:04FromDiscord<Tuatarian> Signed modulo
08:06:48FromDiscord<Tuatarian> How do keyword operators like `mod ` `in` etc work?
08:06:59FromDiscord<Elegantbeef> They're apart of the language
08:07:04FromDiscord<Elegantbeef> So they're hard coded to be binary operators
08:07:25FromDiscord<Tuatarian> That's what I thought from looking at docs, but that's unfortunate
08:07:36FromDiscord<kraptor> Hi all, here David from SUSE: we made an statement from openSUSE regarding Nim, feel free to share 🙂 https://news.opensuse.org/2022/07/14/os-reaches-first-class-support-for-nim/
08:07:44FromDiscord<Elegantbeef> Actually we can use macros to hack this in
08:07:45FromDiscord<Elegantbeef> Maybe
08:07:55FromDiscord<Elegantbeef> Might be wrong
08:09:53FromDiscord<Elegantbeef> Yea i was 100% wrong
08:10:21FromDiscord<Elegantbeef> congrats on getting Nim there 😄
08:10:33FromDiscord<alehander42> the Araq quote
08:10:33FromDiscord<soundmodel> In reply to @kraptor "Hi all, here David": I wonder what's Ubuntu's or something's take on this? Would switch back to Suse, if this means that it will be a solid experience for Nim
08:10:46FromDiscord<alehander42> seems like something from a satirical site 😄
08:10:59FromDiscord<Elegantbeef> I mean why the hell are you developing using your software rep's version of a language
08:11:19FromDiscord<Elegantbeef> Atleast when it comes to languages that arent design by standard that just feels off
08:11:19FromDiscord<soundmodel> tbh I'm not even sure what first class support means
08:11:24FromDiscord<Elegantbeef> design by comittee
08:11:24FromDiscord<alehander42> otherwise nice
08:11:29FromDiscord<soundmodel> FreeBSD had bad support from repos
08:11:33FromDiscord<soundmodel> but nothing preventing from using choosenim
08:11:37FromDiscord<Elegantbeef> It means they have nim packages on all their released arch versions
08:12:06FromDiscord<alehander42> (edit) "seems like something from a satirical site 😄 ... " added "in a good way"
08:12:41NimEventerNew post on r/nim by thindil: openSUSE Reaches First-Class Support for Nim Language, see https://reddit.com/r/nim/comments/vyqlwg/opensuse_reaches_firstclass_support_for_nim/
08:13:53FromDiscord<soundmodel> does it mean that they're also tested so that e.g. choosenim would not break?
08:14:05FromDiscord<soundmodel> (edit) "does it mean that they're also tested so that e.g. ... choosenimwould?" added "they will not break, when" | "would not break?" => "would?"
08:14:09FromDiscord<Elegantbeef> I mean Choosenim isnt apart of Nim-lang
08:14:33FromDiscord<soundmodel> but I mean there's some reason why e.g. FreeBSD repo didn't carry choosenm
08:14:40FromDiscord<Tuatarian> Araq is hilariously straightforward, I love it
08:14:41FromDiscord<soundmodel> (edit) "choosenm" => "choosenim"
08:14:55FromDiscord<Elegantbeef> Does choosenim even work on BSD?
08:15:01FromDiscord<soundmodel> yes
08:15:09FromDiscord<kraptor> Having Nim properly packaged means we can provide software based on Nim and package it, fix security issues on old Nim versions (CVEs, etc.) and have a baseline version to compile any other depedan package (think about gcc or any other compiler in the same way). Basically, we say: we are ready to ship packages based on Nim.
08:15:13FromDiscord<Elegantbeef> I mean most repos dont carry choosenim
08:15:28FromDiscord<elcritch> In reply to @kraptor "Hi all, here David": that's pretty cool! I'm running OpenSuse at work. This is actually pretty cool!
08:15:31FromDiscord<soundmodel> but I like the idea of "tiered" languages, which I was asking at the FreeBSD community as well
08:15:39FromDiscord<Elegantbeef> Do you have LTS and stable?↵(@kraptor)
08:15:40FromDiscord<elcritch> (edit) removed "This is actually pretty cool!"
08:15:44FromDiscord<soundmodel> because it's nice to have an OS "enforce" app languages
08:16:12FromDiscord<soundmodel> like on Android
08:16:12FromDiscord<kraptor> In reply to @soundmodel "does it mean that": I use both the package and choosenim, should work for you too. Any issue, just create a bug on bugzilla.opensuse.org and I will take care of it and work with you to fix it.
08:16:18FromDiscord<soundmodel> it leads to consistency benefits
08:16:33FromDiscord<soundmodel> "okay now all Android code is just Java/Kotlin, no surprises"
08:16:34FromDiscord<Tuatarian> For users yes, for devs eh
08:16:40FromDiscord<Elegantbeef> Except the issue with android is it's awful to write code for if you dont want to use the forced languages
08:16:52FromDiscord<Elegantbeef> Like it's not open which is the exact issue
08:16:58FromDiscord<Tuatarian> I like the freedom to choose what language/tooling/etc without having to deal with massive pita
08:17:44FromDiscord<Tuatarian> Especially since java (not sure on kotlin) itself enforces really strong architectural and stylistic features which may not be best for a project
08:18:00FromDiscord<soundmodel> In reply to @Elegantbeef "Except the issue with": yes this is a drawback, but then you trust the OS devs to do the right thing
08:18:05FromDiscord<kraptor> @ElegantBeef LTS versions of SUSE SLE ship Nim 1.2.x, we aim to package 2.0 version once ready and, in the meantime, make the current 1.6.6 version stable and fix anything new we find before committing to a new version for LTS
08:18:13FromDiscord<soundmodel> I've debated this issue quite long, because I also thought that Java is stupid
08:18:19FromDiscord<Tuatarian> If a language has to be first class for whatever reason it should.imo be C
08:18:26FromDiscord<soundmodel> but if you read the motives of Android devs, you would understand that they do the right thing
08:18:38FromDiscord<soundmodel> so it just takes "being informed" to make those decisions
08:18:59FromDiscord<Tuatarian> I understand their motive and it's worked pretty well, but it's restrictive for devs in a way that I don't think is suitable for a desktop os
08:19:08FromDiscord<Elegantbeef> Here i'm going just wanting to not have to fight to run my own software on a device i purchase
08:19:25FromDiscord<soundmodel> well I would for example disallow the usage of C++
08:19:35FromDiscord<Tuatarian> Why?
08:19:39FromDiscord<Tuatarian> C++ is not horrible
08:19:48FromDiscord<Elegantbeef> Citation needed
08:19:49FromDiscord<soundmodel> because it's hard to use from other languages due to complicated sense of ABI stability
08:19:53FromDiscord<Tuatarian> Controversial opinion I know
08:20:08FromDiscord<soundmodel> or to make this better
08:20:18FromDiscord<soundmodel> we'd say that "you cannot use C++ for libraries, only for apps"
08:20:31FromDiscord<soundmodel> "C for libs, C++ only for apps, not libs"
08:21:26FromDiscord<soundmodel> then you could direct it more like: "Java is only for apps of this type"
08:21:38FromDiscord<soundmodel> so that people would not write scientific software in Java
08:21:52FromDiscord<Elegantbeef> "python is only for software you can point at and laugh"
08:22:32FromDiscord<soundmodel> "python is only for proof-of-concepts and 'small apps'"
08:22:47FromDiscord<soundmodel> which would prohibit people from writing serious software into Python libs
08:22:51FromDiscord<soundmodel> like it's now with SciPy etc.
08:24:25FromDiscord<soundmodel> because then it ends up "oh so much markov models in Python, but not in C"
08:30:46FromDiscord<soundmodel> I think some other OSes used to also promote some languages?
08:30:54FromDiscord<soundmodel> OSX, Windows
08:31:13FromDiscord<soundmodel> it's just odd that Linuxes don't have the idea of Objective-C or C#
08:31:18*toluene3 joined #nim
08:31:26*toluene quit (Ping timeout: 255 seconds)
08:31:27*toluene3 is now known as toluene
08:31:29FromDiscord<Elegantbeef> It's kinda the epitome of linux
08:31:36FromDiscord<Elegantbeef> It's open and you can do what you want
08:32:08FromDiscord<soundmodel> nice but I think it comes at the cost of lack of uniformity
08:32:25FromDiscord<soundmodel> OSX dev is pretty nice, because all the libs are always in the same langs and libraries
08:32:42FromDiscord<soundmodel> (edit) "OSX dev is pretty nice, because all the libs are always ... inusing" added "predominantly" | "predominantlyin the same langs and ... libraries" added "using the same"
08:32:46FromDiscord<Elegantbeef> Sure but that doesnt solve the problem if you dont like the language the house is made out of
08:32:57FromDiscord<soundmodel> then you trust the OS devs
08:33:00FromDiscord<Elegantbeef> If you dont like swift you're in the small corner of mac development
08:33:04FromDiscord<soundmodel> to make the right choices
08:33:18FromDiscord<Elegantbeef> Is swift the right choice?
08:33:20FromDiscord<Elegantbeef> Who knows
08:33:29FromDiscord<soundmodel> or "you don't like" means that you haven't studied all the things that the OS devs did
08:33:30FromDiscord<Elegantbeef> Might be for you, might not be for me
08:33:34FromDiscord<soundmodel> in order to select the best tools
08:33:55FromDiscord<soundmodel> and the idea is not to prohibit other tools
08:33:56FromDiscord<Elegantbeef> If you dislike a language and it's design it doesnt matter how much you use the language you wont like it
08:34:00FromDiscord<soundmodel> but give first class support for some
08:34:07FromDiscord<soundmodel> and then those langs are the ones that are "most robust"
08:34:27FromDiscord<soundmodel> (edit) "and then those langs are the ones that are "most robust" ... " added "on a given platform"
08:34:35FromDiscord<soundmodel> (edit) ""most robust"" => "most robust"
08:35:46FromDiscord<soundmodel> In reply to @Elegantbeef "If you dislike a": not necessarily, I hate Java
08:35:57FromDiscord<soundmodel> but having so much libraries for it mitigates for that fact
08:37:04FromDiscord<soundmodel> also judging by Rust
08:37:25FromDiscord<soundmodel> it's possible that the main method to make a language popular is to have some sort of backing
08:37:34FromDiscord<soundmodel> it's not enough to have a good technology
08:37:58FromDiscord<soundmodel> now people want to use Rust, because Mozilla endorses it
08:50:18FromDiscord<kcnaiamh> sent a long message, see http://ix.io/44k2
08:51:10FromDiscord<Elegantbeef> Well this is cursed 😄
08:51:55FromDiscord<Elegantbeef> You're hiding something though
08:52:09FromDiscord<soundmodel> also I'm not sure if you considered that the free choice in langs does not seem to promote survival of the fittest
08:52:17FromDiscord<soundmodel> or why do we have JavaScript etc.?
08:52:28FromDiscord<Elegantbeef> You're on an ancient nim
08:52:43FromDiscord<Elegantbeef> It's suggested to remove nim from apt then use choosenim
08:52:55FromDiscord<soundmodel> possible other negative outcome of freedom: then uninformed people make uninformed choices
08:53:02FromDiscord<soundmodel> and write software in uninformed ways
08:53:30FromDiscord<soundmodel> (edit) "possible other negative outcome of freedom: then uninformed people make uninformed choices ... " added "(?)"
08:54:49FromDiscord<Elegantbeef> What does `nim -v` say if you've not uninstalled it yet↵(@kcnaiamh)
08:56:30FromDiscord<kcnaiamh> In reply to @Elegantbeef "It's suggested to remove": damn! -2019! :3 https://media.discordapp.net/attachments/371759389889003532/997064032412520498/unknown.png
09:02:35FromDiscord<Goel> sent a code paste, see https://play.nim-lang.org/#ix=44k5
09:09:46FromDiscord<konsumlamm> @ElegantBeef i have to tell you, "apart" is not the same as "a part", in fact they're almost opposites
09:11:58FromDiscord<Elegantbeef> Oh i know
09:14:11FromDiscord<Elegantbeef> phonetic typos aren't worth addressing
09:16:24FromDiscord<creikey> It seems like the nim compiler is very complicated and slow developing because of a lack of full time contributors (no money to the project), causing compiler bugs and slow development of features, is this an accurate assessment or am I being overly negative? Can I rely on weird edge cases of nim like nim async server code to be used in production?
09:20:34FromDiscord<konsumlamm> ime you can't realy on on weird edge cases to work, but i wouldn't call async a weird edge case
09:21:50FromDiscord<konsumlamm> the lack of contributors doesn't really cause the bugs, it just means they aren't fixed that fast
09:23:07FromDiscord<kcnaiamh> sent a code paste, see https://play.nim-lang.org/#ix=44kb
09:23:11FromDiscord<konsumlamm> i can't speak about the complexity of the compiler itself, but i know that it accumulated a decent amount of cruft and there are people that think it should be (partly) rewritten
09:23:11FromDiscord<mratsim> In reply to @creikey "It seems like the": Seldom-tested features cause bugs.↵Most of Nim bugs are compile-time, so if it compiles you're fine.↵↵Async is well tested, otherwise Chronos is battle-tested and in production in a multi-billion industry
09:23:38FromDiscord<creikey> In reply to @konsumlamm "i can't speak about": yeah I saw nimskull but the language in it is written really weirdly
09:23:41FromDiscord<creikey> like the english
09:23:42FromDiscord<creikey> I don't really get it
09:23:59FromDiscord<Elegantbeef> Uh oh you've summoned someone
09:24:00FromDiscord<kraptor> @creikey I'd say that Nim is actually really fast-paced on new features and fixes (compared to other langs) given the "few" people involved... Actually, I struggle to follow everything being done 🙂
09:24:27FromDiscord<Elegantbeef> The biggest issues in my view with Nim and bugs is generics
09:24:45FromDiscord<Elegantbeef> Nim's generics generally work if you dont fly close to the sun
09:24:57FromDiscord<Elegantbeef> But if you do complex generic things they wither
09:25:07FromDiscord<konsumlamm> idk if money actually is a problem (probably best to ask Araq for that), but more full time contributors would definitely help a lot
09:25:10FromDiscord<creikey> In reply to @kraptor "<@180866243819995136> I'd say that": I definitely think it's fast paced but all of the new features are flags because they're unstable right
09:25:24FromDiscord<Elegantbeef> Well not all
09:25:29FromDiscord<creikey> In reply to @konsumlamm "idk if money actually": there's a lot of unsolved open issues on the compiler
09:25:35FromDiscord<creikey> which is what worries me
09:25:38FromDiscord<creikey> and when I look at the source of the compiler
09:25:43FromDiscord<creikey> it seems crazy
09:26:04FromDiscord<konsumlamm> In reply to @kraptor "<@180866243819995136> I'd say that": meanwhile i'm still waitong for concepts and view types lol
09:26:07FromDiscord<Elegantbeef> Eh many bugs are caused by semi-simple things
09:26:07FromDiscord<creikey> that and araq said it was designed for ref gc not orc so it would be too slow on orc(??) that sounds like a red flag to me but I'm not experienced enough with orc to know
09:26:20FromDiscord<konsumlamm> (in a usable state that is)
09:26:22FromDiscord<creikey> In reply to @Elegantbeef "Eh many bugs are": yeah I'm familiar with this from other open source projects
09:26:33FromDiscord<creikey> I come from godot and have fixed issues like that it's just an accumulation of them that causes problems
09:26:52FromDiscord<haxscramper> nobody knows how compiler works really
09:27:04NimEventerNew thread by Drkameleon: Weird error on Ubuntu 2x.04, see https://forum.nim-lang.org/t/9303
09:27:08FromDiscord<haxscramper> it just does stuff most of the time
09:27:09FromDiscord<haxscramper> in the code I mean
09:27:12FromDiscord<konsumlamm> In reply to @creikey "there's a lot of": yes, and?
09:27:15FromDiscord<creikey> In reply to @mratsim "Seldom-tested features cause bugs.": pretty cool actually
09:27:16FromDiscord<kraptor> @creikey seems crazy because it's too abstract and it's been developed for 17 years now 😛
09:27:19FromDiscord<haxscramper> like AI from the meme
09:27:23FromDiscord<haxscramper> you open it up
09:27:24FromDiscord<creikey> In reply to @kraptor "<@180866243819995136> seems crazy because": yeah I can't even imagine
09:27:29FromDiscord<creikey> In reply to @haxscramper "nobody knows how compiler": looool
09:27:34FromDiscord<kcnaiamh> In reply to @kcnaiamh "Still no luck 😦": can anyone help?↵why its showing seg fault
09:27:34FromDiscord<haxscramper> and there are 10E9 `if` statements in there
09:27:41FromDiscord<creikey> In reply to @haxscramper "and there are 10E9": oh my god
09:28:11FromDiscord<xflywind> In reply to @creikey "that and araq said": where?
09:28:48FromDiscord<Elegantbeef> I've never seen a segfault from stock compiler↵(@kcnaiamh)
09:28:51FromDiscord<creikey> In reply to @flywind "where?": https://media.discordapp.net/attachments/371759389889003532/997072171576868864/unknown.png
09:28:52FromDiscord<Elegantbeef> That's an impressive feat
09:29:20FromDiscord<Elegantbeef> It doesnt say it's slower
09:29:25FromDiscord<creikey> yeah I remembered wrong
09:29:44FromDiscord<creikey> lol this guy has a real life nim crown https://media.discordapp.net/attachments/371759389889003532/997072395774996531/unknown.png
09:29:49FromDiscord<creikey> that's so cool
09:30:05FromDiscord<xflywind> In reply to @creikey "": The info is outdated, it is not actually related to seq implementation.
09:30:23FromDiscord<Elegantbeef> Anyway point is if you stay away from the edges you
09:30:24FromDiscord<Elegantbeef> 're probably fine
09:30:38FromDiscord<creikey> that's good news because when I looked at rust the situation was even worse
09:30:42FromDiscord<Elegantbeef> If you do complex things you'll almost certainly hit pitfalls of edge cases
09:30:46FromDiscord<creikey> there's like no good websockets server implemention there
09:30:49FromDiscord<Elegantbeef> Well rust's async is a real joke
09:30:50FromDiscord<creikey> (edit) "implemention" => "implementation"
09:30:53FromDiscord<creikey> yeah it's sooo frustrating
09:31:07FromDiscord<creikey> in golang the main websockets server is literally just unmaintained
09:31:09FromDiscord<Elegantbeef> There are so many issues with it's async and i know atleast 1 person that wishes they did the Nim thing of async in macros
09:31:19FromDiscord<creikey> at least with nim it's treeform and I can read the code, it's simple, and probably used in one of his projects
09:31:40FromDiscord<xflywind> In reply to @creikey "": see https://github.com/nim-lang/Nim/pull/19989 the memory usage has already dropped from 1.2 gib to 800 mib
09:31:53FromDiscord<creikey> In reply to @flywind "see https://github.com/nim-lang/Nim/pull/19989 the ": that much memory is bananas???? wtf is going on in that compiler
09:32:00FromDiscord<creikey> what's the size of all the text code of the compiler
09:32:02FromDiscord<creikey> (edit) "what's the size of all the text code of the compiler ... " added "source"
09:32:08FromDiscord<haxscramper> compile the compiler
09:32:11FromDiscord<haxscramper> 800mb
09:32:16FromDiscord<Elegantbeef> Compiling 100k lines of code is a lot of memory
09:32:23FromDiscord<creikey> In reply to @Elegantbeef "Compiling 100k lines of": it's 100k lines?
09:32:24FromDiscord<creikey> wow
09:32:25FromDiscord<haxscramper> well, if you look at how much token object takes up in memory
09:32:27FromDiscord<haxscramper> or PNode
09:32:41FromDiscord<creikey> In reply to @Elegantbeef "Compiling 100k lines of": honestly less than I thought it would be
09:32:44FromDiscord<creikey> 100k lines is like
09:32:45FromDiscord<haxscramper> token is just insanely huge
09:32:48FromDiscord<creikey> not bananas bananas
09:33:01FromDiscord<creikey> In reply to @haxscramper "token is just insanely": yeah I like the look of zig but it's not 1.0 and the syntax around arrays and lists is really weird
09:33:04FromDiscord<Elegantbeef> Oh i know this too well given my dumb PR to make templates/macros show unexpanded code
09:33:22FromDiscord<Elegantbeef> A lot of zig i'd say is weird
09:33:25FromDiscord<Elegantbeef> But solid compiler
09:33:34FromDiscord<creikey> In reply to @Elegantbeef "But solid compiler": yeah the look of the new self hosted is very promising to me
09:33:42FromDiscord<creikey> my biggest gripe with nim is too many allocations
09:33:44FromDiscord<creikey> that you can't see
09:33:54FromDiscord<Elegantbeef> Uhhh
09:33:55FromDiscord<creikey> but honestly it's so much faster and easier to use than every other language I don't really care in the end
09:34:00FromDiscord<xflywind> Even refc occpies more than 600 Mib memory and it is reasonable for orc to use more memories since it has more optimizations.
09:34:22FromDiscord<creikey> In reply to @flywind "Even refc occpies more": oh that's right orc does autofree reasoning
09:34:25FromDiscord<creikey> (edit) "In reply to @flywind "Even refc occpies more": oh that's right orc does autofree reasoning ... " added "righ"
09:34:27FromDiscord<creikey> (edit) "righ" => "right"
09:34:34FromDiscord<Elegantbeef> Does Nim really have many hidden allocations?
09:34:41FromDiscord<Elegantbeef> I'm trying to think of them aside
09:34:50FromDiscord<Elegantbeef> from exception handling
09:34:54FromDiscord<creikey> I know strings do a lot
09:35:01FromDiscord<Elegantbeef> They're not hidden
09:35:10FromDiscord<creikey> by hidden allocation I mean you don't pass an allocator or memory handle to std
09:35:15FromDiscord<creikey> or some other library
09:35:18FromDiscord<Elegantbeef> That's not hidden to me
09:35:19FromDiscord<xflywind> See also https://github.com/nim-lang/Nim/pull/19995 which intends to improve the performance of the move analyser
09:35:20FromDiscord<creikey> like it's assumed that other code will be doing some allocation
09:35:25FromDiscord<creikey> that you can't control/don't know about
09:35:35FromDiscord<Elegantbeef> Hidden is an allocation that happens from no input from the programmer
09:35:53FromDiscord<Elegantbeef> Yea that's not what i'd define as hidden but my definition is probably wrong
09:35:55FromDiscord<xflywind> I also have a simple Github Action to track the memory usage => https://github.com/nim-lang/Nim/pull/20020#issuecomment-1183315970
09:35:58FromDiscord<creikey> In reply to @Elegantbeef "Yea that's not what": so is mine
09:36:20FromDiscord<Elegantbeef> If there is programmer input i dont feel it's a hidden allocation 😄
09:36:30FromDiscord<Elegantbeef> The most hidden allocation i can think of is the type information on types
09:36:30FromDiscord<creikey> In reply to @flywind "See also https://github.com/nim-lang/Nim/pull/19995": it seems like most commits to the compiler are more green than red which is why it's 100k lines now
09:36:56FromDiscord<creikey> In reply to @Elegantbeef "If there is programmer": yeah I just want things to be reasonable with memory
09:37:06FromDiscord<Elegantbeef> I mean Nim is reasonable on memory
09:37:09FromDiscord<creikey> not 100 mallocs for one function and I don't know about it
09:37:20FromDiscord<creikey> when it could be like 2 at the start and I pass a fixed buffer
09:37:26FromDiscord<creikey> malloc is so expensive
09:37:34FromDiscord<Elegantbeef> On windows\
09:37:34FromDiscord<konsumlamm> In reply to @Elegantbeef "Anyway point is if": sadly those edges also includes stuff like using 64 bit integers on the JS backend, not just crazy generics
09:38:00FromDiscord<Elegantbeef> I mean `var openArray[T]` exists so make PRs and be happy with it
09:38:25FromDiscord<Elegantbeef> Nim has mechanisms for encouraging memory reuse and not allocating
09:38:30FromDiscord<creikey> In reply to @Elegantbeef "Nim has mechanisms for": like what?
09:38:38FromDiscord<konsumlamm> In reply to @creikey "that's good news because": what situation? at least i've never seen a compiler bug in Rust (outside of nightly features, but those are nightly for a reason)
09:38:39FromDiscord<creikey> In reply to @Elegantbeef "I mean `var openArray[T]`": yeah openArray is cool
09:38:55FromDiscord<creikey> In reply to @konsumlamm "what situation? at least": not compiler bugs, but how much it suits what I'm trying to do
09:38:58FromDiscord<Elegantbeef> reference passing, open arrays, preallocating collections
09:39:04FromDiscord<creikey> I have spent an hour shopping for stacks instead of actually working on the thing
09:39:12FromDiscord<creikey> I'm close to just using nim and movingon
09:39:13FromDiscord<creikey> (edit) "movingon" => "moving on"
09:39:40FromDiscord<creikey> In reply to @konsumlamm "what situation? at least": how do I do a websocket server in rust without 8 billion new syntax functional functoids?
09:40:09FromDiscord<Elegantbeef> Also i'd consider iterators over procedures that return `seq[T]` a mechanism to reduce memory usage
09:40:17FromDiscord<Elegantbeef> Iterators can always have a helper proc that emits a sequence
09:40:46FromDiscord<creikey> like what is this?? https://media.discordapp.net/attachments/371759389889003532/997075172400037999/unknown.png
09:40:58FromDiscord<Elegantbeef> Me going to sleep
09:41:03FromDiscord<konsumlamm> In reply to @creikey "how do I do": idk, never tried to use websockets
09:41:12FromDiscord<creikey> I know what it is and I get that the extra syntax are because rust provides certain safety guarantees and you handle the error cases by describing your program like this
09:41:52FromDiscord<creikey> but like you need 8 billion imports to ech oback https://media.discordapp.net/attachments/371759389889003532/997075450016837682/unknown.png
09:41:54FromDiscord<creikey> (edit) "ech oback" => "echo back"
09:42:15FromDiscord<creikey> sent a code paste, see https://play.nim-lang.org/#ix=44kf
09:42:27FromDiscord<konsumlamm> i find it perfectly readable ¯\\_(ツ)\_/¯
09:42:28FromDiscord<creikey> all of this to send like one message
09:42:43FromDiscord<creikey> In reply to @konsumlamm "i find it perfectly": maybe my aversion to code like this is irrational
09:42:48FromDiscord<creikey> I've been using rust for years
09:42:54FromDiscord<creikey> and I still just like
09:43:00FromDiscord<creikey> don't like how it looks
09:43:15FromDiscord<creikey> https://github.com/creikey/rust-pong/blob/main/relay-server/src/main.rs like I wrote similar code for this
09:43:54FromDiscord<kcnaiamh> I pulled nimlang/nim container and nim works find there
09:44:05FromDiscord<kcnaiamh> don't know what is the problem on my local machine
09:58:51FromDiscord<planetis> I tried to write a sso strings library and the biggest bottleneck was this line: if long: s.long.data[i] else: s.short.data[i]. string allocations were meaningless at least on linux
10:00:14FromDiscord<planetis> There is a benchmark with 10k allocations with half short half long strings and performance was the same with std/strings
10:01:23FromDiscord<planetis> but accessing data with this pattern made 2s->6s increase which is crazy
10:03:17FromDiscord<planetis> Also I find rust is awful, it sucks the fun out of programming, for safety's sake.
10:09:34FromDiscord<dom96> sent a code paste, see https://play.nim-lang.org/#ix=44kn
10:09:42FromDiscord<dom96> for some that is a trade off worth having
10:17:28FromDiscord<xflywind> Does goto exception change the behaiour of IndexDefect>
10:17:33FromDiscord<xflywind> (edit) "IndexDefect>" => "IndexDefect?"
10:17:49FromDiscord<xflywind> sent a code paste, see https://play.nim-lang.org/#ix=44ko
10:18:27FromDiscord<xflywind> doAssertRaises can no longer catch IndexDefect.
10:18:42FromDiscord<xflywind> sent a code paste, see https://play.nim-lang.org/#ix=44kp
10:22:36FromDiscord<creikey> In reply to @dom96 "most of that verbosity": there's no error handling in that snippet though?
10:22:59FromDiscord<creikey> well like it is handling an error
10:23:04FromDiscord<dom96> lol
10:23:17FromDiscord<creikey> I didn't mean it's bad that errors have to be handled or unwrapped or whatever
10:23:21FromDiscord<dom96> it is indeed literally handling an error, ergo there is error handling :)
10:23:30FromDiscord<creikey> but why in this`tokio::task::spawn(client_rcv.forward(client_ws_sender).map(` is it reaching across tokio and task and forward and map
10:23:45FromDiscord<creikey> there's 7 words on this one line just to send some text to a client
10:24:21FromDiscord<dom96> also I'm pretty sure you can write `.expect("Error sending websocket")` instead of the whole `map`.
10:24:43FromDiscord<dom96> spawn is probably because you don't want to await it
10:25:49FromDiscord<dom96> and you could get rid of the `tokio::task::` as well with a correct `use`
10:26:20FromDiscord<soundmodel> it's a bit sad to read about "I have written Python programs for 10 years" kinds of posts
10:27:23FromDiscord<soundmodel> (edit) "posts" => "posts, when it's possible the something Nim is around the corner"
10:27:35FromDiscord<soundmodel> (edit) "the" => "that"
10:27:41FromDiscord<soundmodel> (edit) "it's a bit sad to read about "I have written Python programs for 10 years" kinds of posts, when it's possible that something ... Nim" added "like"
10:28:38FromDiscord<laker31> I installed Nim via choosenim on an M1, but for some reason it installed the amd64 version (that's what nim -v says).↵Does anybody know how to actually get the arm64 version with choosenim?
10:29:36FromDiscord<dom96> You can't right now, there is a pending PR to add support for this
10:29:59FromDiscord<dom96> Which reminds me, I need to review it
10:30:17*toluene0 joined #nim
10:30:24*toluene quit (Ping timeout: 244 seconds)
10:30:24*toluene0 is now known as toluene
10:31:10FromDiscord<dom96> if you'd like you can grab this patch https://github.com/dom96/choosenim/pull/301, build it yourself and replace the `choosenim` in ~/.nimble/bin with it
10:32:18FromDiscord<laker31> Thank you! And once the PR is merged, would the fix be included next time I update choosenim?
10:33:50FromDiscord<dom96> In reply to @creikey "It seems like the": Nim async is used in prod because we eat our own dogfood and that is why we eat our own dogfood. Some people really dislike that but it's the only reason async and a lot of web frameworks are where they are at in Nim.
10:34:12FromDiscord<creikey> In reply to @dom96 "Nim async is used": this is nice
10:35:54FromDiscord<alehander42> In reply to @dom96 "most of that verbosity": This is good
10:36:29FromDiscord<dom96> choosenim is also an example of dogfooding and while sometimes it's painful for newcomers to run into bugs they usually indicate something a percentage of them would run into anyway
10:36:46FromDiscord<dom96> great example of this is OpenSSL v3
10:36:57FromDiscord<dom96> sadly the fix is tough for this
10:37:50FromDiscord<creikey> In reply to @dom96 "choosenim is also an": oh yeah I ran into the openssl thing
10:38:17FromDiscord<creikey> yeah I fixed it with this https://media.discordapp.net/attachments/371759389889003532/997089647756841010/unknown.png
10:38:42FromDiscord<dom96> the latest choosenim shouldn't have this issue anymore
10:38:54FromDiscord<dom96> it was released a few days ago though so maybe you missed it
10:39:03FromDiscord<creikey> no that was a couple months ago
10:39:13FromDiscord<creikey> ok honestly now that I actually read the rust websockets code
10:39:14FromDiscord<creikey> it's not that crazy
10:39:18FromDiscord<creikey> like slowly
10:44:33FromDiscord<dom96> Yeah, it definitely requires thinking a little differently and even still Rust is far more verbose than Nim I'd say.
10:44:48FromDiscord<enthus1ast> maybe choosenim on windows should use the winapi for downloading
10:44:50FromDiscord<dom96> I finally used it properly just this last month to write a web app and it was a bit of a slog
10:44:57FromDiscord<dom96> In reply to @enthus1ast "maybe choosenim on windows": it already does
10:45:07FromDiscord<enthus1ast> ah this was the fix?
10:45:17FromDiscord<dom96> it has done so for a long time now
10:45:17NimEventerNew thread by Miran: OpenSUSE Reaches First-Class Support for Nim Language, see https://forum.nim-lang.org/t/9304
10:45:22FromDiscord<dom96> it uses puppy on Windows
10:46:25FromDiscord<deeuu> In reply to @dom96 "I finally used it": How come, just to experiment? ps how did you get on with the move?
10:56:10FromDiscord<TryAngle> In reply to @dom96 "I finally used it": What web framework did u use? At this point rust has soo many lol
10:57:14FromDiscord<dom96> In reply to @deeuu "How come, just to": A combination of various things: I've been wanting to give Rust a proper go for a big project for a while (best way to learn it), I'm personally not happy with how some things are going in Nim-land so I think having another systems language under my toolbelt is a good idea plus you've got to remember that I've been using only Nim for personal projects for the past 12 years now (that's a long time!).
10:57:30FromDiscord<dom96> In reply to @TryAngle "What web framework did": Actix + Diesel
10:57:35FromDiscord<dom96> (edit) "In reply to @TryAngle "What web framework did": Actix + Diesel ... " added "(for the ORM)"
10:57:41FromDiscord<TryAngle> In reply to @dom96 "Actix + Diesel (for": 💀
10:58:06FromDiscord<dom96> Here is what I built in case you're curious: https://mousetrack.co.uk/
10:58:06FromDiscord<TryAngle> Ok ye this is a bit of a verbosity
10:58:52FromDiscord<dom96> Getting Disney fans to visit isn't easy lol
10:59:38FromDiscord<deeuu> Wasn't expecting that..nice app though
10:59:42FromDiscord<laker31> In reply to @dom96 "Here is what I": Looks so nice! Is the frontend also done in Nim?
10:59:50FromDiscord<dom96> Nothing is done in Nim lol
10:59:58FromDiscord<laker31> Nvm it's Rust haha
10:59:59FromDiscord<dom96> Front end is react + typescript
11:00:00FromDiscord<TryAngle> May u do a rant blog post what u don't like about nim-land 🥺
11:00:09FromDiscord<laker31> Ah okay
11:00:54FromDiscord<dom96> In reply to @TryAngle "May u do a": Maybe. It would probably create too much drama.
11:01:01FromDiscord<dom96> But I am considering it.
11:01:49FromDiscord<dom96> Typescript is pretty nice too btw
11:02:07FromDiscord<TryAngle> :nim1:↵💀
11:02:50FromDiscord<dom96> In particular I forgot how nice good auto completion/IDE hints are
11:02:59FromDiscord<dom96> Typescript is second to none from what I've seen so far
11:03:48FromDiscord<TryAngle> In reply to @dom96 "Typescript is pretty nice": I feel same but with rust actix diesel react u really chose the most boilerplate / vebose stack u could chose 😂
11:03:55FromDiscord<planetis> nice website looks like it uses tailwind for CSS?
11:04:28FromDiscord<dom96> In reply to @TryAngle "I feel same but": rust definitely verbose. React not so much
11:04:37FromDiscord<dom96> In reply to @planetis "nice website looks like": Yep, first time using tailwind as well :D
11:04:57FromDiscord<planetis> that I like
11:05:12FromDiscord<dom96> And I used Figma to put together a design first too - highly recommend doing that because fiddling with design while writing CSS leads to poor design
11:05:18FromDiscord<TryAngle> In reply to @dom96 "rust definitely verbose. React": U should have a look at Tokio's Axum + sqlx or SeaORM
11:05:41FromDiscord<dom96> In reply to @TryAngle "U should have a": will do
11:06:31FromDiscord<TryAngle> It's really really new (like this year?) but It's from Tokio team so I guess it's good
11:06:32FromDiscord<dom96> I think I looked at sqlx already
11:08:02FromDiscord<Phil> In reply to @dom96 "In particular I forgot": Have that in java at work. Man do I always miss it with nim
11:09:27FromDiscord<TryAngle> A @dom96 no matter how much ppl talk about Rust analyzer, JetBrains CLion auto complete is really good, years ahead rust analyzer imo.
11:10:09FromDiscord<TryAngle> (edit) "A" => "Ah"
11:27:43FromDiscord<Rika> In reply to @dom96 "Maybe. It would probably": Since when did something like that not cause drama though let’s be real
11:54:22FromDiscord<federico3> Debian has been shipping up-to-date Nim since years and Ubuntu is feeding from it↵(@soundmodel)
12:20:05FromDiscord<Prestige> In reply to @dom96 "In particular I forgot": Hoping Nim gets to that level at some point, IDE support is pretty poor in comparison
12:21:00FromDiscord<Prestige> Have a lot of friends that won't touch Nim for that reason
12:23:45*jmdaemon quit (Ping timeout: 272 seconds)
12:35:16FromDiscord<TryAngle> In reply to @Avahe "Have a lot of": Same 😔 😔 😔
12:36:05FromDiscord<TryAngle> But one of them is a c++ fan boy and makes fun of me for using a non industry standard language lolll
12:47:38FromDiscord<Q-Master> Heh, some many years ago my co-workers on other project had been writing a game for PS2 in C++ using Far commander editor. Without any IDEs \:)
12:48:33FromDiscord<IDF> In reply to @TryAngle "But one of them": make fun of him saying even stroustrupt said he only knows parts of c++
12:51:06*noeontheend joined #nim
12:51:44FromDiscord<laker31> In reply to @Avahe "Hoping Nim gets to": What's the best IDE for Nim right now?↵I am using the Nim extension by saem, Nimsuggest and CodeLLDB, works quite well but I am by no means an advanced coder or anything
12:51:55FromDiscord<laker31> (edit) "In reply to @Avahe "Hoping Nim gets to": What's the best IDE for Nim right now?↵I am using ... the" added "VSC with"
12:52:39FromDiscord<laker31> (edit) "saem, Nimsuggest" => "saem (with nimsuggest + nimpretty enabled)"
12:53:13FromDiscord<IDF> your best bet is using nimlsp with a text editor that supports lsp
12:54:12FromDiscord<Prestige> I believe VSC with that extension is the best thing we have so far
12:54:30FromDiscord<Prestige> I'm using neovim with nimlsp, it's okay
12:54:46FromDiscord<enthus1ast> pkill -9 nimsuggest↵?
12:54:55FromDiscord<Prestige> No autocompletion and the language server dies all the time
12:55:15FromDiscord<enthus1ast> taskkill /im nimsuggest.exe /f
12:55:59FromDiscord<laker31> In reply to @IDF "your best bet is": Ah I see, saem's extension (which I really like) only supports nimlangserver - is that as good as nimlsp?
13:08:32FromDiscord<Rika> They both use the same thing; Nim’s suggestion engine
13:08:38FromDiscord<Rika> (edit) "thing;" => "thing,"
13:13:00FromDiscord<enthus1ast> and the commands i sent, helps if it goes wild
13:14:16FromDiscord<jan0809> In reply to @Avahe "No autocompletion and the": um didnt die yet for me ngl, about autocomp im not entirely sure but i feel like its there (gotta check at home
13:14:34FromDiscord<TryAngle> In reply to @Avahe "I believe VSC with": wait so nimlsp is better than nimsaem?
13:14:56*xet7 joined #nim
13:15:15FromDiscord<enthus1ast> its also interesting that jump to definition works only about 15-20 % of times
13:15:37FromDiscord<enthus1ast> i often just completely disable nimsuggest in the extension
13:15:53FromDiscord<enthus1ast> its kinda usless, harmfull even
13:16:02FromDiscord<jan0809> those didnt ever fail on my end, not even when jumping to stdlib afaik
13:16:27FromDiscord<TryAngle> In reply to @enthus1ast "its also interesting that": ye that's my biggest issue with nimsaem vsc rn, I always open another VSC window on a second monitor with a git clone of the library and use project search 💀
13:16:37FromDiscord<TryAngle> (edit) "💀" => "bc of that💀"
13:17:29FromDiscord<jan0809> um you guys made sure being on devel?
13:18:09FromDiscord<laker31> nimsaem devel or?
13:18:15FromDiscord<jan0809> nim devel
13:18:40FromDiscord<jan0809> atleast if you use nimlangserver
13:18:45FromDiscord<enthus1ast> nope stable↵(@jan0809)
13:18:56FromDiscord<jan0809> that didnt work at all for me
13:19:00FromDiscord<enthus1ast> 1.6.4
13:19:04FromDiscord<jan0809> but devel like charm
13:19:28FromDiscord<jan0809> think devel is 1.7.1 or something
13:19:43FromDiscord<laker31> In reply to @jan0809 "nim devel": Ah, no I'm on 1.6.6. But for me the only thing that doesnt work is jumping to the libraries, jumping to procedures or type definitions always works, and so does autocompletion for everything imports
13:20:12FromDiscord<jan0809> and make sure to apply the settings as said in the readme;
13:20:30FromDiscord<laker31> (edit) "In reply to @jan0809 "nim devel": Ah, no I'm on 1.6.6. But for me the only thing that doesnt work is jumping to the libraries, jumping to procedures or type definitions always works, and so does autocompletion for everything ... imports" added "but"
13:21:02FromDiscord<jan0809> In reply to @laker31 "Ah, no I'm on": for me it always crashed right away on stable -> only using `nimlangserver`
13:22:52FromDiscord<laker31> In reply to @jan0809 "for me it always": Ah that's strange, I haven't ever had that happen
13:23:02FromDiscord<soundmodel> is there any list of community tasks for Nim?
13:23:12FromDiscord<laker31> What's weird for me is that jumping and autosuggest for imports doesnt work on neither nimlangserver nor nimsuggest 🤔
13:23:17FromDiscord<jan0809> just saw on git current stable seem to work now
13:23:29*noeontheend quit (Ping timeout: 255 seconds)
13:24:19FromDiscord<jan0809> https://media.discordapp.net/attachments/371759389889003532/997131432608682044/IMG_20220714_152338.jpg
13:26:01FromDiscord<laker31> So on devel do suggestions for imports work for you? (with `nimlangserver`)
13:27:09FromDiscord<jan0809> im not sure gotta check when im athome
13:27:42FromDiscord<laker31> Thanks, I'd love to know. It's not a big deal but slightly annoying 😄
13:28:18FromDiscord<xflywind> In reply to @soundmodel "is there any list": What do you mean by "community tasks"?
13:28:35FromDiscord<soundmodel> tasks that a community may develop in open source way
13:28:53FromDiscord<soundmodel> I mean I originally came in only as a user, but seeing that Nim is incomplete, I've been wondering what's the best use of time
13:28:59FromDiscord<soundmodel> to develop the compiler or write libraries
13:29:32FromDiscord<soundmodel> based on what's seen on other languages a language will not gain widespread industrial interest as long as it's immature
13:29:40FromDiscord<soundmodel> because no business will take a risk like that
13:31:10FromDiscord<soundmodel> e.g. https://news.ycombinator.com/item?id=24526861
13:32:10FromDiscord<Rika> nim itself is oss so...?
13:34:22FromDiscord<soundmodel> yes, but then you study e.g. how C++ or something is developed
13:34:33FromDiscord<soundmodel> or Linux
13:34:59FromDiscord<soundmodel> you need an original designer to give insight as to the prospects
13:35:14FromDiscord<soundmodel> otherwise someone comes and makes Nim to JavaScript 2
13:36:01FromDiscord<vestel> how do I do list comprehensions?
13:36:11FromDiscord<Rika> look at issues perhaps or https://github.com/nim-lang/needed-libraries
13:36:30FromDiscord<soundmodel> yes, this is part of it, but library dev != compiler dev
13:36:36FromDiscord<soundmodel> != langdev
13:36:48FromDiscord<Rika> In reply to @vestel "how do I do": https://nim-lang.org/docs/sugar.html#collect.m%2Cuntyped
13:37:05FromDiscord<Rika> In reply to @soundmodel "yes, this is part": then the nim issues page
13:37:08FromDiscord<Rika> as ive mentioend
13:37:20FromDiscord<soundmodel> particularly there's this risk that someone writes a library that ends up into some compiler bugs
13:38:09FromDiscord<soundmodel> (edit) "particularly" => "particularly,"
13:38:23FromDiscord<jan0809> thats a good idea tho, im not into enough yet, but that makes it way easier for potentional ready to contrib ppl to find out where to look into
13:38:59FromDiscord<Phil> In reply to @vestel "how do I do": You may want to alternatively consider sequtils or (if performance matters) straight up for loops.
13:39:22FromDiscord<soundmodel> and depending on how deep things are some things can grow out of context
13:39:38FromDiscord<jan0809> In reply to @jan0809 "thats a good idea": you can do i think its called collect
13:39:42FromDiscord<Rika> theres a label "Easy" https://github.com/nim-lang/Nim/issues?q=is%3Aopen+is%3Aissue+label%3AEasy
13:39:57FromDiscord<jan0809> thats quite similar to what list comps do
13:39:58FromDiscord<soundmodel> like can someone develop the compiler unless one has x years of experience with it already
13:40:19FromDiscord<Rika> you can also do documentation
13:40:29FromDiscord<soundmodel> when e.g. GCC is, in comparison, 15 million LOC
13:40:31FromDiscord<jan0809> lol
13:41:15FromDiscord<xflywind> In reply to @soundmodel "yes, this is part": Well take an accepted RFC
13:41:43FromDiscord<xflywind> https://github.com/nim-lang/RFCs/issues?q=is%3Aissue+is%3Aopen+label%3A%22Accepted+RFC%22
13:42:02FromDiscord<Rika> In reply to @flywind "Well take an accepted": thats quite a bit larger and harder to implement
13:43:12FromDiscord<jan0809> In reply to @Rika "you can also do": what would be insanely usefull (atleslast for me) is a list of python terms and whats the nim counterpart
13:43:32FromDiscord<jan0809> 😶‍🌫️
13:43:39FromDiscord<Rika> https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers/17297a0eacf950b4c137b9db3988800696fbe0b0
13:44:18FromDiscord<jan0809> neat
13:44:27FromDiscord<xflywind> In reply to @soundmodel "you need an original": There are also more challenge tasks like https://github.com/nim-lang/compilerdev/issues
13:44:51FromDiscord<Rika> oh thats a new repo
13:44:53FromDiscord<Rika> never seen it
13:45:45FromDiscord<xflywind> It is old but tough
13:47:33FromDiscord<TryAngle> In reply to @soundmodel "because no business will": if ur business is not using v-lang yet, is it really a business?
13:48:25FromDiscord<soundmodel> but I'm also wondering whether compiler dev != other dev
13:48:34FromDiscord<soundmodel> i.e. that it takes too much energy to do everything
13:49:17*noeontheend joined #nim
13:50:31FromDiscord<soundmodel> also cannot find any "beginner doc for the compiler dev"
13:51:15FromDiscord<xflywind> In reply to @soundmodel "also cannot find any": did you read the contributing guide?
13:51:42FromDiscord<xflywind> https://nim-lang.github.io/Nim/contributing.html
13:53:05FromDiscord<soundmodel> I skimmed it, but I couldn't find an overview on how the compiler works
13:53:09FromDiscord<soundmodel> and what its principles are
13:55:19FromDiscord<voidwalker> pls help me with this bugger, I am trying to achieve something like this: ` dbsql.exec(sql"INSERT OR REPLACE INTO ? (?) VALUES (?)",tbName, tsv.headers, tsv.row)↵`
13:55:37FromDiscord<voidwalker> tbName is a string, while the rest are obviously seq[string]
13:55:50*noeontheend quit (Ping timeout: 240 seconds)
13:55:54FromDiscord<voidwalker> is it even possible without dynamically generating the required number of `?` signs ?
13:56:55FromDiscord<xflywind> In reply to @soundmodel "I skimmed it, but": The compiler uses multiple passes. I don't know the overview. But there is going to be a Nim compiler book soon.
13:57:10FromDiscord<Rika> In reply to @soundmodel "I skimmed it, but": because there isnt any i believe, you just go into it and read the code (as ive heard from others)
13:57:23FromDiscord<Rika> In reply to @flywind "The compiler uses multiple": really? when was this announced
13:58:15FromDiscord<voidwalker> can i even somehow check the sql query generated from a exec(dbConn) ?
13:59:01FromDiscord<xflywind> In reply to @Rika "really? when was this": it is the grapevine.
13:59:12FromDiscord<Rika> ?
14:00:26FromDiscord<xflywind> (edit) "In reply to @Rika "really? when was this": ... itfrom" added "I heard" | "is" => "from"
14:01:51FromDiscord<xflywind> Anyway, there is an easy task to take now => backport https://github.com/nim-works/nimskull/pull/380 to upstream
14:06:47FromDiscord<enthus1ast> @voidwalker\: no this is not possible
14:07:22FromDiscord<voidwalker> @enthus1ast yeah, I just came to the exact conclusion. A ? gets replaced by an element of the varargs array, not an array(seq) itself
14:08:01FromDiscord<voidwalker> so i need to do something like repeat("?,")
14:08:40NimEventerNew post on r/nim by naimul9m: printing string giving segmentation fault error, see https://reddit.com/r/nim/comments/vywqtw/printing_string_giving_segmentation_fault_error/
14:10:11FromDiscord<voidwalker> is there a string proc to deletethe last n chars from it ?
14:10:23FromDiscord<enthus1ast> better use join for this
14:10:27FromDiscord<voidwalker> (edit) "deletethe" => "delete the"
14:10:31FromDiscord<enthus1ast> repeat is not the correct tool
14:10:57FromDiscord<voidwalker> repeat to generate the correct number of ?, in (?,?,..)
14:11:02FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=44lh
14:11:04FromDiscord<enthus1ast> (?),(?)
14:11:10FromDiscord<voidwalker> oh
14:11:18FromDiscord<enthus1ast> or withouth ()
14:12:01FromDiscord<voidwalker> you are right.. too many string procs, can't remember them
14:13:33FromDiscord<enthus1ast> sent a code paste, see https://paste.rs/PTc
14:14:14FromDiscord<enthus1ast> BUT, i hate it constructing sql like this...
14:15:18FromDiscord<enthus1ast> sql always feels like a hack to me
14:15:38FromDiscord<voidwalker> yeah it is, not the most elegant interface to it
14:15:40FromDiscord<enthus1ast> if you feels fancy you could pr https://github.com/enthus1ast/nisane with something like this, to not get insane next time \:)
14:17:09FromDiscord<voidwalker> first insane, then nisane
14:17:32FromDiscord<enthus1ast> mhh the "orm" parts of nisane are rather toyisch
14:17:52FromDiscord<voidwalker> btw is there a function to enclose a string in "(" and ")" ?: )
14:18:11FromDiscord<Rika> "(" & str & ")"
14:18:14FromDiscord<Rika> xd
14:18:30FromDiscord<Rika> or even use chars '(' & ... & ')'
14:19:03FromDiscord<enthus1ast> imho https://nim-lang.org/docs/strutils.html#escape%2Cstring%2Cstring%2Cstring
14:19:12FromDiscord<enthus1ast> ah
14:19:12FromDiscord<enthus1ast> no
14:19:15FromDiscord<enthus1ast> it does more
14:22:39FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=44li
14:22:45FromDiscord<voidwalker> (edit) "https://play.nim-lang.org/#ix=44li" => "https://play.nim-lang.org/#ix=44lj"
14:22:55FromDiscord<voidwalker> (edit) "https://play.nim-lang.org/#ix=44lj" => "https://play.nim-lang.org/#ix=44lk"
14:23:07FromDiscord<voidwalker> this no go
14:23:33FromDiscord<voidwalker> Error: type mismatch: got <SqlQuery, string>↵but expected one of:↵proc `&`[T](x: T; y: seq[T]): seq[T]
14:23:57FromDiscord<enthus1ast> you must create the query as a string, then convert it to sql string
14:24:10FromDiscord<enthus1ast> sql(query)
14:24:17FromDiscord<Rika> yeah
14:24:22FromDiscord<Rika> `sql("INSERT OR REPLACE INTO ? (" & paramWhat & ") VALUES ( "& paramWhat & ")")`
14:24:36FromDiscord<enthus1ast> but this is unsafe, sqlinjection is possible here
14:24:47FromDiscord<voidwalker> we have been over this a few days ago I think
14:24:57FromDiscord<voidwalker> dejavu
14:25:04FromDiscord<enthus1ast> could be
14:26:55FromDiscord<voidwalker> create the query as a string, you mean I have to assign it to a var first, and then pass that ?
14:27:01FromDiscord<voidwalker> and why do I have to do that in this case?
14:27:12FromDiscord<voidwalker> because of using paramWhat string inside ?
14:27:18FromDiscord<enthus1ast> because sql is a distinct string
14:27:30FromDiscord<enthus1ast> and & is not overloaded / borrowed
14:27:30*arkurious joined #nim
14:27:47FromDiscord<voidwalker> not sure what that means
14:28:07FromDiscord<voidwalker> Ahh you mean I get a string, and not a distinct string, by using & ?
14:28:34FromDiscord<enthus1ast> https://nim-lang.org/docs/db_common.html#SqlQuery
14:28:36FromDiscord<enthus1ast> yes
14:30:25FromDiscord<phillvancejr (phillvancejr)> Can I overload the assignment operator for a distinct integral type?
14:31:28FromDiscord<Rika> as in `=`? i dont think so no
14:32:11FromDiscord<phillvancejr (phillvancejr)> Ah ok, thank you
14:32:48FromDiscord<jan0809> bless you sir
14:34:19FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=44lm
14:35:04FromDiscord<Rika> its not that vulnerable to injection that code, since its not directly using user input, but you'll prolly be fucked if some lad puts a tsv with 123489719284789124897 columns
14:35:38FromDiscord<voidwalker> well, it's for use on a specific tsv set, from imdb
14:35:51FromDiscord<voidwalker> I want to replace 7 import procedures for each tsv with one : D
14:36:13FromDiscord<voidwalker> So basically this was that, I've done it
14:36:30FromDiscord<voidwalker> as long as I'm happy with all data types being varchar in the db. Which I am not
14:55:52FromDiscord<Phil> In reply to @voidwalker "finally it works !": Whenever I have to insert variables into strings I immediately go for strformat
14:56:52FromDiscord<Phil> In my personal preference strings formatted with strformat are easier to read compared to using the concat operator
14:58:27FromDiscord<voidwalker> I see, I shall investigate it one day
14:59:56FromDiscord<Phil> It's basically`fmt"my var X has value: {X}"`
15:01:10FromDiscord<voidwalker> meanwhile, what would be a good way to add a string to each element in a seq[string] ?
15:01:14FromDiscord<voidwalker> map ?
15:01:30FromDiscord<Rika> map sure yeah
15:03:02FromDiscord<enthus1ast> but @Phil recommendation with strformat is good
15:03:03FromDiscord<enthus1ast> it borrows the implementation from eg `&` from the non distinct type (which is string in `SqlQuery` case)
15:03:05FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=44lK
15:04:24FromDiscord<voidwalker> I see, why wasn't this done in the lib itself ?
15:05:47FromDiscord<Rika> because its not needed
15:05:54FromDiscord<Rika> or was deemed not required for sql queries
15:09:24FromDiscord<Knedlik> Hey guys, quickly jumping here to ask, is there a guide somewhere to generating debug symbols?
15:09:25FromDiscord<ripluke> How can I make a website with nim that's interactive
15:09:35FromDiscord<ripluke> Without using js lol
15:10:06FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=44lN
15:10:37FromDiscord<Rika> In reply to @ripluke "Without using js lol": then you're limited to generating html with links
15:10:44FromDiscord<voidwalker> is there some shorter way to map appending a string ?
15:11:06FromDiscord<Rika> `import sequtils; str.mapIt(it & "something")`?
15:11:45FromDiscord<ripluke> In reply to @Rika "then you're limited to": Hmm
15:12:30FromDiscord<enthus1ast> which is the BEST html↵(@.luke)
15:12:30*tomboh quit (Ping timeout: 260 seconds)
15:12:52FromDiscord<enthus1ast> fast, bloat free, battery friendly, you name it
15:12:54FromDiscord<Rika> im building a website without js too
15:13:01FromDiscord<Rika> prefetch would be nice tho
15:13:17FromDiscord<ripluke> In reply to @enthus1ast "fast, bloat free, battery": And if I want interactivity do I use script tags
15:13:25FromDiscord<Rika> i thought you said no js
15:13:28FromDiscord<Rika> that is js
15:14:09FromDiscord<ripluke> In reply to @Rika "that is js": Well yea but I dont think that you can replace js with nim (rn atleast)
15:14:18FromDiscord<Rika> ??????????????????????????????????????????????
15:14:22FromDiscord<ripluke> Maybe using something like wasm
15:14:44FromDiscord<enthus1ast> nim js yourfile.nim
15:14:53FromDiscord<Rika> nim compiles to js bro
15:15:13FromDiscord<ripluke> In reply to @Rika "nim compiles to js": I forgot about that 💀
15:16:06FromDiscord<enthus1ast> when i build websites in nim i usually do server side rendering (with nimja) + javascript
15:16:44FromDiscord<enthus1ast> it's easier / faster to just use a 3rd party module (my js is mostly crap anyway)
15:17:19FromDiscord<ripluke> https://github.com/andreaferretti/react.nim↵This seems cool
15:17:30FromDiscord<ripluke> And I already have some experience with react
15:17:34FromDiscord<ripluke> Might use this
15:17:42FromDiscord<enthus1ast> also have a look at karax
15:18:30FromDiscord<soundmodel> In reply to @Rika "because there isnt any": Ehh, you think this works out?
15:18:39FromDiscord<Rika> no
15:18:40FromDiscord<Rika> of course not
15:18:42FromDiscord<soundmodel> I've seen such projects and while it's doable, it's hard for forming an overview
15:18:43FromDiscord<Rika> but its the reality
15:19:06FromDiscord<soundmodel> okay so assuming that GCC was this way, you mean one reads 15 million LOCs?
15:19:10FromDiscord<soundmodel> (edit) "LOCs?" => "LOC?"
15:19:10FromDiscord<Rika> i may be uninformed though, i didnt search too much into it
15:19:25FromDiscord<Rika> but ive not heard of any resources for going into nim compiler dev
15:19:31FromDiscord<Rika> again
15:19:33FromDiscord<Rika> i told you
15:19:39FromDiscord<Rika> i dont think it works out
15:19:59FromDiscord<soundmodel> well but I started by asking are there resources to know how to contribute to Nim?
15:20:54FromDiscord<Rika> and library development contributes to nim, in the sense of its ecosystem
15:21:00FromDiscord<Rika> yet you said it didnt
15:21:21FromDiscord<Rika> one of nims weak points is its very very small ecosystem
15:21:35FromDiscord<Rika> its one of the more major weak points i would even say
15:21:39FromDiscord<soundmodel> yes but then I asked whether it's enough to be a lib dev
15:21:41FromDiscord<soundmodel> and not compiler dev
15:21:51FromDiscord<Rika> i think it is enough
15:22:16FromDiscord<Rika> deeming whether a library is useful enough for proliferation is up to you though
15:22:30FromDiscord<Rika> of course you're sensible enough to know that an iseven package makes no sense right?
15:22:35FromDiscord<xflywind> stdlib is easier to contribute to.
15:23:30FromDiscord<soundmodel> it's a bit boring though to close the compiler info
15:23:41FromDiscord<soundmodel> I think a proper community project would need to reveal that as well
15:24:45FromDiscord<soundmodel> then I found this: https://nim-lang.org/docs/intern.html
15:27:46FromDiscord<Rika> me having forgot that page existed:
15:27:48FromDiscord<Rika> my bad
15:32:13FromDiscord<soundmodel> that has pretty good info actually
15:32:38FromDiscord<soundmodel> but it's surprisingly short
15:33:13FromDiscord<soundmodel> consider it's a full compiler
15:33:20FromDiscord<soundmodel> (edit) "consider" => "considering"
15:34:05FromDiscord<soundmodel> but compare to e.g. the FreeBSD contributing doc: https://docs.freebsd.org/en/articles/contributing/
15:42:57*CyberTailor quit (Quit: Konversation terminated!)
15:45:50FromDiscord<soundmodel> it'd be also nice to understand how many LOCs the compiler is
15:48:42FromDiscord<soundmodel> since it says there: "It is essential to understand most of the compiler's code."
15:48:51FromDiscord<soundmodel> so then this might be an investment for someone
15:49:14FromDiscord<soundmodel> (edit) "someone" => "someone, just like deciding to read a 80 page book vs a 550 page book"
15:50:57FromDiscord<Phil> In reply to @enthus1ast "it's easier / faster": With how damn fast nim is an SSR page might honestly be faster than rest + front-end js framework
15:51:56*rwb quit (Ping timeout: 272 seconds)
15:54:08*rwb joined #nim
15:58:07FromDiscord<mattrb> In reply to @Elegantbeef "Might be able to": Do you think it's a compiler bug?
16:03:24FromDiscord<soundmodel> I have to say though that this https://github.com/nim-lang/Nim/tree/devel/compiler looks a bit taxing to start with
16:04:08FromDiscord<soundmodel> I see no comments on the procs for example
16:09:23FromDiscord<voidwalker> if I want to have a table with a key (string) and 3 values string,proc, and something else, the only way is a tuple, right ?
16:09:32FromDiscord<soundmodel> and compare to e.g. https://gcc.gnu.org/onlinedocs/gccint/
16:09:34FromDiscord<voidwalker> (edit) "if I want to have a table with a key (string) and 3 values string,proc, and something else, the only way ... is" added "to store the value"
16:09:43FromDiscord<soundmodel> the Nim compiler's documenting seem very poor compared to this
16:09:47FromDiscord<soundmodel> (edit) "seem" => "seems"
16:11:01FromDiscord<soundmodel> (edit) "and compare to e.g. https://gcc.gnu.org/onlinedocs/gccint/ ... " added "or https://rustc-dev-guide.rust-lang.org/"
16:11:04FromDiscord<soundmodel> (edit) "this" => "these"
16:14:41FromDiscord<soundmodel> (tbh it wants me to use Rust instead)
16:14:52FromDiscord<soundmodel> (edit) "wants" => "makes" | "makesme ... to" added "want"
16:15:04FromDiscord<voidwalker> var updProcs: OrderedTable[string, proc(key:string)] on this kind of table, is it possible to have proc without defining its args, if I want different kinds of procs to be pointed at ?
16:15:13FromDiscord<voidwalker> (edit) "var" => "`var" | "proc(key:string)]" => "proc(key:string)]`"
16:15:23FromDiscord<soundmodel> (edit) "instead)" => "instead!)"
16:18:45FromDiscord<soundmodel> https://nim-lang.org/assets/news/images/survey/nim_displeasing.png
16:23:03*noeontheend joined #nim
16:27:24FromDiscord<kraptor> I have to say that, to me, documentation is quite good (compared to most documentation I find for anything else). Of course, I'm not expecting something like Qt docs (that are top of the top) and we can improve in that area but, anyway
16:28:07FromDiscord<kraptor> It's more concerning the debugging tools status: current nim-gdb wrapper is lacking and it fails most of the time for non-trivial types... 😦
16:35:53FromDiscord<soundmodel> then can you say what to read to understand the compiler?
16:36:20FromDiscord<kraptor> I was talking about the png you shared
16:36:25FromDiscord<soundmodel> IMO, the docs I've seen make Nim seem unprofessional, which could be the reason Microsoft or something consider Rust etc.
16:36:27*xet7 quit (Ping timeout: 272 seconds)
16:36:40FromDiscord<soundmodel> (edit) "IMO, the docs I've seen make Nim seem unprofessional, which could be the reason Microsoft or something consider Rust etc. ... " added "(because they cannot risk playing with some random communities)"
16:36:59FromDiscord<soundmodel> (edit) "communities)" => "community support)"
16:41:58FromDiscord<Yardanico> maybe, but most people don't read compiler docs so that won't affect them
16:42:19FromDiscord<soundmodel> but it also makes the language seem a bit untrustworthy, IMO
16:42:29FromDiscord<soundmodel> since if it's compiler is non-documented code
16:42:39FromDiscord<soundmodel> (edit) "it's" => "its"
16:43:15FromDiscord<soundmodel> it's the same as with badly documented libraries, do you want to risk using them and then hit something that you cannot fix?
16:43:26FromDiscord<soundmodel> (edit) "fix?" => "fix, since you cannot read the code?"
16:46:40*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
16:48:58*Lord_Nightmare joined #nim
16:53:31FromDiscord<soundmodel> and I still want to understand how it's built
16:53:34FromDiscord<soundmodel> if I'm going to use it
17:03:37FromDiscord<phillvancejr (phillvancejr)> is there a short cut to iterating through a range? something similar to Ada like `for i in Nums.range` vs `for i in Nums.low .. Nums.high`
17:03:52FromDiscord<phillvancejr (phillvancejr)> The latter is still short but I just want to know if there is an alternate
17:11:41FromDiscord<Phil> In reply to @phillvancejr (phillvancejr) "is there a short": `for i in 1..10:` ?
17:11:53FromDiscord<Phil> no space between the numbers, the range is inclusive
17:13:37FromDiscord<Rika> No there is nothing like you propose yet
17:13:47FromDiscord<Rika> It sure sounds nice though
17:14:13FromDiscord<Phil> I know I'm wonky because I just came off a flight and I've cruel lack of sleep atm
17:14:31FromDiscord<Phil> But I'm getting the distinct feeling he's asking for something special, what's the special thing
17:14:41FromDiscord<Phil> Is the bounds of the range not explicit?
17:15:11FromDiscord<Rika> He’s asking for a proc that returns low and high range without saying low and high range
17:15:34FromDiscord<Rika> Type.range instead of Type.low .. Type.high
17:15:47FromDiscord<Phil> Ohhhhhhhhh
17:16:03FromDiscord<Phil> Shouldn't it be somewhat easy to macrofy that?
17:16:28FromDiscord<Rika> Proc. No need for a macro here since of HSlice type no?
17:16:47FromDiscord<Phil> Maybe I should just go to sleep
17:17:13FromDiscord<Rika> Hahaha it’s okay
17:17:24FromDiscord<Rika> I’ll be going to sleep though
17:31:12FromDiscord<voidwalker> https://stackoverflow.com/questions/68217774/how-can-i-create-a-lookup-table-of-different-procedures-in-nim
17:31:30FromDiscord<voidwalker> `"↵This dynamic way of handling things is not supported in nim. Type of procs has to be known at compile time, that's just a fact."`
17:31:48FromDiscord<voidwalker> (edit) "`"↵This" => "`"This"
17:32:38FromDiscord<Rika> ?
17:32:52FromDiscord<voidwalker> I asked a question about this earlier, and found an answer
17:33:10FromDiscord<Rika> Oh okay
17:33:31FromDiscord<voidwalker> And wanted some comments maybe
17:35:14FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=44mg
17:35:25FromDiscord<voidwalker> this looks like a shitty way to call procs :\
17:39:30FromDiscord<Phil> You want to store procs in a table?
17:39:42FromDiscord<Phil> Can you make them all have the same signature?
17:40:17FromDiscord<Phil> If so you can store pointers to them, I've done that storing procs for a Django like signal system
17:41:04FromDiscord<Phil> The same signature is necessary because you'll be type casting the proc pointer in order to be able to invoke the thing
17:41:17FromDiscord<voidwalker> yes, I want to store procs in a table. So for each column name in a db, I have a different way of parsing it
17:41:18FromDiscord<Require Support> so noticed that if i have an object with a field as type `JsonNode` and i try to convert the whole object to `JsonNode` using `%` .. i get `SIGSEGV: Illegal storage access. (Attempt to read from nil?)`
17:42:01FromDiscord<voidwalker> I gues.. I could have them, hmmm, each take just the string of the value as it's supposed to get parsed, and maybe sqlite handles the type conversion for me ?
17:43:11FromDiscord<voidwalker> I haven't considered that before, I just did parseInt, parseUint, customParseProc
17:44:49FromDiscord<soundmodel> anyone know about nim-forum password recovery? Don't seem to get a reset email.
17:51:33FromDiscord<Phil> sent a long message, see http://ix.io/44mk
17:52:53FromDiscord<Phil> A connect call then looks like this for example:↵` connect(SignalType.stPostCreate, Character, characterCreateSignal)`
17:53:17FromDiscord<Phil> characterCreateSignal is a proc with this signature in this example:↵`proc characterCreateSignal(connection: DbConn, modelInstance: Character) =`
17:55:16FromDiscord<Phil> You can, strictly speaking, store procs with wildly different signatures in such a table of pointers.↵However, if you do that, all places that take a pointer from that Hashtable must also know the proc signature to cast the pointer to
17:59:40FromDiscord<voidwalker> Ok so how would I sugar syntax it so I don't have to write `cast[proc(a: int, b: int): int {.cdecl.}]` every time ?
18:03:58FromDiscord<Phil> You can make `proc(a: int, b: int): int` a named type (maybe even with the cdecl pragma? no idea), so:↵`type MySuperProc = proc(a: int, b: int): int`↵And then you can use that instead
18:04:20FromDiscord<Phil> That even helps with readability a bit
18:04:30FromDiscord<voidwalker> hmm that makes sense
18:04:44FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=44mo
18:05:18FromDiscord<voidwalker> I am a long way from having an inner map of how everything can connect to everything else, in nim, and programming in general beyond the simple procedural script programs
18:05:21*toluene quit (Quit: Ping timeout (120 seconds))
18:06:18FromDiscord<voidwalker> Ok, for now I will see if I can make it work with a single type of proc
18:07:19FromDiscord<Phil> You can, if the word "cast" or the edgy brackets bother you, of course also make a template. But that template will still need to eat the same 2 parameters, namely 1) the specific proc type and 2) the pointer that you're casting
18:07:22*toluene joined #nim
18:07:59FromDiscord<Phil> (edit) "casting" => "casting. Which means all that achieves is that you get rid of the edgy brackets and can name the entire operation something other than `cast`"
18:11:55FromDiscord<voidwalker> Hm sqlite ate my string input even if the column was declared int, without erroring
18:12:15FromDiscord<voidwalker> (edit) "Hm sqlite ate my string input ... even" added "(that's not a clean int)"
18:12:29FromDiscord<enthus1ast> sqlite does not check the types
18:12:37FromDiscord<enthus1ast> i think you can enables this though
18:13:37FromDiscord<enthus1ast> https://stackoverflow.com/questions/49230311/is-it-possible-to-enforce-sqlite-datatypes
18:13:50FromDiscord<enthus1ast> but yeah, sqlite is a little strange
18:14:11*noeontheend quit (Ping timeout: 255 seconds)
18:18:13FromDiscord<voidwalker> Hm but it should store INT as 1-8 bytes ? that means it silently falls back to VARCHAR if type not compatible?
18:18:33FromDiscord<voidwalker> `sqlite's datatype isn't associated to its column but to the data themselves: this practically means that you can insert any data to any column.` oh I see
18:46:19FromDiscord<voidwalker> uhm, can I have functions instead of procs, in a table ?
18:46:38FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=44my
18:46:59FromDiscord<voidwalker> (edit) "https://play.nim-lang.org/#ix=44my" => "https://play.nim-lang.org/#ix=44mz"
18:47:20FromDiscord<voidwalker> `Error: expression 'ttIdtoId(key)' is of type 'string' and has to be used (or discarded)`
18:50:39FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=44mA
18:51:56FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=44mB
18:54:38FromDiscord<voidwalker> `Error: func keyword is not allowed in type descriptions, use proc with {.noSideEffect.} pragma instead`
18:56:45FromDiscord<demotomohiro> Then it would need to be `type parseProc = proc (key:string): string {.noSideEffect.}`.
18:59:21FromDiscord<soundmodel> In reply to @soundmodel "**URGENT**: anyone know about": Anyone know who to contact?
19:02:04FromDiscord<demotomohiro> I think @dom96 ?
19:12:13FromDiscord<deech> This may have come up before but I'd like some way have all of an imported module's procs compiled to C/C++ not just the ones that are used. The `{.used.}` pragma doesn't do this, the only way I've found is to add `{.exportc.}` to everything but that's not great either, am I missing something?
19:14:42FromDiscord<soundmodel> I hope the compiler docs are improved, because I'm now going back to Python because of it
19:16:39FromDiscord<demotomohiro> In reply to @soundmodel "I hope the compiler": What is the problems in compiler docs?
19:17:22FromDiscord<soundmodel> that this https://nim-lang.org/docs/intern.html is absolutely rudimentary compared to https://rustc-dev-guide.rust-lang.org/
19:17:34FromDiscord<soundmodel> and then when I see the code in Github, it isn't commented
19:17:39FromDiscord<phillvancejr (phillvancejr)> nim doesn't have modulo ranges like Ada does it?
19:18:01FromDiscord<soundmodel> (edit) "Github," => "Github (https://github.com/nim-lang/Nim/tree/devel/compiler),"
19:18:08FromDiscord<soundmodel> (edit) "commented" => "commented. This makes Nim seem very unprofessional."
19:18:19FromDiscord<soundmodel> (edit) "unprofessional." => "unprofessional and therefore I think going to some language that has better docs."
19:28:37*noeontheend joined #nim
19:46:22FromDiscord<jan0809> In reply to @laker31 "Thanks, I'd love to": what should i check for ya? im athome now
19:46:53FromDiscord<jan0809> if the imports itself do autocomplete?
19:55:58*pro joined #nim
20:08:41*rockcavera joined #nim
20:08:41*rockcavera quit (Changing host)
20:08:41*rockcavera joined #nim
20:08:59FromDiscord<sanchopanca> how does one add an item to a HashSet? i don't see anything about it in the docs and my google search results are fruitless too (sorry for potentially silly question, this is my first day using the language)
20:09:20FromDiscord<Prestige> `incl` I believe
20:09:32FromDiscord<Generic> see https://nim-lang.org/docs/sets.html
20:09:44FromDiscord<Generic> it has the same API as the builtin bitsets
20:09:45FromDiscord<sanchopanca> yeah that's the page i'm looking at
20:10:37FromDiscord<sanchopanca> ok, incl wasn't an intuitive name 😅 thanks
20:25:19FromDiscord<planetis> In reply to @phillvancejr (phillvancejr) "nim doesn't have modulo": what dou you mean?
20:27:06FromDiscord<voidwalker> if I do mapIt() on seq[string], can I get the order number of "it" in the sequence to use ?
20:29:15FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=44nd
20:29:23FromDiscord<voidwalker> (edit) "https://play.nim-lang.org/#ix=44nd" => "https://play.nim-lang.org/#ix=44ne"
20:29:37FromDiscord<voidwalker> (edit) "https://play.nim-lang.org/#ix=44ne" => "https://play.nim-lang.org/#ix=44nf"
20:30:00FromDiscord<voidwalker> I want to do something like this, where it.ord is the position in the sequence of the element it
20:34:13FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=44nk
20:37:10FromDiscord<voidwalker> and this does what ? the wording in the doc is too ambiguous for me to understand
20:37:33*krux02 joined #nim
20:38:49FromDiscord<planetis> it adds the last statement in the list
20:39:19FromDiscord<voidwalker> oh I see, and then I use the list itself as data.
20:41:08FromDiscord<voidwalker> welp, I'd have hoped I can somehow use mapit to keept it a oneliner
20:41:12FromDiscord<TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=44nn
20:42:15FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=44no
20:43:19FromDiscord<voidwalker> but enumerate can only be used in for loops ?
20:45:44FromDiscord<TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=44nq
20:49:36FromDiscord<voidwalker> nah, it does not return a sequence to use in map
20:50:37Amun-RamapIt, etc. std/sequtils
20:51:15FromDiscord<hotdog> Or call `toSeq` on it
20:52:13void09mapIt, etc. std/sequtils ?
20:52:34Amun-Rafor example: mapIt, from std/sequtils
20:52:54void09what about mapIt ? my original question was related to mapIt
20:53:19Amun-RaI was responding to TryAngle paste
20:53:38*pro quit (Quit: pro)
21:05:08FromDiscord<voidwalker> @!Patitotective thank you, that worked. Although it still bugs me that I now have 3 extra potentiall avoidable lines in the code 🙂
21:07:44FromDiscord<voidwalker> This is something that @ElegantBeef might know something about
21:09:00FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=44nv
21:09:06FromDiscord<!Patitotective> count might not be the best name though
21:12:29FromDiscord<voidwalker> so this would make a sequence of tuples where the first element is the position, and the second the value
21:12:51FromDiscord<!Patitotective> yes
21:13:24FromDiscord<voidwalker> so like enumerate, but as a persistent sequence, not an iterator
21:13:53FromDiscord<voidwalker> Uhm this looks like something so basic.. it must be somehow possible with the standard libraries
21:15:12FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=44ny
21:15:24FromDiscord<huantian> Isn’t that just someSeq.pairs.toSeq?
21:15:48FromDiscord<voidwalker> hah it is
21:23:35FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=44nz
21:23:44FromDiscord<voidwalker> (edit) "sent a code paste, see https://play.nim-lang.org/#ix=44nz" => "`nim↵ dbsql.exec(sql(sqlQ), tbName & tsv.headers & tsv.row.pairs.toSeq.mapIt(importDict[tsv.headers[it[0]]].parseSq(it[1])))`"
21:23:56FromDiscord<voidwalker> (edit) "`nim↵ dbsql.exec(sql(sqlQ), tbName & tsv.headers & tsv.row.pairs.toSeq.mapIt(importDict[tsv.headers[it[0]]].parseSq(it[1])))`" => "sent a code paste, see https://play.nim-lang.org/#ix="
21:24:06FromDiscord<voidwalker> (edit) "https://play.nim-lang.org/#ix=" => "https://play.nim-lang.org/#ix=44nA"
21:24:52FromDiscord<!Patitotective> you can also use `it.key` and `it.val` to make it clearer imo
21:25:33FromDiscord<TryAngle> In reply to @huantian "Isn’t that just someSeq.pairs.toSeq?": I always forget pairs exist lol
21:33:27FromDiscord<voidwalker> When defining a table, can you put multiple keys at once assigned to the same value ?
21:33:41FromDiscord<voidwalker> So I don't have to use a new line for each of them
21:34:06FromDiscord<Elegantbeef> You could make a new `[]` operator if you wished
21:34:11FromDiscord<Elegantbeef> or use a for loop
21:34:31FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44nC
21:40:42FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=44nD
21:42:20FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44nE
21:43:23FromDiscord<!Patitotective> it worked without that but i guess its nicer
21:43:24FromDiscord<Elegantbeef> Actually nevermind i was dumb
21:44:02FromDiscord<Elegantbeef> Nah i thought there was an issue with recursive calls when K == V
21:44:04*noeontheend quit (Ping timeout: 272 seconds)
21:45:04FromDiscord<!Patitotective> nim smart 🧠
21:46:15FromDiscord<voidwalker> That's beautiful. I will use it, even though it's not my code and I couldn't write it now with my skills
21:46:45FromDiscord<Elegantbeef> It's not that complicated, but yea you'll learn
21:48:09FromDiscord<voidwalker> I will, and reach nimvana
21:49:49FromDiscord<voidwalker> I bought the 70 EUR mastering nim book btw, I hope it keeps Araq fed until nim 2.0 at least : )
21:50:29FromDiscord<voidwalker> It's a bummer I will have to spend a few hours scanning and OCR-ing it though :\
22:24:10*noeontheend joined #nim
22:53:00FromDiscord<ripluke> How can I take a list of colors and compare them to a color to see which is closest
22:59:37FromDiscord<Elegantbeef> How do you have the colour stored
22:59:42FromDiscord<Elegantbeef> Also comparing colours is a tricky thing
22:59:47FromDiscord<Elegantbeef> Cause human perception exists
23:00:52FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=44o7
23:01:41FromDiscord<ripluke> Yes that's exactly what I need :) thx!
23:06:30*jmdaemon joined #nim
23:19:12NimEventerNew thread by Deech: Force compilation of unused parts of a module, see https://forum.nim-lang.org/t/9305
23:30:02NimEventerNew Nimble package! RaytracingAlgorithm - RayTracing Algorith in Nim, see https://github.com/lorycontixd/RaytracingAlgorithm
23:43:59*noeontheend quit (Ping timeout: 244 seconds)
23:44:02*CyberTailor joined #nim