<< 11-02-2020 >>

00:02:05stefantalpalaruhttps://ziglang.org/documentation/master/#Import-from-C-Header-File
00:09:52leorizewe can parse C better but we still can't understand when something should be a `var` or a `ptr` or an `array` thanks to C unclear semantics
00:10:50FromDiscord<clyybber> disruptek: ping
00:13:22*rockcavera is now known as Guest29945
00:13:22*tiorock joined #nim
00:13:22*Guest29945 quit (Killed (weber.freenode.net (Nickname regained by services)))
00:13:22*tiorock is now known as rockcavera
00:18:27*NimBot joined #nim
00:24:09*u0_a121 quit (Read error: Connection reset by peer)
00:28:45*sagax quit (Remote host closed the connection)
00:31:29*Hideki_ joined #nim
00:32:41disruptekclyybber: pong
00:38:04*krux02_ joined #nim
00:40:27*krux02 quit (Ping timeout: 240 seconds)
00:43:01*krux02_ is now known as krux02
00:43:56krux02deech: today I looked into graalvm, and from the examples c++ interop looked preety cool
00:43:58*u0_a121 joined #nim
00:44:25disruptekit makes you want to use nlvm, doesn't it?
00:44:46krux02you should take a look into that. It uses c++ debug information to do the trick
00:44:57krux02basically it means you can't run without debug information anymore
00:45:13disrupteknlvm does?
00:45:31disruptekthat seems like too big a compromise.
00:45:39krux02not really saying I want to use nlvm
00:45:58krux02I didn't see the downsides of graalvm yet.
00:46:04krux02maybe some horrible licensing
00:46:25disrupteki bring it up in here all the time but it's hard to get anyone interested.
00:47:17krux02disruptek, to be honest, I am scared of nlvm
00:47:39krux02all I see is what I would loose
00:47:50krux02and that is the ``emit`` for C interop
00:47:56krux02C/C++ interop
00:48:45krux02I also see that it has potentional bugs that have been evened out in the C backend.
00:48:59disruptekthat's true.
00:49:29krux02so if you want people to use it, show some benchmarks and statistics.
00:49:37krux02show how much faster compilation is
00:49:49krux02show how much faster or slower execution
00:49:50krux02is
00:50:08disruptekit will be a target of nigel at some point. i have a couple other projects to bang out first.
00:50:20krux02nigel?
00:50:43krux02what is nigel?
00:50:58disrupteki have a nim->llvm-ir->klee setup in docker, so that'll be a similar pipe.
00:51:19disrupteknigel is the continuous integration i'm building.
00:53:26FromGitter<Varriount> disruptek: is the name inspired by anything in particular?
00:55:21FromGitter<zetashift> nim and hairgel?
00:58:06disruptekit's an old xtc tune.
00:58:07FromGitter<Varriount> Hair gel? Like... The stuff you put in your hair?
00:58:34disruptekmaking plans for nigel.
00:58:44disrupteknice primus cover, too.
00:59:56FromGitter<zetashift> yes!
01:01:12disrupteki saw them do it live but i cannot find any video, unfortunately.
01:02:38*Hideki_ quit (Remote host closed the connection)
01:02:53*Hideki_ joined #nim
01:05:37disrupteksucks.
01:12:55*u0_a121 quit (Read error: Connection reset by peer)
01:13:05dadadakrux02: the license is gplv2, that's solid
01:18:56krux02ok
01:19:14krux02but there is a community version and an eterprise version
01:19:29krux02don't know the difference, but how is that compatible with gpl?
01:19:52FromDiscord<Elegant Beef> Now more annoying "how to nim" questions, how to pass anonymous functions and storing reference to them in an object?
01:20:02FromDiscord<Elegant Beef> anonymous procs i guess
01:20:27krux02Elegant Beef: what?
01:20:56krux02you want a proc member in an object?
01:21:27krux02callback: proc(arg1: typ1, arg2: typ2)
01:21:34krux02probably with a member like that ^
01:21:40FromDiscord<Elegant Beef> ok
01:21:57FromDiscord<Elegant Beef> and does nim have inline anonymous procs?
01:22:03krux02yes
01:22:38krux02I prefer not to use them though if I don't have to.
01:23:17FromDiscord<Elegant Beef> Yea im making something that i can make system commands using my launcher in linux
01:23:24FromDiscord<Elegant Beef> so inlining or making them is fine
01:26:58*u0_a121 joined #nim
01:26:58*u0_a121 quit (Read error: Connection reset by peer)
01:28:32FromDiscord<Elegant Beef> Hmm wouldnt this `command: proc(self : Run)` be started by `referenceToObject.command()`?
01:28:52*Hideki_ quit (Remote host closed the connection)
01:29:26FromGitter<kristianmandrup> I'm working on JsGen improvements for Nim
01:29:32FromGitter<kristianmandrup> Just opened this PR - WIP - https://github.com/nim-lang/Nim/pull/13381
01:29:33disbotβž₯ Js gen improvements
01:29:46*Hideki_ joined #nim
01:33:29*u0_a121 joined #nim
01:34:02*Hideki_ quit (Ping timeout: 240 seconds)
01:45:45dadadakrux02: the copyright holder has the right to license his work under as many licenses as he/she wishes
01:47:38dadadathat's not in conflict with gplv2 as long as the conditions of gplv2 aren't broken, for distributions of the code/work that are distributed under gplv2
01:48:04dadadaif they make separate enterprise distributions that is under a different license, they can do so
01:48:14dadadabecause they hold all the copyright to the code themselves
01:48:36dadadaif somebody else had part of the copyright(s) of the code/source, they wouldn't be able to do that
01:49:05dadadathat's the advantage of keeping all the copyright to yourself, and making contributors sign copyrights over to your organization
01:49:43dadadathe good news they can't take the gplv2 license away for all code that is already licensed and distributed by it
01:50:07dadadathe only thing they could do is stop licensing future code under gplv2
01:51:52dadadaof course you can use the gplv2 distributed code for enterprise purposes
01:52:00dadadabut then you'll not get support by oracle
01:52:40dadadanot the commercial support
01:53:22dadadaQt has had the same license model for a long time
01:53:51dadadagpl for those that can live without commercial support
01:54:01dadadaproprietary for those that need commercial support
01:54:40dadadaof course you can still get commercial support for the gpl distribution
01:54:49dadadabut you need to get it from a 3rd party company
02:00:16*u0_a121 quit (Read error: Connection reset by peer)
02:03:38*Hideki_ joined #nim
02:15:09*sagax joined #nim
02:15:44*Hideki_ quit (Remote host closed the connection)
02:16:00*Hideki_ joined #nim
02:18:44FromGitter<kristianmandrup> what is "truthy" in Nim?
02:19:28*ptdel joined #nim
02:21:37disruptektrue
02:22:19FromGitter<kristianmandrup> hmm
02:23:39*chemist69 quit (Ping timeout: 272 seconds)
02:24:15FromGitter<kristianmandrup> How can I improve this?
02:24:20FromGitter<kristianmandrup> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5e421054b612cc7bb15ca59c]
02:24:55*dadada quit (Ping timeout: 272 seconds)
02:25:04FromGitter<kristianmandrup> I guess I should instead iterate through the three markers and use find for the first that matches for `useSection`, then only call `getSection` for that one
02:25:06TangerMaybe have useSection return a string to use in a case?
02:25:18*chemist69 joined #nim
02:25:23FromGitter<kristianmandrup> yeah, that could also work
02:26:00rayman22201use an enum instead of a string, then you get completeness checking from the compiler.
02:26:26FromGitter<kristianmandrup> I can pass a proc to `find`, right?
02:28:02FromGitter<kristianmandrup> hmm, how to iterate and return first match efficiently in Nim?
02:29:16TangerWouldn't find[T, S] do the trick? Returns the index of the first match
02:29:23*u0_a121 joined #nim
02:29:23*u0_a121 quit (Write error: Connection reset by peer)
02:29:26TangerMight just need to roll your own `==`
02:31:43FromGitter<kristianmandrup> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5e42120ed4daaa26c196a16b]
02:32:05FromGitter<kristianmandrup> Feels like good'ol BASIC :P
02:32:19rayman22201just throw a break after the `result =`
02:33:30TangerMaybe make it an iterator?
02:33:38*paper_ quit (Ping timeout: 245 seconds)
02:33:42Tangerand yield the marker at the end
02:34:01*theelous3_ joined #nim
02:34:01*theelous3 joined #nim
02:34:14*paper_ joined #nim
02:38:18rayman22201why? There is nothing to gain from making it an iterator.
02:43:33*Hideki_ quit (Remote host closed the connection)
02:44:18*Hideki_ joined #nim
02:45:11*u0_a121 joined #nim
02:45:12*u0_a121 quit (Read error: Connection reset by peer)
02:48:53rayman22201I would again like to point out that enums may be better for this case: https://nim-lang.org/docs/manual.html#types-enumeration-types
02:49:11rayman22201`find` would pretty much work how you expect out of the box
02:49:12*Hideki_ quit (Ping timeout: 265 seconds)
02:49:34rayman22201and you would also get to use `case` statements which have exhaustiveness checking: https://nim-lang.org/docs/manual.html#statements-and-expressions-case-statement
02:50:06rayman22201to help you prevent yourself from shooting yourself in the foot
02:51:19*Hideki_ joined #nim
02:52:35*Hideki_ quit (Remote host closed the connection)
02:53:47*Hideki_ joined #nim
02:55:34*Hideki_ quit (Remote host closed the connection)
02:55:49*Hideki_ joined #nim
02:57:08*Hideki_ quit (Remote host closed the connection)
02:57:52*rockcavera quit (Remote host closed the connection)
02:58:23*Hideki_ joined #nim
02:58:45*endragor joined #nim
02:59:56*endragor quit (Remote host closed the connection)
03:03:03*Hideki_ quit (Ping timeout: 260 seconds)
03:09:21FromDiscord<Elegant Beef> <https://github.com/beef331/nim_rofi>
03:09:21FromDiscord<Elegant Beef> Araq be merry I converted it to the camelcased functions and it hurts πŸ˜„
03:09:31FromDiscord<Elegant Beef> Mostly just throwing it on github for future me
03:10:05*Hideki_ joined #nim
03:11:11*Hideki_ quit (Remote host closed the connection)
03:12:12*letto_ quit (Remote host closed the connection)
03:12:35*letto_ joined #nim
03:15:03*leorize quit (Ping timeout: 240 seconds)
03:15:23*opal quit (Ping timeout: 240 seconds)
03:21:05*u0_a121 joined #nim
03:23:49*oculux quit (Ping timeout: 272 seconds)
03:25:07FromGitter<Varriount> These days I don't care too much about styling as long as it's consistent
03:25:44*Hideki_ joined #nim
03:26:52FromGitter<Varriount> I prefer lowercase underscores (or dashes, if supported) though, as it rules out the "acronym" ambiguity.
03:27:27FromGitter<Varriount> Is it IPAddress, or IpAddress?
03:27:46*Hideki_ quit (Remote host closed the connection)
03:28:01*Hideki_ joined #nim
03:30:09*muffindrake quit (Ping timeout: 272 seconds)
03:33:15*muffindrake joined #nim
03:33:59FromGitter<kaushalmodi> IpAddress .. I remember reading it somewhere.. maybe the NEP II doc
03:34:40FromGitter<kaushalmodi> *Nep1
03:35:35FromGitter<kaushalmodi> >
03:35:45FromGitter<kaushalmodi> > In the age of HTTP, HTML, FTP, TCP, IP, UTF, WWW it is foolish to pretend these are somewhat special words requiring all uppercase. Instead treat them as what they are: Real words. So it's parseUrl rather than parseURL, checkHttpHeader instead of checkHTTPHeader etc.
03:35:59FromGitter<kaushalmodi> https://nim-lang.org/docs/nep1.html
03:40:07FromDiscord<Elegant Beef> Probably like people that prononce GUI as gooey
03:40:12FromDiscord<Elegant Beef> Inhuman is what it is πŸ˜›
03:43:27*u0_a121 quit (Ping timeout: 272 seconds)
03:45:16*Hideki_ quit (Remote host closed the connection)
03:51:37*opal joined #nim
03:54:10*oculux joined #nim
04:04:53*actuallybatman joined #nim
04:05:34*letto_ quit (Quit: Konversation terminated!)
04:07:46*letto joined #nim
04:14:49*letto quit (Remote host closed the connection)
04:15:14*letto joined #nim
04:15:14FromDiscord<Skaruts> How is it that when I'm printing out an object's table field, which is declared as `signals:Table[string, Callback]`, I'm getting `(data: @[], counter: 0)` instead of `{:}`?
04:15:31FromDiscord<Skaruts> (Callback is simply a `proc()`)
04:16:41FromDiscord<Skaruts> when I print a table in my simple tests I get the latter, but in my project I get the former
04:17:53*Hideki_ joined #nim
04:18:09*Ckat quit (Quit: this shouldn't be happening)
04:18:34*Ckat joined #nim
04:21:40FromDiscord<Skaruts> and when I add one entry to the table, that sequence there get filled with a bajillion things like `(hcode: 0, key: "", val: ...)` before the actual entry
04:21:55FromDiscord<Rika> are you printing repr?
04:22:04FromDiscord<Skaruts> just echo
04:22:28FromDiscord<Rika> does Callback have a $
04:22:35FromDiscord<Skaruts> no
04:23:12FromDiscord<Skaruts> hmm, yea there's two differences between my test and my project, that's one, the other is the table in the test isn't a field of any object
04:23:29FromDiscord<Rika> Seems like repr is being called somehow
04:24:47FromDiscord<Rika> Also, a bare proc() doesn't have a $ proc
04:26:59*u0_a121 joined #nim
04:27:38*oculux quit (Ping timeout: 240 seconds)
04:28:14*Ckat quit (Quit: this shouldn't be happening)
04:28:50FromDiscord<Skaruts> hmm, that may be it. In my test I'm not even being able to echo it, it's complaining that `$` doesn't know any Callback type
04:29:01FromDiscord<Skaruts> so my project must be calling repr instead
04:29:14*Ckat joined #nim
04:30:39FromDiscord<Skaruts> is it normal though, that a table gets all that stuff in it when you add an entry? Because if it is then it makes no difference to me, since I already seen that it's otherwise working as intended
04:30:47*Hideki_ quit (Ping timeout: 260 seconds)
04:31:01*oculux joined #nim
04:32:51*lritter quit (Ping timeout: 272 seconds)
04:32:57*lritter_ joined #nim
04:39:23*nsf joined #nim
04:40:29FromDiscord<Skaruts> well, seems like it must be normal, as iterating in a for loop matches the amount of entries
04:44:04*ptdel quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
04:44:40*leorize joined #nim
04:49:19*u0_a121 quit (Read error: Connection reset by peer)
04:54:27*krux02 quit (Remote host closed the connection)
04:55:13*u0_a121 joined #nim
04:57:18*u0_a121 quit (Read error: Connection reset by peer)
04:57:36*u0_a121 joined #nim
05:01:14*hax-scramper quit (Ping timeout: 240 seconds)
05:01:31*hax-scramper joined #nim
05:01:43*livcd quit (Ping timeout: 260 seconds)
05:02:03*livcd joined #nim
05:02:29*Zectbumo joined #nim
05:05:55*theelous3_ quit (Read error: Connection reset by peer)
05:05:55*theelous3 quit (Read error: Connection reset by peer)
05:13:08*u0_a121 quit (Read error: Connection reset by peer)
05:18:51*vesper quit (Ping timeout: 240 seconds)
05:23:30*vesper11 joined #nim
05:24:42*u0_a121 joined #nim
05:26:45*u0_a121 quit (Read error: Connection reset by peer)
05:30:40*u0_a121 joined #nim
05:33:01*u0_a121 quit (Read error: Connection reset by peer)
05:35:11*oculux quit (Ping timeout: 260 seconds)
05:42:11*narimiran joined #nim
05:49:33*Hideki_ joined #nim
05:50:50*dddddd quit (Ping timeout: 240 seconds)
05:52:15*hax-scramper quit (Read error: Connection reset by peer)
05:52:26*hax-scramper joined #nim
05:57:50*marmotini_ joined #nim
06:11:49*marmotini_ quit (Remote host closed the connection)
06:12:24*marmotini_ joined #nim
06:13:26*tefter quit (Quit: WeeChat 2.7)
06:17:02*marmotini_ quit (Ping timeout: 265 seconds)
06:25:55*marmotini_ joined #nim
06:32:07*tefter joined #nim
06:44:27*zyklon quit (Ping timeout: 240 seconds)
06:46:54*livcd quit (Changing host)
06:46:54*livcd joined #nim
06:48:35Zevvhey disruptek, you want to know a funny coincedence
06:51:03Zevvthe albums "Crush" by "Floating Points" is #1 on my 2019 new cool music list. And here you are, getting crushed by floating points!
06:51:08ZevvHow cool is that
06:56:46*Hideki_ quit (Remote host closed the connection)
06:58:19*Hideki_ joined #nim
06:58:58FromGitter<gogolxdong> Error: invocation of external compiler program failed. Cannot allocate memory 12 compiled with --gc:arc on centos7
07:00:18FromGitter<gogolxdong> It's fine with WSL ubuntu 18.04, as far as I tried.
07:01:07*oculux joined #nim
07:01:18*zyklon joined #nim
07:02:57*Hideki_ quit (Ping timeout: 272 seconds)
07:07:08FromGitter<gogolxdong> ah, out of memory , 2GB in total, compiled on 4GB is fine.
07:08:01FromGitter<gogolxdong> Does --gc:regions still work as before or move to --gc:arc now?
07:10:33*lritter_ quit (Quit: Leaving)
07:11:12*Hideki_ joined #nim
07:27:36*Hideki_ quit (Remote host closed the connection)
07:38:51*SunDwarf quit (Ping timeout: 260 seconds)
07:40:22Zevvregions is still there, and arc is not yet bug free
07:42:42*SunDwarf joined #nim
07:51:59*Vladar joined #nim
07:52:15*solitudesf joined #nim
07:56:07FromGitter<gogolxdong> ok, thanks.
07:57:19livcdgogolxdong are you okay?
07:57:23livcdYou are in Shenzhen right?
07:59:39FromGitter<gogolxdong> yes, I'm ok, will return to work next week :)
08:00:00*gmpreussner quit (Quit: kthxbye)
08:03:11*marmotini_ quit (Remote host closed the connection)
08:05:06*gmpreussner joined #nim
08:05:08*ng0_ joined #nim
08:06:16*fanta1 joined #nim
08:08:24*ng0 quit (Ping timeout: 268 seconds)
08:13:25*Hideki_ joined #nim
08:14:00*oculux quit (Ping timeout: 265 seconds)
08:15:28*marmotini_ joined #nim
08:16:05*dadada joined #nim
08:16:28*dadada is now known as Guest1936
08:20:11*Ven`` joined #nim
08:26:33*Hideki_ quit (Ping timeout: 272 seconds)
08:27:08*Guest1936 is now known as dadada
08:37:04livcdgood luck!
08:54:55FromGitter<Varriount> @kaushalmodi That's all well and good, but I don't use Nim at work
08:57:45*marmotini_ quit (Remote host closed the connection)
09:01:33*Hideki_ joined #nim
09:03:06dadadado you know of any standard for describing APIs across languages/platforms?
09:03:18dadadato me it looks like there's none
09:03:37vegaivice versa, there are too many
09:03:49vegaior perhaps I didn't understand your question
09:03:52*marmotini_ joined #nim
09:03:52vegaibut let's say, GRPC?
09:05:05dadadaI mean there are different multiple different tools for creating API/documentation for each language (C++, Java, Nim, etc.)
09:05:34dadadaand almost every project that has an API represents its API differently to the user browsing documentation
09:05:56dadadado you know the program zeal?=
09:06:14dadadait has so called docsets for a multitude of languages/APIs
09:06:55dadadabut even in zeal there's no unified look/database/standard for all the represented APIs
09:07:29*floppydh joined #nim
09:07:53dadadaif there was a unified data representation for components of APIs that you could generate for all languages/libraries/projects
09:08:03dadadayou could all put them into one unified API browser
09:08:12dadadawith one unified layout
09:11:38*Pqzcih5 joined #nim
09:11:59dadadathere's a docset for nim that you can use in zeal bw
09:12:00dadadabtw
09:12:10*fanta1 quit (Quit: fanta1)
09:25:02FromGitter<kdheepak> I've requested support for nimlsp in neovim's built in LSP implementation. You can see the issue here: https://github.com/neovim/nvim-lsp/pull/122
09:25:03disbotβž₯ Add nimls
09:42:45*solitudesf quit (Ping timeout: 246 seconds)
09:44:13*marmotini_ quit (Remote host closed the connection)
09:44:49*marmotini_ joined #nim
09:49:42*marmotini_ quit (Ping timeout: 265 seconds)
09:49:59FromDiscord<clyybber> kdheepak: Nice, theres also https://github.com/alaviss/nim.nvim/
09:50:01*solitudesf joined #nim
10:02:05FromDiscord<clyybber> krux02: Why cant isUnion be implemented as a macro?
10:03:49FromDiscord<clyybber> Like getTypeImpl and then check for the union pragma
10:03:59*Hideki_ quit (Ping timeout: 260 seconds)
10:11:29FromDiscord<exelotl> Would be nice if there was something like distinct but it doesn't lose all existing fields and procedures, just means that any new ones for this type can't be used for other aliases of the same type
10:13:20FromDiscord<clyybber> @exelotl You can do that
10:13:27FromDiscord<clyybber> Just define your distinct
10:13:33FromDiscord<clyybber> and write a {.borrow.}
10:15:46*fanta1 joined #nim
10:15:52FromDiscord<exelotl> :o
10:18:15FromGitter<Varriount> dadada: Swagger
10:18:31FromDiscord<exelotl> Oh right, but then I need to explicitly borrow every operation I want to preserve
10:19:53FromGitter<Varriount> exelotl: Could you use an object with one field plus a converter?
10:21:24FromDiscord<exelotl> Not really cause the variable comes from C, I need to import it as an integer-compatible type
10:23:03FromDiscord<exelotl> (it's an io register and I want to define custom getters/setters for it but also still be able to use the whole bitops library with it)
10:25:56FromDiscord<Rika> @exelotl you can just do `type SomeType = distinct int {.borrow.}` and it does all procs int has
10:26:45FromDiscord<Rika> wrong order
10:26:46FromDiscord<Rika> lol
10:27:05FromDiscord<Rika> pragma order is an issue with me for some reason
10:27:20FromDiscord<Rika> i think its `type ST {.borrow.} = distinct int`
10:28:15FromDiscord<exelotl> The manual doesn't mention this :(
10:28:58*fanta1 quit (Quit: fanta1)
10:29:10FromDiscord<exelotl> It just says you can attach borrow to the type to inherit the `.` operator
10:29:30FromDiscord<Rika> i dont remember where i saw it, i think nim in action mentioned it
10:29:49FromDiscord<Rika> better test it on playground too, i might be wrong
10:31:15FromDiscord<exelotl> I'll give it a try when I can, on my phone rn
10:31:26FromDiscord<Rika> ill test it for you then
10:32:21FromDiscord<Rika> doesnt work
10:32:28FromDiscord<Rika> i dont remember where i saw this then...
10:32:35FromDiscord<Rika> not the nim by example one
10:35:05FromGitter<gogolxdong> Does anyone know what happened `upstream prematurely closed connection while reading response header from upstream` from nginx log?
10:35:19FromGitter<gogolxdong> with asynchttpserver
10:36:48FromDiscord<Rika> @exelotl seems like you need to borrow all procs, maybe someone can write a macro to make something which does that
10:38:03FromDiscord<exelotl> rip :'(
10:38:20*krux02 joined #nim
10:38:40FromDiscord<exelotl> Attaching borrow to the type does feel like it *should* be a thing though
10:41:42FromDiscord<clyybber> oh, I thought it would borrow everything
10:42:58FromDiscord<exelotl> I'll make a feature request for it
10:44:20FromDiscord<clyybber> @exelotl There was https://github.com/nim-lang/Nim/pull/3494
10:44:21disbotβž₯ Borrow all: type some {.borrow.} = distinct other
10:49:44Araqyeah and all it had to do was to butcher overload resolution
10:49:50Araqgreat stuff :P
10:56:04FromGitter<gogolxdong> asynchttpserver used to work but got empty body now.
10:58:41Araqgogolxdong: it's a regression, fix is in the works
11:00:23FromGitter<gogolxdong> ah ,ok will released 1.0.4 work?
11:00:34FromGitter<gogolxdong> I'm on devel
11:00:53FromGitter<kristianmandrup> @timotheecour Thanks for your comments. Not sure how to add such an extra option and then add it to a config option that is accessible from on `PProc` that is passed around
11:01:51Araq1.0.x is fine
11:08:25FromGitter<gogolxdong> checked out to 1.0.6 , get `Error: system module needs: nimBorrowCurrentException`
11:10:15Araqyou need to use build.sh
11:11:09FromGitter<gogolxdong> ci/build.sh ?
11:14:33lqdev[m]no, just build.sh
11:14:50lqdev[m]in the root dir
11:15:56lqdev[m]oh wait, it's called build_all.sh
11:16:10FromGitter<gogolxdong> I'm using build_all.sh
11:17:10Araqhttps://nim-lang.org/download/nim-1.0.6.tar.xz
11:17:18AraqFor the source distribution, open a new terminal window, cd into the extracted directory, and execute the following commands:
11:17:18Araqsh build.sh
11:17:18Araqbin/nim c koch
11:17:19Araq./koch tools
11:19:04*abm joined #nim
11:20:27Araqhttps://doc.rust-lang.org/nomicon/exception-safety.html lol, now that worked out well
11:20:38FromGitter<gogolxdong> I'm using csource/build.sh then build_all.sh
11:20:52Araqso Rust doesn't have exceptions yet it has all the same complexities
11:22:44Araqgogolxdong: follow my instructions please
11:22:49Araqand don't do anything else
11:23:25Araqyou can also follow a different path but then don't complain it doesn't work
11:23:29Araq;-)
11:29:26*solitudesf quit (Ping timeout: 268 seconds)
11:48:50*nsf quit (Quit: WeeChat 2.7)
12:10:19*marmotini_ joined #nim
12:10:23*marmotini_ quit (Remote host closed the connection)
12:11:03*marmotini_ joined #nim
12:12:50*marmotini_ quit (Remote host closed the connection)
12:12:56*oculux joined #nim
12:13:24*marmotini_ joined #nim
12:13:30*marmotini_ quit (Remote host closed the connection)
12:13:44*marmotini_ joined #nim
12:20:51FromGitter<alehander92> disruptek i really liked this song
12:21:24FromGitter<alehander92> Araq but they are used "exceptionally" :P
12:25:10*fanta1 joined #nim
12:37:09*Zectbumo quit (Remote host closed the connection)
12:45:52*rockcavera joined #nim
12:49:24*opal quit (Remote host closed the connection)
12:49:38*opal joined #nim
12:54:07*tarragon joined #nim
12:54:41tarragonhello how I can iterate through all the keys/values of a json object?
12:56:10*solitudesf joined #nim
12:57:17Zevvfor k, v in o:
13:01:15*Pqzcih5 quit (Remote host closed the connection)
13:05:04*Hideki_ joined #nim
13:07:46tarragonI dont really see it : https://play.nim-lang.org/#ix=2boP
13:09:43Zevvyour top level json nod is not an object but an array
13:10:13Zevvyou can iterate that but with only one variable in your for loop.
13:10:18ZevvThe error message is not helpful, I admit
13:10:29Zevvwhat happens if you do a for is that Nim implicitly invokes an iterator on your subject
13:10:39Zevvfor 1 variable its 'items', for 2 variables its 'pairs'
13:11:10tarragonI need go through all the values (dont know the structure of the json) then work with that value
13:11:12tarragonhow do i do this?
13:11:20*Hideki_ quit (Remote host closed the connection)
13:12:02Zevvyou need to check the kind, and then iterate properly. Let me dump an example
13:14:51tarragonthanks i am a bit lost about this
13:15:01Zevvhttps://play.nim-lang.org/#ix=2boW
13:15:06Zevvnp
13:15:15*nsf joined #nim
13:15:53tarragonthat looks complex how do I learn how you did it ?
13:17:50FromDiscord<Rika> basically JsonNodes have a `kind` field
13:18:11FromDiscord<Rika> which is an enum of some sort; has something like JInt and JString and JArray and JObject or so
13:18:34FromDiscord<Rika> you handle JObject in the 1st case, JArray in the 2nd case
13:19:00FromDiscord<Rika> if it's an object (has keys and values), then use the pairs iterator
13:19:18FromDiscord<Rika> if it's an array (only values), then use the items iterator
13:20:07tarragonWhat is that $n ?
13:20:10tarragonecho $n
13:20:28FromDiscord<Rika> stringify
13:20:35FromDiscord<Rika> make n into a string
13:20:41FromDiscord<Rika> then print (echo)
13:20:55FromDiscord<Rika> well, since you dont know that, maybe look into the nim manua
13:21:03FromDiscord<Rika> l
13:21:21Zevvhttps://github.com/nim-lang/Nim/pull/13389
13:21:22disbotβž₯ Improved assertion error messages on usage of JsonNode iterators on wrong kinds.
13:21:50tarragonI get the same result if I omit the $ symbol
13:21:55FromDiscord<Rika> nice, we should strive for error messages better than rustc's
13:22:18FromDiscord<Rika> tarragon, because echo implicitly calls that $ proc for every argument
13:22:47tarragonso I dont need it or do I need it ?
13:23:06FromDiscord<Rika> you dont, but it's allowed if you explicitly want it
13:24:22tarragonThanks!
13:24:27tarragonsorry i am still experimenting
13:24:32FromDiscord<Rika> it's fine
13:24:40FromDiscord<Rika> still recommend reading some sort of tutorial though
13:24:41*Ven`` quit (Quit: Textual IRC Client: www.textualapp.com)
13:25:10FromDiscord<Rika> the nim manual, nim by example, scripter's notes, nim in action, rosetta code (not really a tutorial), whichever works for you
13:26:24tarragonI read it but there's a lot of things that I forgot or cant remember while doing it
13:27:05tarragonI want to do something like if $n.startsWith(re"http:"): but I am getting type mismatch as it's JsonNode
13:27:41FromDiscord<Rika> do ($n).startsWith....
13:28:55tarragonhmm thanks
13:29:00tarragonone more confusing thing :/
13:30:04FromDiscord<Rika> not really, $ binds strongly (i think this is the right terminology)
13:30:33FromDiscord<Rika> which means $x.y.z(a, b, c) partially resolves to $(x.y.z(a, b, c))
13:31:10lqdev[m]it's a matter of precedence, prefix $ binds strong**er** than infix . and (
13:33:20FromDiscord<Rika> afaik only $ binds stronger than usual, am i correct?
13:33:34FromDiscord<Rika> you can also just do n.`$`.startsWith...
13:51:05*abm quit (Quit: Leaving)
14:01:10tarragonThanks a lot everyone!
14:07:44*Hideki_ joined #nim
14:12:21*Hideki_ quit (Ping timeout: 272 seconds)
14:13:25*Hideki_ joined #nim
14:16:33*dadada quit (Ping timeout: 268 seconds)
14:20:30lqdev[m]@Rika, no, all operators except `@` bind stronger than infix
14:20:48lqdev[m]I mean
14:21:00lqdev[m]primarySuffix
14:21:16lqdev[m]here: https://nim-lang.org/docs/manual.html#syntax-precedence
14:21:25FromDiscord<Rika> i see
14:21:27*Hideki_ quit (Remote host closed the connection)
14:25:33*Hideki_ joined #nim
14:26:26*hax-scramper quit (Ping timeout: 240 seconds)
14:26:41FromDiscord<Rika> i'd like to see more input on this since ar_q and i have differing opinions https://github.com/nim-lang/Nim/pull/13371
14:26:41disbotβž₯ allow conversion of ints to enums in json
14:27:01*hax-scramper joined #nim
14:27:13lqdev[m]how do you send/receive data from a unix socket using the `net` module? I have `socket.connectUnix("file"); socket.send(text); echo socket.recvLine()`, but both the server *and* the client don't seem to receive any data
14:27:51lqdev[m]both sockets were created using `newSocket(AF_UNIX, SOCK_STREAM, IPPROTO_ICMP)`
14:28:15*tarragon quit (Remote host closed the connection)
14:29:18*Hideki_ quit (Remote host closed the connection)
14:29:32*Hideki_ joined #nim
14:29:34*Hideki_ quit (Remote host closed the connection)
14:30:07*Hideki_ joined #nim
14:33:39lqdev[m]disruptek_'s swayipc uses IPPROTO_IP, hmm
14:34:06lqdev[m]but that doesn't seem to change anything
14:35:03*Hideki_ quit (Ping timeout: 268 seconds)
14:40:45*nsf quit (Quit: WeeChat 2.7)
14:45:17*dddddd joined #nim
14:54:52*leorize[m] joined #nim
14:54:52leorize[m]icmp?
14:56:39leorize[m]hmm that parameter is actually ignored
15:05:13*Hideki_ joined #nim
15:10:19*dadada joined #nim
15:10:42*dadada is now known as Guest90713
15:11:29*Guest90713 is now known as dadada
15:16:13FromGitter<iffy> I'm trying to put some `await`s in a template to be used with `{.async.}` procs, but I'm getting `Error: Await only available within .async` Any way around this?
15:21:03disruptekhearts and minds!
15:21:47disrupteklqdev: my thing works, just copy it.
15:22:15disruptekrika: what does that enum<->json code do with strings? enum string values?
15:24:07disruptekZevv: har har
15:24:17*natrys joined #nim
15:25:46dadadaI'm sure you guys are aware of https://github.com/Nuitka/Nuitka , which compiles python code to C, it's not a transplicer, it's compiler that targets C similarly to nim
15:26:31FromDiscord<Rika> disruptek: what do you mean?
15:26:51FromDiscord<Rika> it only does it one way, int or string -> enum, not vice versa
15:26:55*Hideki_ quit (Ping timeout: 260 seconds)
15:26:58FromDiscord<Rika> iffy, got some code?
15:28:03nisstyredadada: seems neat
15:28:37dadadait's far from optimized, given that most python code doesn't use annotated types, I wonder how far optimization will come with this project eventually, currently it's producing giant binary blobs, it's definitely not suitable for embedded systems like nim is
15:28:51FromDiscord<Rika> neat
15:29:03nisstyredadada: PyPy uses something called RPython maybe they can leverage that
15:29:12dadadaif you're interested you can follow the blog/website https://nuitka.net/
15:29:19nisstyreit's basically a subset of Python that can be more easily statically analyzed and compiled
15:30:05dadadanisstyre: I think they don't need that, they have a different strategy, they implemented the compiler in python, and it support all of python 3.8
15:30:16dadadasupports
15:30:49dadadawhere Kay Hayen is they who has stemmed 99% of this project alone
15:30:52FromDiscord<Rika> it supports reflection??
15:31:20nisstyreit's a massive task to work on alone
15:31:23nisstyrehe must be retired
15:31:41dadadano, he is a coding veteran, there's speech on youtube, impressive guy
15:31:45dadadaa speech
15:31:54dadadaolder guy
15:33:13dadadas/stemmed/built
15:33:50FromGitter<iffy> Rika: http://ix.io/2bpF
15:35:45dadadaRika: yes it should support reflection, it's intentionally designed to support everything that CPython does
15:35:55dadadaif not, it's considered a bug
15:36:50*natrys quit (Quit: natrys)
15:37:21*natrys joined #nim
15:38:56FromDiscord<Rika> thats cool as heck
15:39:06dadadaI agree on that
15:39:20FromDiscord<Rika> iffy: templates cannot contain await
15:39:36FromDiscord<Rika> make it an async inline proc
15:48:25FromGitter<iffy> okay
16:05:04FromGitter<alehander92> yess @iffy i have a
16:05:06FromGitter<alehander92> PR
16:05:11FromGitter<alehander92> for await in templates/macros
16:05:14FromGitter<alehander92> but its not fully finished
16:06:04FromGitter<alehander92> https://github.com/nim-lang/Nim/pull/12085
16:06:06disbotβž₯ Make await a template
16:06:13FromGitter<alehander92> i use a version of it in my local projects
16:06:27FromGitter<alehander92> but i think i did have some strange type errors initially
16:06:44FromGitter<alehander92> its mostly based on yglukhov's similar code from chronos iirc
16:07:37FromGitter<alehander92> dadada i asked him on email (the nuitka guy) and i had an email from him, a huge email with great detail
16:07:44FromGitter<alehander92> asked him something*
16:07:58FromGitter<alehander92> so it seems as a very welcoming project
16:18:23*dadada quit (Ping timeout: 272 seconds)
16:44:01*nsf joined #nim
16:44:44FromDiscord<Rika> isnt await a template
16:45:21Yardanicoit's about using "await" itself in a template/macro (in result)
16:46:15FromDiscord<Rika> yeah the name is misleading
16:46:39*floppydh quit (Quit: WeeChat 2.7)
16:46:41Yardanicowell it's not, the PR makes "await" a template :P
16:47:06FromGitter<bajro17> https://github.com/the-benchmarker/web-frameworks
16:47:12FromGitter<bajro17> I look at this repo
16:47:22FromGitter<bajro17> and I think you people make beast :D
16:47:26FromGitter<bajro17> congrats
16:47:47FromDiscord<Rika> yardanico, then you're misleading
16:48:04Yardanicoi'm not :P it's for about making "await" available in templates as well
16:48:13FromDiscord<clyybber> disruptek: whats cracking?
16:49:55*fanta1 quit (Quit: fanta1)
16:50:39FromDiscord<Rika> no you are, you didnt answer my question directly implying that i was right no?
16:50:43*hax-scramper quit (Ping timeout: 268 seconds)
16:51:34*hax-scramper joined #nim
17:10:13disrupteknothing new here, but so little is written on this dumpster fire: https://wiki.alopex.li/LetsBeRealAboutDependencies
17:10:32*NimBot joined #nim
17:15:02*ptdel joined #nim
17:16:15*ptdel quit (Remote host closed the connection)
17:17:47*ptdel joined #nim
17:27:43*opal quit (Ping timeout: 240 seconds)
17:30:48*opal joined #nim
17:35:29FromDiscord<clyybber> didn't work on it anymore
17:35:47FromDiscord<clyybber> translation of the tricky parts is missing
17:35:50FromDiscord<clyybber> like casts
17:35:56FromDiscord<clyybber> and shifts
17:36:14FromDiscord<clyybber> I think I'm gonna git init here, so that we can revert if we fuck up
17:36:54disruptekwhat do you mean by "here"?
17:37:02FromDiscord<clyybber> now
17:37:16FromDiscord<clyybber> space and time, always get that mixed up
17:37:32disruptekyes, but it doesn't help.
17:37:40disruptekare you talking about my repo or yours?
17:37:46FromDiscord<clyybber> mine
17:38:30disruptekbazel cannot seem to build ryu tests for me; benchmarks are fine.
17:38:40FromDiscord<clyybber> hmm
17:38:44FromDiscord<clyybber> I managed without bazel
17:38:47FromDiscord<clyybber> cd into ryu
17:38:50FromDiscord<clyybber> and then make test
17:39:09disrupteki guess, sure.
17:41:09disruptekso i guess 2^-23 is actually correct.
17:43:31disruptekwe have an off-by-2 error in there somewhere.
17:45:41FromDiscord<clyybber> Hmm
17:45:59FromDiscord<clyybber> should we really translate C casts to conversions?
17:46:05FromGitter<patrkris> Hi everyone! Is there a way to force `nimble` to use color output?
17:46:12FromDiscord<clyybber> maybe the error is hidden somewhere there?
17:49:26disruptekit's k and j.
17:50:25disrupteki think i added this debug, but anyway, like ~240 in my branch.
17:51:09disruptekwe dump q/i/k/j. k and j are +2 and shouldn't be.
17:52:08FromDiscord<clyybber> what happens if you just -2 them?
17:56:21disruptekfixed it in pow5bits.
17:56:56FromDiscord<clyybber> does it work?
17:57:18disruptekcloser. πŸ˜‰
17:58:22disruptekptal
17:58:30FromDiscord<clyybber> aight
17:59:24FromDiscord<clyybber> whooooo
17:59:30FromDiscord<clyybber> its almost completely working
17:59:32FromDiscord<clyybber> NICE!
18:01:30*dadada joined #nim
18:01:38disruptekoh, it's just length.
18:01:43disruptekwe really need to solve that properly.
18:01:53*dadada is now known as Guest14481
18:02:21*Guest14481 is now known as dadaa
18:02:23*dadaa is now known as dadada
18:03:10disruptekso everything works if i give it enough space. how to determine how much it needs in advance?
18:03:29FromDiscord<clyybber> impossible I think
18:03:36FromDiscord<clyybber> just give it 16
18:03:41FromDiscord<clyybber> and then cut later
18:04:53disruptekwe start at the back, so we can just grow it whenever we need to; one and done, right?
18:06:06disruptekthe sign, the period, the exponent, the `E`... what else could we possibly need?
18:10:22FromDiscord<clyybber> eh
18:10:30FromDiscord<clyybber> C operator precedence really sucks
18:10:39disrupteki don't want to have to strip the result, ya feel me?
18:12:02FromDiscord<clyybber> I feel ya
18:12:12FromDiscord<clyybber> but I don't think we can not do it
18:14:06disruptekmaybe we build a cstring; then we don't have to strip it per se -- we just copy it. a little faster.
18:15:55FromDiscord<clyybber> hmm
18:15:58FromDiscord<clyybber> could be
18:16:14disrupteki think that's the most elegant solution so far.
18:17:54Zevvoi you guys got it working, sweet!
18:18:37disruptekclyybber made me consult the c and that made it trivial.
18:18:59disruptekwhat's the "right" way to alloc a cstring of specific len?
18:19:15disrupteki am just using alloc0 (it needs to be comprised of nulls) but...
18:20:04*natrys quit (Quit: natrys)
18:23:18FromDiscord<clyybber> it shouldn't be needed
18:23:29FromDiscord<clyybber> alloc() no zero should do
18:23:34FromDiscord<clyybber> malloc doesn't initialize either
18:23:37FromDiscord<clyybber> or is not required to
18:23:49disruptekbut i need to initialize it to zero.
18:23:58disruptekwell, i guess i can terminate it manually.
18:23:59FromDiscord<clyybber> why?
18:24:04FromDiscord<clyybber> ah
18:24:17FromDiscord<clyybber> the c version also terminates manually
18:26:07*Trustable joined #nim
18:29:30*Trustable quit (Remote host closed the connection)
18:29:35krux02in c you do calloc
18:30:31disrupteki was really asking if there was a smarter way to alloc a cstring but i honestly don't know how much smarter such a simple operation could be.
18:30:41disrupteksomething more idiomatic for the type.
18:31:44disruptekcstr = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" πŸ˜‰
18:31:58krux02can you please vote on https://github.com/nim-lang/RFCs/issues/185 so that I can close it legit
18:32:00disbotβž₯ deprecate macros.expectLen, expectKind, expectMinLen in favor of something generic or doAssert ; snippet at 12https://play.nim-lang.org/#ix=2bqJ
18:32:39krux02disrupteck a cstring really is just byets
18:32:52disruptekyeah.
18:32:57krux02it is for c intorop therefore it has c types
18:33:29disruptekright. we need those semantics here.
18:33:30krux02malloc and friends give you void*
18:33:42disrupteki don't need it on the heap, though. just gonna use the above.
18:34:04krux02well, there is a alloca I think that allocates on the stack in C
18:34:06krux02I have to go
18:34:11krux02bye
18:34:16disruptekpeace
18:34:23*krux02 quit (Remote host closed the connection)
18:40:36FromDiscord<clyybber> no we need it on the heap
18:40:48FromDiscord<clyybber> or maybe we don't but its unneccessary to have it not on the heap
18:40:54FromDiscord<clyybber> it doesn't matter probably
18:41:03FromDiscord<clyybber> since we copy it to a string in the end anyways
18:41:22FromDiscord<clyybber> the C version has it on the heap FWIW
18:41:28Zevvclyybber: take the allocation out what you are doing, expect the caller to provide allocation
18:41:33Zevvthen you can make versions that do effective things
18:42:01disrupteki really don't want it on the heap. that just seems stupid.
18:42:08Zevvoften I want to add to an existing buffer. We can make addSomething that makes sure the underlying buffer is large enough
18:42:08disruptekbut anyway, this doesn't work.
18:42:38Zevvcan't you just take a var openarray[char]
18:43:56*Trustable joined #nim
18:44:42Zevvor I can shut up - also a good idea probably
18:45:41shashlick@narimiran - nightlies is broken last whole week
18:46:33narimiranshashlick: huh, strange i didn't get any email. but it is probably because travis decided again to not recognize me as a part of nim team....
18:47:29narimiranand travis is red on devel for quite some time too. (only travis)
18:47:35shashlicklooks like linenoise.h is missing
18:50:55FromDiscord<clyybber> ugh
18:51:02FromDiscord<clyybber> I tolt timothee that this is a hack
18:51:17narimiran"nim secret: support linenoise when available"
18:51:30narimirancommit 574f61315d015033dbf20e4840a645057b0c2060
18:51:54FromDiscord<ELECTR0ZED> sup peeps
18:51:57shashlickhow did it get through the standard CI
18:51:58*Hideki_ joined #nim
18:52:07FromDiscord<clyybber> linenoise is available there probably
18:52:08FromDiscord<Recruit_main_70007> @ELECTR0ZED welcome
18:52:10disruptekZevv: technically, you're right, but pragmatic impl details complicate things.
18:52:11FromDiscord<clyybber> sup
18:52:37FromGitter<deech> https://github.com/nim-lang/Nim/issues/13390
18:52:39disbotβž₯ Exporting generic methods to C causes name clashes ; snippet at 12https://play.nim-lang.org/#ix=2bqU
18:52:58FromDiscord<ELECTR0ZED> why all this spam in general
18:53:26Zevvthat's what my wife always says: "*technically* you are right"
18:53:38FromDiscord<clyybber> @ELECTR0ZED it is not spam??
18:53:38shashlickwhy cannot firefox load github, works fine on IE
18:53:55FromDiscord<clyybber> works for me
18:54:07FromDiscord<ELECTR0ZED> is the messages 2 way tho? do they see what we send
18:54:13FromDiscord<clyybber> yeah
18:54:15narimiranshashlick: red travis on devel seems to be something else, my ctrl+F 'linenoise' doesn't bring anything there
18:54:20disruptekwhat does ireland have to do with it?
18:54:27FromDiscord<ELECTR0ZED> oh so they just ignoring us lol
18:54:58FromDiscord<clyybber> narimiran: So it isn't linenoise?
18:55:02FromDiscord<clyybber> Is it the PR tho?
18:55:17narimiran@clyybber on nightlies it is, on devel (nim repo) it isn't
18:55:38FromDiscord<clyybber> nightlies is not devel??
18:55:49shashlickdo you need linenoise installed?
18:55:52FromDiscord<clyybber> or do you mean it only fails on the nightlies build bot?
18:55:55narimirannightlies have their own repo
18:56:08narimiran(sorry for the confusion)
18:56:31FromDiscord<clyybber> nah, I know that they have their own repo
18:56:37FromDiscord<clyybber> but they build from devel no?
18:56:47shashlickyes
18:56:50*Hideki_ quit (Ping timeout: 265 seconds)
18:56:51narimirane.g. nightlies fail: https://travis-ci.org/nim-lang/nightlies/jobs/648291211 vs devel fail: https://travis-ci.org/nim-lang/Nim/jobs/648850106
18:57:05shashlickwhat was added to travis for devel CI to run
18:57:14FromDiscord<clyybber> shashlick: Can you try doing import rdstdin?
18:57:17FromDiscord<clyybber> it should fail
18:57:29narimiranshashlick: this was the PR: https://github.com/nim-lang/Nim/pull/13328
18:57:32disbotβž₯ nim secret: support linenoise when available ; snippet at 12https://play.nim-lang.org/#ix=2bqY
19:01:02*Vladar quit (Quit: Leaving)
19:01:37shashlickthis is failing in build.sh - https://travis-ci.org/nim-lang/nightlies/jobs/648291211#L20720
19:05:38shashlickcsources build itself is failing because linenoise.h isn't getting packaged into the xz file created
19:09:25*letto quit (Quit: Konversation terminated!)
19:11:33*letto joined #nim
19:37:48*xet7 quit (Remote host closed the connection)
19:38:54*xet7 joined #nim
19:51:11disrupteki do not understand cstring.
19:51:46*marmotini_ quit (Remote host closed the connection)
19:52:07Araqit's char*
19:52:19*marmotini_ joined #nim
19:52:21disrupteklol
19:52:31disrupteki know, but i cannot set indicies reliably.
19:52:59Araqit needs to backed up by a buffer
19:53:15disruptekhttps://play.nim-lang.org/#ix=2brb
19:53:15*dadada quit (Ping timeout: 240 seconds)
19:53:28leorize[m]that's weird, what kind of problem are you having?
19:54:01Araqdisruptek, all invalid code
19:54:11disrupteka works.
19:54:39disruptekit can never hold a static value?
19:55:11disruptekor point to a value on the static?
19:55:15disruptekstack, rather?
19:56:27*marmotini_ quit (Ping timeout: 240 seconds)
19:59:54*nsf quit (Quit: WeeChat 2.7)
20:00:24Araqdon't mutate static strings
20:01:03disrupteki guess that makes sense.
20:01:13disruptekwell, it's on the stack. who cares?
20:03:59disruptekseems to work if i take the addr of the stack var. but something else breaks in my tests.
20:07:05disruptek$cstring(something) makes a string that has a len equal to that of the cstring, without regard to the terminator.
20:07:40disruptekthen == for "123" == "123" fails because one of 'em has a remarkably !3 length.
20:14:53*dadada joined #nim
20:15:03*leorize quit (Ping timeout: 240 seconds)
20:15:16*dadada is now known as Guest93045
20:15:55*leorize joined #nim
20:16:27disruptekah, i'll just use a nim string and setLen to truncate it at the correct point.
20:18:31leorize[m]the pattern to get a cstring from C is: str = newString(bufsize); callC(cstring str); setLen(len(cstring(str)))
20:19:26*Guest93045 is now known as dadada
20:21:44disrupteki was only using a cstring because i wanted the terminator semantic, but as long as i'm using a nim string, do i have to worry about `result` getting alloc'd (200 chars?) upon entry?
20:21:50disruptekthat's the bit i'm trying to avoid.
20:22:45disruptekguess i'll return a string ref.
20:24:20*tefter quit (Quit: WeeChat 2.7)
20:24:33Araqno
20:25:31Araquse a Nim string with setLen
20:25:45Araqor maybe an array[30, char]
20:26:12disruptekyeah, setLen seems like the most sensible.
20:26:55*letto quit (Quit: Konversation terminated!)
20:28:54*letto joined #nim
20:30:31disrupteki guess ryu is done for some values of x.
20:31:15*gangstacat quit (Quit: Ĝis!)
20:31:52*ptdel quit (Ping timeout: 260 seconds)
20:33:31Araq\o/
20:34:52Zevvbut you need to test *all* off them
20:35:21disruptek128bit yields quite a few values, zevv.
20:35:34disruptekhow about you test half?
20:36:24Zevv*all*
20:36:39disruptekyou wanna test them all?
20:36:47Zevvyou just should have followed my advice and put them all in a table, would have been much faster
20:37:29disruptekima whip some up ahead of time and let people fill out a web form to order fresh values for delivery anywhere in the world.
20:37:55Zevvright!
20:38:13FromGitter<Varriount> Araq: Regarding https://github.com/nim-lang/RFCs/issues/188#issuecomment-584053806 , what compilers are we looking to support for instruction set intrinsics?
20:38:13disbotβž₯ [performance] performance tricks to improve std/json, parsers, lookups
20:47:18*Trustable quit (Remote host closed the connection)
20:49:41FromDiscord<clyybber> disruptek: Did you start on d2s?
20:50:45*filcuc joined #nim
20:51:36disruptekyeah.
20:51:47FromDiscord<clyybber> oh ok
20:51:48disrupteksee d2s branch.
20:51:52FromDiscord<clyybber> I'll stop then
20:52:41disruptekboundary round even breaks with an incorrect value, so that's interesting.
20:53:55FromDiscord<clyybber> d2s or f2s?
20:54:09disruptekf2s with the small table optimization.
20:54:21FromDiscord<clyybber> oh
20:54:27disruptek3.4366718E10 versus 3.436672E10
20:54:29FromDiscord<clyybber> wait a minute
20:56:09FromDiscord<clyybber> disruptek: try f2s with this: http://ix.io/2bru
20:56:13FromDiscord<clyybber> this is my version
20:56:21FromDiscord<clyybber> its pretty raw
20:57:23FromDiscord<clyybber> I translated the casts literally, so you need the first bit of this common.nim: http://ix.io/2brv
20:57:26disruptekwell, does it work?
20:57:33FromDiscord<clyybber> it doesn't compile :p
20:57:37FromDiscord<clyybber> but due to common.nim
20:57:46FromDiscord<clyybber> But maybe you can diff it
20:58:01FromDiscord<clyybber> To see where yours differs
20:58:10FromDiscord<clyybber> maybe that leads us to the error
20:58:16disruptekwhat error?
20:58:24FromDiscord<clyybber> that it doesn't work?
20:58:28FromDiscord<clyybber> small table?
20:58:42disrupteki /just/ started on it.
21:00:19*filcuc quit (Remote host closed the connection)
21:03:15*narimiran quit (Ping timeout: 240 seconds)
21:03:16*muffindrake quit (Quit: muffindrake)
21:03:27*filcuc joined #nim
21:03:29*muffindrake joined #nim
21:08:42disruptekoff by one somewhere.
21:09:12disrupteklow for vp.
21:10:09*ng0_ is now known as ng0
21:15:27dom96hello hello
21:15:45FromDiscord<clyybber> sup
21:16:03FromDiscord<clyybber> is nims mod the same as C's % ?
21:16:06FromDiscord<clyybber> I forgot
21:17:20FromDiscord<Recruit_main_70007> yeah, at least its python's %
21:18:18FromDiscord<clyybber> nah, its not pythons %
21:18:33FromDiscord<clyybber> python doesn't return negative remainder
21:20:16FromDiscord<clyybber> ah, nice. We are the same as C %
21:26:17FromDiscord<exelotl> dang push/pop pragmas don't work for templates :(
21:27:54FromDiscord<exelotl> I have a macro that generates getter/setter templates and I can't find a way to disable the XDeclaredButNotUsed warnings for just those defs
21:28:15disruptekadd a {.used.} pragma where necessary.
21:28:30FromDiscord<exelotl> aha
21:28:58FromDiscord<exelotl> thanks that's perfect
21:29:02disrupteknp
21:46:32*deepend quit (Quit: o/)
21:46:57*deepend joined #nim
21:51:38*gangstacat joined #nim
21:57:12*Zectbumo joined #nim
22:10:01*filcuc quit (Quit: Konversation terminated!)
22:18:05FromDiscord<exelotl> I did a thing https://gist.github.com/exelotl/1f387c47468d02be4587044ed270c907
22:18:26lqdev[m]I'm trying to use the `cairo` library bindings for Nim, but the problem is that I can't use anything. `import cairo; var surface*: ptr Surface` gives me an error "undeclared identifier: 'Surface'" even though Surface is clearly declared in the cairo module.
22:18:53disrupteklqdev[m]: treeform took those over. maybe see if he has a branch.
22:19:29lqdev[m]I know he took those over, but araq was merging his PRs recently so I thought upstream would work
22:19:46FromDiscord<clyybber> disruptek: Hey, I just finished f2s for fun
22:19:51FromDiscord<clyybber> and it doesn't fail all tests
22:20:02disruptekwith 128bit?
22:20:09FromDiscord<clyybber> nah f2s
22:20:13FromDiscord<clyybber> unneccessary work
22:20:23FromDiscord<clyybber> but I had it done anyways
22:20:32disruptekyes, but try running it with -D:ryuOptimizeSize or w/e.
22:20:34FromDiscord<clyybber> just to see if it works
22:20:40disruptekthen you get a cookie.
22:20:43FromDiscord<clyybber> yeah, not that far yet
22:20:48*letto quit (Ping timeout: 265 seconds)
22:20:49FromDiscord<clyybber> hehe
22:21:00lqdev[m]everything import works fine for vladar's sdl2 bindings
22:21:45FromDiscord<clyybber> disruptek: Did you hit this: https://hastebin.com/witacoriyi.sql too?
22:22:16FromDiscord<clyybber> these are the only ones that fail here
22:23:03lqdev[m]ah wait, it's still pulling the old tag
22:23:16disruptekit looks like you need to truncate.
22:23:19disrupteksetLen
22:23:19lqdev[m]how do I tell nimble to pull HEAD? preferably in my .nimble file
22:23:31disrupteksomepkg#head
22:23:45FromDiscord<clyybber> disruptek: Nah, I'm doing the strip hack for now. I'm getting inaccuracies
22:24:00disruptekoh, i see that now.
22:24:36disruptekcheck the pow5bits
22:25:07disrupteki wish the test suite was a little more comprehensive. 😁
22:25:08lqdev[m].disruptek: `Unable to parse dependency version range: Unexpected char in version range ' #head': #.`
22:25:17disruptekno spaces.
22:25:22lqdev[m]ah, ok
22:25:25lqdev[m]damn
22:25:28disruptekyeah.
22:25:41disruptekalso, please don't publish a #head req.
22:26:12FromDiscord<clyybber> disruptek: Why do you + 1 there?
22:26:16FromDiscord<clyybber> ah nevermind
22:26:21FromDiscord<clyybber> I can't read my own code lol
22:26:26disruptekulf told me it was a good idea.
22:26:45FromDiscord<clyybber> hmm
22:26:53disruptekbut i do have an off-by-one somewhere. that, or our int128 type is bugged.
22:26:54FromDiscord<clyybber> my pow5bit looks exactly the same
22:27:53disruptekwhat's weird is, our int128 /seems to be producing *more correct* results than expected/
22:28:15disruptekie. tighter bounds.
22:29:10disruptekwe should probably port the table generator too, for completeness.
22:29:28disruptekit would suck biggly if our constants were somehow bugged.
22:30:21*letto joined #nim
22:33:43disrupteki dunno how to license this stuff, either.
22:34:09FromDiscord<clyybber> apache
22:34:13FromDiscord<clyybber> like ulfjack
22:36:57FromDiscord<clyybber> disruptek: Eh, did you port d2s_intrinsicis?
22:46:01*abm joined #nim
22:48:23*solitudesf quit (Ping timeout: 268 seconds)
22:48:32FromDiscord<clyybber> ah, I see it isn't needed
22:48:38FromDiscord<clyybber> what about umul128 tho?
22:49:27disruptekwhat about it?
22:49:49FromDiscord<clyybber> disruptek: how did you import it?
22:50:34disruptekanything missing symbols, i just delete.
22:51:16FromDiscord<clyybber> hehe
22:51:28FromDiscord<clyybber> no but really, did you import it from C ?
22:52:43disrupteknah.
22:53:31FromDiscord<clyybber> how how how
22:53:45*Hideki_ joined #nim
22:54:09FromDiscord<clyybber> oh
22:54:18FromDiscord<clyybber> u use int128
22:54:19FromDiscord<clyybber> nice
22:55:02disruptekyeah.
22:55:25FromDiscord<clyybber> I'm gonna try the umul way
22:55:39FromDiscord<clyybber> maybe that shows us the error
22:58:03*Hideki_ quit (Ping timeout: 240 seconds)
22:58:32disruptekthat seems valuable.
23:03:30FromDiscord<exelotl> hey does anyone know a better name for the macro in the gist I posted above?
23:04:00disruptekteh confusor
23:04:22disruptekimplicit behavior generator 9000
23:04:52disruptekthe semantic obfuscator
23:05:09FromDiscord<exelotl> wao
23:05:10disruptekthe wheel of misfortune
23:05:50FromDiscord<exelotl> I'll call it the disruptekinator
23:05:50disruptekrando symbo 4.0
23:06:20disrupteklevel seven stupid
23:07:17disruptekthe orb of disturbance
23:07:22FromDiscord<exelotl> petition to replace Nim's name mangling rules with a direct connection into disruptek's brain
23:07:37disruptekterry the wonder weasel
23:07:55FromDiscord<exelotl> !stop
23:07:59FromDiscord<exelotl> !off
23:08:04FromDiscord<exelotl> !shutdown
23:08:19disrupteki actually have a thing called the "Safety Weasel" in nigel.
23:09:03FromDiscord<clyybber> safty wissel
23:09:58disruptekit's a simple leaky-bucket throttle so you don't blow up your cloud account.
23:11:02disruptekdude, i could really go for a weasel right now.
23:11:16disrupteki mean, not a weasel. skittles. i could really go for some skittles right now.
23:20:46FromDiscord<clyybber> AAAAH
23:20:52FromDiscord<clyybber> cannot include <intrin.h>
23:21:20shashlickAraq: your choosenim milestone is done - https://github.com/dom96/choosenim/milestones
23:22:07Araqhmm so what I'm gonna complain about?
23:22:24Araqno arguments left, good job :-)
23:22:56shashlickπŸ‘:skin-tone-3:
23:25:19stefantalpalaru"--skipUserCfg --skipParentCfg" is not added in all compilation steps, when building the Nim compiler, so having a --passC:"-march=native" in a nim.cfg in some parent dir breaks compilation in iteration 3: https://dev.azure.com/nimbus-dev/e48a97ce-60bd-4c43-a919-71a3ababfa4c/_apis/build/builds/1591/logs/18
23:25:43stefantalpalaruIt's hitting this Mingw-w64 bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65782
23:27:32stefantalpalaru(or some other bug, since I already added the --passC:"-fno-asynchronous-unwind-tables" workaround)
23:28:29disrupteki guess don't do that.
23:29:44disruptekshashlick: what's the best way for me to find out if choosenim is working? is there a status page?
23:33:29shashlickwhy wouldn't it work most of the time
23:34:47disrupteki'm afraid you're asking the wrong bloke.
23:35:35disruptekmaybe there's a way to programmatically see which versions work and publish that info to others?
23:36:02FromDiscord<clyybber> disruptek: hahahaha
23:36:05FromDiscord<clyybber> all tests fail
23:36:15FromDiscord<clyybber> except for really basic
23:36:20FromDiscord<clyybber> with RYU_OPTIMIZE_SIZE
23:36:24disruptekhey, that's something.
23:36:38FromDiscord<clyybber> and I translated VERY faithfully to the C version
23:36:46disruptekthat's your problem.
23:36:51FromDiscord<clyybber> maybe
23:36:53FromDiscord<clyybber> the tests
23:36:56FromDiscord<clyybber> arent supposed to pass
23:37:03disrupteki guess i will do a little more work on this.
23:37:03FromDiscord<clyybber> for RYU_OPTIMIZE_SIZE
23:37:19disrupteki'm kinda feeling like, "eh, i have other more interesting stuff to do"
23:37:32FromDiscord<clyybber> yeah, understandable
23:38:07disruptekit was just something i said i'd do early on when i had no idea what was involved. πŸ˜‡
23:38:18FromDiscord<clyybber> I can take over if you want
23:38:41disrupteklet's just see if int128 can work, or if it exposes a compiler bug.
23:38:47FromDiscord<clyybber> aight
23:39:13disrupteki'll give you some numbers, you do some int128 math on them, okay?
23:41:26shashlickdisruptek: how about you give me a bug i can work on? cause the latest version works pretty well
23:41:35shashlickand i don't see a good reason to use older versions of choosenim
23:41:47disruptekokay, what's the current version?
23:41:58disruptekand will that work with any later nim?
23:42:11shashlick0.5.1 is latest but #head has a bunch more good features
23:42:20shashlickwill release another version once we fix the osx crash issue
23:43:01*sekao joined #nim
23:43:11disruptekso basically, when someone comes in here saying they have a choosenim problem, i should reply "0.5.1 is latest, but #head has more good features. the latest one works pretty well, but i'm sure where. i do know there's an osx crash issue."
23:44:22disruptekwhich nightlies don't work? is that only inside choosenim? or is it a completely unrelated issue? i wasn't able to follow...
23:44:55*ptdel joined #nim
23:45:15shashlicknightlies isn't building since the last few days so we have no new nightly devel releases
23:45:27disruptekso, a nim repo issue.
23:45:36shashlicknot related to choosenim
23:45:54disruptekright. choosenim devel will choose, what, a devel from a few days ago? but, it'll work fine otherwise?
23:46:08shashlickhttps://github.com/nim-lang/Nim/pull/13328 is the problem
23:46:10disbotβž₯ nim secret: support linenoise when available ; snippet at 12https://play.nim-lang.org/#ix=2bqY
23:46:30shashlick`choosenim devel` will work fine since it will use csources from the csources repo to bootstrap
23:46:43shashlicksee https://github.com/nim-lang/Nim/pull/13328#issuecomment-584886841
23:46:44disbotβž₯ nim secret: support linenoise when available ; snippet at 12https://play.nim-lang.org/#ix=2bqY
23:47:09disruptekoh, i didn't realize i was rehashing email. my bad.
23:47:18disrupteki rarely read email these days.
23:47:27*krux02 joined #nim
23:49:28disruptekso 0.5.2 will be the best version to recommend, soon.
23:50:01disruptek~choosenim is https://github.com/dom96/choosenim/releases/tag/v0.5.1
23:50:02disbotchoosenim: 11https://github.com/dom96/choosenim/releases/tag/v0.5.1
23:51:40*dddddd quit (Ping timeout: 265 seconds)
23:52:27FromDiscord<clyybber> hmm
23:52:40FromDiscord<clyybber> somehow ulfjacks ryu can work just fine with small table
23:53:00disruptekwhy wouldn't it?
23:56:02FromDiscord<clyybber> I dunno
23:56:10FromDiscord<clyybber> I wonder why we don't
23:56:37shashlickYep, 0.6.0 will be next
23:56:39FromDiscord<clyybber> well
23:56:42shashlickNew features and all
23:56:45FromDiscord<clyybber> at least we fail SPECTACULARILY
23:57:46disrupteki just realized that these debugging statements alter the order of the values.
23:57:58disruptekwhere do these people come from?
23:58:01disrupteki really want to know.
23:58:05FromDiscord<clyybber> wdym alter the order?
23:59:30disruptekit was /my/ debugging.