<< 03-04-2019 >>

00:35:15*kapil____ joined #nim
00:42:29*btbytes joined #nim
00:43:18*btbytes quit (Client Quit)
00:43:31*btbytes joined #nim
00:44:37*dddddd quit (Remote host closed the connection)
00:58:31*d10n-work quit (Quit: Connection closed for inactivity)
01:11:01*btbytes quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
01:11:46*nif joined #nim
01:12:01*gmpreussner_ joined #nim
01:12:19*jonafato- joined #nim
01:12:38*nif_ quit (Quit: ...)
01:12:39*gmpreussner quit (Quit: kthxbye)
01:12:41*jonafato quit (Quit: ZNC - http://znc.in)
01:12:42*banc quit (Ping timeout: 245 seconds)
01:15:20*banc joined #nim
01:38:13*rnrwashere quit (Remote host closed the connection)
01:40:44*rnrwashere joined #nim
01:41:20*rnrwashere quit (Remote host closed the connection)
01:56:41*btbytes joined #nim
02:06:43*banc quit (Quit: Bye)
02:28:34*banc joined #nim
02:28:56*rnrwashere joined #nim
02:34:52*rnrwashere quit (Remote host closed the connection)
03:15:53*ryukoposting joined #nim
03:44:05*noeontheend_ joined #nim
03:45:27*noeontheend quit (Ping timeout: 240 seconds)
03:48:08*noeontheend_ quit (Ping timeout: 246 seconds)
04:33:10*nsf joined #nim
04:37:23*ryukoposting quit (Quit: WeeChat 1.6)
04:51:05*rnrwashere joined #nim
05:01:38*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
05:03:51*rnrwashere quit (Remote host closed the connection)
05:18:11*rnrwashere joined #nim
05:19:07*rnrwashere quit (Remote host closed the connection)
05:25:24*couven92 joined #nim
05:27:17*narimiran joined #nim
05:46:52*solitudesf joined #nim
06:06:55*PMunch joined #nim
06:10:54*krux02 joined #nim
06:21:16PMunchnarimiran, since you didn't seem convinced the other day about our snow: https://uploads.peterme.net/IMG_20190402_194831.jpg
06:21:31PMunchThat's taken yesterday after I was done shoveling
06:22:02*MightyJoe quit (Ping timeout: 250 seconds)
06:22:16*cyraxjoe joined #nim
06:22:47narimiranPMunch: the skeptic would still check EXIF and made sure if this isn't taken 3 months ago :P
06:24:08PMunchHuh, apparently I've got geotagging on as well
06:24:15PMunchSo now you know where my house is..
06:24:30*rnrwashere joined #nim
06:24:41*rnrwashere quit (Remote host closed the connection)
06:24:55*rnrwashere joined #nim
06:27:54PMunchThere, scrubbed the geotags out
06:31:44*narimiran quit (Remote host closed the connection)
06:32:17*narimiran joined #nim
06:33:56I_Right_IPMunch: Where do you live Greenland?
06:36:59PMunchHaha, not quite. North of Norway
06:38:37*solitudesf quit (Ping timeout: 250 seconds)
06:41:17Zevvnort of norway. Are you santa?
06:42:28PMunchNope, but I know a guy who knows a guy who knows him
06:42:59Zevvwell, he knows me, I've been told
06:43:23Zevvnice and subtle response on the V post araq :)
06:43:37PMunchV post?
06:43:59Zevvhttps://forum.nim-lang.org/t/4758
06:44:41Zevv"Yeah no shit, please go on since so far no convincing argument has been found."
06:45:11*I_Right_I quit (Remote host closed the connection)
06:45:25Zevvdamn that *is* some snow
06:45:56*tdc joined #nim
06:46:16Zevvcan you not lie, make free energy out of that, or something. a waste to let it all lie there and melt. make snow balls and ship them to italy, monetize!
06:46:32Zevvs/lie/like/
06:47:04PMunchYeah, that's even after I've given up on digging down to the actual ground. I have two steps down from my door and a staircase to get up to the road, currently it's a straight path over to the staircase (which I've now carved out of the snow instead of finding the actual steps).
06:47:26PMunchWell I guess you could set up a hydro-generator on the melting snow
06:47:44PMunchI guess that's how much of Norways hydro-power already works though :P
06:48:01PMunchWhy would Italy want our dirty snow?
06:48:10narimiranto make gelatto
06:48:15Zevvexactly
06:48:42Zevvand some sand and grit is no issue when making straciatella
06:50:51Zevvback to nim: i have a macro that generates code with getAst on a template call. This template also calls templates. When I do a repr on the generated code at the end of the macro, the inner template calls are still there. Is there a way to "fully expand" all templates in a way?
06:51:49narimirani haven't used it, but maybe https://nim-lang.github.io/Nim/macros.html#expandMacros.m%2Ctyped ?
06:52:03Zevvhmm missed that one, lemme see
06:52:50ZevvProblem is that the code calling the initial maco must have the inner templates in scope. I now need to export stuff that I'd rather hide
07:00:00*gmpreussner_ quit (Quit: kthxbye)
07:01:10Zevvhmm, almost but not quite.
07:02:57Araqwhy do the inner templates have to be expanded?
07:04:29*gmpreussner joined #nim
07:14:34Zevvbecause now I need to export those templates to the caller of the macro.
07:15:22Zevvmain calls macro, macro uses getAst on templateA which calls templateB -> main needs to know about templateB
07:42:22FromGitter<mratsim> if it's template calling template, templateA can probably use mixin
07:42:56FromGitter<mratsim> or the module that defines template A should import the module that defines template B
07:54:50ZevvI'll put op a minimized example later today, thanks
07:55:45ZevvI must admit that I've never looked into mixin and bind, no clue what they do
08:00:09*kapil____ quit (Quit: Connection closed for inactivity)
08:03:24*rnrwashere quit (Remote host closed the connection)
08:04:43*ng0 joined #nim
08:05:48*floppydh joined #nim
08:05:48*btbytes quit (Read error: Connection reset by peer)
08:07:22*Vladar joined #nim
08:15:34PMunchI was originally skeptical of the nilseqs and nilstrings thing, but it's sooo much nicer when you get used to it :)
08:15:44PMunchAnd it's more consistent with the other types
08:16:56FromGitter<alehander42> The ability to not have nil
08:16:58FromGitter<alehander42> ?
08:17:08PMunch?
08:17:33FromGitter<alehander42> Is that what you mean by
08:17:39FromGitter<alehander42> Nilstring
08:18:19*vlad1777d joined #nim
08:29:39PMunchYeah
08:30:24PMunchThe fact that "var myString: string" can now be used as a string and not a nil
08:43:59Zevvand next is to get `var myTable: Table[int, int]` to work without having to do initTable(). Where is this RFC, let us upvote!
08:45:01narimiranZevv: here it is https://github.com/nim-lang/RFCs/issues/101
08:46:39narimiranalso this would be nice: https://github.com/nim-lang/RFCs/issues/48
08:50:40livcdthis is much better
08:50:51livcdshashlick: I attached cmder to putty and it works flawlessly
08:52:15Zevvnarimiran: So, what do I do to get a lobby going for this?
08:54:56narimiranZevv: spread the word and hope the pressure will be too high to ignore :)
09:02:53Zevvspread! Spread! SPREAD!
09:20:10FromGitter<gogolxdong> How to convert ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ca47acaf851ee043d53d8a4]
09:22:09*JustASlacker joined #nim
09:25:32FromGitter<alehander42> Yep
09:25:36FromGitter<alehander42> Very good
09:28:16*MightyJoe joined #nim
09:28:22*cyraxjoe quit (Ping timeout: 245 seconds)
09:29:29*Vladar quit (Remote host closed the connection)
09:29:57*Vladar joined #nim
09:34:54FromGitter<gogolxdong> trying to concatenate two NimNodes into a json field accessing : ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ca47e3e93fb4a7dc2c77fde]
09:36:27*Xe quit (Ping timeout: 240 seconds)
09:37:23*snowolf quit (Ping timeout: 268 seconds)
09:41:54*snowolf joined #nim
10:04:00*Xe joined #nim
10:05:46*couven92 quit (Ping timeout: 250 seconds)
11:04:02*couven92 joined #nim
11:05:58*Snircle joined #nim
11:17:47*abm joined #nim
11:17:54ZevvHa, I outgolfed your set narimiran
11:18:11narimiranZevv: no you didn't :D
11:18:12ZevvI'm an expert in sets these day
11:18:20narimiranbecause that's not a HashSet anymore ;)
11:18:33*NimBot joined #nim
11:18:55Zevv*delete post*
11:19:07narimiranZevv: don't worry, even Araq got that one wrong :P
11:19:17Zevvghehe
11:19:56Zevv"you can not delete this post", well that's nice
11:20:18narimiranyep, even i can't do that, and i'm a moderator
11:20:58Zevvso, this will be my heritage, a wrong answer on a forum on the internet. How utterly embarrising
11:21:18narimiranZevv: oh c'mon, you know the workaround around this
11:21:31Zevvyeah, just act as if it never happened
11:21:35narimirannope
11:21:52Zevvyou know I'm not going to admit I'm wrong
11:22:19narimiranwell, you can "delete" the *contents* of your post ;)
11:22:32Zevvhaha
11:23:10ZevvDamn now I already admitted I was wrong
11:23:29narimiranApril fools, whole month long!
11:23:53Zevvso. much. fun.
11:27:26*lritter joined #nim
11:39:03FromGitter<gogolxdong> How about ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ca49b5793fb4a7dc2c85ba7]
11:39:48FromGitter<gogolxdong> then we can get the date 1 year ago. ` echo getDateStr(now()-1.years)`
11:52:59ZevvI forgot, what's that abbreviation of nim's way of calling things? c.foo() or foo(c)
11:53:45*Snircle quit (Ping timeout: 268 seconds)
11:54:32planetis[m]there is an empty node after the first statement in StmtListExpr ``dumpTree: if (x.inc; x) > 0`` is this a parser bug?
11:55:49FromGitter<zetashift> UFCS?
11:56:14Zevvah yes, thanks
11:57:00Zevvnarimiran: about my problem this morning: https://forum.nim-lang.org/t/4762
11:58:47FromGitter<zetashift> @Zevv I don't know much about templates but might this be the reason? https://nim-lang.org/docs/manual.html#templates-limitations-of-the-method-call-syntax
12:02:55PMunchWhat was that new tool to help with wrappin C libraries?
12:03:11FromGitter<zetashift> nimterop?
12:03:18PMunchAh, that's the one
12:03:27FromGitter<zetashift> man I'm on fire
12:03:29Zevvnimterop++!
12:03:45Zevvoh nimbot doesnt know about ++ :)
12:04:56*PMunch quit (Remote host closed the connection)
12:05:20*PMunch joined #nim
12:06:28FromGitter<zetashift> I don't know about vlang it sounds nice and all that but that developer keeps pushing his 'open source release' date
12:07:24*Snircle joined #nim
12:07:37Zevv"V for Vaporware"
12:08:58planetis[m]is until a keyword!?
12:10:26FromGitter<zetashift> according to the manual it isn't
12:11:00planetis[m]then why??
12:11:19PMunchHmm, Volt, the program he created V for looks more interesting than the language :P
12:11:34planetis[m]pf, I'm getting `Error: undeclared identifier: 'until'`
12:11:59planetis[m]all the time, sorry it took me 5 min to figure it out
12:12:23planetis[m]then i changed it to smth else and worked
12:13:15PMunchThat sounds strange
12:13:45FromGitter<zetashift> yeah
12:14:00shashlickI tried volt on windows and it immediately got quarantined by my anti virus
12:14:21FromGitter<zetashift> I mean some antivirus also pick up on Nim
12:14:25planetis[m]i will post a nim file
12:15:00*arecacea1 quit (Remote host closed the connection)
12:15:08PMunchzetashift, ah it wasn't actually nimterop I was thinking of, but nimgen
12:15:17PMunchNimterop looks really interesting though
12:15:18*arecacea1 joined #nim
12:16:09FromGitter<zetashift> yea nimgen is more of a helper tho isn't it?
12:16:25FromGitter<zetashift> anybody got feud working on Windows getting a weird SSL error
12:16:42FromGitter<zetashift> feud being this: https://github.com/genotrance/feud
12:16:58planetis[m]oh no, it was because I made a repeat macro and the symbol clases with strutils repeat
12:17:14planetis[m]what do I do?
12:17:19PMunch"Fed Ep with UDitors" :P
12:18:29PMunchplanetis[m], "import strutils except repeat"?
12:18:54planetis[m]yeah but I planning making a lib package...
12:18:59planetis[m]*am
12:19:34PMunchqualify your repeat macro? mymodule.repeat?
12:19:45PMunchWithout code it's kinda hard to understand what you're trying to do
12:20:26PMunchHmm, feud looks interesting
12:20:29PMunchWindows only though..
12:20:42planetis[m]a repeat until statement here: https://gist.github.com/b3liever/98f5e1b079637814ba2828f564d4439f
12:20:52planetis[m]thanks for the help by the way
12:21:55planetis[m]i will finish it later
12:22:40FromGitter<zetashift> for now PMunch (tm)
12:23:18PMunchWell, if you had it as a library then I guess people would have to either not use repeat from strutils, or qualify your macro..
12:23:34shashlickzetashift: what error are you seeing with feud
12:24:19planetis[m]I should pbl allow endless loop
12:25:41PMunchHmm strange, qualifying didn't help either..
12:26:57FromGitter<zetashift> @shashlick https://pastebin.com/1e2FzHEe
12:28:31PMunchplanetis[m], this works: http://ix.io/1FdH/Nim
12:28:36PMunchBut it's not optimal
12:29:33planetis[m]sure, I will just write a note in the readme, can't be bothered now
12:33:00Zevvzetashift, thanks, that seems to be my problem
12:33:35*dddddd joined #nim
12:34:57*salewski joined #nim
12:36:17shashlickzetashift do you have an older build of nimterop installed?
12:37:05salewskiDo we have something like max_by() from Ruby in Nim already?
12:37:09salewskihttps://ruby-doc.org/core-2.6.2/Enumerable.html#method-i-max_by
12:37:32salewskiExample use: fing longest string in a seq of strings.
12:37:46narimiranyou can define your own `cmp`?
12:38:00shashlickzetashift is an issue with tls1.2, update nimterop and it should work
12:38:32salewskiAh yes, defining own cmp seems to be the Nim solution...
12:40:16FromGitter<zetashift> ah thanks I will
12:41:05salewskiUnfortunately, when we type "find" keyword in search entry in page
12:41:08salewskihttps://nim-lang.github.io/Nim/lib.html
12:41:27salewskiwe get unly results for strings still. Bad for newcomers.
12:44:41PMunchHmm, nimterop doesn't seem to work: http://ix.io/1FdM/Nim
12:44:47PMunchOr I might be doing something wrong
12:45:38shashlickThis is latest? Yay crash :)
12:46:05PMunchshashlick, yeah, just downloaded
12:46:34FromGitter<zetashift> I actually can't install nimterop due some cligen bug
12:46:40FromGitter<zetashift> or cligen error*
12:47:05shashlickPMunch can you try with debug build
12:47:10shashlickGet some trace
12:48:23PMunchHow?
12:48:24shashlickZetashift paste? What's version of Nim
12:48:56FromGitter<zetashift> Using nim devel: ... C:\Users\rskar\.nimble\pkgs\cligen-0.9.19\cligen\argcvt.nim(8, 24) Error: undeclared identifier: '$'
12:50:56FromGitter<zetashift> gonna try with stable
12:54:22shashlickzetashift that should be fixed, do you have latest devel
12:54:33shashlickAnd latest cligen
12:54:46FromGitter<zetashift> I don't have latest devel but I do have latest cligen
12:54:50FromGitter<zetashift> I'll update devel then
12:55:26shashlickPMunch I'll try in a bit - what does your wrapper look like
12:55:39shashlickAre there any #defines you need to be set
12:55:58PMunchNo idea :P
12:56:15salewskiI still have not found an easy way to get index of longest string of @["aa", "ccc", "d"] :-(
12:56:26PMunchBut I found that there is a ODBC wrapper already
12:57:01narimiransalewski: (length, index) tuple?
12:59:40FromGitter<arnetheduck> why is `mixin` needed? what prevents the compiler from lazily finding those names later?
13:00:56shashlickOk I'll take a look in 30 minutes
13:01:54*cgfuh joined #nim
13:02:04shashlickCan you share your testodbc.nim file
13:07:47Araqarnetheduck: nothing but we found out empirically that it's better if the compiler does some pre-instantiation checking for generics
13:08:21FromGitter<arnetheduck> as in.. fewer surprises?
13:09:04*Cthalupa quit (Ping timeout: 250 seconds)
13:09:41Araqyes
13:10:53PMunchsalewski, what's wrong with something like: http://ix.io/1FdZ/Nim
13:11:39*Cthalupa joined #nim
13:13:05*ng0 quit (Quit: Alexa, when is the end of world?)
13:14:17salewskiPMunch, thanks. I just assumed that something like max_by exists already,
13:14:53salewskias for sort() we have sortedByIt or sort with custom cmp proc. Seems not for min/max.
13:15:05salewskiOK, will write it myself, thanks.
13:17:28PMunchsalewski, well x.sortedByIt(len(it)) works fine. But if you needed the index it's a bit more complicated
13:18:51*Cthalupa quit (Ping timeout: 268 seconds)
13:19:37*Cthalupa joined #nim
13:19:51salewskiYes I know, no problem. Bye.
13:19:57*salewski quit (Quit: WeeChat 2.3)
13:22:10*stefanos82 joined #nim
13:23:02PMunchI mean this would also work: http://ix.io/1Fe2/Nim
13:23:21*Vladar quit (Remote host closed the connection)
13:26:37*Vladar joined #nim
13:34:52shashlickPMunch - you just needed to set the include path
13:35:13PMunchshashlick, I tried that, but it didn't appear to work
13:35:15shashlickbut that assertion error is too opaque, will look into that
13:36:23shashlickthis works: toast --pnim --preprocess -I . sql.h
13:36:32shashlickso you need a cInclude()
13:37:40PMunchDidn't seem to like that either: http://ix.io/1Fe7/
13:38:23shashlickthat's some other toast 😄
13:38:46PMunchAh :P
13:39:00shashlicktry ~/.nimble/bin/toast
13:40:06*matthias__ joined #nim
13:40:16shashlickyou will also need recurse
13:40:37shashlickotherwise the #include symbols are not pulled in, the resulting wrapper won't compile
13:41:20*matthias__ quit (Client Quit)
13:41:28PMunchHmm, http://ix.io/1Fe7/
13:41:36PMunchStill doesn't appear to like it
13:42:05*matthias__ joined #nim
13:42:19*matthias__ quit (Client Quit)
13:42:55shashlickthat's the same snippet
13:43:57PMunchOops, my bad http://ix.io/1Fe9/
13:44:55shashlickneed the full path to sql.h
13:45:52PMunchAha, that seemed to work
13:49:56PMunchHmm, now I get an undefined error
13:50:12PMunch../../.choosenim/toolchains/nim-0.19.0/lib/core/macros.nim(749, 42) Error: undeclared identifier: 'SQLHENV'
13:51:38shashlickyep, i'm a few steps ahead - will share my results as soon as it compiles
13:52:37*matthiaswh joined #nim
13:57:13shashlickPMunch - here's what I have that compiles - http://ix.io/1Feb/nim
13:57:29shashlicksome symbols conflict so needed editing
13:58:39shashlickhere's what the wrapper looks like - //ix.io/1Fec
13:58:45shashlickhttp://ix.io/1Fec
14:03:28livcdcoffeepot's odbc library does not work anymore?
14:05:28*vlad1777d quit (Ping timeout: 245 seconds)
14:07:45PMunchlivcd, I got a connection now
14:07:55*PMunch quit (Remote host closed the connection)
14:13:20planetis[m]Hey what do you think: https://github.com/b3liever/looper
14:16:07Araqplanetis[m], it's neat. I wouldn't use it in production though,
14:16:23Araqmacros need to pull in their weight
14:16:46*JustASlacker quit (Remote host closed the connection)
14:16:57Araqand afaik you don't have to use macros for this, 2 templates would do
14:17:09Araqtemplate repeat(body: untyped) = while true: body
14:17:22Araqtemplate until(cond: bool) = if not cond: break
14:18:06Araqtemplate until(cond: bool) = if cond: break # lol
14:18:18AraqI always get true and false wrong.
14:19:47AraqOberon calls it 'loop' iirc which wouldn't clash with strutils.repeat
14:23:22planetis[m]yes, after i released it, realised that it can't work with a break before until
14:23:33planetis[m]it was fun though
14:23:37livcdand you did not get it before ?
14:23:39livcdoh he left
14:26:44*solitudesf joined #nim
14:38:33*metadave joined #nim
14:50:29*WilhelmVonWeiner joined #nim
14:51:05WilhelmVonWeinerhow would I use a string in an if statement?
14:51:20WilhelmVonWeinerlike `if string: echo string`
14:52:24narimiranif string.len > 0
14:53:46WilhelmVonWeinerfair enough
14:54:34FromGitter<liquid600pgm> I always used `if str != ""`, but using `len` makes more sense in terms of performance
15:35:01FromGitter<alehander42> i am not sure if this is slower
15:35:08FromGitter<alehander42> if it is, we should optimize it
15:35:34FromGitter<alehander42> there was this idea of a geneirc isEmpty
15:35:37FromGitter<alehander42> or something like that
15:35:39FromGitter<alehander42> what happened
15:36:43FromGitter<alehander42> Araq, are owned refs based only on the gel paper
15:37:49*nsf quit (Quit: WeeChat 2.4)
16:10:30*abm quit (Ping timeout: 250 seconds)
16:11:41*rnrwashere joined #nim
16:14:40*Trustable joined #nim
16:17:38*rnrwashere quit (Remote host closed the connection)
16:19:12*CcxWrk quit (Ping timeout: 255 seconds)
16:20:07*CcxWrk joined #nim
16:23:26federico3gel?
16:24:44*rnrwashere joined #nim
16:25:05*CcxWrk quit (Ping timeout: 268 seconds)
16:28:12*CcxWrk joined #nim
16:36:37Zevvhttps://www.yumpu.com/en/document/view/38020191/ownership-you-can-count-on-a-hybrid-approach-researcher-ibm
16:38:58*I_Right_I joined #nim
16:46:46*rnrwashere quit (Remote host closed the connection)
16:50:52*cgfuh quit (Ping timeout: 245 seconds)
16:57:05*floppydh quit (Quit: WeeChat 2.4)
17:09:17Araqalehander42: yeah, pretty much. I've tinkered with similar stuff before I found Gel
17:09:40Araqand when I read it was like reading something that I already knew, deep inside :P
17:10:05Araqwhich is why I'm so sold on the idea.
17:27:12*rnrwashere joined #nim
17:32:13*rnrwashere quit (Ping timeout: 268 seconds)
17:39:44*ng0 joined #nim
17:47:45federico3Zevv: thanks. This looks better in case someone want it https://researcher.watson.ibm.com/researcher/files/us-bacon/Dingle07Ownership.pdf
17:59:12*Trustable quit (Remote host closed the connection)
18:00:05*abm joined #nim
18:09:25Zevvyeah that was a pretty bad link, sorry for that - was on mobile
18:09:46*theelous3_ joined #nim
18:24:10*rnrwashere joined #nim
18:28:23rayman22201What are the other core team opinions on owned refs? narimiran and krux02?
18:28:57krux02well I want owned refs.
18:29:00narimirani don't know enough about the topic to give my opinion
18:29:11rayman22201lol. fair enough
18:29:19Zevvtwo out of three ain't bad :)
18:29:24krux02well I did not test them out in practice yet.
18:29:33krux02But I really like to break the dependency to the GC
18:29:37*rnrwashere quit (Remote host closed the connection)
18:29:57krux02and the owned refs are a concept that promise to do exactly that
18:30:14krux02and I didn't see any reason why they would not work
18:30:49rayman22201two out of three ain't bad at all :-P
18:31:18krux02what do you think about it?
18:31:40krux02rayman22201: ^
18:33:08rayman22201I'm a big fan. I like it.
18:34:48rayman22201same reasons. I don't like the GC, and the logic of the proposal is actually very intuitive for me.
18:40:21CcxWrkI don't buy the determinism claims. The heap allocation/deallocation algorithm is not really deterministic by itself so you won't have anything deterministic building on top.
18:41:47rayman22201read the paper... They do a pretty convincing job of proving that it is deterministic
18:44:01rayman22201"Unlike garbage-collected languages, memory management in Gel is deterministic: objects are freed as soon as they are no longer needed."
18:45:25CcxWrkI've seen that. That doesn't prove a thing. The best you can hope with scheme like this is some bounded behaviour with specialized allocator. Which is definitely not what you'll get if you defer to libc. Have you seen the code to implement free()?
18:47:55ZevvHow much effort and time would it take the core team (or solo Araq) to actually get this up and running up to a level that it is ready to be tested by others? There's a lot of discussion about wether or not this is a good idea; will this take a considerable share of resources which would otherwise be spent on other important tasks?
18:48:44rayman22201Araq already has a prototype that is "almost" finished, and should be merged into devel soonish iirc.
18:48:52Zevvotherwise, why not just say: 'Go for it' to see where this is going
18:49:08Zevvwell, that's pretty nice indeed.
18:50:49rayman22201arguing about determinism and libc() free is silly. That's an implementation detail. I'm pretty sure everybody considers C to have deterministic memory management.
18:50:58AraqCcxWrk: we have an O(1) allocator, pretty deterministic
18:51:21CcxWrkWhat about deallocation? What about fragmentation?
18:51:35Araqread the paper about TLSF, that's what Nim implements
18:51:55Araqspoiler: deallocation is also O(1)
18:56:11Araqbut most allocators are all pretty good these days, most claims about them are based on ignorance. People use the word "free list" like it implies traversing this list. This is not what happens, it's a simple linked list add/removal
18:59:51CcxWrkInteresting. How well does it handle reallocation?
19:00:35Araqthat has not much to do with the underlying allocator's algorithms, either you can special case the alloc&copyMem&dealloc dance or you can't
19:00:52AraqNim's doesn't special case it but we could.
19:01:57CcxWrkWell, you preallocate extra size on string growth, so I guess that mitigates that.
19:03:37Araqyup
19:04:10*nsf joined #nim
19:04:44CcxWrkReading the TLSF paper makes me want to design a language again. :P But I know better.
19:04:53AraqZevv, it definitely takes up resources but most of the effort also makes destructors rock solid
19:05:28Araqso if it turns out to be a failure, not everything is lost
19:06:10CcxWrkThe alias counting is a kind of design-by-contract thing as I see it. It provides runtime checking of program conforming to correctness constraints.
19:06:36CcxWrkSo that's a good thing even if the implementation doesn't end up being faster or more predictable.
19:11:06Araqfor me it's C++'s smart pointers done right.
19:11:57Araqa brilliant variation of its unique/shared/weak pointers
19:50:21*rnrwashere joined #nim
19:52:06*rnrwashere quit (Remote host closed the connection)
19:53:46*rnrwashere joined #nim
19:55:22I_Right_II am willing to bet this would simply a lot of things when it comes to Threads, Threads Pools and maybe a few other things in the stdlib.
19:58:05*rnrwashere quit (Ping timeout: 258 seconds)
19:58:36AraqI_Right_I, as I said, it addresses the core pain points of Nim
20:01:06Araqand I've also figured out how the interop with a GC could look like but first we need this prototype and we need it yesterday
20:10:07*noeontheend joined #nim
20:10:28*nsf quit (Quit: WeeChat 2.4)
20:14:54*abm quit (Ping timeout: 250 seconds)
20:14:55disrupteki really don't understand why everyone has such an issue with this. the way i see it, if it's a 75% solution, that's 98% of what is practically needed. even if after building the thing, a major design flaw is uncovered, the mere fact that the compiler is refactored to support the concept and the language extended to enable its use is going to put everyone in a better position to try something else.
20:15:01disruptekplus, it's free language research for the rest of the world. what gives? why the hate? it's not like Araq is asking us to pay for it. :-P
20:16:11*narimiran quit (Ping timeout: 244 seconds)
20:20:33*Vladar quit (Remote host closed the connection)
20:24:12*rnrwashere joined #nim
20:26:14I_Right_IWell if you are a programmer that comes from GC only languages, ever book you read tells you about how the GC is a big hug that protects you from writing code that will destroy all hardware that code touches.
20:27:18*rnrwashere quit (Remote host closed the connection)
20:27:25*rnrwashere joined #nim
20:29:58FromGitter<alehander42> Please don't assume so much
20:30:11FromGitter<alehander42> There are great reasons to support a gc
20:30:16FromGitter<alehander42> No need to fud
20:31:57disruptekthis may let the compiler make determinations about when the GC might be omitted. that could be a huge win/win right there. hugs don't have to go bye-bye.
20:32:48*noeontheend quit (Ping timeout: 250 seconds)
20:33:05I_Right_Ialehander42: Oh, I don't mean to sound like anti GC activist. I agree with you.
20:37:08I_Right_II was just pointing out the Idea of not having a GC could be scary to some.
20:37:33disruptekwell, it really says something that we're still using boehm after 30 years.
20:40:13FromGitter<alehander42> Yeah no
20:40:17FromGitter<alehander42> No*
20:40:21FromGitter<alehander42> No prob
20:40:55FromGitter<alehander42> But still I think a lot of software works fine with gc and is writtrn in a better way with one
20:41:23FromGitter<alehander42> Because of less special nonlogic related code
20:41:55FromGitter<alehander42> Maybe even concurrency
20:41:59disruptekagree. and sometimes it's preferable to let a service leak memory or suffer a logic bug versus crashing.
20:42:21FromGitter<alehander42> I'd say most software works great hat way and doesn't need the little performamce boost
20:42:37disruptekit would be awesome to use GC as an auditor in debug and then take the training wheels off in release.
20:42:43FromGitter<alehander42> Of course there is some stuff that really requires it and the deterministic
20:42:57FromGitter<alehander42> Yeah you're right
20:43:05FromGitter<alehander42> But.i still feel wry catious
20:43:11FromGitter<alehander42> About a debug mode
20:43:31FromGitter<alehander42> You have to have excellent fuzzing and tests
20:44:41FromGitter<alehander42> The service point is true ye
20:44:42disruptekyes, good code is valuable. perhaps more-so when it's as dangerous as this. but that's where the language can add value (and good code) to the user's binary.
20:45:48I_Right_Ialehander42: are you saying you think GC makes concurrency easier or harder
20:46:30FromGitter<alehander42> I think it can make it easier sometimes and that it can make expressing an algorithm easier
20:46:47I_Right_Iah, okay
20:51:28I_Right_IAs far as the newruntime I don't really think it will take much of an adjustment. I think you will be able to write most algorithms with the same expressiveness and ease.
20:55:20FromGitter<alehander42> I hope so
20:55:40FromGitter<alehander42> My xp is a little bit with rust where I feel the mental overhead
20:56:08FromGitter<alehander42> Is unwarranted except if you need very low level or very fast code
20:56:24FromGitter<alehander42> But that's subjective
20:57:53I_Right_Ioh I completely agree with you there.
20:58:10disruptekthe whole idea is to dramatically reduce that without giving up any ease of writing naive code.
20:58:24*vlad1777d joined #nim
21:03:33FromGitter<Varriount> > _>
21:06:04I_Right_Iyeah I am really excited about nim, after a couple days I was able to write(in the eye of the beholder) useful code. And I have never used a language with python like syntax.
21:10:17*thomasross_ joined #nim
21:10:17*thomasross quit (Killed (hitchcock.freenode.net (Nickname regained by services)))
21:10:17*thomasross_ is now known as thomasross
21:11:42*solitudesf quit (Ping timeout: 255 seconds)
21:21:00*rnrwashere quit (Remote host closed the connection)
21:26:55rayman22201Varriount still does not believe lol
21:28:22FromGitter<alehander42> this is a very valid viewpoint
21:29:59rayman22201what? skepticism? of course. I mean no disrespect to Varriount!
21:33:20*ptdel joined #nim
21:35:35ptdelis there a stdlib proc to sort a table? or should i do something like convert the table to a list of tuples and attempt to compare in some other way?
21:37:50rayman22201use an OrderedTable: https://nim-lang.github.io/Nim/tables.html#sort%2COrderedTable%5BA%2CB%5D%2Cproc%28%2C%29
21:39:22ptdelrayman22201: correct me if I'm wrong, but the ordered table only remembers insertion order, or does it actually sort things? example: it will alphabetically sort keys
21:39:58rayman22201The sort function I linked you modifies the internal ordering to be sorted instead of insertion order
21:40:55ptdeloh I see what you are saying. If I initially create things as ordered tables rather than standard tables, I am able to sort on them
21:40:59ptdelthank you rayman22201
21:41:19rayman22201👍 np
21:41:57*ptdel quit (Remote host closed the connection)
21:48:16*ng0 quit (Quit: Alexa, when is the end of world?)
21:48:45FromGitter<zetashift> I also like the GC since I don't do anything bare-metal at all and current GC performs well. However in Araq's blog he did make good points
21:48:53FromGitter<zetashift> One which stood out for me was this one: ``` I have spent far more time now in fixing GC related bugs or optimizing the GC than I ever spent in hunting down memory leaks or corruptions. ```
21:57:11rayman22201It's not just bare-metal. Do you do anything with threads and shared memory, how about making a shared library? All of those things are painful in current Nim.
21:57:54*rnrwashere joined #nim
21:58:08*rnrwashere quit (Remote host closed the connection)
21:58:33FromGitter<zetashift> yea he mentions those in the blogpost, I also don't do much with that :P
21:58:35*rnrwashere joined #nim
21:58:57rayman22201lol. Fair enough
21:59:28FromGitter<zetashift> it's a tricky thing and if it's gonna be a big part of the language I just hope it gets documentated well.
22:02:43*rnrwashere quit (Ping timeout: 246 seconds)
22:02:49*vlad1777d quit (Remote host closed the connection)
22:03:03rayman22201It will definitely make the run-time and stdlib more deterministic and arguably more efficient (arguably less buggy too). The question is how much will it affect application code / end users. I don't think it will affect end user code that much, but we won't know until we try. It's definitely an experiment.
22:03:09*druonysus joined #nim
22:03:09*druonysus quit (Changing host)
22:03:09*druonysus joined #nim
22:03:52*stefanos82 quit (Remote host closed the connection)
22:04:31*abm joined #nim
22:05:24*vlad1777d joined #nim
22:05:28FromGitter<zetashift> It's gonna be a fun ride, especially for Araq
22:06:12rayman22201He is already getting a mountain of crap for it. I don't envy him lol. Luckily he is not easily offended :-P
22:08:37FromDiscord<PusiteGA> i am newb but i think too for shared memory its better whitout GC
22:10:52*vlad1777d quit (Ping timeout: 245 seconds)
22:10:57*krux02 quit (Remote host closed the connection)
22:13:47*vlad1777d joined #nim
22:15:12rayman22201yay. another +1 :-)
22:18:00*rnrwashere joined #nim
22:22:06*rnrwashere quit (Remote host closed the connection)
22:22:12*rnrwashere joined #nim
22:43:20*rnrwashere quit (Remote host closed the connection)
22:44:14*rnrwashere joined #nim
22:44:54*yglukhov[m] quit (Ping timeout: 264 seconds)
22:45:03*yglukhov[m] joined #nim
22:47:53*luis_ joined #nim
22:58:24*lritter quit (Quit: Leaving)
23:03:29*rnrwashere quit (Remote host closed the connection)
23:05:39*rnrwashere joined #nim
23:06:49*ikan-keli_ quit (Quit: ZNC 1.8.x-git-125-e415d9f5 - https://znc.in)
23:07:36*ikan-keli_ joined #nim
23:15:03*theelous3_ quit (Ping timeout: 245 seconds)
23:17:38*rnrwashere quit (Remote host closed the connection)
23:17:49*rnrwashere joined #nim
23:17:58*luis_ quit (Ping timeout: 246 seconds)
23:34:51*arecacea1 quit (Remote host closed the connection)
23:35:10*arecacea1 joined #nim
23:40:29*rnrwashere quit (Remote host closed the connection)
23:45:21*rnrwashere joined #nim
23:47:52*abm quit (Quit: Leaving)
23:49:34*rnrwashere quit (Ping timeout: 244 seconds)
23:52:07*rnrwashere joined #nim
23:56:18*rnrwashere quit (Ping timeout: 245 seconds)
23:58:03*rnrwashere joined #nim