<< 19-12-2019 >>

00:13:41FromDiscord<snluu> Hi! Searching through the standard library, but I probably missed it. What modules/procs can I use to do things like listing files in a directory, getting file metadata (time created, size) etc.
00:13:52disrupteksee the os module.
00:14:38FromDiscord<snluu> thanks!
00:15:19*Hideki_ joined #nim
00:23:33*Hideki_ quit (Remote host closed the connection)
00:24:25*Hideki_ joined #nim
00:25:42clyybbergn8 peeps
00:25:44*clyybber quit (Quit: WeeChat 2.7)
00:28:49*Hideki_ quit (Ping timeout: 258 seconds)
00:41:06*krux02_ joined #nim
00:43:48*krux02 quit (Ping timeout: 248 seconds)
00:48:22sealmovestandard way to convert seq[byte] to string?
01:01:10*Hideki_ joined #nim
01:13:15*Hideki_ quit (Ping timeout: 240 seconds)
01:13:27*krux02_ quit (Remote host closed the connection)
01:15:16*seni quit (Quit: Leaving)
01:22:28*voltist joined #nim
01:43:24*icebattle quit (Ping timeout: 246 seconds)
01:45:45*icebattle joined #nim
02:09:46FromDiscord<Kaynato> @mratsim I'm porting an argmax_max with random tiebreaks which includes parallel argmax from my python RL framework, and I found the note you made about the degradation on MNIST. The following is what I was about to port (https://hastebin.com/kejuvigeho.py) - would using the regular old threadpool parallel/spawn work sensibly or would there be other things to worry about?
02:46:53*voltist quit (Remote host closed the connection)
02:54:44*sagax quit (Read error: Connection reset by peer)
02:59:17FromGitter<gogolxdong> What's the usage of `untyped{ident}`?
02:59:45FromGitter<gogolxdong> what's the `ident ` and the `{}`?
03:00:18FromGitter<gogolxdong> why could it follow untyped?
03:02:14*sagax joined #nim
03:10:28sealmovegogolxdong where did you see it?
03:11:17FromGitter<gogolxdong> https://github.com/mratsim/weave/blob/master/weave/parallel_for.nim
03:12:07FromGitter<gogolxdong> Is this hidden magic?
03:16:04FromGitter<dumjyl> It restricts the input to nodes of kind `nkIdent`. https://play.nim-lang.org/#ix=24PY
03:17:20FromGitter<dumjyl> See https://nim-lang.org/docs/manual_experimental.html#ast-based-overloading and https://nim-lang.org/docs/manual_experimental.html#term-rewriting-macros-parameter-constraints
03:19:42FromGitter<gogolxdong> ah, it's documented in experimental manual.
03:23:14*icebattle quit (Ping timeout: 240 seconds)
03:44:40*pbb quit (Ping timeout: 252 seconds)
03:50:15*endragor joined #nim
03:59:34*endragor quit (Remote host closed the connection)
04:02:06*sealmove quit (Quit: WeeChat 2.6)
04:02:40*endragor joined #nim
04:03:39*endragor quit (Remote host closed the connection)
04:20:41*pbb joined #nim
04:24:27*nsf joined #nim
04:24:28*chemist69 quit (Ping timeout: 245 seconds)
04:26:43*chemist69 joined #nim
04:28:36*pbb quit (Ping timeout: 246 seconds)
04:29:03*pbb joined #nim
04:39:59FromDiscord<snluu> when would one use `= ref RootObj` vs just (ref) `object` when declaring a new object type?
04:40:14FromDiscord<snluu> is RootObj required for inheritance?
04:47:05nisstyreI think it is required to do it at runtime
04:47:13nisstyrehttps://nim-lang.org/docs/tut2.html
04:50:28*endragor joined #nim
04:59:42FromDiscord<snluu> Thanks!
05:01:08FromDiscord<snluu> so, if I have something like `type Dog = object of Animal`, is there a short hand to create a new `ref Dog` object without having an explicit `type DogRef = ref Dog`?
05:04:28disruptekis `ref Dog` too long?
05:08:57FromDiscord<snluu> no, i mean, can I create a ref object without declaring a ref type?
05:09:14disrupteksure.
05:10:01FromDiscord<snluu> `var x: ref Animal`. How do I assign a `ref Dog` to `x`
05:10:02FromDiscord<snluu> ?
05:10:19FromDiscord<snluu> `x = ref Dog()` does not work
05:10:27disruptekyou don't; x is a ref Animal.
05:10:45*Hideki_ joined #nim
05:10:47FromDiscord<snluu> if I have a `type DogRef = ref Dog`, `x = DogRef()` work just fine
05:10:55disrupteksure.
05:11:58FromDiscord<snluu> so thatโ€™s what Iโ€™m asking, is there a shorthand to `DogRef()` to create a new instance of `ref Dog` without explicitly declaring `DogRef` type
05:15:10*Hideki_ quit (Ping timeout: 258 seconds)
05:15:21FromDiscord<snluu> https://play.nim-lang.org/#ix=24Qd
05:15:21FromDiscord<snluu> Can I do this without having `type DogRef`
05:28:12FromDiscord<snluu> I guess I can do `x = (ref Dog)()`
05:41:05*Tanger quit (Remote host closed the connection)
05:43:56*narimiran joined #nim
05:52:45*gour joined #nim
05:56:40*lvmbdv quit (Quit: OH GOD THE CLINTONS CAME FOR ME)
06:03:51*lorenthal joined #nim
06:03:58lorenthalHello everyone
06:04:56*lorenthal left #nim (#nim)
06:16:01*Tanger joined #nim
06:30:46*lorenthal joined #nim
06:30:59*lorenthal left #nim (#nim)
06:41:09*solitudesf joined #nim
06:43:43*ikan-keli_2 joined #nim
06:44:43*ikan-keli_ quit (Ping timeout: 268 seconds)
07:02:07FromDiscord<Kayaba> I saw I got a ping from Discord. Joined here to comment.
07:02:07FromDiscord<Kayaba>
07:02:07FromDiscord<Kayaba> It's interesting to see KMD get involved. Mind if I ask what specifically you're working on, @Slyris?
07:22:38FromDiscord<Milerius> Hello @Kayaba I'm working on the Desktop port of https://atomicdex.io, repo is here: https://github.com/KomodoPlatform/atomicDEX-QT (nim is in https://github.com/KomodoPlatform/atomicDEX-QT/tree/master/atomic_dex_desktop)
07:23:08FromDiscord<Milerius> atomicdex is a fully decentralized exchange, you can learn more here: https://komodoplatform.com/atomicdex-komodos-revolutionary-p2p-atomic-swap-decentralized-exchange-now-in-public-beta/
07:23:34FromDiscord<Milerius> And here: https://komodoplatform.com/decentralized-exchange/
07:24:44FromDiscord<Kayaba> Yep, I know what it is ๐Ÿ˜› I've kept an eye onm Komodo's work for a while now despite not being the largest fan.
07:26:45FromDiscord<Milerius> No solution is perfect @Kayaba ๐Ÿคท
07:28:33FromDiscord<Kayaba> My main issue is with DPoW and cultism. Prime example of the latter is the modified SPV protocol which has some benefits yet was claimed to revolutionize making BTC accessible ๐Ÿ˜›
07:29:17FromDiscord<Kayaba> Anyways. Happy to talk more in PM as I do appreciate AtomicDEX and this may not be the best place to have a long discussion ๐Ÿ˜‰
07:29:27FromDiscord<Milerius> Yeah doesn't hesitate !
07:29:31FromDiscord<Milerius> i would love !
07:41:54*PMunch joined #nim
07:44:40*ikan-keli_2 quit (Quit: ZNC 1.8.x-git-125-e415d9f5 - https://znc.in)
07:44:46*junland quit (Quit: %ZNC Disconnected%)
07:46:02*junland joined #nim
07:46:26*ikan-keli_ joined #nim
08:00:00*gmpreussner quit (Quit: kthxbye)
08:04:58*gmpreussner joined #nim
08:07:54*dddddd quit (Remote host closed the connection)
08:23:12Araqanybody awake? want to listen to me streaming about the new runtime?
08:27:15PMunchWith pleasure :)
08:27:34federico3yup
08:28:22Araqhttps://www.twitch.tv/araq4k
08:31:39*krux02 joined #nim
08:37:50*Vladar joined #nim
08:43:50FromDiscord<Fern & Simula (They/Them)> I've got an `Ident` node. is there any way to check the identifier's type?
08:44:39PMunch.kind?
08:45:10FromDiscord<Fern & Simula (They/Them)> that's just nnkIdent
08:45:30PMunchOh you want to check the type of what the ident points to
08:45:50FromDiscord<Fern & Simula (They/Them)> yeah
08:46:22FromDiscord<Fern & Simula (They/Them)> alternatively, a way to check if a type is valid for fieldpairs would also work
08:46:39FromDiscord<Fern & Simula (They/Them)> that's probably what i actually want lol
08:48:30PMunchhttps://play.nim-lang.org/#ix=24QD
08:50:20FromDiscord<Fern & Simula (They/Them)> awesome, thank you!
08:50:42PMunchNo problem :)
08:50:52FromDiscord<Fern & Simula (They/Them)> nope, `node has no type`
08:51:06FromDiscord<Fern & Simula (They/Them)> wait
08:51:06PMunchAh, you need to have your macro argument as `typed`
08:51:19FromDiscord<Fern & Simula (They/Them)> ah, alright
08:52:09PMunchEssentially the difference is that untyped happens before type checking, which is handy if what you pass in isn't actually Nim code but rather some random DSL. And typed happens after type checking which means that it has to be valid Nim code, but you get all the information Nim has about the input.
08:53:01FromDiscord<Fern & Simula (They/Them)> nope, still not working. macro only accepts identifiers
08:53:16FromDiscord<Fern & Simula (They/Them)> oh thats my own error
08:53:42FromDiscord<Fern & Simula (They/Them)> lol im so confused by what im doing
09:04:11FromDiscord<Fern & Simula (They/Them)> is there a way to check if a type is a nim builtin, ie not user-defined?
09:04:20PMunchLike int or string?
09:04:48FromDiscord<Fern & Simula (They/Them)> yeah
09:04:59FromDiscord<Fern & Simula (They/Them)> but for all nim types so i don't have to manually compare
09:05:30PMunchI guess check if getTypeImpl is just a single identifier
09:05:53FromDiscord<Fern & Simula (They/Them)> i think i want NimTypeKind
09:06:06PMunchMaybe with some logic to discern distinct types if you need that
09:07:17FromDiscord<KcVinu> I have type named Button which inherits another type named Control. This Control type have a proc named "text" which gives the text of the control. But how do i limit this proc to only specific types like Button, Label, Edit etc. Because, i don't want to use this proc for ListView, Menubar etc.
09:07:55PMunchy.getType.typeKind should work
09:08:05PMunchBut note you will get ntyDistinct if it is a distinct type
09:08:05*clyybber joined #nim
09:08:48PMunchKcVinu, make another type
09:09:01PMunchControl -> Labeled -> Button
09:09:14PMunchAnd then have Control -> ListView
09:09:17FromDiscord<KcVinu> You mean make a clone of Control - ?
09:10:13FromDiscord<KcVinu> Is there any interface like things in nim ?
09:12:29*Hideki_ joined #nim
09:17:12*Hideki_ quit (Ping timeout: 265 seconds)
09:22:33*letto quit (Quit: Konversation terminated!)
09:23:55*letto joined #nim
09:29:14FromDiscord<Fern & Simula (They/Them)> can i pass multiple identifiers to a single typed macro body? like this example https://play.nim-lang.org/#ix=24QX
09:33:11FromGitter<gogolxdong> Is live streaming video recorded as well, we cannot access twitch without VPN from China.
09:35:04FromGitter<gogolxdong> Is it possible to send us a copy after live streaming?
09:36:25FromGitter<bung87> what โ€™s the syntax import c pointer of struct ?
09:41:24*akitoshi quit (Quit: Connection closed for inactivity)
10:00:36*marmotini_ joined #nim
10:01:11*marmotini_ quit (Remote host closed the connection)
10:01:12FromGitter<sheerluck> @gogolxdong yes you can access video after live streaming: https://www.twitch.tv/araq4k/videos
10:01:33*NimBot joined #nim
10:07:31FromGitter<gogolxdong> I mean twitch is banned.
10:07:49FromGitter<gogolxdong> Is there any video copy?
10:25:45*marmotini_ quit (Remote host closed the connection)
10:26:21*Vladar quit (Quit: Leaving)
10:29:05FromGitter<gogolxdong> @Araq, you can upload to youtube so that we can get an English caption.
10:31:00federico3Araq: doesn't the stream of Hints: bother you?
10:33:34*krux02 quit (Remote host closed the connection)
10:34:59FromGitter<bung87> found interesting thing https://github.com/iovisor/bcc
10:36:50Araqfederico3, for me it's a shitty "progress" report
10:37:05Araqgogolxdong: will upload to youtube later, probably shorten it
10:37:29Araqturned out to be way more frustrating than I anticipated
10:37:38federico3we could have a better one - how about dots printed on the current line and disabling Hints: by default?
10:38:04clyybberits handy to know what actually gets compiled
10:38:31Araqfederico3, some real progress bar would be better, maybe we can calculate it somehow
10:38:59federico3that could be a next step after the dots perhaps
10:40:18federico3it could come out neatly as part of implementing parallel compilation
10:40:20*clyybber quit (Remote host closed the connection)
10:41:08Araqparallel compilation is nice but all my bets are on incremental compilation
10:41:52Araqwhich is slightly easier to get right and brings more benefit
10:41:59federico3both should allow adding the progress bar I suppose
10:42:47federico3incremental unit tests would be nice and good PR
10:46:40Araqthe priorities are clear IMO, focus on --gc:arc for better runtime speed and embedded devices, then focus on IC for a better developer experience
10:51:05federico3is arc == newruntime?
10:53:35Araqyes
11:04:58federico3yay \o/
11:05:43*marmotini_ joined #nim
11:07:47FromGitter<Willyboar> New gc, new threading. Perfect
11:10:11Zevvnew threading how so?
11:10:36FromGitter<Willyboar> Weave
11:24:07FromGitter<alehander92> i think such a progress bar can be done
11:24:13FromGitter<alehander92> even now without problems
11:24:51FromGitter<alehander92> its especially useful for file watchers etc, where i turned off hints for now just to be able to easily see errors when i compile >10 outputs
11:47:15FromDiscord<kodkuce> did isAlphaAsci got removed form string?
11:49:19FromDiscord<kodkuce> https://nim-lang.org/docs/strutils.html#isAlphaAscii%2Cstring
11:53:34FromGitter<alehander92> its a good removal
11:53:40FromGitter<alehander92> but it needs a "use hint"
11:53:43FromGitter<alehander92> in the docs
11:54:10FromGitter<alehander92> usually people probably need stringValue.allIt(it.is..)
12:02:46*Vladar joined #nim
12:04:50PMunchKcVinu, no there aren't anything strictly like an interface in Nim. What I meant was to do it in two levels of inheritance, that's how you would usually do these things. However you can do all of this without any object inheritance at all.
12:05:29PMunchFern (can't be arsed to type out your name), you can do varargs typed: https://play.nim-lang.org/#ix=24Rm
12:06:01PMunchbung87, do you have a specific example of what you want to import?
12:06:27*nsf quit (Quit: WeeChat 2.6)
12:10:55FromGitter<bung87> seems ,I got it work, if c using typedef just need type X โ€ฆ = object whether it refers to a struct or point of struct
12:13:52FromGitter<bung87> `psutil_get_proc_list(struct kinfo_proc **procList, size_t *procCount) ` now Iโ€™m struggle with `**procList`
12:18:00FromGitter<bung87> https://github.com/bung87/psutil-nim/blob/master/src/psutil/psutil_macosx.nim#L311 see if anyone interested in and could help me fix this
12:20:18*marmotini_ quit (Remote host closed the connection)
12:22:56*B_ceecbgh joined #nim
12:28:53*marmotini_ joined #nim
12:29:55*marmotini_ quit (Remote host closed the connection)
12:30:03*B_ceecbgh quit (Ping timeout: 265 seconds)
12:33:19PMunchThat is a pointer to a list
12:33:50PMunchSo you just create a sequence and then you pass mySeq[0].addr to procList and mySeq.len to procCount
12:33:53*marmotini_ joined #nim
12:36:42PMunchbung87 ^
12:36:51FromGitter<bung87> but seq compatible ?
12:37:44FromGitter<bung87> araq told me seq not compatible
12:38:38*marmotini_ quit (Client Quit)
12:39:38FromGitter<bung87> and the original python c version check the address and value
12:40:13PMunchWell a seq directly isn't compatible, as it has the size and capacity stored
12:40:37PMunchBut the pointer to the first element is the same as a pointer to a sequence of elements
12:40:53Zevvto an *array* of elements
12:40:56Zevvin nim-speak
12:40:59FromGitter<Willyboar> @alehander92 I create a repo. I will work on that today.
12:41:00PMunchErr, yes
12:41:01PMunchSorry
12:41:13Zevvbung87: http://zevv.nl/nim-memory/
12:41:21FromGitter<bung87> but it doest not has a const length
12:41:26Zevvsection "how_nim_stores_data_in_memory"
12:41:52PMunchOh cool, I have been meaning to write exactly that article
12:42:28FromGitter<alehander92> @Willyboar ok !
12:43:16ZevvPMunch: that would be plagiarism, no?
12:43:47PMunchHaha, well maybe not that exact article :P But an article with exactly the same kind of content. But now I don't have to :)
12:43:52Zevv:)
12:43:58ZevvBut wait: it is far from complete
12:44:12Zevvso if you ever find yourself bored, you might want to consider adding some missing sections
12:44:15Zevvsee the bottom notes
12:44:21FromGitter<bung87> good article!
12:44:52Zevvmissing is: GC alternatives, nim without GC, newruntime, closures, FFI
12:45:24*Hideki_ joined #nim
12:46:20FromGitter<bung87> oh, I forget 2 problem
12:48:08FromGitter<bung87> when import c struct do I need porting full structure? when I need cast it to ptr UnCheckedArray[structA]
12:48:37FromDiscord<mratsim> if it's always manipulated via pointers no
12:49:24FromGitter<bung87> well Iโ€™ll need dereference and access it property
12:51:02PMunchWell as long as you have the memory allignment right it doesn't matter
12:53:46FromGitter<bung87> oh I just got it work.`proclist:ref StructKinfoProc`, `proclist = new StructKinfoProc`
12:54:37FromGitter<bung87> I dont need porting exactly c logic right?
12:55:34FromDiscord<mratsim> in doubt, have tests ๐Ÿ˜‰
12:56:07FromGitter<bung87> unless the end developer turn off gc ...
12:58:45FromGitter<bung87> I ignore serveral c pointer nil check
13:07:27*marmotini_ joined #nim
13:11:14*MarderIII joined #nim
13:17:10*letto quit (Quit: Konversation terminated!)
13:18:51*MarderIII quit (Quit: Leaving)
13:30:21*letto joined #nim
13:33:51*endragor quit (Remote host closed the connection)
13:34:10*Vladar quit (Quit: Leaving)
13:36:02*marmotini_ quit (Remote host closed the connection)
13:45:50*couven92 joined #nim
13:49:25*Hideki_ quit (Ping timeout: 268 seconds)
13:52:38*marmotini_ joined #nim
14:00:52*clyybber joined #nim
14:05:05couven92Okay, I updating my Nim code nim 0.17.1 to 1.0... First of all: strings cannot be nil as I understand, do I change my code to return an empty literal instead?
14:05:29couven92do we have a default literal (like the defaul keyword in C#)?
14:05:29disruptekhearts and minds, people; hearts and minds!
14:05:45disruptekcouven92: you can use "" or use a cstring, which can be nil.
14:06:02disruptekstrings are "" by default.
14:07:32FromDiscord<Rika> if you `var x: string` its == to `""` by default
14:12:24PMunchcouven92, yeah it depends on if this is a direct link with some C code or not
14:12:51PMunchBut empty literal is the preferred way (unless these two things should be kept separate, in which case you should use the Option type)
14:13:01couven92okay, next one: I have a macro returning `typed`. Nim warns that `typed` is deprecated... It says that `void` can be used instead of `typed`?
14:13:11PMunch!eval var x = default(string); echo x.len
14:13:14NimBot0
14:13:17FromGitter<iffy> Anyone know of a Nim package for accessing the OS keyring (for macOS/Windows/Linux)? Comparable to https://github.com/zalando/go-keyring
14:13:46disruptekcouven92: try `untyped` instead.
14:13:47PMunchcouven92, that sounds weird. Link?
14:13:58PMunchBut yeah, untyped is more common
14:14:29disruptekvoid is the peeled type, but i think we're discouraged from using it in code.
14:15:58couven92`typed` will change its meaning in future versions of Nim. `void` or no return type declaration at all has the same meaning as the current meaning of `typed` as return type declaration. [Deprecated]
14:16:00couven92https://github.com/couven92/nim-windowssdk/blob/master/src/windowssdk/ansiwide.nim#L79-L81
14:16:46couven92It is a macro that invokes a proc returning a NimNode
14:17:13disruptekuntyped
14:18:47couven92ok... Why? There was a reason I didn't return `untyped` all those years ago...
14:19:14disruptekwhat was that reason?
14:19:30*Hideki_ joined #nim
14:20:07disrupteknim will turn the nimnode into whatever type it evaluates to, but since nimnode could be anything, `untyped`.
14:20:51couven92I don't remember. But I think it's because I actually want to state that I return valid code...
14:21:32disruptekthe compiler will verify that for ya.
14:21:37disrupteknice feature of compilers.
14:21:51disruptekwell, /some/ compilers.
14:24:06*Hideki_ quit (Ping timeout: 258 seconds)
14:24:20couven92okay, next one: `unchecked` is no longer a valid pragma to declare a type that maps to an array of any length?
14:24:28couven92(Yes I know that is unsafe!)
14:25:13couven92and also, pragma before generic argument list i deprecated? Put it after?
14:25:54couven92so I have: `type AnySizeArray*[T] {.unchecked.} = array[0, T]`
14:26:05couven92what do I write instead of `unchecked`?
14:34:49solitudesfhttps://nim-lang.github.io/Nim/manual.html#types-unchecked-arrays
14:35:05solitudesfuse this instead of your type
14:35:10couven92solitudesf, ah, thx! :)
14:37:19FromDiscord<Milerius> Hello, I would like to use `folly::ConcurrentHashMap` from c++ Folly library, I Successfully imported the type in my code.
14:37:19FromDiscord<Milerius>
14:37:20FromDiscord<Milerius> Now i'm asking my self how i can iterator over this collection.
14:37:20FromDiscord<Milerius>
14:37:20FromDiscord<Milerius> in c++ i have 2 ways to do it: for ranges and iterator.
14:37:20FromDiscord<Milerius>
14:37:23FromDiscord<Milerius> Let's say i want to do it with iterator, i looked at the iterator page of Nim, but there is no example for an imported type such as **std::map** for example.
14:37:23FromDiscord<Milerius>
14:37:26FromDiscord<Milerius> I know we can import iterator too, is the solution to import both const iterator from c++ and import dereference operator too and use it in a yield ?
14:37:30FromDiscord<Milerius> I must admit that i have some trouble.
14:37:43*Yardanico quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
14:41:18FromDiscord<Milerius> there is the usage in c++: https://gist.github.com/Milerius/5780d7460b1926f1deb0f4c82c959cde of this specific container
14:44:06*silvernode joined #nim
14:44:22silvernodeMorning all!
14:46:58silvernodewhat is the replacement for "isDigit()" since I get a warning that it has been deprecated since v0.20?
14:48:53disruptekiterate over the string and isDigit each character.
14:49:06*sealmove joined #nim
14:49:45silvernodedisruptek: a ok, so things got switched to be a little more manual then.
14:50:37disruptekisDigit on a string was a little confusing for unexpected inputs.
14:51:25*endragor joined #nim
14:52:23silvernodedisruptek: Actually now that I think of it, isDigit isn't really what I should be using for this. What I am trying to do is pretty simple. Detect non decimal characters and return an error message. With "isDigit" of course I can't put in 3.14 since the period trips it up
14:53:01disruptekthe whole premise of the proc was flawed, imo. ๐Ÿ˜‰
14:53:36disrupteki'm surprised it was only deprecated in 0.20. feels like it was removed a little soon, but i guess they wanted it out for 1.0.
14:53:46silvernodeI am learning how to deal with user input and it's got me going crazy lol
14:53:56disruptekusers are quite inventive.
14:54:51couven92right, I have a proc that accepts the NimNode for a type as argument. I want to default that argument with the symbol NimNode for the `bool` type, and I want it bound in the macro definition. I tried using `bindSym("bool")` but that returns a `type` and not a `NimNode`.
14:55:08silvernodeI am trying to take in some decimals and integers but ignore everything else. I could go with a regex but figured there might be a quick proc that can do this for me a bit easier
14:55:52disrupteki don't know of one.
15:01:00silvernodeI guess I'll have to learn regex then :)
15:01:29FromGitter<alehander92> you can try lexbase
15:02:54clyybberjust iterate through the input and allow one dot?
15:03:10clyybbereverything else must be isDigit
15:03:53disruptektoo complicated; write a lexer-parser instead.
15:05:01silvernodeclyybber: That actually sounds pretty easy.
15:05:16disruptekyou can have it output msgpack and provide a separate program to render that.
15:05:48silvernodedisruptek: lol
15:06:24*ng0 quit (Ping timeout: 260 seconds)
15:06:45*ng0_ joined #nim
15:14:18couven92I have a macro the retuns `untyped`. Inside the macro I assign an AST to result. Later in the code I call `result.Add(nimNode)`. Nim complains that "typechecked nodes may not be modified". What happened here? :O
15:16:22FromDiscord<Milerius> How we import in nim a type from c++ that is non default constructible ?
15:16:42*Yardanico joined #nim
15:18:32*ng0_ is now known as ng0
15:21:27*PMunch quit (Quit: Leaving)
15:37:13FromGitter<alehander92> what is .Add
15:37:32FromGitter<alehander92> sorry, probably a typo (but just making sure its not code)
15:38:07FromGitter<alehander92> ah, so from the compiler tests
15:38:10FromGitter<kayabaNerve> PMunch: You use obj.addr?
15:38:30FromGitter<alehander92> couven92: it seems that this is when you assign typed to untyped
15:39:50couven92alehander92, no I found out that I needed to clone the Tree of an input parameter in order to be able to modify it. Also calling add on the result variable does not work, but if I first created a variable, and at the very end returned that variable, it works just fine
15:39:52*marmotini_ quit (Remote host closed the connection)
15:40:07*marmotini_ joined #nim
15:40:42FromGitter<alehander92> yes
15:40:53FromGitter<alehander92> well thats not really exact
15:41:03FromGitter<alehander92> you can modify input parameter
15:41:09FromGitter<alehander92> but probably not `typed` one
15:41:25FromGitter<alehander92> result.add works
15:41:31*marmotini_ quit (Remote host closed the connection)
15:41:32FromGitter<alehander92> but you need to initialize it to something
15:47:05*dddddd joined #nim
15:47:37clyybberAraq: Why does reset(x) need to be replaced with x = default(typeof(x)) ?
15:47:57Araqreset(x) calls the destructor of x
15:48:14Araqat least that's what I think it was supposed to do
15:48:38Araqbefore we had desturctors these things were incredibly underspecified
15:48:44clyybberI see
15:48:53disruptekhmm, that's a little surprising.
15:48:53Araqto the point that GC_unref does different things for different GCs :-(
15:48:57clyybberreset(x) calling the destructor feels kinda redundant
15:48:57disrupteknaming-wise.
15:49:54Araqreset(x) was originally for case objects so that you could re-assign the field discriminator
15:50:03Araqand then people started to use it for other things
15:50:37clyybberIMO it should be an alias for default(typeof(x)) in newruntime
15:50:39disrupteki wish i'd have stuck with nim the first time i played with it.
15:50:51disrupteki'd be neat to know the history a little better.
15:51:09aeverr[m]Same
15:51:23disrupteki'm nostalgic for leaving this language but i haven't left yet.
15:52:09*marmotini_ joined #nim
15:52:18Araqleaving Nim? don't be crazy, we can setup a grant and pay you for nimph/nimble.
15:52:39disruptekare you kidding?
15:52:50*couven92 quit (Quit: Disconnecting)
15:52:50Araqno
15:53:05disrupteklol that would be amazing, thank you.
15:53:22disruptekbut, nimph is almost done. ๐Ÿ˜ข
15:53:33disruptekmy children grow up so fast.
15:54:13disrupteki want two features:
15:54:17clyybberdisruptek: Its done when it supports mercurial :p
15:54:21disruptekconceptual negation of requirements,
15:54:22*marmotini_ quit (Remote host closed the connection)
15:54:38disruptekand the ability to "roll 3.1" and catch a 3.1.14 version.
15:54:48disruptekso, essentially "roll to my requirement"
15:54:50clyybbernearly pi
15:54:50*marmotini_ joined #nim
15:55:28disruptekwell, i want to impl distributions, too. but i'm kinda waiting to see if github packages will work for that.
15:55:53FromDiscord<Milerius> Hey, can someone guide me how to import a type that is non default constructible in c++ ?
15:55:58disruptekit's not really clear if nimph will remain platform-centric.
15:57:06disruptekclyybber: PRs welcome. ๐Ÿ˜œ
15:57:28disruptekthere are, i think, a grand total of eleven (11) merc repositories in the official nimble packages database.
15:57:41AraqMilerius, I don't remember
15:57:53clyybberdisruptek: mercury is lethal in low dosages
15:57:59Araqmark the imported constructors with .constructor
15:58:07disruptekapparently it's insoluble in nim, as well.
15:58:19FromDiscord<Milerius> https://gist.github.com/Milerius/4f4f889400307e16d1eb5ab80ca56311
15:58:23FromDiscord<Milerius> @Araq
15:58:36FromDiscord<Milerius> The problem is that the function that i need to import return a implace constructible type
15:58:37clyybberAraq: Then reset wouldn't have to be magic in nrt
15:58:41FromDiscord<Milerius> and nim blame me about that.
15:58:41FromGitter<kayabaNerve> Are you trying to stop it from being constructed?
15:58:57FromGitter<kayabaNerve> Use a pointer. Pointered C++ classes don't call constructors.
15:59:07FromDiscord<Milerius> Yeah but my friend
15:59:32*marmotini_ quit (Ping timeout: 248 seconds)
15:59:33FromDiscord<Milerius> How can i import:
15:59:33FromDiscord<Milerius>
15:59:33FromDiscord<Milerius> "ConstIterator cbegin() const noexcept {
15:59:33FromDiscord<Milerius> return ConstIterator(this);
15:59:33FromDiscord<Milerius> }"
15:59:41FromDiscord<Milerius> I tried few signature
15:59:49Yardanicowhat's that for?
15:59:53FromDiscord<Milerius> They all try to create the ConstIterator type that is non default constructible
16:00:21FromDiscord<Milerius> I'm importing a ConcurrentHashMap From C++ which have only const iterator
16:00:29Araqclyybber: sounds like a plan
16:00:52Yardanico@milerius there are iterators in nim, but they're different from C++
16:00:54Yardanico(simpler :P)
16:00:59FromGitter<kayabaNerve> No idea, besides importcpp and maybe pointers :P My C++ bindings never got that complicated.
16:01:07clyybberAraq: I'll pull up a PR, unless you want to do it in your misc branch
16:01:16FromGitter<kayabaNerve> I also don't even use the C++ backend anymore. It's actually a funny story.
16:01:58FromGitter<kayabaNerve> I moved to C++ for lib X, which wouldn't build under C. I then replaced lib X with lib Y, which wouldn't build under C++, but since I no longer needed C++ for X... kinda balanced itself out
16:02:07FromDiscord<Milerius> kayaba i dm you on discord now
16:02:10FromDiscord<Milerius> Short question
16:02:45Yardanico@Milerius and please, for the future - don't do multiline code pastes :) it doesn't look good for users in IRC
16:02:50Yardanicouse paste services like ix.io or paste.debian.net
16:03:05FromDiscord<Milerius> I pasted a gist
16:03:48Yardanicoby the way, what's its supposed to do?
16:05:00*Hideki_ joined #nim
16:05:16shashlickAraq: is there any way to get compiler flags during compile time?
16:05:39shashlickhttps://github.com/nimterop/nimterop/issues/153
16:05:40disbotโžฅ Ignores nimcache option
16:06:52disrupteklook at the process table?
16:07:46Araqclyybber: no, PR away please
16:08:12FromGitter<juancarlospaco> Hi
16:08:21disruptekawww sup boss.
16:08:23FromGitter<juancarlospaco> I sent LearnInXminutes of Nim on Spanish, but they wont merge it yet https://github.com/adambard/learnxinyminutes-docs/pull/3786/files?short_path=b40660e#diff-b40660e06853c0c3fac52abdf33decd8
16:08:24disbotโžฅ [nim/es] Add Nim Spanish
16:09:07disruptekyou would like my gully tool.
16:09:14disruptek!repo gully
16:09:15disbothttps://github.com/disruptek/gully -- 9gully: 11a code comment formatter 15 1โญ 0๐Ÿด
16:09:47disrupteklike most disrupteknology, it doesn't do anything yet.
16:11:19FromGitter<bung87> a pointer char + a pointer char means what ?
16:11:29Yardanico?
16:11:35YardanicoYou mean summing two pointers?
16:11:39FromGitter<bung87> in c
16:12:07FromGitter<alehander92> i doubt its an useful operation
16:12:15FromGitter<bung87> `char *buf = NULL, *lim, *next; lim = buf + len;`
16:12:16clyybberdisruptek, juancarlospaco: I think cutelog is the thing you want most :p
16:12:18FromGitter<simkimsia> Hi all Iโ€™m here because of this tweet by Juan Carlos https://twitter.com/juancarlospaco/status/1207692210025762818?s=20
16:13:01aeverr[m]welcome
16:13:03disruptekwow, we are on social media.
16:13:10FromGitter<bung87> I may read a book of c programing , during porting psutil to macosx
16:13:17FromGitter<alehander92> @bunbg87 sorry
16:13:24FromGitter<alehander92> so you need
16:13:28FromGitter<alehander92> i guess `len` is int
16:13:45FromGitter<alehander92> because pointer + int is basically pointer[int]
16:13:46FromGitter<bung87> size_t
16:13:46FromGitter<simkimsia> Iโ€™m mostly a django web developer and I stumbled upon nim recently. Found a few useful articles in dev.to by Juan Carlos so was wondering if anybody here has successfully use nim to improve their productivity as a python/django web dev
16:13:50FromGitter<alehander92> thats how arrays work in c
16:14:06Yardanico Will `arc` GC eventually support async (and it also has shared GC right?)
16:14:20FromGitter<alehander92> e.g. char* a; a+ 2 should give you pointer to the values 2 bytes after a
16:14:29FromGitter<alehander92> but! if it was int64_t* a
16:14:40FromGitter<alehander92> then a + 2 => 16 bytes after a
16:14:45FromGitter<bung87> wow, I thought itโ€™s a pointer move , or address assignment.
16:14:47disrupteksimkimsia: Willyboar is a resident web dev but i dunno if he uses python.
16:14:56disruptekmostly i wanted to ping him.
16:15:31FromGitter<alehander92> a + n is basically a[n] : so you can imagine its <pointer to value of the same type after n * sizeof(type)>
16:16:38FromGitter<alehander92> @simkimsia i've used django a bit in the past
16:16:53FromGitter<alehander92> and tried to work on a toy web framework in nim
16:17:15FromGitter<alehander92> you kinda can use jester currently, but its more minimal than django
16:17:19YardanicoWhat's the best way to send messages between threads currently?
16:17:20*icebattle joined #nim
16:17:21disrupteksimkimsia: checkout karax or figlet to get some ideas of the state of the art.
16:17:25disruptek!repo figlet
16:17:28disbothttps://github.com/cmatsuoka/figlet -- 9figlet: 11Claudio's FIGlet tree 15 610โญ 66๐Ÿด 7& 29 more...
16:17:33disrupteknope. not that one.
16:17:34Yardanicolol
16:17:40disruptek!repo treeform/figlet
16:17:41disbotno results ๐Ÿ˜ข
16:17:43FromGitter<Willyboar> Willyboar used flask in the past
16:17:45Yardanico!repo treeform
16:17:46disbothttps://github.com/Tormund/news -- 9news: 11news - nim easy web socket. Based on https://github.com/treeform/ws 15 20โญ 2๐Ÿด
16:17:47madpropsany of those support websockets?
16:17:49FromGitter<simkimsia> Thank you @alehander92
16:17:52disruptek!repos treeform
16:17:53disbothttps://github.com/Tormund/news -- 9news: 11news - nim easy web socket. Based on https://github.com/treeform/ws 15 20โญ 2๐Ÿด
16:17:59disruptek!repos treeform/
16:18:02disbothttps://github.com/treeform/ws -- 9ws: 11Simple WebSocket library for nim. 15 61โญ 7๐Ÿด
16:18:02disbothttps://github.com/treeform/typography -- 9typography: 11Fonts, Typesetting and Rasterization. 15 72โญ 4๐Ÿด
16:18:04disbothttps://github.com/treeform/chroma -- 9chroma: 11Everything you want to do with colors, in nim. 15 28โญ 5๐Ÿด 7& 26 more...
16:18:08FromGitter<simkimsia> And @disruptek
16:18:08disruptekwell, shit.
16:18:21disrupteklook at his stuff. maybe i forgot the name.
16:18:28disruptek!repo treeform gui figma
16:18:29disbotno results ๐Ÿ˜ข
16:18:31FromGitter<Willyboar> figma
16:18:33disruptek!repo treeform/ gui figma
16:18:35disbotno results ๐Ÿ˜ข
16:18:36FromGitter<alehander92> @simkimsia but it depends on what you want: if you want to write web apps in nim, best would be to try one of the existing web frameworks
16:18:42*disruptek gives up.
16:18:43FromGitter<Willyboar> !package figma
16:18:44disbotno packages match ๐Ÿ˜ข
16:18:51FromGitter<Willyboar> !repo figm
16:18:54disbothttps://github.com/figma/figma-api-demo -- 9figma-api-demo: 11 15 679โญ 123๐Ÿด & 29 more...
16:18:58disruptek!repo gui figma
16:18:59FromGitter<alehander92> https://github.com/treeform/fidget
16:19:00disbothttps://github.com/Metarock13/figma-style-guides -- 9figma-style-guides: 11Style Guide generator for Figma documents. 15 5โญ 0๐Ÿด 7& 4 more...
16:19:03FromGitter<alehander92> disruptek please
16:19:04disruptekFIDGET
16:19:08disruptekthat's what it was.
16:19:21disruptekmy bad ๐Ÿคฃ
16:19:21FromGitter<alehander92> :D
16:19:43FromGitter<bung87> I understand itโ€™s assignment and pointer move right?
16:20:06FromGitter<bung87> but assign to lim memory start or end ?
16:20:07FromGitter<alehander92> its assigned to lim yeah
16:20:32FromGitter<alehander92> honestly this snippet
16:20:40FromGitter<alehander92> is strange, because if buf is literally NULL
16:20:51FromGitter<alehander92> probably it doesnt make sense to add to it..
16:20:55clyybberdisruptek: With wayfire you can make a you-know-what with it
16:21:01FromGitter<alehander92> but in principle yeah its like buf[len]
16:21:06FromGitter<alehander92> lim = buf[len] *
16:21:33FromGitter<alehander92> @simkimsia if you want to just port some things, there has been some stuff like nimpy
16:21:44disruptekclyybber: a buffer overrun?
16:21:52FromGitter<alehander92> which lets you interop between python and nim
16:22:04*sschwarzer joined #nim
16:22:26clyybberdisruptek: I don't want to say the word
16:22:30clyybberthe f-s word
16:22:44sschwarzerclyybber: you don't have to ;-)
16:22:49Yardanicoso what's the best way to send messages between threads in nim? :D
16:22:52Yardanicoi asked but chat moved too fast
16:23:02FromGitter<bung87> ok ,thank you @alehander92 , Iโ€™ll check if I can make it work
16:23:34disruptekyardanico: idiomatic is channels.
16:23:48Yardanicoand "best" is? :)
16:23:51disruptekthe f-s word...
16:24:08disruptekwell, channels aren't brilliant, but they are the best.
16:24:11AraqYardanico: we're investigating
16:24:21disrupteka day could come when channels are revamped to work better.
16:24:26FromGitter<alehander92> shared memory?
16:24:38FromGitter<alehander92> brave wild west
16:24:47sschwarzeralehander92: *lol*
16:24:51YardanicoI'm just thinking about creating a program for bridging between different backends, and each backend runs in a separate thread
16:24:58clyybberdisruptek: fidget spinner
16:25:01YardanicoI mean chat services*
16:25:01clyybberthere I said it
16:25:06Yardanicooh no
16:25:13disruptekman, i never would have guessed that in a million years.
16:25:24FromGitter<alehander92> Yardanico what kind of backend
16:25:50disruptekyou find yourself wasting time shaking your windows around the screen to watch them wobble?
16:26:01*Hideki_ quit (Remote host closed the connection)
16:26:13Yardanico@alehander92 for example 4 threads for 4 chat backends - discord, irc, telegram, gitter
16:26:16disruptekyardanico: i wouldn't have reservations about using channels.
16:26:17aeverr[m]We're back at the wayfire thing
16:26:21clyybberdisruptek: unfortunately yes
16:26:27disruptekbut, async is probably better.
16:26:29Yardanicoand if a message is received in irc, it's gonna send that message to 3 other threads
16:26:34Yardanicodisruptek: well I know, but it's going to be a mess
16:26:35clyybberaeverr[m]: the fire never dies
16:26:40disruptekit's an i/o-limited app.
16:26:59disruptekyardanico: nah, it won't be bad at all.
16:27:06Yardanicohmm
16:27:10sschwarzerDoes anyone mind giving discussing / giving feedback on the bug mentioned at https://forum.nim-lang.org/t/5697#35421 ? The underlying code is here: https://hg.sr.ht/~sschwarzer/vppdiff/browse/default/src/vppdiff/cleanxmi.nim#L46 and the problematic condition at https://hg.sr.ht/~sschwarzer/vppdiff/browse/default/src/vppdiff/cleanxmi.nim#L80 .
16:27:14disruptekclyybber: i give you two months, max.
16:27:18aeverr[m]I still don't understand async keywords, lmao
16:27:26sschwarzer(remove the first "giving")
16:27:29Yardanicoaeverr[m]: wdym?
16:27:41Yardanicoyou don't have to understand async to use it xD
16:28:37FromGitter<simkimsia> Iโ€™m going to ask some really stupid questions here so do go easy on me.
16:28:38disruptekasync works well enough, but ignore the manual.
16:28:38clyybberdisruptek: to stop wiggling? Even if I get tired of the wiggle wayfire is fast and slick
16:28:50clyybberalso, I just setup xwayland
16:28:52disruptektalk to me about slick.
16:28:58FromGitter<simkimsia> Oh btw thanks for all the repo recommended I have bookmarked them :)
16:29:02aeverr[m]Yardanico, im not a fan of using things i dont at least partially understand
16:29:02disrupteksimkimsia: everyone starts off as an idiot.
16:29:03clyybberI can wiggle minecraft now, what else do you want?
16:29:34*marmotini_ joined #nim
16:29:39*Hideki_ joined #nim
16:29:39aeverr[m]simkimsia, what'cha askin?
16:30:04disruptekboys wiggle, men don't need mice.
16:30:18FromGitter<simkimsia> Iโ€™m thinking of making it easier to have my own DSL to generate django models, drf serializers, viewsets etc
16:30:49aeverr[m]ok so
16:30:50FromGitter<simkimsia> As I was thinking abt doing this in python I saw nimlang so was wondering if nimlang might be a better fit?
16:31:12aeverr[m]most probably
16:31:15aeverr[m]most likely, rather
16:31:15Yardanicoyou can just call nim nim :)
16:31:32aeverr[m]nim is not a common word, unlike g-
16:32:04FromGitter<simkimsia> As in nimlang to write a DSL to generate django model, drf serializer etc
16:32:25FromGitter<alehander92> yes you can do it
16:32:30FromGitter<simkimsia> Oh okay sorry Iโ€™ll use nim
16:32:35FromGitter<alehander92> thats an interesting approach
16:32:38clyybberaeverr[m]: gimp? common?
16:32:47FromGitter<simkimsia> I mean Iโ€™ll call nim nim
16:32:51FromGitter<alehander92> basically generating other language code from nim
16:33:04sschwarzersimkimsia: of course this channel is a bit biased ;-)
16:33:36clyybberAraq: I think we can do that for the old runtime too
16:33:41FromGitter<simkimsia> I mean yes but at the same time maybe somebody has already tried this so Maybe Iโ€™ll find them here
16:33:42clyybberThe tests seem to indicate such
16:34:08*Hideki_ quit (Ping timeout: 265 seconds)
16:34:08sschwarzersimkimsia: I didn't mean to say you shouldn't ask :)
16:34:36FromGitter<Willyboar> Disruptek i start wor on something
16:34:37FromGitter<Willyboar> king
16:35:19FromGitter<simkimsia> Oh no worries I didnโ€™t take it that way. I will of course weight according to what I find here abt biases. At this point I more in discovery mode. Lots of things I dunno that I dunno
16:37:07Araqclyybber: sounds risky
16:37:18clyybberikr, but it seems to work out
16:37:32clyybberAraq: I could also do it conditionally with nimHasDefault?
16:37:34disruptekWillyboar: what is it?
16:38:12Araqclyybber: oh whatever, just do something, it's devel, 1.1 alpha with best effort --useVersion backwards compat mode
16:38:34Araqwe simply won't backport it
16:38:37clyybberyeah, I was about to say that; we can just revert if something really happens
16:38:46clyybberAraq: Yeah, I don't think we should backport that
16:40:11clyybberAraq: Can we assume hasNimDefault to be true these days? Or how does this work?
16:40:25*endragor quit (Remote host closed the connection)
16:40:36FromGitter<Willyboar> https://github.com/Willyboar/nimux
16:41:27Araqyes, defineSymbol("nimHasDefault")
16:41:32Araqin condsyms.nim
16:41:42Araqit's always true, probably since 0.20
16:41:55disruptekWillyboar: you are off and running; good luck!
16:42:00clyybberOk, nice, so I dont have to handle the else case..
16:42:25Araqer ... then why even write the 'when'
16:43:02clyybberexactly
16:43:08clyybberthats why I was asking
16:43:39clyybberah, I'll just put the old reset into the else case
16:44:24FromGitter<Willyboar> Well i will need all the help i can get
16:44:56disruptek!search github action interfacing
16:44:58disbothttps://github.com/disruptek/nimph/issues/83 -- 3add some simple github action interfacing 7& 1 more...
16:45:03disruptekoh yes.
16:45:07disruptekit's coming.
16:47:00disruptekwould you like a way to clone other people's branches and use them as your dependencies from inside nimph?
16:47:13disrupteknot hard to achieve.
16:49:51disruptekie. you could `nimph fork npeg clyybber:fix43` and it would take your currently-stock npeg and pull in clyybber's branch "fix43" and point at it; then you just build you app and you're running clyybber's code.
16:51:36sealmovedisruptek I think it's an overkill
16:51:51sealmovebranches are temporal
16:52:04disruptekof course.
16:52:43FromDiscord<KcVinu> How to create a cast statement inside a macro ?
16:52:50disruptekthe alternative is that you have to go into the repo and do that stuff manually.
16:53:02disruptekwouldn't you want it automated?
16:53:04sealmoveyou are right, could be useful
16:53:25FromDiscord<KcVinu> result = newStmtList(nnkCast(newIdentNode(tName.treeRepr), newIdentNode(idenName.treeRepr)))
16:53:26FromDiscord<KcVinu> This is not working
16:53:55sealmovenewIdentNode(idenName.treeRepr) ??
16:54:01Yardanicowat
16:54:14Yardanico@KcVinu treeRepr is for debugging
16:54:19sealmoveis idenName a string?
16:54:33solitudesfrun dumpTree or dumpAstGen on whatever you want to achieve and build up to it
16:54:36FromDiscord<KcVinu> Ok, edited to only repr
16:54:52FromGitter<bung87> @alehander92 `lim = cast[int](buf) + len.int` does the same ?
16:54:56FromDiscord<KcVinu> i got this from dumbTree
16:54:57FromDiscord<KcVinu> StmtList
16:54:57FromDiscord<KcVinu> Cast
16:54:57FromDiscord<KcVinu> Ident "int"
16:54:57FromDiscord<KcVinu> Ident "abc"
16:55:02Yardanico@KcVinu, no, you shouldn't use repr at all
16:55:06Yardanicohere
16:55:26clyybberdisruptek: I think its a good idea
16:55:26sealmoveyeah, if idenName is a string, then `indent(idenName)` suffices
16:55:29sealmoveident*
16:55:35sealmoveident is synonym with newIdentNode
16:55:48clyybberdisruptek: Cloning by branch though, is not :p
16:55:54FromDiscord<KcVinu> result of dumbTree looks simple. But how to create new ast ?
16:56:02disruptekcloning by branch?
16:56:34clyybberoh
16:56:39clyybberI meant to say "my"
16:56:53sealmoveKcVinu: what are you trying to do?
16:56:53disruptekoh.
16:57:03FromDiscord<KcVinu> This is the macro signature
16:57:03FromDiscord<KcVinu> macro castTo(tName : untyped, idenName : untyped): untyped =
16:57:15sealmoveKcVinu: there is also dumpAstGen which shows you how to create ast
16:57:32Yardanico@KcVinu also, for some simple cases you can use quote do
16:57:33FromDiscord<KcVinu> Ok. thanks Let me try
16:57:33disruptek!issue arbitrary fork command
16:57:34disbothttps://github.com/nim-lang/Nim/issues/12628 -- 3osproc: support for passing arbitrary fds to child processes 7& 4 more...
16:57:46disruptek!issue arbitrary fork command url
16:57:47disbotno results ๐Ÿ˜ข
16:58:01disruptekdisbot: is this going to be one of those days?
16:58:03disbotyep. ๐Ÿ˜Š
16:58:07disruptekshit.
17:02:15*Hideki_ joined #nim
17:03:09FromDiscord<KcVinu> dumpAstGen shows this
17:03:09FromDiscord<KcVinu> nnkStmtList.newTree(
17:03:09FromDiscord<KcVinu> nnkCast.newTree(
17:03:10FromDiscord<KcVinu> newIdentNode("int"),
17:03:10FromDiscord<KcVinu> newIdentNode("abc")
17:03:10sschwarzerDoes the disbot have a help function? :) I asked "help" but it replied "Nah" :-D
17:03:10FromDiscord<KcVinu> )
17:03:10FromDiscord<KcVinu> )
17:03:22FromDiscord<couven92> Hmm... I was playing with the idea to get nim to produce error, warning and debug messages that are recognised by Azure Pipelines. Is there a way to hook into the compiler and intercept events during compilation. E.g. on_warning, on_error? Any other ideas on how to do something like that?
17:03:27Yardanico@KcVinu please use paste services, we don't have multiline code here in IRC :)
17:03:27disruptekyeah, !help
17:03:30FromDiscord<KcVinu> I need to replace "int" with my parameter name
17:03:49disrupteki guess disbot should respond with some help if it cannot parse your request.
17:03:50FromDiscord<KcVinu> Paste service means, pastebin.com ?
17:04:02Yardanicopaste.debian.net, ix.io, etc, pastebin.com is not really a good choice :)
17:04:03disrupteki thought i implemented that but i guess not.
17:04:12clyybber!help
17:04:17sschwarzerdisruptek: makes sense, I should have thought of this given your "!issue" command :)
17:04:55disruptekthis is how software improves.
17:07:52FromGitter<alehander92> @bung87 not really
17:07:57FromGitter<alehander92> like, in this case maybe
17:07:59FromGitter<alehander92> it does
17:08:19sschwarzerdisruptek: Also would be nice if you could get more than three results. I understand that you don't want to have the channel spammed, but I think it could make sense for private chats.
17:08:35FromGitter<alehander92> but in principle there should be a `+` for pointers
17:08:39disruptekgood point. we'll limit it to 30 for private convos.
17:09:14disrupteki can always throttle it if the bot floods itself off.
17:09:15FromGitter<alehander92> @bung87 pointer + int IS NOT pointer.int + int: very important, IT IS NOT the same in principle
17:09:24sschwarzerdisruptek: Is there a repo to enter an issue? I searched for disbot on Github, but get countless hits.
17:09:45disrupteknah, but i'm usually on irc.
17:10:11FromDiscord<KcVinu> Hi, finally i got the result with this code. But you said not use repr()
17:10:11FromDiscord<KcVinu> nnkStmtList.newTree(nnkCast.newTree(newIdentNode(tName.repr), newIdentNode(idenName.repr)) )
17:10:13sschwarzerdisruptek: Ok, so I guess you have the two issues (!help and more results) on your todo list now? :)
17:10:40FromGitter<alehander92> it seems there is no stdlib for that
17:10:41disrupteki impl help, just wanna do more results before i recompile. ๐Ÿ˜‰
17:10:48FromDiscord<KcVinu> If i not use repr, then it will show errors
17:11:07sschwarzerdisruptek +1 ! :-)
17:11:56FromGitter<alehander92> @bung87 https://stackoverflow.com/questions/4772932/pointer-addition-and-element-size so generally you need to define something like
17:12:27disrupteksschwarzer: try now.
17:12:29FromGitter<alehander92> https://github.com/status-im/nim-stew/blob/master/stew/ranges/ptr_arith.nim
17:12:31sschwarzerIs mratsim also on IRC?
17:12:55clyybberon discord
17:13:07clyybberbut its bridged
17:13:22FromGitter<alehander92> sorry actually https://github.com/status-im/nim-stew/blob/master/stew/ptrops.nim#L29
17:13:27FromDiscord<KcVinu> Well, i can use "$" sign instead of repr
17:13:32sschwarzerdisruptek: I was going to write it doesn't reply to "!help", but after a few seconds it did.
17:13:39FromGitter<alehander92> hm mozilla went to matrix/riot
17:13:39FromDiscord<KcVinu> Any problem in using dollar sign ?
17:13:41FromGitter<alehander92> after all
17:13:42FromGitter<alehander92> interesting
17:14:15sschwarzerclyybber: I guess there's no bridge to msg someone on Gitter, i. e. the bridge is "only" for this channel?
17:14:21clyybbersschwarzer: Packet transports are having a hard time in the canadian wilderness
17:14:22FromGitter<alehander92> i am on gitter
17:14:40FromGitter<alehander92> you can `@<name>` for people here, but no PM-s indeed
17:15:05FromDiscord<KcVinu> I think everybody is busy with other queries. Never mind, i am leaving it here. My head spins with this macro.
17:15:34FromGitter<alehander92> i think `repr` is fine , i am using it a lot
17:15:42FromGitter<alehander92> i think `$` is the same for idents
17:15:58FromGitter<alehander92> `repr` works for all nodes afaik
17:15:59clyybberin general $ is preferable over repr
17:16:02sschwarzerdisruptek: Ok, !issues gives me more results now
17:16:03FromGitter<alehander92> `$` just for some of them
17:16:31FromGitter<alehander92> so yeah maybe `$` is good if you want to make sure you dont string some unexpected node
17:16:32sschwarzerdisruptek: I'll try the >30 case by using "macro" or something :)
17:16:32clyybberrepr won't work in new runtime, though in this case it shouldn't matter since afaict you do it at compile time
17:17:03FromGitter<alehander92> huh that would break some code
17:17:18*endragor joined #nim
17:17:30clyybberKcVinu: What is indenName in your code?
17:17:32FromGitter<alehander92> maybe just a "repr doesnt work here" or `$` alias might be ok
17:17:38FromGitter<alehander92> as it is used mostly for debugging out of CT
17:17:42silvernodeWell I learned how to do regex in Nim and solved my "match everything except 0-9 and ." issue. Now users can't input anything but integers and floats
17:17:42FromGitter<alehander92> i hope
17:17:49FromGitter<alehander92> but people might parse it ..
17:18:16FromDiscord<KcVinu> idenName is any variabale like LRESULT, HWND etc
17:18:29clyybbervariable as in its a string?
17:18:31*Hideki_ quit (Ping timeout: 258 seconds)
17:18:33clyybberor is it a sym?
17:18:57clyybbereither way $ should work just fine for all sane purposes
17:19:11FromDiscord<KcVinu> Actually, i just write what dumpAstGen gave to me
17:19:23*disruptek quit (Quit: Bye)
17:19:47FromDiscord<KcVinu> But this macro and original cast statement, both are giving weird results
17:19:47*disruptek joined #nim
17:19:57clyybberdisruptek: thought you were a goner here for a sec
17:19:58Yardanicocan you show us what do you want to do?
17:20:05YardanicoI mean what is your expected result?
17:20:24FromDiscord<KcVinu> if i convert float 5.0 to int , i am epecting 5
17:20:26disrupteklol
17:20:38disruptektrying to get my bouncer to let the bot spam me faster.
17:20:44Yardanico@KcVinu int(floatvar)
17:20:54FromDiscord<KcVinu> but i got 4617315517961601024
17:21:11clyybberthen the float was not a 5.0 :p
17:21:14YardanicoBy the way, what happened to nim highlighting?
17:21:15Yardanicohttps://github.com/nim-lang/Nim/blob/devel/lib/system.nim
17:21:18Yardanicodoesn't work here for me
17:21:40FromDiscord<KcVinu> Actually i just tested with int and float, in real case, i need to convert LPARAM to LPNMHDR struct
17:21:47FromDiscord<KcVinu> and stuff like that
17:21:56FromDiscord<KcVinu> Whole win api data types
17:21:59*endragor quit (Ping timeout: 265 seconds)
17:22:16sschwarzerHm, only 11 hits for `!issues macro`? ;) For comparison, the Github search for nim-lang `is:issue is:open in:title macro` gives me 75 open tickets.
17:22:17clyybberYardanico: Maybe due to the documentation top comments, idk if githubs highlighting thing is open source tho
17:22:23Yardanicoit is
17:22:31clyybberdo they use treesitter?
17:22:38Yardanicohttps://github.com/github/linguist
17:22:46Yardanicoah sorry wrong one
17:23:51FromGitter<bung87> @alehander92 ok, I decide read some c tutorials
17:24:00Yardanico@KcVinu so you just want to replace one type with another?
17:24:08Yardanicoeverywhere?
17:24:21Yardanico(everywhere inside of your macro invocation I mean)
17:24:37Yardanicoclyybber: ah wait, that repo is the right one
17:24:47Yardanicohttps://github.com/github/linguist/blob/master/vendor/README.md this lists the repos they use for languages
17:24:59Yardaniconim one uses syntax highlighting from https://github.com/Varriount/NimLime
17:25:04Yardanicoxd
17:25:19*endragor joined #nim
17:25:31disrupteksschwarzer: it's the same search, except mine looks for language:nim and doesn't care if the issue open or closed.
17:26:58silvernodeI think I have a basic Nim question: How do I catch when users cancel the program with Ctrl+c , so I can give a nice message when they kill it?
17:27:05YardanicosetControlCHook
17:27:16*Vladar joined #nim
17:27:21Yardanicohttps://nim-lang.org/docs/system.html#setControlCHook%2Cproc%29
17:27:39sealmovesilvernode: this is not a simple question
17:27:42clyybberYardanico: Huh, so they are able to use sublime text highlighting in their site
17:27:44clyybberinteresting
17:28:18*tribly quit (Quit: WeeChat 2.7)
17:28:31clyybberits a submodule though, so to fix it NimLime has to be PRed and then githubs thing updated, unless they keep the submodules up to date themselves
17:28:43disrupteksschwarzer: if you really want more than 30 hits, i can do up to 100, but...
17:28:53*tribly joined #nim
17:29:00*Kaivo joined #nim
17:30:00silvernodesealmove: Well I guess I should be glad, I was hoping I wouldn't look dumb. :P
17:30:24sschwarzerdisruptek: Not a problem, but I got only 11 instead of 30
17:31:46FromGitter<alehander92> @bung87 good idea: pointers might be a bit tricky in the beginning, but once everything is clear on them, this helps a lot imho
17:34:36FromGitter<alehander92> clyybber i think sublime was using some kind of more general textmate thing
17:34:38FromGitter<alehander92> or supporting
17:34:42FromGitter<alehander92> but i might be confused
17:37:17*nsf joined #nim
17:37:29FromGitter<alehander92> hm https://blog.rust-lang.org/2019/12/19/Rust-1.40.0.html#[non_exhaustive]-structs,-enums,-and-variants
17:37:33FromGitter<bung87> I think I Know pointer referrence, several years ago ,when learn c++, but in this case it's specific to the language.
17:37:34FromGitter<alehander92> this is an interesting idea
17:37:44FromGitter<alehander92> @bung87 yeah its mostly pointer arithmetic
17:38:09clyybberalehander92: Ah that would make sense
17:41:28clyybberalehander92: It is an interesting idea
17:41:40clyybberbut nim doesn't realy have the same problem
17:42:04clyybberwell
17:42:08FromGitter<alehander92> well, you can apply it to enums
17:42:10FromGitter<bung87> I also remeber when I porting c++ project fastText, there โ€™s no pointer move operation in nim, atleast not through just one operator
17:42:11clyybberyeah
17:42:19FromGitter<alehander92> but yeah our pattern matching (at leat my lib)
17:42:27FromGitter<alehander92> doesnt even support exhaustiveness yet iirc :D
17:43:21clyybberalehander92: Yeah I take it back, we could introduce a pragma that makes it so when you case of over an enum, you are allowed to write an else even though that else won't be reached with the current possible values of the enum
17:44:18clyybberthat would be the nim equivalent of #[non-exhaustive]
17:44:59clyybberand maybe erroring when there is no else branch
17:45:55FromGitter<alehander92> yeah i guess so, more interesting is probably
17:46:03FromGitter<alehander92> how to make a macro pattern matching exhaustive
17:46:09clyybberhmm
17:46:25FromGitter<alehander92> i imagine one can analyze invariants for primitive types and do a similar logic
17:46:28FromGitter<alehander92> like the compiler does
17:47:02FromGitter<alehander92> and generalize it over PRODUCT and OR
17:47:35clyybbertry it :)
17:47:38FromGitter<alehander92> actually i cant see a huge problem
17:48:00FromGitter<alehander92> but no much time
17:48:07FromGitter<alehander92> my only side project ideas these days are
17:48:16FromGitter<alehander92> to make a simple gdb-like debugger in rust
17:48:26clyybberregarding that #[non-exhaustive], maybe it isnt a good idea for rust either, I mean if you only want to handle a few specific cases you;ll have an else branch either way
17:48:35FromGitter<alehander92> and to prototype one other thing in nim :D
17:48:46clyybberand when you dont then its not a good idea to introduce enums silently
17:48:58FromGitter<alehander92> yeah, sounds reasonable
17:49:00clyybberbecause then the code thats supposed to handle each one individually gets forgotten
17:49:14FromGitter<alehander92> the user is expected to code for "possible future other enum" values
17:49:19clyybberyeah
17:49:25FromGitter<alehander92> which sometimes makes sense, but sometimes doesnt
17:49:50FromGitter<alehander92> but i guess here lies the lib author responsiblity
17:50:31FromGitter<alehander92> to not use it for enums which should be kinda unchanging
17:50:41disruptekthanks to sschwarzer, you can now use the bot to spam yourself with >3 results via private chat.
17:50:43*narimiran quit (Ping timeout: 258 seconds)
17:51:14FromGitter<alehander92> !disbot give me 20 results
17:51:23*leorize joined #nim
17:51:54FromGitter<alehander92> !disbot just make me eggs man
17:52:02FromGitter<alehander92> hungry
17:52:08FromGitter<alehander92> disruptek lets go for a lunch
17:52:18disruptekaight.
17:52:46FromGitter<alehander92> i figure paris might be somewhere in the middle
17:52:53clyybberAraq: #12937 its passing \o/
17:52:54disbothttps://github.com/nim-lang/Nim/pull/12937 -- 3system.reset is no longer magic
17:52:57FromGitter<alehander92> they have good bakeries
17:53:03FromGitter<Willyboar> I take dinner in a while
17:53:07FromGitter<alehander92> me too
17:53:15disrupteki used to have a french bakery across the street.
17:53:20FromGitter<alehander92> but i wanted to be us-friendly
17:53:33disruptekin nyc. unbelievable.
17:53:43FromGitter<Willyboar> Disruptek are you in us?
17:53:47FromGitter<alehander92> disruptek i imagine there are porbably 23 bulgarian restaurants
17:53:49FromGitter<alehander92> in nyuc
17:53:56disruptekyeah.
17:53:59FromGitter<alehander92> from what ive heard about the international cuisin
17:54:06FromGitter<alehander92> ok, maybe 2
17:54:24FromGitter<alehander92> ok, there is a tasty turkish place nearby
17:54:24*vsantana joined #nim
17:54:33FromGitter<Willyboar> There are a lot of greeks there. In astoria
17:54:34FromGitter<alehander92> but i .. want something different
17:55:28clyybberalehander92: Hunger tastes.. different
17:56:04*lbart joined #nim
18:05:03disruptekhow should the !forum bot command work?
18:05:08disruptekgoogle site search of the forum?
18:05:55leorizethe forum has a search function, isn't it
18:06:20disruptekso does github.
18:06:36leorizeyea but there's a REST api for it, no?
18:07:14disruptekfor the forum?
18:07:48leorizeyea
18:08:10disrupteki dunno anything about the forum. if there's a search api, i could use that.
18:10:47leorizehttps://github.com/nim-lang/nimforum/blob/35baa815fdb3762f779474ff6e81ae20dec2070c/src/frontend/search.nim#L86-L87
18:11:01leorizelooks like the endpoint is /search.json
18:11:21leorizethe structure is on top of the file
18:11:39*gmpreussner quit (Ping timeout: 240 seconds)
18:12:41leorizelol you can even query all post from spammers
18:14:37*marmotini_ quit (Remote host closed the connection)
18:14:55*marmotini_ joined #nim
18:16:36*marmotini_ quit (Remote host closed the connection)
18:18:41*leorize quit (Remote host closed the connection)
18:19:03*leorize joined #nim
18:22:10*marmotini_ joined #nim
18:26:27*gmpreussner joined #nim
18:31:29*zyklon joined #nim
18:31:42disrupteki guess we can limit it to posts or threads, then. we'll have !post !thread or the more general !forum.
18:33:19*uvegbot quit (Ping timeout: 265 seconds)
18:45:26FromGitter<Willyboar> dude you are on fire
18:46:57FromGitter<alehander92> boar how is the web going
18:46:57FromGitter<bung87> whatโ€™s `atoi` in Nim?
18:47:18FromGitter<alehander92> parseInt ?
18:48:02FromGitter<bung87> the question previous, *char to int ,since `lim` represent as limit number
18:48:31FromGitter<alehander92> but what is char* then
18:48:56FromGitter<alehander92> is it something like "2"
18:49:58FromGitter<alehander92> if you want the string content itself, atoi is the thing, otherwise if you want the pointer value as int, just use (int)
18:50:12FromGitter<bung87> I dont know exactly the `buf` coming from `sysctl(mib.addr, 6, buf, len, nil, 0) `
18:51:27*vsantana quit (Quit: leaving)
18:51:49FromGitter<alehander92> well, what does it contain
18:52:09FromGitter<alehander92> yeah, look, what are you trying to do
18:52:13FromGitter<alehander92> in the big picture
18:53:25FromGitter<bung87> https://github.com/bung87/psutil-nim/blob/master/src/psutil/psutil_macosx.nim#L690
18:54:18FromGitter<bung87> `PRs accepted! Adding a single function to any platform is a huge help and can usually be done with less than an hour of work.`
18:54:28FromGitter<bung87> I spent much more hours...
18:55:15FromGitter<alehander92> yeah, but you might learn very important c stuff
18:56:53FromGitter<bung87> yeah , I did learned something by porting projects.
18:57:26FromGitter<alehander92> ok, so what is the original code
18:57:45FromGitter<bung87> https://github.com/hamon-in/cpslib/blob/master/pslib_osx.c#L674
18:58:17FromGitter<bung87> and pure c version https://github.com/hamon-in/cpslib/blob/master/pslib_osx.c#L674
18:58:24FromGitter<alehander92> ok
18:58:25FromGitter<alehander92> lim = buf + len;
18:58:57FromGitter<bung87> thatโ€™ all?
18:59:07FromGitter<alehander92> just means var lim: ptr char ; lim = buf.pointerAdd(len)
18:59:51FromGitter<alehander92> and next < lim can be done with cast[int] i think (they're both pointers)
19:00:03FromGitter<alehander92> and next += ifm->ifm_msglen;
19:00:27FromGitter<alehander92> next = next.pointerAdd(ifm->ifm_msglen.pointerAdd)
19:00:31FromGitter<alehander92> next = next.pointerAdd(ifm->ifm_msglen)
19:00:34FromGitter<alehander92> sorry
19:00:42FromGitter<alehander92> you need to define pointerAdd mostly
19:02:11FromGitter<alehander92> for that look at https://github.com/status-im/nim-stew/blob/master/stew/ptrops.nim#L29
19:02:25FromGitter<alehander92> its the same thing
19:02:34FromGitter<alehander92> as offset here and as `+` in c
19:04:19FromGitter<bung87> ok , let me try .
19:04:43*nsf quit (Quit: WeeChat 2.6)
19:06:47clyybberAraq: ping
19:08:06FromGitter<Willyboar> @alehander92 i made a repo and some progress.
19:08:07FromGitter<Willyboar> https://github.com/Willyboar/nimux
19:10:14FromGitter<alehander92> ok, just several suggestions
19:10:20FromGitter<alehander92> 1) looks great!
19:11:39FromGitter<alehander92> 2) i imagine a great feature would be that nim has a javascript backend: so .nim (or .js.nim) instead of .js โŽ 3) its easy to load karax server side views: so one can use .nim instead of .html there too (and even easily combine it as SPA)
19:12:54FromGitter<Willyboar> I am waiting @xmonader to create a jinja clone :P
19:13:23FromGitter<Willyboar> but sure i want to here all options
19:14:15FromGitter<bung87> canโ€™t see src source files.
19:14:15FromDiscord<Milerius> is PMunch around ?
19:14:34FromGitter<alehander92> but karax already works for this
19:14:46FromGitter<Willyboar> @bung87 you mean to nimux?
19:14:49FromGitter<alehander92> and its imo even better than jinja :P as you can even reuse it
19:14:54FromGitter<alehander92> but i think
19:14:55FromGitter<Willyboar> because there isn't any
19:14:56FromGitter<bung87> for option 2, js backend not good as c backend
19:15:17FromGitter<alehander92> the best would be for you to support different template "engines" but of course this is not so critical
19:15:27FromGitter<bung87> (https://files.gitter.im/nim-lang/Nim/9ORi/Screenshot-2019-12-20-at-3.15.17-AM.png)
19:15:31FromGitter<alehander92> @bung87 i dont agree
19:15:35FromGitter<Willyboar> the goal for me is to be easy to use from a beginner to a pro
19:15:42FromGitter<alehander92> we work on a product using the javascript backend
19:15:54*Hideki_ joined #nim
19:16:02FromGitter<alehander92> and reusing stuff between the server and the client code is great
19:16:12FromGitter<alehander92> many people go thru great lenghts to do it in other languages
19:16:21disruptekthis.
19:16:26FromGitter<alehander92> like node , ruby : openstack (which uses opal)
19:16:26FromGitter<alehander92> etc
19:16:35FromGitter<bung87> @alehander92 bot araq said that , when I asked him , the js backend development progress is behind c backend
19:16:38FromGitter<alehander92> clojurescript and clojure, scala.js and scala , many examples
19:17:03FromGitter<alehander92> @bung87 yeah, but i think its almost good enough for js
19:17:41FromGitter<alehander92> but this is again, just a nice thing to have
19:17:43FromGitter<bung87> I develop a tool before , itโ€™ s pass the c tests, but not work for js backend
19:18:02FromGitter<alehander92> well, you need to be careful with some edges, but i work with the js backend for years
19:18:11FromGitter<alehander92> and i find it almost as good as typescript for my needs
19:18:49FromGitter<bung87> Iโ€™d like to have a web framework using elm lang as template
19:19:01FromGitter<alehander92> of course nimux can support just anything that produces .js
19:19:09FromGitter<alehander92> so my point doesnt really matter
19:19:51FromGitter<Willyboar> Everything is open
19:19:52FromGitter<alehander92> @Willyboar looks great, cant wait to see more, sorry for my bikeshedding :)
19:20:24*Hideki_ quit (Ping timeout: 265 seconds)
19:20:45FromGitter<bung87> and here โ€™s one more side to consider, the Nim community lib mostly is for c backend
19:20:48FromGitter<Willyboar> I want to be a project for everyone
19:21:24FromGitter<bung87> @Willyboar you finnally decide develop a framwork by your own?
19:21:54FromGitter<Willyboar> the doors are open to anyone who wants to join
19:22:08FromGitter<alehander92> @bung87 sorry, but i just dont agree
19:22:25FromGitter<Willyboar> to what?
19:22:28FromGitter<alehander92> many of the stdlib modules which are not supported arent really applicable in browsers
19:22:51FromGitter<alehander92> i think you shouldn compare the js backend to the c one, they are just very different
19:22:59FromGitter<alehander92> but to things like typescript or ecmascript
19:23:21FromGitter<Willyboar> I think elm is interesting like wasm
19:23:23FromGitter<bung87> I really check my tool, generated js source file.
19:23:47FromGitter<bung87> I just wrote 200 line about, it produce 6000+ line
19:24:01FromGitter<alehander92> well, thats because
19:24:06FromGitter<Willyboar> but for the start is better to concetrate to simple things
19:24:08FromGitter<alehander92> it imports much of the stdlib in one file
19:24:23FromGitter<alehander92> i guess
19:24:28FromGitter<alehander92> but i am telling you, that the nim js backend is good enough and we use it in a commercial product
19:24:34FromGitter<bung87> and the std DateTime ,dont produce a js Date type
19:24:48FromGitter<alehander92> well, that would be just wrong, as they're different types
19:25:16FromGitter<alehander92> still, if one is careful, he can reuse a huge amount of his own code
19:25:38FromGitter<alehander92> one of my plans is to actually reuse most of my UI code written in karax in a TUI app
19:25:42FromGitter<bung87> and I also using a timezones lib support more timezone, but also not support return a Date type
19:26:52FromGitter<alehander92> yeah, i agree some stdlib modules can be better in that sorry
19:27:14FromGitter<alehander92> but all in all, its a great fit for nimux
19:28:23FromGitter<bung87> and that day , I also see a RFC propsal to easy way add a backend
19:29:30FromGitter<bung87> I think it also a important thing, once done , developers from other background can add more backend to Nim
19:33:22FromGitter<alehander92> hmm, can you give me an example
19:33:46FromGitter<alehander92> like python backend?
19:35:34*sschwarzer quit (Quit: leaving)
19:44:18*Araq quit (*.net *.split)
19:44:18*acidx quit (*.net *.split)
19:44:18*gsingh93 quit (*.net *.split)
19:44:30*Araq joined #nim
19:44:37*acidx joined #nim
19:44:58*gsingh93 joined #nim
19:46:22FromGitter<bung87> no, not me
19:47:51FromGitter<bung87> I mean if there is someone interested , then someone must have good knowlage about programing , thatโ€™s good for Nim.
19:48:39disrupteknlvm is a working demonstration of a 3rd-party backend.
19:48:51disruptek!repo nlvm
19:48:51disbothttps://github.com/arnetheduck/nlvm -- 9nlvm: 11LLVM-based compiler for the Nim language 15 245โญ 18๐Ÿด 7& 1 more...
19:54:40FromGitter<Willyboar> nice things happen in the nim world
19:55:17disrupteklotta happy people here.
19:56:18FromGitter<Willyboar> hearts and minds
19:56:20FromGitter<Willyboar> :P
19:56:39disruptekyep.
19:56:44disrupteklet's do this thing.
19:57:26disruptekwe had a saying in my car company:
19:57:35disruptekporsche: there is no substitute.
19:57:40clyybberI wanna buy a fine automobile
19:57:40FromDiscord<Milerius> Hello, i'm trying to use: https://github.com/PMunch/jsonschema
19:57:40FromDiscord<Milerius>
19:57:40FromDiscord<Milerius> But i'm creating a Schema inside a .nim file and i try to use it inside an unittest i got an error undeclared identifier: 'MyType'
19:57:40FromDiscord<Milerius>
19:57:41FromDiscord<Milerius> I was supposing that i have to add a * add the end of type but it's not working
19:57:41FromDiscord<Milerius>
19:57:42FromDiscord<Milerius> is it Normal ?
19:57:50FromGitter<bung87> my task done
19:58:40FromDiscord<Milerius> When i add a * i got : Error: expression expected, but found ':'
19:59:09FromGitter<bung87> you should export your type
19:59:10disruptekthe * goes after the symbol name, not its type.
19:59:32disruptektype Foo*: Bar
19:59:41FromDiscord<Milerius> It's exactly what i tried
20:00:02solitudesfits = not :
20:00:12FromDiscord<Milerius> https://gist.github.com/Milerius/37c3923faa0660227fc998c18e73a07a
20:00:21disruptekright.
20:00:33FromDiscord<Milerius> (according to this library: https://github.com/PMunch/jsonschema)
20:01:11FromDiscord<Milerius> If i create a jsonSchema from this library i'm expecting to use exported type to test the schema
20:01:13FromGitter<alehander92> not sure if
20:01:15FromGitter<alehander92> a? : b
20:01:19FromGitter<alehander92> is parsed the same way as
20:01:21FromGitter<alehander92> a ?: b
20:01:27FromGitter<alehander92> maybe, but you need to check
20:02:14FromDiscord<Milerius> Yeah but this is not my problem i guess
20:02:21FromDiscord<Milerius> related to exporting type
20:02:41FromDiscord<Milerius> (it's working if i use the schema locally, i tried it)
20:02:45FromDiscord<Milerius> but i cannot export it
20:03:11FromGitter<alehander92> it seems it should be the same
20:05:06*revere quit (*.net *.split)
20:05:06*Lord_Nightmare quit (*.net *.split)
20:05:17*revere joined #nim
20:05:19*Lord_Nightmare joined #nim
20:05:36*PMunch joined #nim
20:05:55FromGitter<alehander92> i dont really think its supported maybe
20:06:58FromGitter<alehander92> so you can manually
20:07:08FromGitter<alehander92> hm, probably not
20:07:29FromGitter<alehander92> https://github.com/PMunch/jsonschema/blob/master/src/jsonschema.nim#L161
20:07:58FromGitter<alehander92> and https://github.com/PMunch/jsonschema/blob/master/src/jsonschema.nim#L122
20:08:02FromGitter<alehander92> need to be changed afaik
20:08:10FromDiscord<Milerius> Can i write unit test directly in the same nim file ?
20:08:22FromDiscord<Milerius> there is something like when defined(unit_test)
20:08:25FromDiscord<Milerius> ?
20:08:28FromGitter<alehander92> you can use `when isMainModule: <my tests>`
20:08:46PMunchHuh, do you have an issue with jsonschema?
20:08:48FromGitter<alehander92> and run directly your file
20:09:15FromGitter<alehander92> wow github links trigger nicks
20:09:18FromGitter<alehander92> smart
20:09:28FromDiscord<Clyybber> whats up with glibc
20:09:34FromDiscord<Clyybber> @Milerius ?
20:09:37FromDiscord<Clyybber> sorry
20:09:39FromDiscord<Clyybber> wrong tag
20:09:41FromDiscord<Clyybber> @mratsim
20:09:49PMunchWell is HexChat nicks trigger anywhere :)
20:09:56FromDiscord<Milerius> Yo PMunch
20:10:00PMunchWithout any @ or anything like that
20:10:00FromGitter<alehander92> yes exactly
20:10:04FromGitter<alehander92> but its cool that
20:10:07FromDiscord<Milerius> I'm trying to use your library :p
20:10:12FromGitter<alehander92> github links techincally do have this property
20:10:16FromDiscord<mratsim> @Clyybber I uncovered a bug in glibc condition variables
20:10:18FromGitter<alehander92> that they include it
20:10:22PMunchMilerius, trying to?
20:10:27FromDiscord<Milerius> use jsonSchema
20:10:33FromDiscord<Milerius> but i'm in trouble
20:10:36FromDiscord<Milerius> tbh
20:10:40*solitudesf quit (Ping timeout: 265 seconds)
20:10:42PMunchalehander92, yeah as long as your nick is the same on IRC and GitHub
20:10:49PMunchMilerius, how so?
20:10:52FromDiscord<Milerius> I Couldn't use a jsonSchema that i have declared in a nim file in an unit test
20:10:56FromDiscord<Milerius> because type are not exported
20:10:56FromDiscord<mratsim> When I signal a condition variable, sometimes the waiting thread isn't woken up
20:11:02*luis_ joined #nim
20:11:04FromDiscord<Milerius> and i cannot export the type
20:11:05FromDiscord<mratsim> doesn't happen on OSX
20:11:24*solitudesf joined #nim
20:12:00FromDiscord<Milerius> @PMunch (file.nim -> create the json schema) (test.nim -> test the schema created in file.nim)
20:12:06FromDiscord<Milerius> Unable to test this way
20:12:16*luis_ quit (Client Quit)
20:12:43*luis_ joined #nim
20:13:09FromDiscord<Clyybber> @mratsim Ha, nice.
20:13:09*luis_ quit (Remote host closed the connection)
20:14:02FromDiscord<mratsim> not nice, either I give up on my backoff, or I implement some super complicated scheme (and any kind of loop on the signaler thread might block it which is not what I want ...)
20:14:12FromDiscord<Clyybber> Or glibc gets a fix?
20:14:12FromDiscord<mratsim> tough luck on that
20:14:40FromDiscord<mratsim> Would probably be easier to implement my own Futexes and Condition variables on top of OS syscalls
20:15:04*NimBot joined #nim
20:15:39FromDiscord<Clyybber> AFAIK yes
20:17:09FromDiscord<Milerius> Ah that's why
20:17:20FromDiscord<Milerius> Do you think it's possible to fix the export PMunch ?
20:17:39FromDiscord<Milerius> Also i may have question for the usage
20:17:44PMunchWhat do you mean fix, it's done that way on purpose..
20:18:01FromDiscord<Milerius> ok, i will use include
20:19:04*leorize quit (*.net *.split)
20:19:04*ng0 quit (*.net *.split)
20:19:26*luis_ joined #nim
20:19:36PMunchBut it would be possible to add a switch to jsonschema to make it export everything
20:20:25FromDiscord<mratsim> @clyyber, it doesn't happen with musl
20:20:35FromDiscord<mratsim> @Clyybber*
20:20:40FromDiscord<Milerius> Ok thanks for the info
20:20:52FromDiscord<mratsim> ah no it just did
20:21:18FromDiscord<Milerius> now i may have another question PMunch
20:21:20FromDiscord<Milerius> for the usage
20:23:07PMunchFire away
20:23:48*luis_ quit (Remote host closed the connection)
20:25:35*luis_ joined #nim
20:25:43*luis_ quit (Remote host closed the connection)
20:27:26FromDiscord<Milerius> giving the following type: https://gist.github.com/Milerius/fdcc48767e1c54505eeb805fc6a2a7b2
20:27:26FromDiscord<Milerius>
20:27:26FromDiscord<Milerius> Let's say i have my json, i validate my schema from the json i receive. so i have my JsonNode
20:27:26FromDiscord<Milerius>
20:27:27FromDiscord<Milerius> I validate the schema with isValid function
20:27:27FromDiscord<Milerius>
20:27:29FromDiscord<Milerius> Then i have just to unmarshall to my type, Everything will be automatic ?
20:27:48shashlickanyone have code to redirect stdout to a file in nim?
20:28:18PMunchBy the way, here is an example on how to use it with import to access the types and procedures you need: http://ix.io/24T9/
20:29:01FromDiscord<Milerius> Thank's i'm reading it
20:31:16*luis_ joined #nim
20:33:07*ng0 joined #nim
20:33:07FromDiscord<mratsim> @shashlick, I just use `tee` or `script`
20:33:13PMunchMilerius, and this is how I use it in nimlsp: http://ix.io/24Tb/
20:33:45*luis_ quit (Client Quit)
20:35:27*luis_ joined #nim
20:35:30FromDiscord<Milerius> ok i'm trying to understand
20:35:37FromDiscord<Milerius> in fact i did The type twice
20:35:40PMunchEssentially that verifies that the passed JsonNode is of the correct schema, then it shadows the identifier I used for the JsonNode with a version cast to this distinct type. The distinct type has a `[]` which checks on compile-time if that field exists in the schema or not and throws an error if it doesn't, or returns the correct type according to the schema.
20:36:40FromDiscord<Milerius> So if i'm understanding correctly
20:37:07FromDiscord<Milerius> Let's say you receive an external Json, you parse it to a node, then you give it to whenValid?
20:38:45*luis_ quit (Remote host closed the connection)
20:41:15FromDiscord<Clyybber> @mratsim Absolutely sure that it isn't some quirky but documented behaviour?
20:41:20shashlickhttps://nim-lang.org/docs/io.html#reopen%2CFile%2Cstring%2CFileMode worked
20:41:27FromDiscord<Clyybber> Seems wierd that both glibc and musl have that bug
20:41:31PMunchMilerius, correct
20:41:33*luis_ joined #nim
20:42:15PMunchSomething like this: https://github.com/PMunch/nimlsp/blob/master/src/nimlsp.nim#L171-L177
20:42:57FromDiscord<Milerius> It's very nice
20:43:19FromDiscord<Milerius> And when it's valid how do you access the optional stuff ?
20:44:05PMunchOh wait, never mind, it doesn't actually cast the type..
20:44:14PMunchI thought I had implemented that, but apparently not
20:44:33*luis_ quit (Client Quit)
20:44:58*luis_ joined #nim
20:45:02PMunchMilerius, same way as normal, but x["myField"] will now return an `Option[JsonNode]` from the `options` module
20:45:27FromDiscord<Milerius> Hmm ok
20:45:29FromDiscord<Milerius> i think i understand
20:46:39PMunchBy the way, you can pass `-d:jsonSchemaDebug` to the compiler and it will show you all the things it generates
20:46:45FromDiscord<Milerius> ๐Ÿ˜ฎ
20:46:47FromDiscord<Milerius> i will check
20:47:07PMunchBe warned though, it's not meant to be super readable :P
20:47:21*luis_ quit (Remote host closed the connection)
20:47:28FromDiscord<Milerius> i'm a beginner but your module will probably make me save lot of time
20:48:04*voltist joined #nim
20:48:39PMunchWell, you've already spent some time learning how to use it :P
20:49:08PMunchIt's meant to "just work" so maybe I should add some more documentation..
20:49:20PMunchAnd possibly throw in the whenValid templates..
20:50:05FromDiscord<mratsim> @Clyybber: https://github.com/mratsim/weave/issues/56
20:50:06*ng0 quit (Changing host)
20:50:06*ng0 joined #nim
20:50:06disbotโžฅ [Glibc] Condition variable lost wakeups
20:50:56FromDiscord<mratsim> I don't assume anything at this point
20:51:06FromDiscord<mratsim> but I have math on my side
20:51:08FromDiscord<Milerius> I will show you when i will have something that i like PMunch
20:51:13FromDiscord<Milerius> for the moment still discovering it
20:51:30PMunchHmm, federico3 does the nimble directory not install dependencies when generating documentation?
20:53:34*NimBot joined #nim
20:53:34PMunchHmm, just realised that this module doesn't have any documentation besides the README..
20:54:50PMunchMilerius, you kinda jumped in the deep end when you decided to use a rather complex DSL that generates code which leverages the power of some compile-time magic and the strong type system in Nim :P
20:55:05FromDiscord<Milerius> Yeah...
20:55:09FromDiscord<Milerius> Now i'm asking my self
20:55:15FromDiscord<Milerius> how we deal properly is optional
20:55:19FromDiscord<Milerius> using isSome() each time for get
20:55:23PMunchWell..
20:55:35FromDiscord<Milerius> I would like some kind of ignore if there is no value, but use it if it's exist
20:55:57PMunchMay I reccomend https://github.com/PMunch/nim-optionsutils
20:56:06PMunch(shameless plug)
20:56:28FromDiscord<Milerius> im checking
20:56:46PMunchNow that module has proper documentation! https://nimble.directory/docs/optionsutils//optionsutils.html
20:56:57FromDiscord<Milerius> i'm on it already ๐Ÿ˜„
20:57:22FromDiscord<Milerius> Ok 'im explaining now
20:58:37FromDiscord<Milerius> I have to create a json and send it to an RPC
20:58:37FromDiscord<Milerius>
20:58:37FromDiscord<Milerius> This json have optional value, i would like to automatically add the params to the output json if they are present.
20:58:53FromDiscord<Milerius> I have to create a json and send it to an RPC
20:58:53FromDiscord<Milerius>
20:58:53FromDiscord<Milerius> This json have optional value, i would like to automatically add the params to the output json if the optional have some value
21:02:10*krux02 joined #nim
21:07:51PMunchMilerius, just pushed a version v1.1.0 of optionsutils which means you don't need to have both a `some` and a `none` case for `withSome`. It's something that's been annoying me for a while.
21:08:00*voltist quit (Read error: Connection reset by peer)
21:08:36PMunchOh and by the way, please don't edit your messages on Discord..
21:08:46PMunchThey come through as a duplicate on IRC
21:09:09PMunchA bit annoying: https://irclogs.nim-lang.org/19-12-2019.html#20:58:37
21:09:21FromDiscord<Milerius> ah i'm sorry
21:09:27PMunchNo problem
21:09:31FromDiscord<Milerius> By the way in the json schema
21:09:36FromDiscord<Milerius> how we define the root object
21:09:42PMunchRoot object?
21:09:55FromDiscord<Milerius> the first braces
21:10:00FromDiscord<Milerius> doesn't have a name, but contains object
21:10:00PMunchHuh?
21:10:12PMunchOh, var x = %{}
21:10:28FromDiscord<Milerius> I mean in the schema ?
21:10:32FromDiscord<Milerius> ok i send a gist
21:10:33FromDiscord<Milerius> minute
21:11:12FromDiscord<Milerius> https://gist.github.com/Milerius/ed710b577d1543d4edb764bdd26b02e5
21:11:24FromDiscord<Milerius> the schema is at the end
21:12:53PMunchUhm, what are you trying to do there?
21:13:19*voltist joined #nim
21:13:25FromDiscord<Milerius> Representing the schema of this json
21:13:30PMunchOh, you're trying to define the outer object, which is an object with random keys?
21:14:01FromDiscord<Milerius> my whole json is
21:14:02FromDiscord<Milerius> tables[string, CoinConfigParams]
21:14:05FromDiscord<Milerius> something like that
21:14:08PMunchThat isn't supported ("yet"). What you need to do is loop over all the keys and verify each of them
21:14:36FromDiscord<Milerius> root: Table[string, CoinConfigParams]*
21:14:45FromDiscord<Milerius> Ah ๐Ÿ˜ข
21:15:00FromDiscord<Milerius> I was expecting to read the json file and use isValid with the schema
21:16:12PMunchI mean, you could actually make that table: var ccps: Table[string, CoinConfigParams]; for key in json.keys: let obj = json[key]; whenValid(CoinConfigParams, obj): ccps[key] = obj
21:16:18PMunchSomething like that
21:17:30FromDiscord<Milerius> https://gist.github.com/Milerius/56372c2f902aa559cbfb56ecea771789 there is the final version
21:17:34FromDiscord<Milerius> that i'm trying to achieve
21:20:09FromGitter<alehander92> but PMunch i dont get it
21:20:19FromGitter<alehander92> why isnt it supposed to be imported
21:20:26FromGitter<alehander92> i think include should be rarely used
21:21:27*ng0 quit (Quit: Alexa, when is the end of world?)
21:22:14PMunchMilerius: I'd probably do something like this: http://ix.io/24Tt/nim
21:22:36PMunchalehander92, I wanted to give the user the possibility to not export all the types
21:22:43FromDiscord<Milerius> nice idea !
21:23:29PMunchOh whoops, those `"key"` is obviously meant to just be `key`
21:25:40*abm joined #nim
21:26:02clyybberkrux02: Sup krux, have you seen #12938? Somehow lengthOrd( ExampleArray ) is too big for an int64
21:26:08lqdev[m]I'm trying to `getType` on a default parameter, but it doesn't seem to work https://play.nim-lang.org/#ix=24Tw
21:26:25lqdev[m]:s/getType/getTypeInst/
21:27:34FromDiscord<Clyybber> @mratsim no comment?
21:27:38FromDiscord<Clyybber> losing sanity?
21:27:40FromDiscord<Clyybber> ๐Ÿ˜›
21:27:42FromDiscord<mratsim> yes
21:28:28lqdev[m]`getTypeInst` seems to work on normal variables, though.
21:28:35FromDiscord<mratsim> I think I'm gonna have to either switch backoff strategy or rewrite part of pthread from scratch
21:29:27lqdev[m]ah, I see, it's `Ident "t"` instead of `Sym "t"`. is there any way I can get around this?
21:30:06FromDiscord<mratsim> use typed input
21:30:15FromDiscord<mratsim> ah
21:30:22FromDiscord<mratsim> default parameter are not typed?
21:30:29FromDiscord<mratsim> you need to bindSym them then
21:30:34lqdev[m]seems like so.
21:30:35FromDiscord<mratsim> or newLit
21:30:42FromDiscord<mratsim> but should be a bug
21:31:02lqdev[m]I just read about that .experimental: "dynamicBindSym" thing, it might help
21:33:52FromDiscord<Clyybber> @mratsim What is the crazy thing in your screenshot? That en.signaled switched to 1?
21:34:00*letto quit (Quit: Konversation terminated!)
21:35:30FromDiscord<mratsim> Worker 1, is sleeping on the condition variable for a while. I have locks and full fences everywhere.
21:35:30FromDiscord<mratsim> Worker 0 signals TWICE, and also take a lock and unlock (according to the Linux condition variable ceremony I found in some posts)
21:35:30FromDiscord<mratsim> And worker 1 still doesn't wake up
21:35:59FromGitter<alehander92> PMunch so `*` for each
21:36:05FromDiscord<mratsim> And fighting against either glibc or GCC is a pain
21:36:05FromGitter<alehander92> might be easy to implement
21:36:19*gour quit (Remote host closed the connection)
21:36:33FromGitter<alehander92> but i agree that if one wants
21:36:39FromGitter<alehander92> the importsite to control the exportees
21:36:43FromGitter<alehander92> hmm it can with except
21:36:50FromGitter<alehander92> so i think this works but it needs a patch
21:36:54FromGitter<alehander92> but its not too important
21:37:07FromDiscord<Clyybber> @mratsim Might be worth it joining glibc or musl irc and asking there?
21:37:32FromDiscord<mratsim> and losing 3 days to reproduce that in pure C?
21:37:50PMunchalehander92, well that's true..
21:37:56FromDiscord<mratsim> I read and understand C but I'm not really a C dev
21:38:11FromDiscord<Clyybber> Yeah, maybe they know whats up right from the start?
21:38:28PMunchWhat happens if you have a shim module that is import somemodule except sometype; export somemodule?
21:38:35FromDiscord<Clyybber> Or they can point you to the part of musl/glibc code that explains this behaviour
21:38:37PMunchWolud that do what you expect it to?
21:40:05lqdev[m]is it possible to `bindSym` at macro instantiation time?
21:40:46FromDiscord<mratsim> want to know a compiler bug I discovered? GCC-only. THis will crash probably by stack corruption
21:40:46FromDiscord<mratsim> https://cdn.discordapp.com/attachments/371759389889003532/657336549213732894/unknown.png
21:41:08FromDiscord<Clyybber> holy fuck
21:41:25FromDiscord<mratsim> the fix is putting arena after: https://github.com/mratsim/weave/blob/master/weave/memory/memory_pools.nim#L216
21:41:48FromDiscord<mratsim> I lost an evening on that thing
21:42:02FromDiscord<Clyybber> hmm
21:42:57lqdev[m]@mratsim bindSym doesn't help, because it looks up symbols in the module it was called
21:45:02shashlick@ldev - your issue should be fixed
21:45:38lqdev[m]shashlick: the CI one from yesterday?
21:46:19PMunchWait what? Why is that a bug mratsim?
21:46:26lqdev[m]I already bumped nimterop in my nimble file about an hour ago, and it works beautifully now.
21:46:30PMunchLike what causes it?
21:46:44shashlick@lqdev - neat
21:46:48FromDiscord<Milerius> PMunch i finished my first usage
21:46:51FromDiscord<Milerius> it's work like a charm
21:46:52FromDiscord<Milerius> https://github.com/KomodoPlatform/atomicDEX-QT/blob/master/atomic_dex_desktop/src/atomic_dex_desktop/coins/coins_cfg.nim
21:46:57FromDiscord<Milerius> i'm really happy :p
21:47:40FromDiscord<mratsim> that's quite concise
21:47:53lqdev[m]think I might have to ignore non-literal default parameters for the time being :/
21:48:30PMunchMilerius, yay :)
21:48:38*ng0 joined #nim
21:48:42FromDiscord<Milerius> Thank's you for your insane help PMunch
21:48:45FromDiscord<Milerius> I appreciate a lot
21:48:47FromDiscord<Milerius> very nice community
21:49:38PMunchThanks, we try our best :)
21:50:20FromDiscord<Milerius> How we print a type in nim ?
21:50:25PMunchOr at least I do, but in general the Nim community is very friendly
21:50:25FromDiscord<Milerius> echo typeof(T) ?
21:50:29PMunchyeah
21:50:38FromDiscord<Milerius> thanks
21:50:43*Vladar quit (Quit: Leaving)
21:50:49PMunch!eval var x: int; echo x.typeof
21:50:51NimBotint
21:51:15*letto joined #nim
21:52:49FromDiscord<Clyybber> @mratsim How is it "fixed"?
21:52:51*silvernode quit (Ping timeout: 240 seconds)
21:52:57FromDiscord<Clyybber> Fixed in gcc HEAD?
21:53:03FromDiscord<mratsim> no, in my code
21:53:12FromDiscord<mratsim> my code already has the workaround
21:53:25FromDiscord<mratsim> gcc is till broken in 9.x
21:54:02FromDiscord<Clyybber> How do you work around it?
21:54:38FromDiscord<mratsim> look the difference between the screenshot and the quoted code
21:54:50FromDiscord<mratsim> pool.last = arena place was changed
21:55:07FromDiscord<Clyybber> its gone?
21:55:18FromDiscord<mratsim> yes, if you do that gcc doesn't generates faulty code
21:55:39FromDiscord<Clyybber> interesting
21:55:40FromDiscord<mratsim> believe me, I didn't want to believe it "you won't imagine what happens next"
21:56:26FromDiscord<mratsim> it also disappears if you add an "echo" in between so annoying to debug
21:56:38stefantalpalaruCould it be a bug in the "align" pragma instead?
21:56:55FromDiscord<mratsim> it doesn't happen with clang or icc
21:59:37stefantalpalaruAre you disabling GCC's default packing of your custom aligned struct with "__attribute__((__packed__))"?
21:59:49FromDiscord<mratsim> no
22:00:32FromDiscord<mratsim> I checked the assembly, not closely but gcc and clang assembly are different
22:00:58stefantalpalaruSounds like a disagreement about a struct member's offset between Nim and C. See if you can get a reproducible case in C, before blaming the C compiler.
22:01:25FromDiscord<mratsim> Clang doesn't crash and just moving the assignment out of the if section solves the issue
22:01:55stefantalpalaruThat's not encouraging.
22:02:27FromDiscord<mratsim> well since I have an easy fix I didn't investigate further
22:03:01FromDiscord<mratsim> the condition variable not signaling properly is more of an issue currently. :/
22:03:18FromDiscord<Clyybber> inb4 its all related
22:03:26FromDiscord<Clyybber> by some unholy magic
22:03:37*luis_ joined #nim
22:04:33*luis_ quit (Client Quit)
22:05:03*luis_ joined #nim
22:07:41*solitudesf quit (Ping timeout: 268 seconds)
22:08:11voltistI've chanced upon recordings of talks about Nim on YouTube, and one guy was wearing a Nim T-shirt. Is there a place online where I can buy these in a way that supports the project, or are they all unofficial?
22:08:25FromDiscord<mratsim> ping @dom96
22:08:53FromDiscord<mratsim> You can get them at Fosdem, Brussels on February 1 and 2 I guess
22:10:35voltistThat's a little far to fly from here in NZ for a T-shirt I think ;)
22:11:34FromDiscord<mratsim> I heard you could do quantum teleportations ๐Ÿ˜‰
22:12:16FromDiscord<Clyybber> ending up very confused on what or where you are
22:12:20FromDiscord<Clyybber> and when
22:12:41clyybberdisruptek: Should we worry about c-blake? https://github.com/c-blake/cligen/commit/db80691e0a0a00e63d57b3f71f544c3611a10597
22:12:48clyybberwatch the streets fellas
22:12:52*luis_ quit (Ping timeout: 248 seconds)
22:12:56disrupteklol
22:13:12voltistHmmmm
22:13:32voltistOddly specific
22:14:11disrupteki've heard it's hard out there for a pimp.
22:15:46*luis_ joined #nim
22:16:09*luis_ quit (Client Quit)
22:16:23FromDiscord<mratsim> probably gonna drive far maybe in the snow for the break
22:16:34FromGitter<dumjyl> disruptek: btw `nimph tag` crashes on projects without any tags. I was to lazy to open an issue, but made a pr to bump with info.
22:16:43voltistmratsim: Well there is this, but you can't be sure where the profit is going (or how much is going anywhere considering the nature of these online marketplaces): https://teespring.com/shop/nimlang1?pid=374&cid=100046
22:17:02disruptekdumjyl: bump or nimph?
22:17:31FromGitter<dumjyl> `nimph` crashes but the pr is to `bump`
22:17:42FromDiscord<mratsim> @voltist it certainly looks like the official one, but you would have to ping dom96 or Araq to confirm
22:17:43disruptekaha; thank you!
22:18:41voltistmratsim: will do
22:19:38disruptekdumjyl: 0.5.3
22:19:52disruptekany other issues?
22:24:25FromGitter<dumjyl> One, i'll open an issue.
22:24:57disruptekhttps://github.com/disruptek/nimph/issues/88
22:24:59disbotโžฅ arbitrary commit hash requirements broken
22:25:46*narimiran joined #nim
22:26:19disrupteki'm rewriting resolution at the moment, to make it looser for matches. i think it's more important to match something than not match, especially after we have requirement negative (deficiencies).
22:26:31disrupteks/negative/negation/
22:32:44*NimBot joined #nim
22:32:54*FromDiscord joined #nim
22:34:23FromGitter<dumjyl> Yeah, didn't see a need for it to be on nimble.
22:34:29*dom96 joined #nim
22:34:29*dom96 quit (Changing host)
22:34:29*dom96 joined #nim
22:35:26disruptekso when you just have a url, it's basically guessing the package name and stripping kebab-prefixes because they are usually like nim-foobar.
22:35:44disruptekwe can just render it more verbosely here.
22:37:26*theelous3 joined #nim
22:51:50*marmotini_ quit (Remote host closed the connection)
22:59:58*PMunch quit (Remote host closed the connection)
23:01:19*actuallybatman joined #nim
23:02:06FromGitter<deech> Tall order but anyone know of a YAML parser that works at compile time? Not worried about {de}serialization, just a parse tree.
23:02:20disrupteknot unless you can extend sealmove's.
23:02:43FromGitter<deech> Do you have a link I'm not familiar with them.
23:02:52disruptek!repo sealmove/
23:02:53disbothttps://github.com/sealmove/nimitai -- 9nimitai: 11A native binary data structure parser generator 15 8โญ 0๐Ÿด 7& 3 more...
23:02:57disruptekpart of that.
23:03:17disrupteki think he's only parsing a subset of yaml, though.
23:03:43disruptekif you find a solution, please lemme know. openapi just demands that you feed it json for this reason.
23:04:32FromGitter<deech> NimYAML seems good if you don't need it at compile time.
23:05:26*setenforce quit (Ping timeout: 265 seconds)
23:06:53*zedeus quit (Ping timeout: 265 seconds)
23:07:23FromGitter<deech> On that note is NimYAML pretty robust?
23:08:23disrupteki didn't mess with it.
23:08:46disrupteki'm just using yq for conversion.
23:10:07FromDiscord<mratsim> I feel like it has been mostly focused on serialization deserialization
23:10:32FromDiscord<mratsim> if I need to work on the node themselves I always transform them to json
23:11:37FromDiscord<mratsim> I terms of deserialization it's robust, in terms of serialization, the default output has too much tags and such and it's really hard to find the option to disable that and get a humane output
23:12:48FromDiscord<mratsim> If you want to see actual examples, check our test files that import yaml files in the nim-beacon-chain repo: https://github.com/status-im/nim-beacon-chain/search?q=yaml&unscoped_q=yaml
23:16:28FromGitter<deech> Thanks!
23:22:50*al_ joined #nim
23:23:14*al_ is now known as Guest94576
23:27:21*leorize joined #nim
23:29:40*leorize quit (*.net *.split)
23:31:27*narimiran quit (Ping timeout: 260 seconds)
23:33:24*Guest94576 quit (Quit: Guest94576)
23:33:47*voltist quit (Ping timeout: 260 seconds)
23:37:27*uvegbot joined #nim
23:37:30*zyklon quit (Quit: Konversation terminated!)
23:52:57*abm quit (Quit: Leaving)
23:53:20FromGitter<Willyboar> I think thats it for tonight. Tomorrow i will start the cli part