<< 13-04-2018 >>

00:04:10*enthus1a1t is now known as enthus1ast
00:09:13*arnetheduck quit (Read error: Connection reset by peer)
00:20:22FromGitter<arnetheduck> Araq, so here's *the* idea to solve all your std lib problems: remove it! just ship with a minimal compiler, system.lib and a nimble that can get the rest, nicely split up into pieces.. strutils sucks? that's fine, just let it stay in permafrost for old apps to download and make a new one.
00:21:00FromGitter<arnetheduck> imagine how clean the issue tracker will be :)
00:22:28*yglukhov joined #nim
00:27:08*yglukhov quit (Ping timeout: 276 seconds)
00:28:26*smt quit (Read error: Connection reset by peer)
00:28:47*smt joined #nim
00:39:09*dddddd quit (Remote host closed the connection)
00:47:49*mostly-harmless quit (Ping timeout: 256 seconds)
00:50:46FromGitter<zacharycarter> well I finished - took me 2 hours past the deadline and then some for the last question
00:51:06FromGitter<zacharycarter> but I got 3/4 done before the deadline and even though I didn't get the last one in on time - I still finished it
00:51:09FromGitter<zacharycarter> so I'm hopeful
00:51:20FromGitter<zacharycarter> but meh - we'll see
00:54:54*mostly-harmless joined #nim
01:01:00petersjt014[m]Hi, I have sort of an abstract question
01:01:42petersjt014[m]I've been messing around with Nim for a bit now and can definitely see myself using it practically
01:02:13petersjt014[m]And I also kind of like the python-ish feel to it
01:02:48FromGitter<krux02> you are welcome
01:03:26petersjt014[m]But I also like functional programming, which is supremely frustrating in Pytthon (seriously, that lambda syntax)
01:03:53FromGitter<krux02> well nim is not really a functional programming language either
01:04:00FromGitter<krux02> it's procedural
01:04:31petersjt014[m]The thing I was going to ask if it's 'better' at FP than python
01:05:20FromGitter<krux02> well I am not a python programmer so I can't say anything about that comparison, but compared to scala it is not as good as that language at functional programming
01:05:44FromGitter<krux02> but the question is also, what do you understand as functional programming?
01:05:50petersjt014[m]definitely not, yeah.
01:06:09petersjt014[m]my view of FP is something like:
01:06:17FromGitter<krux02> but it is much better than scala in actually using resources efficiently.
01:07:00petersjt014[m]I knd of got that impression, yeah
01:07:53FromGitter<krux02> so what's your question?
01:08:08petersjt014[m]I've been trying to look for a good functional scripting language for awhile now, and it sure aint easy
01:08:22FromGitter<krux02> scripting language?
01:09:15FromGitter<krux02> nim is not a scripting language either. It is a compiled language that can alse be "interpreted"
01:09:37FromGitter<krux02> but it is not a classical scripting language that you would integrate into anthore program such as lua.
01:10:23petersjt014[m]I consider it a scripting lang by comparison to some others (i.e. Java). What does lua do differently?
01:10:47FromGitter<krux02> is is optimized for being embedded as as scripting language into other programs
01:11:14FromGitter<krux02> it is used in games such as factorio and company of heroes
01:12:02FromGitter<krux02> what do you want to do? that is the more important question
01:12:23FromGitter<krux02> then I might be able to answer more specifically if nim is the right language for you.
01:13:24FromGitter<krux02> I programmed extensively in c++ Scala Go and Nim and also looked into a lot of other languages, so I might be able to give you an idea
01:13:32FromGitter<krux02> but I am going to bed very very soon
01:14:12petersjt014[m]I suppose It's the fact that I really like some of the features that FP offers (referential transparency and the like), and I always like to see if I can make them useful in any language I try
01:14:40FromGitter<krux02> what is referential transparency?
01:14:47petersjt014[m]some it works terribly in (python), some so-so (ruby), some pretty good (javascript)
01:15:19petersjt014[m]The idea that a function will always return the same result for the same input
01:15:40petersjt014[m]i.e. no reliance on state
01:16:00FromGitter<krux02> well nim as a pragam to tag and check functions as side effect free
01:16:43petersjt014[m]what exactly are pragmas? I only recognize the term from sqlite
01:17:14FromGitter<krux02> pragmas in nim are like tags
01:17:43FromGitter<krux02> just tell the compiler "hey I want this function to be side effect free, please ensure that for me"
01:18:17petersjt014[m]ah. I've seen that before
01:18:21FromGitter<krux02> pragmas are a way to talk to the compiler
01:18:23petersjt014[m]scala has one for tail recursion
01:18:31FromGitter<krux02> yes
01:18:35FromGitter<krux02> same thing
01:19:14petersjt014[m]I think I've found that my question doesnt really have an easy answer
01:19:45petersjt014[m]im still not completely sure what it even exactly is, but I got a grasp
01:19:53FromGitter<krux02> yes and your referential transparency, is it really easy to ensure in javascript?
01:21:02petersjt014[m]sort of. strongly preferring using consts and freezing just about do it
01:21:32FromGitter<krux02> well consts exist in nim, too.
01:21:38FromGitter<krux02> let doesn't allow you to mutate
01:21:47FromGitter<krux02> const is compile time constant
01:22:26petersjt014[m]right
01:22:27FromGitter<krux02> but for the most part it is a style of programming.
01:22:49FromGitter<krux02> if you want your functions to be referential transparent, then you write them that way.
01:22:59FromGitter<krux02> it's the same in c++
01:24:02FromGitter<krux02> and scala might be a good functional programming language, but it doesn't ensure referential transparency at all. At least not when I programed it.
01:24:04*xkapastel quit (Quit: Connection closed for inactivity)
01:24:27petersjt014[m]I use it and it's def not enforced
01:24:48FromGitter<krux02> it just makes it east to program functional with all the functional constructs such as map flod reduce map collect partial fucnitons etc
01:24:53petersjt014[m]unless you only use `val` instead of `var`
01:25:10FromGitter<krux02> not even then
01:25:34FromGitter<krux02> well yes a val can't be reassigned, but a function can just change a var somewhere else
01:26:12*endragor joined #nim
01:26:18petersjt014[m]hybrid object-functional goes some weird places :\
01:26:28FromGitter<krux02> so even in scala, a functional programming language, it is mostly about good programming skills and not tools
01:26:52FromGitter<krux02> if you want referential transparency I recommend you haskell
01:27:08FromGitter<krux02> it has a very unique evaluation scheme
01:27:23petersjt014[m]ah, the scary language
01:27:30FromGitter<krux02> function arguments are actually not evaluated on function invocation
01:28:02petersjt014[m]lazy eval?
01:28:09FromGitter<krux02> lets say you have a function with two arguments but it just returns the second
01:29:02FromGitter<krux02> then you can pass a value as the first argument that is basically just an endless loop
01:29:39FromGitter<krux02> but that endless loop(recursion to be honest) will never be evaluated, because the function doesn't use it
01:30:05FromGitter<krux02> that is a very unique feature of that language and it can only be done, because it is purely functional
01:30:19FromGitter<krux02> a function println could not be implemented in haskell
01:30:31FromGitter<krux02> because it doesn't return a value that can be used for something
01:30:41FromGitter<krux02> meaning it would never be executed
01:30:48*endragor quit (Ping timeout: 260 seconds)
01:31:05FromGitter<krux02> that dosn't mean that there is no println
01:31:25petersjt014[m]monads or something wrapper-like handle that then?
01:32:40FromGitter<krux02> yea monads is the keyword
01:32:51FromGitter<krux02> I hate that word, because it just confuses people
01:32:57FromGitter<krux02> or scares them away.
01:33:05petersjt014[m]last time I tried looking it up it was a mess
01:33:17FromGitter<krux02> "Don't fear the Monads" are names of talks about haskell
01:33:30petersjt014[m]stackoverflow had a post with 100+ answers, none accepted, and was locked :/
01:33:38FromGitter<krux02> the average user just understands "... fear ... monads"
01:34:51petersjt014[m]for practical use, just thinking "magic state thingy" is what I'd prob do
01:35:10FromGitter<krux02> monads sholud get a proper name, so people who hear it the first time get actially an idea what it is about.
01:35:38FromGitter<krux02> it's bascally just map input to output
01:35:58FromGitter<krux02> when there is no input, there is also no output
01:36:02FromGitter<krux02> dead simple
01:36:47FromGitter<krux02> but yea enough for me for today I need sleep
01:36:49FromGitter<krux02> good night
01:37:12petersjt014[m]k, I kind of have an answer
01:37:48*vlad1777d quit (Ping timeout: 260 seconds)
01:38:11petersjt014[m]I'll be trying to use it ideomatically, but'll still jump for a mapreduce etc if practical
01:39:25petersjt014[m]there'll be other interesting conceptual things to learn along the way anyway
01:56:10shashlickinteresting conversation
01:56:23shashlickI guess the main question I had was what you're trying to do
01:56:56*paysonl_ joined #nim
01:57:59FromGitter<zacharycarter> I didn't read the convo
01:58:01FromGitter<zacharycarter> but there is - https://github.com/vegansk/nimfp
01:58:09FromGitter<zacharycarter> and probably some other fp related Nim stuff out there on github already
02:02:21FromGitter<zacharycarter> man... I don't think I know of ANY employees at my current company that would have passed that programming test
02:02:55FromGitter<zacharycarter> I mean I didn't - but I came close - but I bet there are like < 5 people that would have passed the first quesiton
02:03:42FromGitter<zacharycarter> and it's not that difficult of a question - it's just no one at my current company knows what they asked
02:04:12FromGitter<zacharycarter> it's not the problem domain we solve - so no one codes in / deals with that low level of code
02:04:36FromGitter<zacharycarter> if I had never done any programming outside of my job I wouldn't have been able to answer it
02:04:48shashlickI don't know why interviews are about testing the impossible
02:04:55FromGitter<zacharycarter> well it's not impossible
02:05:31FromGitter<zacharycarter> it's just like - I'm applying for a webdev role and they asked me to write a C++ class implementing a dynamic 2d array that can be resized
02:05:35FromGitter<zacharycarter> and you can just wrap vector from STL
02:05:59FromGitter<zacharycarter> so like - yeah - I can do that because I have experience with C++ from Nim and game programming etc...
02:06:16FromGitter<zacharycarter> but if I was like the average donk at my company that knows Java and maybe some NodeJS
02:06:39FromGitter<zacharycarter> there's no way they would have been able to do it
02:06:59FromGitter<zacharycarter> can't just wrap STL vector* sorry
02:08:39FromGitter<zacharycarter> if I don't get this job - I'm thinking about just quitting my current job - and then offering my services to them as a consultant
02:09:33FromGitter<zacharycarter> because at this point - I just can't take the ridiculousness that goes on there on a daily basis and the castration of people that could actually make things better
02:25:22shashlickwhat's your interest?
02:27:11FromGitter<zacharycarter> well - I just like being challenged as a programmer and getting to learn lower and lower level programming concepts
02:27:47FromGitter<zacharycarter> I was a history major in college and then I started testing .NET software and learned VB and C# and TSQL and then switched to the JVM
02:28:16FromGitter<zacharycarter> but now - having done a lot of C/C++ | Nim programming I really can't stand my job
02:28:30FromGitter<zacharycarter> it's like a full-stack web dev role atm but I don't want to write JS or TypeScript or Java etc
02:28:47FromGitter<zacharycarter> I mean - a lot of people at my job like Java and think it's great - I just can't comprehend
02:29:34FromGitter<zacharycarter> and then it seems like the people behind the worst decisions, are further enabled to make more terrible decisions
02:29:38FromGitter<zacharycarter> it's like you fuck up and get promoted
02:29:40FromGitter<zacharycarter> idgi
02:30:56shashlickinterested in moving to texas? :)
02:32:53FromGitter<zacharycarter> haha - what's in Texas?
02:34:57*SenasOzys quit (Ping timeout: 265 seconds)
02:35:36shashlickI am, could look around for openings where I work - large multinational so
02:38:28FromGitter<zacharycarter> meh - I dunno - I have no idea what my next move will be
02:38:34FromGitter<zacharycarter> I'm just hoping this current thing works out
02:39:49shashlickI hope so too
02:40:29shashlickis there a simple way to kick off a child process and kill it if it doesn't exit in X seconds?
02:41:05FromGitter<zacharycarter> thanks!
02:41:13FromGitter<zacharycarter> with Nim? I don't know...
02:44:49leorizeshashlick: use https://nim-lang.org/docs/osproc.html#waitForExit,Process,int
02:47:32shashlicktrue - startProcess(), loop on waitForExit() then kill() thanks!
02:47:44shashlickam going to use parallel as well
02:56:28NoOpnim syntax is lovely but kinda strange for me, I wanna do so many things already with it :D but I'm like a child wanting to ride a bike without learning to ride it :S
02:56:28NoOpxD
03:00:48FromGitter<zacharycarter> RTFM :)
03:01:01FromGitter<zacharycarter> orrrrr come from a python background
03:01:04FromGitter<zacharycarter> either works
03:01:23FromGitter<zacharycarter> but welcome either way!
03:01:34FromGitter<zacharycarter> I'm going to bed now
03:01:59NoOpI come from a python background
03:02:02NoOpxD
03:02:04NoOpbye :D
03:02:12NoOpyou went to bed :(
03:02:30NoOpI mean `initCountTable[string]()` ?
03:02:38NoOpthat's what I mean lol
03:17:16*endragor joined #nim
03:31:24shashlickit's kinda quiet now
03:34:05NoOpikr
03:35:21shashlickya, cause most folks are from Europe, I'm in Texas so an hour more before I log off
03:41:19*athenot quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
03:43:24*yglukhov joined #nim
03:46:14NoOplegit
03:46:23NoOpim from Fl
03:47:12*black_13wv joined #nim
03:48:20NoOpwhy this thing doesn't works? https://i.imgur.com/87CDgVK.png
03:48:58*yglukhov quit (Ping timeout: 264 seconds)
03:51:35*black_13wv quit (Remote host closed the connection)
03:52:40*sz0 quit (Quit: Connection closed for inactivity)
03:53:52leorizeNoOp: you might want to put code in pastebin instead
03:54:34NoOphttps://pastebin.com/raw/M1hrWyJK
04:02:43leorizeNoOp: your Rand object is always using the same seed
04:03:04NoOpaaaaaaaaaah
04:03:30leorizealso, you might want to simplify your code with the implict "result" variable
04:05:11*m712zp joined #nim
04:05:18NoOpgotcha
04:07:19*m712zp quit (Remote host closed the connection)
04:17:51NoOpthanks :D
04:46:01*leorize quit (Quit: WeeChat 2.1)
05:38:57Araqbtw 'func' is now an alias for 'proc {.noSideEffect.}', so FP got a tiny little bit better :-)
05:41:20*DarkArctic_ joined #nim
05:41:40shashlickgood morning araq - I was about to log off
05:41:46shashlickhttps://gist.github.com/genotrance/79aae96cc5e39c7859585c1638f10049
05:42:15shashlicki've posted the crash test script as a gist for now, lots of things that could be improved but it does quite a bit already
05:42:27*niv quit (Quit: Ping timeout (120 seconds))
05:42:48shashlicklaptop dying so will post as repo tomorrow - feedback appreciated
05:42:53*niv joined #nim
05:42:57*byte512 quit (Ping timeout: 264 seconds)
05:44:23*DarkArctic quit (Ping timeout: 255 seconds)
05:46:12Araqok thank you!
05:46:29*byte512 joined #nim
05:53:33*floppydh quit (Read error: Connection reset by peer)
05:54:22*floppydh joined #nim
05:58:03*aguspiza joined #nim
06:10:12*leorize joined #nim
06:17:04*nsf joined #nim
06:18:58*aguspiza quit (Ping timeout: 260 seconds)
06:21:03FromGitter<data-man> @Araq: https://github.com/data-man/issuesources ⏎ getSources <label>
06:21:53FromGitter<data-man> I am late :(
06:25:49Araqwell, combine these 2 scripts perhaps
06:26:11Araqand run them
06:27:13Araqand create a PR containing "closes #1234, closes #2345, closes #5555" with test cases that ensure these bugs stay fixed
06:28:58Araqthe task doesn't really involve Araq. :-)
06:31:34Araqwe can make a challenge out of this. who closes the most bugs for 0.19. :P
06:32:54Araqspeed is rewarded indirectly as the one who comes first has the most easy-to-close bugs in the repo.
06:35:09FromGitter<narimiran> > **<Araq>** btw 'func' is now an alias for 'proc {.noSideEffect.}', so FP got a tiny little bit better :⁠-) ⏎ ⏎ nice one!
06:35:15*aguspiza joined #nim
06:42:46*gokr joined #nim
06:43:48FromGitter<Varriount> Araq: Is there a way to output the number of allocations made during the life of a program?
06:45:34*gokr left #nim (#nim)
06:49:05*aguspiza quit (Ping timeout: 240 seconds)
06:51:53FromGitter<data-man> Oh, parseSql with Stream support was removed :(
06:52:11Araqonly by hacking into lib/system/alloc.nim
06:52:22Araqbut it's a one line change
06:52:38Araqdata-man: no, it was only moved to the bottom of the file
06:53:10FromGitter<data-man> Oh, my bad :)
06:56:36*xet7 joined #nim
06:58:07FromGitter<Varriount> Araq: Woo! My AWS v4 signing code is nearly 3 times faster. And it makes fewer heap allocations.
06:58:20FromGitter<Varriount> @cheatfate Thanks for the awesome crypto library!
06:59:40*jaco60 joined #nim
07:03:42*yglukhov joined #nim
07:05:09*yglukhov_ joined #nim
07:05:29*yglukhov quit (Read error: Connection reset by peer)
07:06:33*Vladar joined #nim
07:07:26*vivus joined #nim
07:07:30*yglukhov_ quit (Read error: Connection reset by peer)
07:08:06*yglukhov joined #nim
07:10:20*Trustable joined #nim
07:27:18FromGitter<gogolxdong> Did you release your package?
07:28:55FromGitter<krux02> @zacharycarter your problems are actually very common.
07:29:54FromGitter<krux02> Araq: since when does func work? I think I will use a lot more now. I think I tried it in the past and assumed it was exactly that, but it didn't work.
07:30:26Araqsemcheck was added in 0.18 and completed yesterday
07:30:47Araqit might still grow the "write tracking" features though
07:31:15FromGitter<krux02> that is cool
07:31:20FromGitter<krux02> I will use it for sure
07:31:28Araqwhich means 'func' will be a feature that is
07:31:33Araqa) behind a keyword
07:31:35Araqb) useful
07:31:37Araqc) used
07:31:42Araqd) quirky.
07:31:53AraqI'm beginning to see a pattern here ...
07:32:21FromGitter<krux02> well at the moment I would disagree on d, but maybe that is because I didn't see the quirkyness yet.
07:32:41Araqwell for now it's safe, but just wait until I enabled the write tracking...
07:33:04FromGitter<narimiran> `func` can still use global variables, just not modify them, right?
07:33:22Araqno, it can't. .noSideEffect means no access to globals.
07:33:40FromGitter<narimiran> that's great to hear!
07:33:50*yglukhov quit (Read error: Connection reset by peer)
07:33:53FromGitter<krux02> ah then it is not "noSideEffects" but more "referential transparent"
07:34:13Araqyeah well, noSideEffect is a misnomer
07:34:16FromGitter<krux02> which is a phrase nobody knows what it means unless you look it up.
07:34:18Araqit really means noGlobals
07:34:22*yglukhov joined #nim
07:34:31FromGitter<krux02> but consts are ok?
07:34:41Araqmaybe we should introduce noGlobals. consts are ok, yes.
07:35:23FromGitter<krux02> and what about cheating? like how do I implement a fuction that tells the compiler "hey I am referential transparent, but please don't check it, I am cheating"
07:35:30FromGitter<krux02> like "debugEcho"
07:35:33FromGitter<narimiran> i have seen you have added a line in the changelog about `func` - imho, it would be good to add this brief explanation, to reduce confusion
07:35:53Araq'func' doesn't even have a proper entry in the manual
07:36:03FromGitter<krux02> well it's a keyword
07:36:13FromGitter<krux02> and I really do like the distinction between func and proc
07:36:22Araqme too.
07:36:28FromGitter<narimiran> me three
07:36:42FromGitter<krux02> func is a function for functional programming and proc is a procedure for procedural programming
07:36:58Araqvar vs let, func vs proc, the parameter passing semantics
07:37:07AraqNim gets lots of things right.
07:37:17FromGitter<narimiran> ...and `func` is closer to the mathematic definition of a function, which is also a plus
07:37:18FromGitter<krux02> yes
07:37:47Araqand I already want to annotate my parameters with 'sink' everywhere, a good sign.
07:37:59Araq:-)
07:38:04FromGitter<krux02> maybe tutorials should start explaining functions first, so people start with that first. and then they only use proc when actually needed.
07:38:42FromGitter<krux02> sink? like the default in rust?
07:38:50FromGitter<narimiran> should sugar `->` be for procs or funcs?
07:38:55Araqno, it's different.
07:39:21Araq'sink' is different from Rust, it's quite close to by-copy parameters in C++. curiously.
07:39:34skelettThe only documentation I could find about is "Future directions: func may become a keyword and syntactic sugar for a proc with no side effects:"
07:40:07FromGitter<krux02> @narimiran: I think `->` is for procs at the moment, but that's a good point
07:40:08skelettIn the noSideEffect section
07:40:20Araqskelett: yeah, I know :-)
07:40:49FromGitter<narimiran> @krux02 yeah, it is for procs, but with this change, funcs are finally meaningful :)
07:40:50FromGitter<krux02> I rememer that. Good that it is the case now
07:41:23Araqto answer your question about cheating, via 'cast'
07:41:41Araqcast the proc you need to call to a proc with .noSideEffect. a bit messy, but it works.
07:42:08FromGitter<krux02> yea it doesn't need to be pretty.
07:42:13FromGitter<krux02> it just needs to be possible
07:44:08Araqhmm thinking about it, we can make the write tracking emit warnings, no?
07:44:23Araqthen we have some room to fix its bugs and glitches
07:44:59FromGitter<krux02> yea mean warnings instead of errors?
07:45:07Araqyes
07:46:19FromGitter<krux02> well that would make debug echo obsolete, and I would see where debug echo is called.
07:47:24FromGitter<krux02> not sure if I like that. Because normally libraries are full of warnings.
07:48:15FromGitter<mratsim> use Nim!!!
07:48:37FromGitter<mratsim> uh, my Gitter is not in sync at all
07:48:40FromGitter<krux02> ??
07:48:43FromGitter<krux02> ah
07:49:03FromGitter<krux02> if you are talking about my advices there, I just wanted to be honest about everything
07:49:05FromGitter<mratsim> last conversation was the one with Zach interview
07:56:10FromGitter<mratsim> > <Araq> btw 'func' is now an alias for 'proc {.noSideEffect.}', so FP got a tiny little bit better :⁠-) ⏎ ⏎ No side effects is not about no globals only, it’s really about referential transparency: if you read from a file and the result changes depending on what you read, it shouldn’t be allowed (which Nim does properly). It’s at a cross-road of the no globals and “tainted” input.
07:57:14FromGitter<mratsim> OpenMP is also tagged “side-effect” because the results is indeterministic, it may depends on the order the threads finish their work
07:57:35Araqwell the spec is pretty clear about what .noSideEffect means.
07:57:46Araqyou are talking what it means in FP land.
07:58:08FromGitter<mratsim> actually no, it also worked like that in Nim ;) whatever the name is
07:58:12FromGitter<mratsim> works*
07:58:28Araqyes, for reasons you don't understand :P
07:58:39FromGitter<mratsim> ah, accidental agreement :P
07:59:01Araqan IO effect is a write to an unnamed global variable, like the terminal's output window
07:59:33FromGitter<mratsim> Indeed
07:59:40Araqand so write() and friends are marked as .sideEffect
08:02:23Araqand procs which call .sideEffect procs are themselves with .sideEffects
08:02:48Araqand so it all works out, but strictly speaking the semantics are "does not access a global"
08:03:20FromGitter<mratsim> What about OpenMP?
08:04:07AraqOpenMP should really be deterministic :-)
08:04:35*gmpreussner quit (Ping timeout: 240 seconds)
08:04:35Araqyou can probably argue it accesses a global under the hood ;-)
08:05:08Araqbtw like every other FP language we pretend heap allocations are not writes to globals...
08:05:26vivusWhich is the most popular GUI lib I can use with nim?
08:05:27*gmpreussner joined #nim
08:05:52FromGitter<mratsim> I gathered about 440 reddit point by taking my Araq hat about non-determinism 2 weeks ago: https://www.reddit.com/r/programming/comments/873vvy/2_2_4_er_41_no_43_nvidias_titan_v_gpus_spit_out/dwas6sa/
08:06:07*Vladar quit (Quit: Leaving)
08:06:12Araqvivus: my libui wrapper for Nim works fine but is very limited
08:06:30Araqkarax is browser based.
08:06:52vivusI just want to wrap another Nim lib and make a very small/experimental GUI app.
08:06:52Araqand then we have GTK3, wxWidgets, Qt wrappers. and FLTK iirc
08:07:20Araqit depends on the widgets that you need.
08:07:27FromGitter<mratsim> Also nix which apparently works quite well (but OpenGL based):https://github.com/yglukhov/nimx
08:07:33FromGitter<mratsim> nimx*
08:07:47Araqfor example, if you need a syntax highlighting component, libui is not for you.
08:07:51FromGitter<data-man> func vs proc is like to function and procedure in Pascal?
08:08:36Araqvivus: I would start with libui and/or PMunch's DSL on top of it
08:08:39FromGitter<mratsim> func results only depends on passed parameters
08:08:53FromGitter<mratsim> or consts
08:09:01vivusnoted.
08:09:10Araqdata-man: the distinction in Pascal makes little sense, in Pascal functions return values and procedures don't. very different from Nim's ideas.
08:10:14FromGitter<mratsim> Ah it’s like VB function vs procedure
08:10:15vivusso is that a real thing? a function and procedure have a different meaning? I've also seen functions inside classes called "methods"
08:10:56Araqmethods are orthogonal to this and are about attaching the routine to one type.
08:11:23*NimBot joined #nim
08:11:41FromGitter<mratsim> methods are only useful for polymorphism/inheritance
08:11:47FromGitter<data-man> I was hoping that it would be in Pascal :(
08:11:52vivusyeah that's a bit over my head lol.
08:12:18Araqdata-man: you should be happy we improved upon old Pascal.
08:12:34FromGitter<mratsim> Easy then: don’t use inheritance/polymorphism? use procs.
08:13:06Araquse polymorphism? use proc vars :P
08:13:53Araqoh mmmm, 'method's are behind-a-keyword, useful, used, quirky...
08:14:37Araqsame for 'not nil'. what a mess. any brilliant solutions around?
08:14:39vivusa common question lots of beginners ask is: "if I only write functions in my program, am I doing functional programming?"
08:15:23Araqhmm that sounds true once I enabled write tracking for them, yes.
08:17:37vivusAraq: is this libui: https://github.com/nim-lang/ui ?
08:17:42Araqyep
08:18:03FromGitter<data-man> @Araq: I'm happy :) About setLastModificationTime. This proc can be used for github's issues scripts, e.g. We can assign an issue time to downloaded file. It's helpful for a file managers.
08:19:30FromGitter<gogolxdong> func can't be async?
08:23:07Araqprobably not, they register at the event loop
08:23:34*sendell joined #nim
08:26:49Araqdata-man: what? sounds like a hack. instead add a comment with a date inside the code snippet
08:27:02Araqlying about file timestamps is a horrible idea
08:27:59FromGitter<data-man> Also I want a saveTime parameter to downloadFile.
08:29:19Araqthe more features of an operating system I ignore, the happier I am.
08:30:31FromGitter<data-man> But Nim is a systems programming language. :)
08:31:49Araqalternatively you can worry about signal-safe code all day long and trailing whitespace and file access bits and colors in your pathetic 80x20 terminal environments and TTYs...
08:33:32Araqor how to stop demon processes or how to spell them
08:33:33FromGitter<data-man> pathetic? We have truecolor! :-D
08:34:26FromGitter<alehander42> ohh func, finally
08:34:48FromGitter<alehander42> @Araq will there be v0.19 at all ? :D
08:34:50FromGitter<mratsim> Now @yglukhov cannot say “I think you are going overboard with noSideEffect” :D
08:35:11yglukhovhuh
08:35:14FromGitter<alehander42> :D
08:35:18yglukhovwhy not?
08:35:29yglukhovohh func, i see...
08:35:30FromGitter<mratsim> proc {.noSIdeEffect.} —> func
08:35:52yglukhovmratsim: well, i'm happy for you =)
08:36:55FromGitter<mratsim> @alehander42 I thought we still could do a 0.18.2
08:38:47FromGitter<mratsim> actually `func` is will probably quite useful with {.this:self.} because it becomes evident where to search “where the hell did that came from"
08:43:03FromGitter<alehander42> we can converge the version to pi * 6
08:46:05*MonsterAbyss quit (Ping timeout: 256 seconds)
08:46:09FromGitter<data-man> I remembered the question from the old math book: what is bigger, e*Pi or Pi*e? :)
08:58:39FromGitter<alehander42> I couldn't solve it @data-man , now i feel weak
08:59:51FromGitter<alehander42> but I used `nim secret` to solve it [cuts to a billboard in a weird advertisement]
09:00:06FromGitter<alehander42> calculate*
09:00:43Araqe^pi = -1
09:01:34FromGitter<alehander42> I am sure there was an `i` there
09:01:42FromGitter<alehander42> but can't remember where exactly
09:02:37FromGitter<alehander42> e ^ (pi * i)
09:03:23Araqah yeah lol
09:05:17FromGitter<krux02> Araq: https://github.com/nim-lang/Nim/pull/7585
09:06:16*dddddd joined #nim
09:06:35*SenasOzys joined #nim
09:13:07Araqhint: close+reopen to trigger a rebuild
09:14:56FromGitter<krux02> Ah ok, seems a good idea. can I also close and reopen?
09:15:46Araqsure
09:16:01FromGitter<krux02> Araq: can you close this? it is just the introduction of dead code with no functionality
09:16:03FromGitter<krux02> https://github.com/nim-lang/Nim/pull/7572
09:16:22Araqhey it's data-man, he is around
09:16:55Araqbut I agree, data-man please create PRs when you've got something to show :-)
09:17:00FromGitter<krux02> @data-man hey I just talk about your pr
09:19:11*MonsterAbyss joined #nim
09:31:30narimiran[m]any news about for-statement maybe?
09:33:19*vivus quit (Quit: Leaving)
09:38:46FromGitter<mratsim> the repo is growing at a rate of 5~10 bugs a day :O
09:39:01FromGitter<mratsim> @narimiran for-expression you meant?
09:41:38narimiran[m]i mean for on the right-hand side of a =
09:41:50FromGitter<mratsim> yes, that’s an expression ;)
09:42:28narimiran[m]any news about for-expression maybe? :)
09:42:40FromGitter<mratsim> you can use my package for that at the moment: https://github.com/numforge/loop-fusion
09:43:36FromGitter<mratsim> Feel free to add your input on what name to give: https://github.com/numforge/loop-fusion/issues/2
09:45:03Araqnarimiran[m]: it's tricky, so no. the parser additions looked easy enough but how to design it is tricky.
09:46:27FromGitter<alehander42> you can also use zero_functional for most cases when you'd have a one line body and you need some kind of result
09:48:01narimiran[m]thanks guys, i know about both libraries, but i was interested if we could have something like that built-in
09:48:41narimiran[m]i guess we won't, at least not for v1
09:48:58FromGitter<alehander42> :D vote for small goverment, vote for no more stdlib/language features
09:49:23FromGitter<alehander42> (no, I want for-expr too, just found always amusing to compare language ecosystems to economy)
09:49:57*SenasOzys quit (Ping timeout: 265 seconds)
09:51:08*xet7_ joined #nim
09:52:20Araqlet x = @[for a in s: if cond: a]
09:52:25Araqlet x = @[for a in s: if cond: yield a] ?
09:52:43narimiran[m]without yield
09:53:27FromGitter<mratsim> yield would make that more in line with inline iterators
09:53:38FromGitter<mratsim> toSeq(for a in s: if cond: yield a)
09:53:46*xet7 quit (Ping timeout: 264 seconds)
09:53:52narimiran[m]and this look nicer than current LC, imo
09:54:07*jaco60 quit (Ping timeout: 260 seconds)
09:54:46FromGitter<mratsim> but it’s too that no expression (if or block) uses yield so
09:58:12FromGitter<data-man> @Araq @ krux02 ⏎ The idea is that the user can specify his own unrolling step. ⏎ When I optimized strutils.find it gave a very good performance boost. ⏎ And I need help from a macro-gurus. :) For the unroll template. [https://gitter.im/nim-lang/Nim?at=5ad07f346d7e07082bed6e3b]
09:58:54*leorize quit (Ping timeout: 260 seconds)
09:59:07FromGitter<mratsim> @data-man that can be a start, I hard-coded the operations though: https://github.com/mratsim/Arraymancer/blob/master/src/tensor/fallback/blas_l3_gemm_micro_kernel.nim#L18
10:00:39FromGitter<mratsim> also this: https://github.com/nim-lang/Nim/blob/devel/lib/system/gc.nim#L393
10:05:26*SenasOzys joined #nim
10:08:54FromGitter<mratsim> but I think you can just use GCC/Clang: -fmax-unroll-times flag
10:09:39FromGitter<mratsim> ah no it’s a —param max-unroll-times=n
10:09:42FromGitter<data-man> @mratsim: Thanks, I saw it. ⏎ I think about something like this: ⏎ ⏎ ```template unroll(startIndex, lastIndex: int, variable, body: untyped) =``` [https://gitter.im/nim-lang/Nim?at=5ad081e65d7286b43a251d2c]
10:09:44Araqthat blindly unrolls everything I think
10:10:00FromGitter<mratsim> I’d rather have the {.unroll: n.} pragma working ;)
10:10:06FromGitter<data-man> How about unrolling for js?
10:10:15*Vladar joined #nim
10:10:16FromGitter<mratsim> people don’t use JS for performance
10:10:19Araqjs has a JIT
10:10:27AraqJITs excel at these things
10:10:27FromGitter<mratsim> and V8/node is probably doing something about it
10:10:32Araqyup.
10:10:57Araqunrolling is only for static compilers really that lack profile information
10:12:00Araqthat said, I don't know why C++ has no JIT available :-)
10:12:14FromGitter<mratsim> too slow to compile already :D
10:12:25Araqyou have the LLVM IR
10:12:31Araqwhich is the same for everything.
10:12:34FromGitter<data-man> I think that manual unrolling is better. And more reliable. :)
10:12:58FromGitter<mratsim> then try to get {.unroll: n.} pragma working I think, currently it’s a stub
10:13:06Araqyes.
10:17:08FromGitter<alehander42> what happened to the of branches with shared fields idea btw
10:17:23FromGitter<data-man> With my PR not need to modify a sources for changing the unrolling step.
10:17:56Araqbut that's a bad idea. usually I want "small code" unless it is "hot", then I want unrolling.
10:18:05AraqI don't want to unroll all my loops.
10:18:33Araqthe unroll annotation needs to be attached to the loop.
10:18:36FromGitter<data-man> Just set step to 1
10:18:53Araqotherwise you can indeed just use —param max-unroll-times=n
10:18:59Araqfor clang.
10:19:23FromGitter<mratsim> if I take the example of Arraymancer, I want to unroll loops where I work on integers or floats. but I don’t want to unroll loops on whole tensors.
10:20:44FromGitter<mratsim> also loop unrolling introduce register pressure, so the best unrolling factor also depends on how much variables are needed within a loop.
10:22:27FromGitter<mratsim> related GCC bug loop unrolling + register pressure: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=20969
10:24:19FromGitter<data-man> I planned to implement the loop unrolling in many modules: sequtils, algorithm, ... Maybe for strutils it's also will be useful.
10:24:27Araqalso consider the fact that a modern CPU does out-of-order execution with register renaming
10:24:42Araqwhich is comparable to what loop unrolling does.
10:25:24FromGitter<mratsim> sequtils I’m not sure, seq\[float\] ok, but seq\[seq\[float\]\] is probably not ok
10:26:47FromGitter<mratsim> unless you add `when T is SomeNumber: {.unroll: 4.}`for example to have type-specific unrolling
10:27:15FromGitter<data-man> "For further optimizations." as it's written in my PR. :)
10:27:19FromGitter<alehander42> does `unroll` honor `debugInfo` or something like that?
10:28:22FromGitter<alehander42> or, should it? (can we assume the unrolling can't possibly have introduced a "different" bug?)
10:29:12*kier quit (Remote host closed the connection)
10:30:20FromGitter<mratsim> unrolling introduces bugs, at least I have hard time to get it right when the unroll factor is not a divisor of the number of loops somehow
10:30:27*kier joined #nim
10:34:09FromGitter<mratsim> or maybe {.unroll: n.} should just emit #pragma unroll n ?
10:34:30Araqseems wise.
10:35:04Araqwe're not really in the backend optimizer business, we produce C code for a reason.
10:35:59*leorize joined #nim
10:39:35*MonsterAbyss quit (Ping timeout: 240 seconds)
10:42:36*birdspider joined #nim
10:46:38FromGitter<alehander42> does `#pragma unroll n` always generates an unroll, or it depends on the compiler/env
10:54:04Araqbetter lc for you tinker with: https://gist.github.com/Araq/971a36d03fad0ed04e01282b4cee0bcb
10:55:32FromGitter<data-man> `````` [https://gitter.im/nim-lang/Nim?at=5ad08ca3109bb04332baf975]
11:01:53Araqonce my semityped macros work we can make the type inference smarter ...
11:13:26*MonsterAbyss joined #nim
11:14:42FromGitter<AxDSan> legito
11:20:40*MonsterAbyss quit (Ping timeout: 256 seconds)
11:21:21*SenasOzys quit (Ping timeout: 256 seconds)
11:22:30FromGitter<AxDSan> this is on my end ⏎ ⏎ #``` ⏎ ⏎ #GlobalBenchmark relative time/iter iters/s ... [https://gitter.im/nim-lang/Nim?at=5ad092f6080a3850532a4596]
11:24:04*leorize quit (Ping timeout: 260 seconds)
11:29:52FromGitter<data-man> @AxDSan: -d:release is defined?
11:32:09*floppydh quit (Ping timeout: 264 seconds)
11:44:31*floppydh joined #nim
11:47:09FromGitter<mratsim> @data-man you will skip computation for size 10 for example
11:47:23FromGitter<mratsim> you will only do 0..<8
11:48:00FromGitter<mratsim> your last should be the biggest multiple of 8 below openarray.high
11:48:17FromGitter<mratsim> and then you have to special case your increment
11:48:34FromGitter<mratsim> unrolling for non divisor is a pain ;)
11:49:15FromGitter<AxDSan> @data-man Nope, `nim c -r "d:\DevStuff\NimDev\projects\learning-nim\nene.nim"` was specified
11:49:23FromGitter<mratsim> or decrement before the last while by the 8 - mod(high, 8) or something like that
11:49:41FromGitter<mratsim> @AxDSan you must use -d:release for benchmark
11:50:26FromGitter<AxDSan> with -d ⏎ ⏎ #``` ⏎ ⏎ #GlobalBenchmark relative time/iter iters/s ... [https://gitter.im/nim-lang/Nim?at=5ad09982df3e0fb547d2f1ea]
11:50:34FromGitter<mratsim> mod(high, 8) can be replaced by `high and 7` but the compiler should do that for you anyway
11:51:54FromGitter<mratsim> also @data-man for benchmark the seq length should be supplied by command-line because I think the compiler here can deduce the size and number of unrolls at compile time. The 0.35% difference can probably be explained because you are doing less work due to the increment issue
11:56:45*SenasOzys joined #nim
12:04:01Araqwow nobody cares about my 'lc' macro :-)
12:07:51*MonsterAbyss joined #nim
12:08:09FromGitter<mratsim> I will actually steal it and use it for loopfusion :P
12:08:56FromGitter<krux02> lc macro, you mean list comprehension?
12:09:07FromGitter<mratsim> this: https://gist.github.com/Araq/971a36d03fad0ed04e01282b4cee0bcb
12:09:11FromGitter<krux02> the use of the [] operator is just a bad idea
12:09:33FromGitter<mratsim> maybe reuse @[] and be done with it
12:10:17Araqhmmm?
12:10:19*leorize joined #nim
12:10:28AraqI don't use []
12:10:31FromGitter<data-man> @mratsim: Thanks! Without ```mod``` - just to replace ```while x <= last:``` on ```while x <= last - 8:```
12:10:50FromGitter<krux02> @mratsim what would be a good pattern to mach both nnkStmtList(therealpattern(...)) and therealpattern(...)
12:11:03FromGitter<krux02> I am asking about a cool syntax
12:11:03FromGitter<alehander42> in zero_functional we manage to just hint the shape without `newSeqint ()`, like: `let x = [1, 2, 3] --> filter(it mod 2 == 0) --> to(seq)`
12:11:07FromGitter<krux02> at the moment I don't know
12:11:22FromGitter<alehander42> is something like that possible here? lc(seq): ..
12:11:58FromGitter<mratsim> @alehander42 the issue is with conditional filters. When I tried to use it in loop fusion, Nim complained that sometimes it received void and sometimes a value of type T
12:13:09FromGitter<alehander42> I need an example, but I think that can be solved, I haven't had such issues
12:13:18Araqalehander42: I don't know, I'd rather spend my time on semityped which is the right solution
12:13:35FromGitter<alehander42> @krux02 why can't it `of pattern, otherPattern:`
12:13:53FromGitter<alehander42> like now you can `of Enum, OtherEnum:`
12:13:55FromGitter<mratsim> @alehander42 latest example: https://github.com/numforge/loop-fusion just use a “if i mod 2 ==0"
12:13:58FromGitter<alehander42> (you can, right? )
12:13:59*xet7_ is now known as xet7
12:14:13Araqkrux02: how do you deal with Pattern(x, x) ?
12:14:39FromGitter<mratsim> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ad09f2f01a2b40f382ebe4f]
12:14:40Araqthat requires a notion of equality and for Nim's Nodes there is not only one notion of equality
12:14:44FromGitter<krux02> what do you mean with pattern(x,x)
12:15:05Araqplus(x,x) --> x*2
12:15:23Araqit means I bind 'x' to the first argument and then check the second argument is the same
12:15:37FromGitter<krux02> well I don't deal with it at all
12:15:45FromGitter<krux02> at the moment it would fail to compile I think
12:15:53Araqpity but good enough.
12:16:16FromGitter<krux02> nnkInfix(`x`,`x`) would generate two variables both named x
12:16:31FromGitter<krux02> the if could solve it
12:16:42FromGitter<alehander42> ok, maybe Araq needs plus(`x`, `x`) ?
12:16:53FromGitter<krux02> of nnkInfix(`x`, `y`) if `x` == `y`:
12:17:00FromGitter<alehander42> ```plus(`x`, `x`)```
12:17:16Araqyeah that's good enough, albeit not as sexy
12:17:27FromGitter<krux02> well first of all it needs to work
12:17:35FromGitter<alehander42> yeah, having plus(`x`, `x`) would be nice, but it can get in a next version
12:17:41FromGitter<krux02> I use astspec.txt as test case
12:18:35FromGitter<krux02> so I cant o create a test that verifies that the astspec is correct
12:19:54FromGitter<zacharycarter> @krux02 - what problems?
12:19:59FromGitter<zacharycarter> you mean with my work?
12:20:12FromGitter<zacharycarter> or the ones on the test?
12:23:52FromGitter<alehander42> @mratsim shoudln't it be @[7] ?
12:25:05FromGitter<alehander42> anyway I see
12:26:39FromGitter<mratsim> yeah forgot to change the assert
12:27:52FromGitter<krux02> @zacharycarter I don't remember
12:27:57FromGitter<mratsim> by the way, any comment @alehander42 for @krux02 proposal: https://github.com/numforge/loop-fusion/issues
12:27:58FromGitter<krux02> I think it was your work
12:28:09FromGitter<mratsim> sorry: https://github.com/numforge/loop-fusion/issues/2
12:29:06FromGitter<zacharycarter> oh yeah - I was bitching about how no one at my job has any low level programming / native programming knowledge
12:29:16FromGitter<krux02> yes that one
12:29:20FromGitter<zacharycarter> and they don't care to understand anything lower than the code they write
12:29:27FromGitter<krux02> that is very very common heared it from so many people
12:29:30FromGitter<zacharycarter> they don't even really know about the JVM memory model etc
12:29:43FromGitter<zacharycarter> yeah - it's bad
12:30:14FromGitter<krux02> well when you know about it, you can humiliate them, maybe then they will be less arrogant
12:30:29FromGitter<zacharycarter> they humiliate themselves
12:30:40FromGitter<zacharycarter> I quoted one of our devs the other day saying -
12:30:52FromGitter<zacharycarter> > All code is garbage, and should be treated as such.
12:31:09FromGitter<zacharycarter> so your saying your job is to produce garbage? and then you're supposed to treat the output of your job as garbage?
12:31:16FromGitter<zacharycarter> ok...
12:31:28FromGitter<krux02> well I don't know the context
12:31:32FromGitter<krux02> could also mean something else
12:31:35FromGitter<zacharycarter> we were just talking about different programming languages
12:31:45FromGitter<zacharycarter> no he was trying to insinuate that you shouldn't spend time trying to write good code
12:31:49FromGitter<krux02> could be an expression of frustration about the bad code quality
12:31:51FromGitter<zacharycarter> and that no one writes "good code"
12:31:55FromGitter<data-man> @Araq: #7545 ⏎ The man worked. Any comments?
12:32:12FromGitter<zacharycarter> he also was the braintrust behind one of the projects at CFX that's supposed to fill the role of an API gateway
12:32:29*vivus joined #nim
12:32:56FromGitter<zacharycarter> except to put your API behind said "gateway" you have to check out the project, and write Java that basically just exposes HTTP endpoints and proxies your request to another HTTP endpoint.
12:33:07FromGitter<zacharycarter> but again - in order to do that - you have to check the project out and add code to it
12:33:11FromGitter<zacharycarter> and tests
12:33:19FromGitter<zacharycarter> while other teams are trying to do the same thing
12:33:46FromGitter<zacharycarter> and this kid - even after everyone says what a shitty idea this was - gets promoted or at least gets more autonomy to work on projects all other developers are instructed to rely on
12:34:09Araqhttps://github.com/nim-lang/Nim/pull/7545 that one?
12:34:36FromGitter<data-man> unicode stuff
12:36:00FromGitter<alehander42> @mratsim I am not sure about the loopfusion type thing, I don't have time to go deeper in the impl, in zero_functional we had a way to always generate the correct return type anyway
12:36:02FromGitter<krux02> well yea I recently heared the term "sales prevents office"
12:36:12FromGitter<alehander42> but if it's about threating if as an expression
12:36:13Araqthese tables need to be generated from the unicode standard
12:36:29FromGitter<alehander42> maybe you can just inject `sdfsdf.add(code)` in `if test: code`
12:36:32AraqI hesitate to have more of these that require manual maintainance.
12:36:33FromGitter<alehander42> when there is no else ?
12:36:48FromGitter<mratsim> @alehander42 it was just about the name `forEach` vs `forZip`
12:36:56FromGitter<alehander42> no I am talking about your example
12:36:59FromGitter<alehander42> and the compiler
12:37:33FromGitter<mratsim> yes, I will probably do it like Araq did, a recursive inspection to detect the variable and replace it by add
12:37:49FromGitter<alehander42> yeah
12:38:47FromGitter<krux02> well for me it is a no brainer to call it `forZip`
12:38:54FromGitter<krux02> but it's me who created that issue
12:39:26Araqkrux02: have you looked at 'patty' from andreaferretti?
12:41:01FromGitter<data-man> @Araq: In PR the tables from unicode 10.0 (the last official)
12:43:34FromGitter<alehander42> yeah, forZip or forEachZip might be more precise
12:44:34AraqNim's 'for' is always 'for each'
12:44:41AraqforZip is fine.
12:45:18Araqdata-man, so what, we would need to adapt them manually for Unicode 11.0
12:45:27Araqand that's bad.
12:45:43FromGitter<data-man> And we need to update the tables for alphas, spaces, etc.
12:45:54Araqyep.
12:46:03Araqwe have staticRead and compiletime parsing
12:46:26Araqand what do we do? have manual data arrays in unicode.nim? it's pathetic.
12:47:13AraqFYI I copied these tables from Plan 9 and never updated them. I'm pretty sure we didn't have good compile-time parsing back then
12:50:44FromGitter<data-man> I wonder what's faster: binary searching in a tables or case's ranges?
12:51:47Araqthe 'fast' binary search for a power of two? :-)
12:52:19Araqcompilers translate the case ranges into binary searches but I bet they don't know about fastBinarySearch
12:52:50FromGitter<data-man> Maybe. :) ⏎ @Araq: In other languages, a tables are updated only with the new version of unicode.
12:53:27AraqGolang generates its tables from the Unicode spec.
12:53:34AraqFreePascal does it too.
12:54:10Araqit's easy to regenerate if from the .txt files. I'm not asking for downloading the spec at compile-time...
12:55:57FromGitter<data-man> My copy of Go contains generated tables.go
12:56:13Araqyes, *generated*.
12:56:23AraqI'm asking for the same.
12:57:30FromGitter<data-man> But unicode.nim also contains generated. We just to regenerate them for 10.0. :)
12:58:27Araqand then what do you? delete, copy&paste manually?
12:58:43Araqsee the problem? it's not generated when you do manual work.
12:59:13Araqyou can either use a macro to produce these tables or have it in an 'include' file
12:59:31FromGitter<data-man> New tool? gentables in tools?
12:59:59Araqif you can't do it in a macro.
13:00:31FromGitter<data-man> It's slowly
13:01:44*DarkArctic_ quit (Read error: Connection reset by peer)
13:04:16Araqkrux02: (?nnkStmtList)(therealpattern(...))
13:04:46Araqit's an optional nnkStmtList you want to skip, so prefix ? seems good
13:13:23*nixfreak joined #nim
13:17:04FromGitter<narimiran> i'm reading previous conversations.... about `forEach` and `forZip` - i agree with others that `forZip` is better (but i feel as there must be even better name, just nobody has thought of it yet) cc @mratsim
13:19:11FromGitter<krux02> Araq: I found a way to not need it in pattern matching at all, I use peelOff, I think I saw it in the comiler as `skip`
13:19:32FromGitter<krux02> doesn't solve everything, but I don't want to make the project too big for now
13:21:29Araq'skip' is everywhere in the compiler, yes.
13:25:30FromGitter<mratsim> I bow down before @krux02 @narimiran @Araq and @alehander42 and will use `forZip`, also `mapReduce` and `mapFold` for the reduce and fold version (I need the last 2 to properly deal with multiprocessing cache invalidation/bank conflicts)
13:28:56FromGitter<narimiran> haha, i say wait until we find some better name :)
13:30:38*floppydh quit (Remote host closed the connection)
13:31:27*floppydh joined #nim
13:33:16*nixfreak quit (Ping timeout: 256 seconds)
13:39:15*xkapastel joined #nim
13:40:24*user1101 joined #nim
13:41:32*chemist69 joined #nim
13:41:36FromGitter<data-man> D's fans also want interpolated strings :) https://github.com/dlang/dmd/pull/7988 ⏎ @Araq: Can the fmt macro be improved so that specifiers can be in variables? (minimumwidth at least)
13:41:58FromGitter<narimiran> btw, `forEach` can be also used with only one container, right? (`let x = forEach(x in a): x+10`)
13:42:38FromGitter<narimiran> if so, `forZip` might not be a good name
13:45:26FromGitter<narimiran> maybe `forAll`?
13:47:09Araqmeh.
13:47:31Araqmoar features for fmt, no thanks
13:48:45FromGitter<mratsim> @narimiran yes you can use it with only one container
13:48:52*couven92 joined #nim
13:48:59FromGitter<mratsim> forAll is a good name
13:50:02FromGitter<mratsim> I want to use this: ∀
13:50:39FromGitter<mratsim> post it as a suggestion in the RFC thread
13:50:48Yardanico∀ ?
13:51:10FromGitter<narimiran> Yardanico : maths way of saying for all
13:51:14FromGitter<mratsim> ∀ means for all
13:52:11shashlickdata-man: looks like we have similar code?
13:52:12FromGitter<mratsim> ∀x ∈ ℕ means for all x (natural numbers)
13:52:31FromGitter<mratsim> fun time at school :P
13:54:56FromGitter<alehander42> I remember I was very confused when I read type theory and they expressed type rules as equivalents to forall in sets etc
13:55:12FromGitter<alehander42> maybe it has been some kind of type theory connections with set theory thing
13:55:33FromGitter<mratsim> probably category theory / Monads from Haskell
13:56:41FromGitter<mratsim> Monoid / Group / Ring comes from Math category theory
13:56:50FromGitter<alehander42> no, not really related to that
13:56:52FromGitter<mratsim> Monad I’m not sure, never saw that in my math classes
13:56:55FromGitter<mratsim> oh
13:57:11FromGitter<alehander42> maybe more related to curry howard isomorphism
13:57:22FromGitter<alehander42> but I am just googling it now , so I might be mistaken again
13:58:08FromGitter<AxDSan> where is `format`?
13:58:10FromGitter<alehander42> yes, you can view universal quantification as generalised product type (Π type) and existential quantification as generalised sum type (Σ type)
13:58:13FromGitter<AxDSan> as in echo `format`
13:58:33FromGitter<alehander42> and similarly function type as implication
13:58:54FromGitter<alehander42> it seemed very elegant, I have to brush up my logic
13:58:57FromGitter<AxDSan> was looking at https://forum.nim-lang.org/t/1235/2 for string interpolation but I get a undeclared identifier
14:01:57FromGitter<data-man> @shashlick: I started earlier, but you finished before :)
14:03:01FromGitter<mratsim> @AxDSan strformat module, import it
14:03:21FromGitter<mratsim> it’s called `fmt` or `&`
14:03:23FromGitter<AxDSan> @mratsim Thank you so much :D
14:03:27FromGitter<AxDSan> sweet
14:03:46FromGitter<AxDSan> like the syntactic sugar for `&`
14:03:55shashlickdata-man: do you see how we can consolidate? what was your goal? I am yet to see your code in detail
14:04:05FromGitter<mratsim> @AxDSan keep that as a bookmark: https://nim-lang.org/docs/theindex.html
14:04:37FromGitter<data-man> @AxDSan: https://nim-lang.org/docs/strformat.html
14:04:39FromGitter<mratsim> it’s different say you have a myvar defined you can use `&”printing {myvar}”`
14:05:40FromGitter<AxDSan> legit :D bookmarked :D
14:06:45FromGitter<data-man> @shashlick: I want to improve https://github.com/watzon/github-api-nim for full API support
14:06:58*paysonl_ quit (Remote host closed the connection)
14:07:25Araqdata-man: I'm waiting for your "close #x compiler crashes" PR
14:08:40shashlickso the gist I posted basically scans all issues (not PRs) and checks if there's a crash, then downloads and runs the snippet and verifies if ti still crashes
14:08:54shashlickit also creates a log of the snippet and output for further analysis
14:09:45*Trustable quit (Remote host closed the connection)
14:09:56Araqshashlick: it's now a competition
14:09:59*endragor quit (Remote host closed the connection)
14:10:19FromGitter<genotrance> well, so now that i have a list, what action do you want the script to take?
14:10:25Araqwho closes most bugs for the upcoming release. every tool is allowed.
14:12:01shashlickI need to improve some of the checks of the output, then I can tell if the code crashes or times out
14:12:04FromGitter<data-man> Yesterday my IP was blocked for GitHub's API access :-D
14:12:34shashlickbut I'm curious what action - just post a comment saying it no longer crashes
14:12:43*endragor joined #nim
14:14:23Araqshashlick: to say "closes #123" in a PR you have to add a test that proves that the bug is gone
14:15:26shashlickokay so take that snippet and make a test out of it?
14:15:34Araqexactly.
14:15:53shashlickdo you traditionally add such tests in new files or append to an existing file? any specific dir for compiler crashes?
14:16:20Araqmost crashes turn into better errmsgs/
14:16:36Araqand error messages is something we don't have collective tests for.
14:17:16Araqbut I tried to "enrich" existing tests if possible.
14:17:29Araqin order to fight travis and appveyor timeouts.
14:17:50*endragor quit (Ping timeout: 276 seconds)
14:18:26*floppydh quit (Quit: WeeChat 2.1)
14:21:13FromGitter<data-man> Hmm, maybe to collect an issues to db?
14:26:10shashlickOk so data-man how do you want to collaborate here
14:26:46FromGitter<krux02> shashlick: I prefer to apeend the tests to an already existing file
14:27:32FromGitter<krux02> new test files increase the time for tests to run through.
14:27:57shashlickI need to improve detection of failure types during compile and exec. That can be used to categorize better.
14:28:22shashlickAlso need to cache GitHub issues instead of downloading every time
14:28:48shashlickI'll find a file to append tests to
14:29:17Araqbtw if this turns into a github-issue-to-DB-importer I will be a happy man too
14:29:33*nixfreak joined #nim
14:30:27shashlickWhich db?
14:31:31FromGitter<data-man> OMG, I need to finish the new SQLite's wrapper :)
14:34:01Araqthere is only sqlite.
14:37:13*miran joined #nim
14:38:07shashlickno I'm not aware of this sqlite db - where is it stored and what's it's purpose?
14:40:08*jxv joined #nim
14:48:37Araqyou need to create it.
14:48:57Araqit doesn't exist yet.
14:52:01*athenot joined #nim
14:56:33FromGitter<data-man> Did you manually write bindings for SQLite? ⏎ ⏎ `````` [https://gitter.im/nim-lang/Nim?at=5ad0c5215f188ccc156057b3]
14:57:51Araqprobably I pas2nim'ed it.
15:03:00shashlickso you want a database of all nim fixed issues in an sqlite file?
15:05:00FromGitter<data-man> Maybe to rename all functions in the wrapper to accord with SQLite's API? And to fix db_sqlite.nim
15:08:10shashlicki'm still lost - is the goal to improve/complete the sqlite wrapper and the github issues are just a test bed?
15:11:55FromGitter<data-man> @shashlick: No, the github issues more important.
15:12:13Araqwhy would I like a database full of fixed bugs?
15:12:25Araqit should contain open bugs.
15:12:42Araqlike a structured todo list.
15:12:48shashlickoh okay, so you want a DB with all github data so that you can filter better
15:13:03Araqyes, but it's not as important as closing/fixing bugs
15:13:18Araq;-)
15:13:20shashlickwell, getting the json and converting to csv is super easy
15:13:26shashlickbut then that's spreadsheet hell
15:14:23shashlickyou want sqlite so that you can run queries? and perhaps generate a site out of it?
15:15:19FromGitter<data-man> @Araq: Do you use any GUI-app for for viewing a DBs?
15:15:41Araqsometimes.
15:15:54Araqshashlick: yeah to run queries, but as I said, it's not important
15:16:14shashlickwell, json => csv is easy, and there's csv => sqlite converts available
15:16:23Araqalternatively we can import the github issues to a github repository
15:18:20shashlickwell, there's many ways to solve this but the key is understanding your process so that the final product actually makes things easier
15:18:55shashlickwhat columns do you want to see? how do you expect to use the data
15:19:10shashlickif you give some use cases, it will help
15:19:16FromGitter<data-man> Ha-ha, GUI-app "IssueTracker" written on pure Nim. :)
15:19:44FromGitter<mratsim> wasn’t there a startup doing data viz on Nim issues just next to us on FOSDEM?
15:20:31shashlicki think it will be best to use a spreadsheet since it already does this well - pivot tables and what not. For a DB you will need to write queries for everything
15:20:46mirankeep it simple
15:21:23FromGitter<mratsim> the proper tool is NimData: https://github.com/bluenote10/NimData/blob/master/docs/viewer_example.png :D
15:21:34FromGitter<mratsim> buggy gitter
15:21:46FromGitter<zetashift> that's a big face on gitter
15:21:56FromGitter<data-man> @shashlick: I'm using https://github.com/sqlitebrowser/sqlitebrowser
15:21:57FromGitter<krux02> lol
15:22:29FromGitter<alehander42> :D I can't argue with this
15:23:34shashlickdata-man: makes sense
15:25:41shashlickdata-man: so are you working on this github => sqlite tool? seems different than the nim crash tool i'm working on
15:32:34FromGitter<data-man> @shashlick: I thought about DB an hour ago. It's a fresh idea. :)
15:38:40FromGitter<data-man> And now I remembered about the ormin library.
15:42:17miranalehander42: zero-functional is not in nimble?!
15:42:57miranahhh, _ instead of -
15:45:08FromGitter<alehander42> yep it's https://nimble.directory/pkg/zero_functional
15:45:50miranwill make quick PR to address this
15:46:50Araqmore good news for FP'lers. (1,) now produces a tuple
15:47:43*jaco60 joined #nim
15:47:54miranshould i add a note to emphasise it is `_` and not `-`, or do you think the (copy-pasteable) example is enough?
15:48:02*jxv quit (Quit: string can snapped)
15:48:56FromGitter<data-man> Wow ```29 files changed, 99 insertions(+), 64 deletions(-)``` :)
15:49:38miranAraq: next step with tuples - better unpacking in loops? (https://github.com/nim-lang/Nim/issues/7486) :)
15:50:56Araqmiran: for a, b in items(x) does unpack.
15:51:19Araqfor (a, b) in x is too ambiguous, could be pairs, could be unpacking for items.
15:51:28miransee the link
15:52:29AraqI know it.
15:52:35FromGitter<krux02> Araq: for loops, and a) ... d) quirky
15:52:40Araq> If mySeq is container of tuples, we currently need to do
15:52:44Araqno we don't.
15:52:53Araqall it takes is to spell out the 'items'.
15:53:25*aguspiza joined #nim
15:54:10FromGitter<krux02> I wish a new container type woudn't be required to implement all four iterators items mItems pairs mpairs
15:54:28FromGitter<krux02> it would be cool if pairs and mpairs would have a default implementation somehow
15:55:08FromGitter<krux02> in scala for example there is zipWithIndex, that works on everything with an iterator
15:55:42miranas stated in the thread, `items` solve first half of the problem. the second part is if you would like to use both index and unpacking
15:55:46Araqyeah yeah yeah, will have that when we decide to use 'concept' in the stdlib
15:56:27Araqmiran: that's an iterator chaining problem more than a tuple unpacking problem
15:58:48FromGitter<alehander42> @miran yeah, we should add a note indeed
15:59:13Araqkrux02: what's quirky about them?
15:59:19miranalehander42: on it!
16:04:26miranPR submitted
16:06:37miran(don't merge it yet, will add some more corrections)
16:15:01*yglukhov quit (Remote host closed the connection)
16:21:39FromGitter<alehander42> thanks miran <3
16:26:20*yglukhov joined #nim
16:29:57*yglukhov quit (Remote host closed the connection)
16:30:09*nsf quit (Quit: WeeChat 2.0.1)
16:30:10*yglukhov joined #nim
16:31:41FromGitter<krux02> Araq: well a lot.
16:32:19FromGitter<krux02> when you want to define iterators, you have to define four of them to follow the conventions: items mItems, pairs, mPairs
16:32:57*sendell quit (Remote host closed the connection)
16:32:58FromGitter<krux02> when you want to iterate with indices, you better hope that iterator has a pairs version
16:33:41shashlickdata-man: okay I'll continue with my work then
16:33:55FromGitter<krux02> when you iterate something that already generates paris, for example zipping two arrays, then then you want add also indices to it, you have to introduce a breaking naming convention
16:34:57*yglukhov quit (Ping timeout: 240 seconds)
16:37:58*smt` joined #nim
16:38:49shashlickis it possible to read from streams in a non-blocking fashion?
16:42:21*smt quit (Ping timeout: 264 seconds)
16:44:06miranalehander42: pushed. there are fewer changes than it looks like :)
16:46:34FromGitter<data-man> @shashlick: Maybe https://nim-lang.org/docs/asyncfile.html ?
16:47:10shashlickcool
16:51:05Araqkrux02: that's all about to be fixed.
16:51:25Araqwith yet another new feature ... :-)
16:51:43Araqbut at least it's about macros, so we have an excuse
16:53:07*zolk3ri joined #nim
17:01:42*athenot quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:04:02*athenot joined #nim
17:07:25*yglukhov joined #nim
17:09:19shashlickstreams.peekFile() is crashing with illegal storage access - i'm trying to read the outputStream() of a process I started with startProcess() - any ideas?
17:11:08shashlickstreams.nim(94) getPosition
17:12:08Araqan outputstream does not support peeking
17:14:13shashlickok then looking at asyncfile
17:15:32shashlickdon't think that will work either
17:16:42shashlickaraq: is there a nonblockig way to read from outputstream of process?
17:21:11Araqosproc.hasData(p)
17:21:42Araqmaybe check nimedit's console.nim
17:21:52shashlickyep it's right there :P
17:22:36*vlad1777d joined #nim
17:25:30*birdspider quit (Quit: Leaving)
17:25:47FromGitter<abijahm> btw the asyncstream module look very different from streams shouldn't they unified like file and asyncfile
17:28:18FromGitter<mratsim> Did other get conversion problem with: https://github.com/nim-lang/Nim/commit/f6df2d9956a79eda048639107274ce60cbcf3542 ?
17:28:46FromGitter<mratsim> We have CI broken on Windows and Mac but working on Linux for the whole day
17:35:04yglukhovAraq: hot code reloading is awesome. Any ideas of implementing it for native targets?
17:36:29FromGitter<alehander42> Araq I will rebase sourcemaps when I get home
17:38:36Araqso ... tests are red ... let's see
17:39:01Araqalehander42: btw I'm renaming it to --hotCodeReloading
17:39:11Araq--hotReloading is just weird :P
17:39:56miranis code hot, or is reloading hot?
17:40:36miranbecause that rename sounds like the former ;)
17:41:40FromGitter<mratsim> Nim is hot, as is blockchain ;)
17:45:01FromGitter<flowck> I everyone, I hope you're doing fine. I wrote a quick tutorial about Nim's installation process on Ubuntu. ⏎ ⏎ Any feedback is important. Thanks. ⏎ ⏎ http://firmino.engineer/installing-nim-lang-on-linux-ubuntu/ [https://gitter.im/nim-lang/Nim?at=5ad0ec9c2b9dfdbc3a89e4ea]
17:46:28miranflowck: in concepts (at the beginning), "choosenim basically: provideS..."
17:47:40miranbtw, installing via apt-get - which version does it install?
17:49:38shashlickI'm on Ubuntu artful and it has 0.17.2
17:50:05shashlickhttps://github.com/genotrance/tissue
17:50:09FromGitter<flowck> Thanks @miran
17:50:43FromGitter<flowck> I have the 0.18.0 installed on my environment
17:51:22FromGitter<flowck> Installing via apt-get should get you the latest version
17:54:02miranshashlick: any specific reason why you sometimes use `var` block, and sometimes each variable has its own `var`?
17:54:18shashlicknot used to blocks yet :)
17:55:54FromGitter<alehander42> @Araq I haven't worked on the hotReloading PR, but I agree hotCodeReloading is hotter
17:56:07shashlickmiran: is there any convention?
17:56:14FromGitter<alehander42> redHotReloadingPeppers
17:56:26miran:D :D
17:56:55FromGitter<alehander42> would be also a very scientific name
17:57:13miranshashlick: i'm looking at https://nim-lang.org/docs/nep1.html and i don't see it. to me it looks nicer
17:59:23miranbtw, dom96: maybe add a part about spacing between procs? is there a concensus about it, btw? (to me, one free line feels cramped, so i use two lines (just like in PEP8))
18:01:33Araqhah, it says "hot" and "load".
18:03:27*jaco60 quit (Read error: Connection reset by peer)
18:04:47*yglukhov quit (Remote host closed the connection)
18:08:32FromGitter<alehander42> Cold loads would be just depressing now
18:08:41FromGitter<data-man> @shashlick: if you replace ```$someJsonNode[...]``` to ```someJsonNode[...].getStr``` then you'll not need to do ```replace("\\r\\n", "\n")```
18:09:15shashlicknice
18:11:24*jaco60 joined #nim
18:13:22miranbtw, isn't there some package which would do cli parsing for you? :)
18:14:46*Vladar quit (Quit: Leaving)
18:17:49miran(i ask because i might need it relatively soon)
18:20:31Araqcligen iirc, check nimble
18:21:41FromGitter<data-man> @miran: cligen, docopt.nim, commandeer, lib/pure/parseopt :)
18:21:57mirancc shashlick
18:22:36mirancligen looks quite nice!
18:24:48*yglukhov joined #nim
18:27:06dom96miran: nep1 needs many changes. I didn't write it
18:28:03Araqapis.html should be part of nep1
18:28:25Araqor maybe not.
18:28:44Araqbut then apis.rst needs to be made more well known.
18:29:56miranthis is the first time i hear about it. it might be a part of new, more detailed nep1, imo
18:30:09Araqyglukhov: native targets, not sure. I'm not happy with --hotCodeReloading as it is, but at least the implementation complexity for JS is bearable
18:30:57*nixfreak quit (Ping timeout: 240 seconds)
18:31:37Araq--hint[source]:on is also not known.
18:31:50yglukhovAraq: in the meantime I'm playing with nimx trying to make it so that UI layout definition is updated in live preview as you're typing it in the editor. Kinda how react works.
18:32:24yglukhovthat involves dylibs and so on.
18:32:47Araqthe way we implement dylibs is excellent for hot code reloading
18:33:06yglukhovalso i've got an idea of a true native repl, that preserves process as you're advancing, that's pretty doable already, without nim changes needed.
18:33:12Araqwe only need to expose reloadDll("namehere.dll")
18:33:17yglukhovyep
18:34:46yglukhovso i've been thinking if we could somehow provide a way of making all functions into a dll, or smth. can't really formulate my idea yet. thought maybe you had some ideas about that.
18:35:44*rauss quit (Quit: WeeChat 2.1)
18:37:12Araqwell it would be comparable to how we build nimrtl.dll, no?
18:38:15yglukhovexactly. but I'm curious if it's possible to do this without explicit annotations.
18:38:29yglukhovand if it's really needed to in the first place :)
18:39:37yglukhovor maybe that were an ide should come into play...
18:39:45yglukhov*that's where
18:40:25AraqI need to figure out whether I prefer REPL or hot code reloading first.
18:40:35Araqand where the difference is...
18:41:53yglukhovlike I said nim as it is is absolutely repl compatible, as i'm seeing it.
18:42:31dom96It's not like REPL and hot code reloading are mutually exclusive features
18:42:41yglukhovah, but i get your point. you mean code reloading could make repl useless?
18:43:19Araqno, my point is:
18:43:29AraqI understand what a REPL needs to do.
18:43:59AraqI don't understand what hot code reloading needs to do. not really, anyway, never really used it anywhere before.
18:44:43AraqI notice that Python's REPL doesn't change Python and doesn't add API calls like reload()
18:45:06Araqand I noticed Nim's hot code reloading brought us a 'once' template.
18:45:08yglukhovwell, high-rate repeating code is subject to code reloading. like drawing, or game logic, or signal processing.
18:45:32yglukhovah, that one. yes, it is weird.
18:46:29yglukhovtbh, i did not consider global code at all. thought only about functions so far.
18:48:15yglukhovbut truth be told, python would behave in a similar way? i mean importing module will re-evaluate its globals, right?
18:48:34Araqwell I do understand that you're testing a level and want to fix the AI on the fly :P
18:49:09Araqso you press a key to open an internal terminal and type in 'reload ai.dll' :P
18:49:30Araqthat is mapped to what Nim offers.
18:49:52Araqdunno how Python's REPL deals with imports
18:49:57dom96libffi?
18:49:59yglukhovnah, that's too difficult. it's just 'while true: reload ai.dll; sleep 1sec'
18:50:30Araqlol
18:50:45shashlickdata-man - I've used docopt and commandeer, both are nice
18:50:52shashlickdidn't feel like it was needed yet for this
18:51:06AraqI wrote a toy RTS game engine once. and even that one had a command window for these things
18:51:16yglukhovAraq: i mean, it should feel like it. it surely could use file system monitor under the hood.
18:52:08yglukhovwell, ok, let's say both approaches should be possible =)
18:52:55Araqhmm I should port that engine to Nim...
18:53:18yglukhovoh, speaking about fs monitors. any thoughts on https://github.com/nim-lang/Nim/pull/7571? Araq, dom96, anyone?
18:53:38Araqit was written in Delphi back then with a preprocessor I wrote because Delphi sucked
18:53:45Araq:-)
18:53:57yglukhovhaha, and that's how nim appeared? :D
18:54:15Araqit certainly had an influence on Nim.
18:56:15yglukhovbbl
18:58:50Araqdom96: you keep bringing it up. want to work on it?
18:59:11dom96hah no
18:59:17FromGitter<krux02> Araq: Age of Wonders 2 is written in Delphi great game.
18:59:52FromGitter<krux02> and Age of Wonders 2 is great. so I like Delphi, indirectly.
19:00:09AraqBaldur's Gate was written in it too iirc
19:00:58Araqbut don't quote me on that.
19:08:10*shashlick quit (Ping timeout: 264 seconds)
19:10:26FromGitter<krux02> well baldur's gate has a Linux port, and Delphi does not have that AFAIK
19:10:43FromGitter<krux02> so I don't think baldur's gate is a Linux port.
19:10:50*endragor joined #nim
19:11:42Araq1. Delphi had a Linux port but it didn't sell well (because nothing sells well on Linux?)
19:12:06Araq2. FPC is compatible enough with Delphi and runs pretty much everywhere.
19:12:43Araq3. They might have ported it to C++ over the years, like many other Delphi based software.
19:15:24*endragor quit (Ping timeout: 260 seconds)
19:16:03FromGitter<krux02> I wonder is there anything really better in the Delphi world compared to c++?
19:16:20FromGitter<krux02> is it simpler, does it provide something c++ can't do?
19:16:44FromGitter<krux02> I would really like to know if there is something good about Delphi that I should know about.
19:17:00Araqbut I'm probably wrong, https://en.wikipedia.org/wiki/Baldur%27s_Gate doesn't indicate anything
19:17:32Araqwell Delphi compiled 100_000 LOC on a CPU you nowadays have in your toaster
19:17:41FromGitter<krux02> and yea nothing really sells well on Linux. I mean the system is about free software. it is even called "Free Software Foundation". But I do buy games for Linux.
19:17:51AraqLOC/s
19:18:08FromGitter<krux02> I have one boxed game that runs on Linux. And I basically bought only because if was for Linux.
19:18:22FromGitter<krux02> lines of code?
19:18:28Araqthey got bug reports about the "compile" button doing nothing.
19:18:29*SenasOzys quit (Ping timeout: 256 seconds)
19:18:45Araqbecause it was too fast. :-)
19:19:26FromGitter<krux02> that's cool
19:19:39Araqalso they had an IDE where you could drag&drop UI elements on a canvas
19:19:59Araqremember, that was before we had web apps.
19:20:10AraqUI development was a big thing then.
19:20:41Araqoh and it had bounds checking for its arrays
19:22:00Araqand a string type that know its length
19:22:32FromGitter<krux02> yay bounds checking. C doesn't really know it's bounds, so it can't really do do it
19:23:12FromGitter<krux02> collections that know it's size are generally a good thing
19:23:19Araqit also has subrange integer types and was memory safe, more or less.
19:23:22FromGitter<data-man> FreePascal has Lazarus and MSEide with MSEgui :)
19:24:02Araqthe original Pascal had new() for heap allocation but lacked dispose()
19:24:14*SenasOzys joined #nim
19:24:36Araqso it stayed memory safe but you had to reuse your list nodes on your own or else you would leak memory.
19:25:19Araqbut when you re-use the nodes on your own type/memory safety persists. pretty interesting design given its age.
19:26:44FromDiscord<geckojsc> lol I had to use Turbo Pascal on my CS course a few years back. I was genuinely worried because we had to do text processing in the exam, but our installation didn't support strings longer than 256 characters (in 2013!!)
19:27:25Araqthat's TP yeah. Delphi had "Ansi Strings", refcounted things
19:27:40FromDiscord<geckojsc> we must have been one of the only schools in the country who weren't using Python for that exam
19:29:21Araqnobody needs strings longer than 256 characters. :P
19:29:42miran...on twitter
19:30:10Araqyou should have build a linked list of strings and then write a couple of thousand lines to do the list handling.
19:30:15*shashlick joined #nim
19:30:48FromDiscord<geckojsc> :'(
19:31:22Araqfull of node^.next = node^.next^.next lines because it's the "disciplined", "structured" approach to build software.
19:31:25*rauss joined #nim
19:31:31Araqoh my bad
19:31:48Araqthat should have been node^.next := node^.next^.next
19:32:25FromDiscord<geckojsc> I do remember being impressed by the module system in turbo pascal. Better than header files
19:32:45FromDiscord<geckojsc> (given how old the language was)
19:32:59Araqyeah.
19:33:32Araq'unit' is a TP extension though. the original pascal had no module system.
19:33:48Araqnor #include, every solution was vendor specific.
19:33:53Araq:-)
19:34:00FromDiscord<geckojsc> D:
19:34:23*athenot quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:34:50FromGitter<data-man> And units can to have initialization and finalization sections.
19:35:20Araqso yeah. 70's Pascal was memory safe without a GC. Take that Rust!
19:36:38Araq(it also was unusable...)
19:37:22Araqbut hey, it was for teaching, and it was pretty good for teaching.
19:40:05FromGitter<data-man> TP produced .com files. Max size is 64KiB. :-D
19:41:30FromGitter<data-man> Early versions. Before the Windows era.
19:46:08FromGitter<krux02> invent a language for teaching and there will be people who program it. and it will eventually be a language where software is written in.
19:46:23*r3d9u11 joined #nim
19:47:31FromGitter<krux02> @data-man I think a Hello world in c++ is bigger than that
19:47:59Araqecho "hello world" # hello.nim
19:48:26Araq# in order to compile it to the tinyest possible file, do this:
19:48:39Araqcp hello.nim hello && chmod +x hello
19:49:14AraqNim's hello world binary size is almost unmatched :P
19:49:51FromGitter<krux02> well it's bash not nim
19:49:58FromDiscord<geckojsc> isn't that technically JIT? xD
19:53:06FromDiscord<geckojsc> wait actually what's happening there
19:53:56FromDiscord<geckojsc> would ./hello.nim invoke the nim compiler, or would it just run in bash?
19:57:36*miran quit (Quit: Konversation terminated!)
19:58:05FromGitter<data-man> > When my "Hello, World" programs are too large, I optimise them to "Hi, World". ⏎ ⏎ From Stack Overflow :-D
19:59:57FromDiscord<geckojsc> also I have a beginner's question: I cloned a nim repo, wrote a simple example in the same folder as the library source, and it works
19:59:57FromDiscord<geckojsc> but if I move the example to another directory it can't import the library module anymore. What would be the correct way to make it so the compiler can find the module?
20:03:01FromGitter<data-man> Add library's path to nim.cfg
20:03:54Araqgeckojsc: it depends on your setup but I don't use --path anymore
20:04:28Araqwith the import "../lib" / [a, b, c] syntax I can always do what I need
20:04:32Araqto.
20:07:53FromDiscord<geckojsc> ah ok, yeah that works just fine
20:12:03*r3d9u11 quit (Remote host closed the connection)
20:12:08FromDiscord<geckojsc> how would you do it if the library and program are in different repos altogether (but the library is not installable via nimble)
20:12:28Araqin the library dir:
20:12:31Araqnimble init
20:12:34Araqnimble develop
20:12:55Araqand then it's available, not need to "install" it via nimble
20:13:15FromDiscord<geckojsc> holy biscuits
20:13:30*yglukhov quit (Remote host closed the connection)
20:13:37Araqor you use --path then
20:17:25FromDiscord<geckojsc> nah, nimble develop is exactly what I was looking for, thank you :)
20:39:03*couven92 quit (Quit: Client disconnecting)
20:46:53FromDiscord<treeform> is there a way to pass a compile time flag to an import or include statement? This used to work before: https://gist.github.com/treeform/0c7331e3ecaff8697f50fc194d7d4d02 or I was just confused?
20:52:59FromGitter<mratsim> oh I missed a conversation about Age of Wonders and Baldur’s Gate
21:03:49FromDiscord<geckojsc> how do I decide between clear(renderer) clear renderer renderer.clear renderer.clear()
21:05:05Araqgood question, I don't know
21:05:30FromGitter<mratsim> listen to your heart
21:05:38Araqrenderer.clear() is probably what others use most often.
21:05:56Araqas 'clear' is pretty attached to the renderer it uses the dot syntax.
21:06:08Araqand as it is an effectful call it gets the ()
21:06:20FromDiscord<geckojsc> yeah, I guess that makes the most sense
21:07:15FromDiscord<geckojsc> the 3rd style probably makes most sense when the method is acting like a getter
21:07:27Araqyes
21:09:32*zolk3ri quit (Remote host closed the connection)
21:14:35*gmpreussner quit (Ping timeout: 240 seconds)
21:17:55*gmpreussner joined #nim
21:27:25*nsf joined #nim
21:41:40shashlickdo you need csources sitting around after bootstrapping once?
21:42:03Araqno.
21:42:23shashlickyou can just use koch to compile after that right?
21:42:29shashlicknim to compile koch to compile nim
21:45:41Araqsure
21:46:02shashlickrunning out of space on my laptop, have to ditch some stuff
21:47:03Araqbuy a new laptop?
21:47:49shashlickjust lots of unnecessary data on it
21:50:28FromDiscord<treeform> `when defined(nimphp)` what? PHP?
21:53:07*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
21:53:30Araqthe PHP backend never was official
21:53:46Araqand eventually somebody will clean up the code and throw it away
21:54:04Araqas you noticed, I'm not the guy who cleans up code.
21:54:44Araq(unless I fix related bugs or work on features touching it)
21:54:57*vlad1777d quit (Ping timeout: 265 seconds)
21:55:39Araqyou can buy Nim plus a PHP backend for a 1000$ license for every development machine that you use
21:56:43shashlickwhy don't we have an update script in the nim dir?
21:57:01Araq'koch update' used to be a thing
21:57:28*gokr joined #nim
21:58:32*gokr left #nim (#nim)
21:59:34FromDiscord<treeform> I can clean up the PHP if you want, there is only like 3 places: https://github.com/nim-lang/Nim/search?utf8=✓&q=nimphp
21:59:51FromDiscord<treeform> This is an actual problem i run into: https://github.com/nim-lang/Nim/issues/7603
22:00:37Araqwell you know how to fix it, right?
22:01:01shashlickwhy does ./koch temp c fail at the end? the bin is generated though
22:01:05FromDiscord<treeform> I hope so.
22:01:29shashlickbin/nim_temp c => command expects a filename argument
22:01:51Araqwell yes, strange question.
22:02:03Araq'koch temp' is for testing single files
22:02:48*athenot joined #nim
22:03:47FromGitter<data-man> It's Friday, 13th :-D
22:06:38Araqit's not. it's saturday already
22:06:45shashlickya but there's some issue in the koch temp c since it runs an empty command at the end
22:06:46*athenot_ joined #nim
22:07:31*athenot quit (Ping timeout: 265 seconds)
22:10:44*athenot joined #nim
22:11:14*athenot_ quit (Ping timeout: 255 seconds)
22:12:06FromDiscord<geckojsc> hey, is there any reason to use ; over , in parameter lists?
22:15:05*Lord_Nightmare joined #nim
22:15:33FromDiscord<treeform> Araq, do you know why in PHP case `cmp` just returns -1, 0, 1 while in nim's c case its like 4 and -4, and in JS is just difference between characters? Why don't they all just return one of -1, 0, 1?
22:16:10Araqshashlick: it's 'koch temp c foo.nim'
22:16:29Araqgeckojsc: ; is slightly more readable
22:16:53Araqtreeform: cmp returns == 0, < 0, > 0
22:17:30Araqit's not specified which values so that cmp for integers can be implemented as x - y with no branches
22:17:38FromDiscord<treeform> does it need to follow some pattern though?
22:17:49Araqtreeform: cmp returns == 0, < 0, > 0
22:17:57Araq== 0 iff a == b
22:18:02Araq< 0 iff a < b
22:18:06Araq> 0 iff a > b
22:19:01FromDiscord<treeform> I guess my real question is should I do A or B and why? https://gist.github.com/treeform/77b8b92f2cab7cf321198ef82d123fdd
22:21:18FromDiscord<treeform> Also I feel like in JS `if (`a` == `b`) return 0;` does `if (`a`.toString() == `b`.toString()) return 0;` when a or b could be huge arrays.
22:23:14shashlickOh I see
22:25:41FromDiscord<treeform> https://github.com/nim-lang/Nim/pull/7604
22:28:49Araqhuh? shouldn't it iterate over the minimum of the two lengths?
22:30:46FromDiscord<treeform> that too
22:31:33FromDiscord<treeform> just checked `a == b` is always false for arrays.
22:31:40FromDiscord<treeform> so that line does nothing
22:42:48FromDiscord<treeform> updated to check for minim of two lengths: https://github.com/nim-lang/Nim/pull/7604/files#diff-0a745113cb3d35b845b613e0e99a1300
22:51:48*nsf quit (Quit: WeeChat 2.0.1)
22:57:09FromGitter<genotrance> :q
22:57:34shashlickvim isn't quitting for some reason...
23:01:40Araqtreeform, rebase perhaps I just made the JS tests green
23:08:55FromDiscord<treeform> ok
23:09:45FromDiscord<treeform> Is my new bug related to the thing you just did ? https://github.com/nim-lang/Nim/issues/7605
23:10:12dom96Love that a link to a freaking commit adding webasm to Go can get on the HN front page... https://news.ycombinator.com/item?id=16834181
23:11:06FromDiscord<treeform> Any one doing webasm work for nim?
23:11:12FromDiscord<treeform> Anyone doing webasm work for nim?
23:11:36dom96https://github.com/stisa/nwasm
23:11:46FromDiscord<treeform> Neat
23:12:36Araqtreeform: maybe
23:14:01dom96Wishing this repo was a bit more minimal
23:14:22dom96like https://github.com/arnetheduck/nlvm
23:14:53FromDiscord<treeform> That repo looks like a fork, maybe it could be merged in later?
23:16:34dom96https://github.com/stisa/nwasm/issues/1
23:19:30Araqas I said, little frontend changes to make the backend spinoffs easier to develop are fine with me.
23:20:22Araqhttps://github.com/nim-lang/Nim/issues/7301 we need somebody for this bug
23:20:48Araqsupporting archaic systems is one of Nim's nichés
23:21:33Araqwe even support __VXWORKS__ :-)
23:22:04Araqwhich is a pretty offensive name since nothing 'works' on it.
23:24:23FromDiscord<treeform> Araq, i rebased waiting for the CI to run.
23:25:44Araqdon't wait for it, come back tomorrow
23:25:54Araqthe CIs are overly busy
23:28:05FromDiscord<treeform> ok
23:55:25*user1101 quit (Quit: user1101)