00:04:10 | * | enthus1a1t is now known as enthus1ast |
00:09:13 | * | arnetheduck quit (Read error: Connection reset by peer) |
00:20:22 | FromGitter | <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:00 | FromGitter | <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:46 | FromGitter | <zacharycarter> well I finished - took me 2 hours past the deadline and then some for the last question |
00:51:06 | FromGitter | <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:09 | FromGitter | <zacharycarter> so I'm hopeful |
00:51:20 | FromGitter | <zacharycarter> but meh - we'll see |
00:54:54 | * | mostly-harmless joined #nim |
01:01:00 | petersjt014[m] | Hi, I have sort of an abstract question |
01:01:42 | petersjt014[m] | I've been messing around with Nim for a bit now and can definitely see myself using it practically |
01:02:13 | petersjt014[m] | And I also kind of like the python-ish feel to it |
01:02:48 | FromGitter | <krux02> you are welcome |
01:03:26 | petersjt014[m] | But I also like functional programming, which is supremely frustrating in Pytthon (seriously, that lambda syntax) |
01:03:53 | FromGitter | <krux02> well nim is not really a functional programming language either |
01:04:00 | FromGitter | <krux02> it's procedural |
01:04:31 | petersjt014[m] | The thing I was going to ask if it's 'better' at FP than python |
01:05:20 | FromGitter | <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:44 | FromGitter | <krux02> but the question is also, what do you understand as functional programming? |
01:05:50 | petersjt014[m] | definitely not, yeah. |
01:06:09 | petersjt014[m] | my view of FP is something like: |
01:06:17 | FromGitter | <krux02> but it is much better than scala in actually using resources efficiently. |
01:07:00 | petersjt014[m] | I knd of got that impression, yeah |
01:07:53 | FromGitter | <krux02> so what's your question? |
01:08:08 | petersjt014[m] | I've been trying to look for a good functional scripting language for awhile now, and it sure aint easy |
01:08:22 | FromGitter | <krux02> scripting language? |
01:09:15 | FromGitter | <krux02> nim is not a scripting language either. It is a compiled language that can alse be "interpreted" |
01:09:37 | FromGitter | <krux02> but it is not a classical scripting language that you would integrate into anthore program such as lua. |
01:10:23 | petersjt014[m] | I consider it a scripting lang by comparison to some others (i.e. Java). What does lua do differently? |
01:10:47 | FromGitter | <krux02> is is optimized for being embedded as as scripting language into other programs |
01:11:14 | FromGitter | <krux02> it is used in games such as factorio and company of heroes |
01:12:02 | FromGitter | <krux02> what do you want to do? that is the more important question |
01:12:23 | FromGitter | <krux02> then I might be able to answer more specifically if nim is the right language for you. |
01:13:24 | FromGitter | <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:32 | FromGitter | <krux02> but I am going to bed very very soon |
01:14:12 | petersjt014[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:40 | FromGitter | <krux02> what is referential transparency? |
01:14:47 | petersjt014[m] | some it works terribly in (python), some so-so (ruby), some pretty good (javascript) |
01:15:19 | petersjt014[m] | The idea that a function will always return the same result for the same input |
01:15:40 | petersjt014[m] | i.e. no reliance on state |
01:16:00 | FromGitter | <krux02> well nim as a pragam to tag and check functions as side effect free |
01:16:43 | petersjt014[m] | what exactly are pragmas? I only recognize the term from sqlite |
01:17:14 | FromGitter | <krux02> pragmas in nim are like tags |
01:17:43 | FromGitter | <krux02> just tell the compiler "hey I want this function to be side effect free, please ensure that for me" |
01:18:17 | petersjt014[m] | ah. I've seen that before |
01:18:21 | FromGitter | <krux02> pragmas are a way to talk to the compiler |
01:18:23 | petersjt014[m] | scala has one for tail recursion |
01:18:31 | FromGitter | <krux02> yes |
01:18:35 | FromGitter | <krux02> same thing |
01:19:14 | petersjt014[m] | I think I've found that my question doesnt really have an easy answer |
01:19:45 | petersjt014[m] | im still not completely sure what it even exactly is, but I got a grasp |
01:19:53 | FromGitter | <krux02> yes and your referential transparency, is it really easy to ensure in javascript? |
01:21:02 | petersjt014[m] | sort of. strongly preferring using consts and freezing just about do it |
01:21:32 | FromGitter | <krux02> well consts exist in nim, too. |
01:21:38 | FromGitter | <krux02> let doesn't allow you to mutate |
01:21:47 | FromGitter | <krux02> const is compile time constant |
01:22:26 | petersjt014[m] | right |
01:22:27 | FromGitter | <krux02> but for the most part it is a style of programming. |
01:22:49 | FromGitter | <krux02> if you want your functions to be referential transparent, then you write them that way. |
01:22:59 | FromGitter | <krux02> it's the same in c++ |
01:24:02 | FromGitter | <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:27 | petersjt014[m] | I use it and it's def not enforced |
01:24:48 | FromGitter | <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:53 | petersjt014[m] | unless you only use `val` instead of `var` |
01:25:10 | FromGitter | <krux02> not even then |
01:25:34 | FromGitter | <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:18 | petersjt014[m] | hybrid object-functional goes some weird places :\ |
01:26:28 | FromGitter | <krux02> so even in scala, a functional programming language, it is mostly about good programming skills and not tools |
01:26:52 | FromGitter | <krux02> if you want referential transparency I recommend you haskell |
01:27:08 | FromGitter | <krux02> it has a very unique evaluation scheme |
01:27:23 | petersjt014[m] | ah, the scary language |
01:27:30 | FromGitter | <krux02> function arguments are actually not evaluated on function invocation |
01:28:02 | petersjt014[m] | lazy eval? |
01:28:09 | FromGitter | <krux02> lets say you have a function with two arguments but it just returns the second |
01:29:02 | FromGitter | <krux02> then you can pass a value as the first argument that is basically just an endless loop |
01:29:39 | FromGitter | <krux02> but that endless loop(recursion to be honest) will never be evaluated, because the function doesn't use it |
01:30:05 | FromGitter | <krux02> that is a very unique feature of that language and it can only be done, because it is purely functional |
01:30:19 | FromGitter | <krux02> a function println could not be implemented in haskell |
01:30:31 | FromGitter | <krux02> because it doesn't return a value that can be used for something |
01:30:41 | FromGitter | <krux02> meaning it would never be executed |
01:30:48 | * | endragor quit (Ping timeout: 260 seconds) |
01:31:05 | FromGitter | <krux02> that dosn't mean that there is no println |
01:31:25 | petersjt014[m] | monads or something wrapper-like handle that then? |
01:32:40 | FromGitter | <krux02> yea monads is the keyword |
01:32:51 | FromGitter | <krux02> I hate that word, because it just confuses people |
01:32:57 | FromGitter | <krux02> or scares them away. |
01:33:05 | petersjt014[m] | last time I tried looking it up it was a mess |
01:33:17 | FromGitter | <krux02> "Don't fear the Monads" are names of talks about haskell |
01:33:30 | petersjt014[m] | stackoverflow had a post with 100+ answers, none accepted, and was locked :/ |
01:33:38 | FromGitter | <krux02> the average user just understands "... fear ... monads" |
01:34:51 | petersjt014[m] | for practical use, just thinking "magic state thingy" is what I'd prob do |
01:35:10 | FromGitter | <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:38 | FromGitter | <krux02> it's bascally just map input to output |
01:35:58 | FromGitter | <krux02> when there is no input, there is also no output |
01:36:02 | FromGitter | <krux02> dead simple |
01:36:47 | FromGitter | <krux02> but yea enough for me for today I need sleep |
01:36:49 | FromGitter | <krux02> good night |
01:37:12 | petersjt014[m] | k, I kind of have an answer |
01:37:48 | * | vlad1777d quit (Ping timeout: 260 seconds) |
01:38:11 | petersjt014[m] | I'll be trying to use it ideomatically, but'll still jump for a mapreduce etc if practical |
01:39:25 | petersjt014[m] | there'll be other interesting conceptual things to learn along the way anyway |
01:56:10 | shashlick | interesting conversation |
01:56:23 | shashlick | I guess the main question I had was what you're trying to do |
01:56:56 | * | paysonl_ joined #nim |
01:57:59 | FromGitter | <zacharycarter> I didn't read the convo |
01:58:01 | FromGitter | <zacharycarter> but there is - https://github.com/vegansk/nimfp |
01:58:09 | FromGitter | <zacharycarter> and probably some other fp related Nim stuff out there on github already |
02:02:21 | FromGitter | <zacharycarter> man... I don't think I know of ANY employees at my current company that would have passed that programming test |
02:02:55 | FromGitter | <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:42 | FromGitter | <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:12 | FromGitter | <zacharycarter> it's not the problem domain we solve - so no one codes in / deals with that low level of code |
02:04:36 | FromGitter | <zacharycarter> if I had never done any programming outside of my job I wouldn't have been able to answer it |
02:04:48 | shashlick | I don't know why interviews are about testing the impossible |
02:04:55 | FromGitter | <zacharycarter> well it's not impossible |
02:05:31 | FromGitter | <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:35 | FromGitter | <zacharycarter> and you can just wrap vector from STL |
02:05:59 | FromGitter | <zacharycarter> so like - yeah - I can do that because I have experience with C++ from Nim and game programming etc... |
02:06:16 | FromGitter | <zacharycarter> but if I was like the average donk at my company that knows Java and maybe some NodeJS |
02:06:39 | FromGitter | <zacharycarter> there's no way they would have been able to do it |
02:06:59 | FromGitter | <zacharycarter> can't just wrap STL vector* sorry |
02:08:39 | FromGitter | <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:33 | FromGitter | <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:22 | shashlick | what's your interest? |
02:27:11 | FromGitter | <zacharycarter> well - I just like being challenged as a programmer and getting to learn lower and lower level programming concepts |
02:27:47 | FromGitter | <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:16 | FromGitter | <zacharycarter> but now - having done a lot of C/C++ | Nim programming I really can't stand my job |
02:28:30 | FromGitter | <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:47 | FromGitter | <zacharycarter> I mean - a lot of people at my job like Java and think it's great - I just can't comprehend |
02:29:34 | FromGitter | <zacharycarter> and then it seems like the people behind the worst decisions, are further enabled to make more terrible decisions |
02:29:38 | FromGitter | <zacharycarter> it's like you fuck up and get promoted |
02:29:40 | FromGitter | <zacharycarter> idgi |
02:30:56 | shashlick | interested in moving to texas? :) |
02:32:53 | FromGitter | <zacharycarter> haha - what's in Texas? |
02:34:57 | * | SenasOzys quit (Ping timeout: 265 seconds) |
02:35:36 | shashlick | I am, could look around for openings where I work - large multinational so |
02:38:28 | FromGitter | <zacharycarter> meh - I dunno - I have no idea what my next move will be |
02:38:34 | FromGitter | <zacharycarter> I'm just hoping this current thing works out |
02:39:49 | shashlick | I hope so too |
02:40:29 | shashlick | is there a simple way to kick off a child process and kill it if it doesn't exit in X seconds? |
02:41:05 | FromGitter | <zacharycarter> thanks! |
02:41:13 | FromGitter | <zacharycarter> with Nim? I don't know... |
02:44:49 | leorize | shashlick: use https://nim-lang.org/docs/osproc.html#waitForExit,Process,int |
02:47:32 | shashlick | true - startProcess(), loop on waitForExit() then kill() thanks! |
02:47:44 | shashlick | am going to use parallel as well |
02:56:28 | NoOp | nim 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:28 | NoOp | xD |
03:00:48 | FromGitter | <zacharycarter> RTFM :) |
03:01:01 | FromGitter | <zacharycarter> orrrrr come from a python background |
03:01:04 | FromGitter | <zacharycarter> either works |
03:01:23 | FromGitter | <zacharycarter> but welcome either way! |
03:01:34 | FromGitter | <zacharycarter> I'm going to bed now |
03:01:59 | NoOp | I come from a python background |
03:02:02 | NoOp | xD |
03:02:04 | NoOp | bye :D |
03:02:12 | NoOp | you went to bed :( |
03:02:30 | NoOp | I mean `initCountTable[string]()` ? |
03:02:38 | NoOp | that's what I mean lol |
03:17:16 | * | endragor joined #nim |
03:31:24 | shashlick | it's kinda quiet now |
03:34:05 | NoOp | ikr |
03:35:21 | shashlick | ya, 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:14 | NoOp | legit |
03:46:23 | NoOp | im from Fl |
03:47:12 | * | black_13wv joined #nim |
03:48:20 | NoOp | why 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:52 | leorize | NoOp: you might want to put code in pastebin instead |
03:54:34 | NoOp | https://pastebin.com/raw/M1hrWyJK |
04:02:43 | leorize | NoOp: your Rand object is always using the same seed |
04:03:04 | NoOp | aaaaaaaaaah |
04:03:30 | leorize | also, you might want to simplify your code with the implict "result" variable |
04:05:11 | * | m712zp joined #nim |
04:05:18 | NoOp | gotcha |
04:07:19 | * | m712zp quit (Remote host closed the connection) |
04:17:51 | NoOp | thanks :D |
04:46:01 | * | leorize quit (Quit: WeeChat 2.1) |
05:38:57 | Araq | btw 'func' is now an alias for 'proc {.noSideEffect.}', so FP got a tiny little bit better :-) |
05:41:20 | * | DarkArctic_ joined #nim |
05:41:40 | shashlick | good morning araq - I was about to log off |
05:41:46 | shashlick | https://gist.github.com/genotrance/79aae96cc5e39c7859585c1638f10049 |
05:42:15 | shashlick | i'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:48 | shashlick | laptop 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:12 | Araq | ok 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:03 | FromGitter | <data-man> @Araq: https://github.com/data-man/issuesources ⏎ getSources <label> |
06:21:53 | FromGitter | <data-man> I am late :( |
06:25:49 | Araq | well, combine these 2 scripts perhaps |
06:26:11 | Araq | and run them |
06:27:13 | Araq | and create a PR containing "closes #1234, closes #2345, closes #5555" with test cases that ensure these bugs stay fixed |
06:28:58 | Araq | the task doesn't really involve Araq. :-) |
06:31:34 | Araq | we can make a challenge out of this. who closes the most bugs for 0.19. :P |
06:32:54 | Araq | speed is rewarded indirectly as the one who comes first has the most easy-to-close bugs in the repo. |
06:35:09 | FromGitter | <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:48 | FromGitter | <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:53 | FromGitter | <data-man> Oh, parseSql with Stream support was removed :( |
06:52:11 | Araq | only by hacking into lib/system/alloc.nim |
06:52:22 | Araq | but it's a one line change |
06:52:38 | Araq | data-man: no, it was only moved to the bottom of the file |
06:53:10 | FromGitter | <data-man> Oh, my bad :) |
06:56:36 | * | xet7 joined #nim |
06:58:07 | FromGitter | <Varriount> Araq: Woo! My AWS v4 signing code is nearly 3 times faster. And it makes fewer heap allocations. |
06:58:20 | FromGitter | <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:18 | FromGitter | <gogolxdong> Did you release your package? |
07:28:55 | FromGitter | <krux02> @zacharycarter your problems are actually very common. |
07:29:54 | FromGitter | <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:26 | Araq | semcheck was added in 0.18 and completed yesterday |
07:30:47 | Araq | it might still grow the "write tracking" features though |
07:31:15 | FromGitter | <krux02> that is cool |
07:31:20 | FromGitter | <krux02> I will use it for sure |
07:31:28 | Araq | which means 'func' will be a feature that is |
07:31:33 | Araq | a) behind a keyword |
07:31:35 | Araq | b) useful |
07:31:37 | Araq | c) used |
07:31:42 | Araq | d) quirky. |
07:31:53 | Araq | I'm beginning to see a pattern here ... |
07:32:21 | FromGitter | <krux02> well at the moment I would disagree on d, but maybe that is because I didn't see the quirkyness yet. |
07:32:41 | Araq | well for now it's safe, but just wait until I enabled the write tracking... |
07:33:04 | FromGitter | <narimiran> `func` can still use global variables, just not modify them, right? |
07:33:22 | Araq | no, it can't. .noSideEffect means no access to globals. |
07:33:40 | FromGitter | <narimiran> that's great to hear! |
07:33:50 | * | yglukhov quit (Read error: Connection reset by peer) |
07:33:53 | FromGitter | <krux02> ah then it is not "noSideEffects" but more "referential transparent" |
07:34:13 | Araq | yeah well, noSideEffect is a misnomer |
07:34:16 | FromGitter | <krux02> which is a phrase nobody knows what it means unless you look it up. |
07:34:18 | Araq | it really means noGlobals |
07:34:22 | * | yglukhov joined #nim |
07:34:31 | FromGitter | <krux02> but consts are ok? |
07:34:41 | Araq | maybe we should introduce noGlobals. consts are ok, yes. |
07:35:23 | FromGitter | <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:30 | FromGitter | <krux02> like "debugEcho" |
07:35:33 | FromGitter | <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:53 | Araq | 'func' doesn't even have a proper entry in the manual |
07:36:03 | FromGitter | <krux02> well it's a keyword |
07:36:13 | FromGitter | <krux02> and I really do like the distinction between func and proc |
07:36:22 | Araq | me too. |
07:36:28 | FromGitter | <narimiran> me three |
07:36:42 | FromGitter | <krux02> func is a function for functional programming and proc is a procedure for procedural programming |
07:36:58 | Araq | var vs let, func vs proc, the parameter passing semantics |
07:37:07 | Araq | Nim gets lots of things right. |
07:37:17 | FromGitter | <narimiran> ...and `func` is closer to the mathematic definition of a function, which is also a plus |
07:37:18 | FromGitter | <krux02> yes |
07:37:47 | Araq | and I already want to annotate my parameters with 'sink' everywhere, a good sign. |
07:37:59 | Araq | :-) |
07:38:04 | FromGitter | <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:42 | FromGitter | <krux02> sink? like the default in rust? |
07:38:50 | FromGitter | <narimiran> should sugar `->` be for procs or funcs? |
07:38:55 | Araq | no, it's different. |
07:39:21 | Araq | 'sink' is different from Rust, it's quite close to by-copy parameters in C++. curiously. |
07:39:34 | skelett | The 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:07 | FromGitter | <krux02> @narimiran: I think `->` is for procs at the moment, but that's a good point |
07:40:08 | skelett | In the noSideEffect section |
07:40:20 | Araq | skelett: yeah, I know :-) |
07:40:49 | FromGitter | <narimiran> @krux02 yeah, it is for procs, but with this change, funcs are finally meaningful :) |
07:40:50 | FromGitter | <krux02> I rememer that. Good that it is the case now |
07:41:23 | Araq | to answer your question about cheating, via 'cast' |
07:41:41 | Araq | cast the proc you need to call to a proc with .noSideEffect. a bit messy, but it works. |
07:42:08 | FromGitter | <krux02> yea it doesn't need to be pretty. |
07:42:13 | FromGitter | <krux02> it just needs to be possible |
07:44:08 | Araq | hmm thinking about it, we can make the write tracking emit warnings, no? |
07:44:23 | Araq | then we have some room to fix its bugs and glitches |
07:44:59 | FromGitter | <krux02> yea mean warnings instead of errors? |
07:45:07 | Araq | yes |
07:46:19 | FromGitter | <krux02> well that would make debug echo obsolete, and I would see where debug echo is called. |
07:47:24 | FromGitter | <krux02> not sure if I like that. Because normally libraries are full of warnings. |
07:48:15 | FromGitter | <mratsim> use Nim!!! |
07:48:37 | FromGitter | <mratsim> uh, my Gitter is not in sync at all |
07:48:40 | FromGitter | <krux02> ?? |
07:48:43 | FromGitter | <krux02> ah |
07:49:03 | FromGitter | <krux02> if you are talking about my advices there, I just wanted to be honest about everything |
07:49:05 | FromGitter | <mratsim> last conversation was the one with Zach interview |
07:56:10 | FromGitter | <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:14 | FromGitter | <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:35 | Araq | well the spec is pretty clear about what .noSideEffect means. |
07:57:46 | Araq | you are talking what it means in FP land. |
07:58:08 | FromGitter | <mratsim> actually no, it also worked like that in Nim ;) whatever the name is |
07:58:12 | FromGitter | <mratsim> works* |
07:58:28 | Araq | yes, for reasons you don't understand :P |
07:58:39 | FromGitter | <mratsim> ah, accidental agreement :P |
07:59:01 | Araq | an IO effect is a write to an unnamed global variable, like the terminal's output window |
07:59:33 | FromGitter | <mratsim> Indeed |
07:59:40 | Araq | and so write() and friends are marked as .sideEffect |
08:02:23 | Araq | and procs which call .sideEffect procs are themselves with .sideEffects |
08:02:48 | Araq | and so it all works out, but strictly speaking the semantics are "does not access a global" |
08:03:20 | FromGitter | <mratsim> What about OpenMP? |
08:04:07 | Araq | OpenMP should really be deterministic :-) |
08:04:35 | * | gmpreussner quit (Ping timeout: 240 seconds) |
08:04:35 | Araq | you can probably argue it accesses a global under the hood ;-) |
08:05:08 | Araq | btw like every other FP language we pretend heap allocations are not writes to globals... |
08:05:26 | vivus | Which is the most popular GUI lib I can use with nim? |
08:05:27 | * | gmpreussner joined #nim |
08:05:52 | FromGitter | <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:12 | Araq | vivus: my libui wrapper for Nim works fine but is very limited |
08:06:30 | Araq | karax is browser based. |
08:06:52 | vivus | I just want to wrap another Nim lib and make a very small/experimental GUI app. |
08:06:52 | Araq | and then we have GTK3, wxWidgets, Qt wrappers. and FLTK iirc |
08:07:20 | Araq | it depends on the widgets that you need. |
08:07:27 | FromGitter | <mratsim> Also nix which apparently works quite well (but OpenGL based):https://github.com/yglukhov/nimx |
08:07:33 | FromGitter | <mratsim> nimx* |
08:07:47 | Araq | for example, if you need a syntax highlighting component, libui is not for you. |
08:07:51 | FromGitter | <data-man> func vs proc is like to function and procedure in Pascal? |
08:08:36 | Araq | vivus: I would start with libui and/or PMunch's DSL on top of it |
08:08:39 | FromGitter | <mratsim> func results only depends on passed parameters |
08:08:53 | FromGitter | <mratsim> or consts |
08:09:01 | vivus | noted. |
08:09:10 | Araq | data-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:14 | FromGitter | <mratsim> Ah it’s like VB function vs procedure |
08:10:15 | vivus | so is that a real thing? a function and procedure have a different meaning? I've also seen functions inside classes called "methods" |
08:10:56 | Araq | methods are orthogonal to this and are about attaching the routine to one type. |
08:11:23 | * | NimBot joined #nim |
08:11:41 | FromGitter | <mratsim> methods are only useful for polymorphism/inheritance |
08:11:47 | FromGitter | <data-man> I was hoping that it would be in Pascal :( |
08:11:52 | vivus | yeah that's a bit over my head lol. |
08:12:18 | Araq | data-man: you should be happy we improved upon old Pascal. |
08:12:34 | FromGitter | <mratsim> Easy then: don’t use inheritance/polymorphism? use procs. |
08:13:06 | Araq | use polymorphism? use proc vars :P |
08:13:53 | Araq | oh mmmm, 'method's are behind-a-keyword, useful, used, quirky... |
08:14:37 | Araq | same for 'not nil'. what a mess. any brilliant solutions around? |
08:14:39 | vivus | a common question lots of beginners ask is: "if I only write functions in my program, am I doing functional programming?" |
08:15:23 | Araq | hmm that sounds true once I enabled write tracking for them, yes. |
08:17:37 | vivus | Araq: is this libui: https://github.com/nim-lang/ui ? |
08:17:42 | Araq | yep |
08:18:03 | FromGitter | <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:30 | FromGitter | <gogolxdong> func can't be async? |
08:23:07 | Araq | probably not, they register at the event loop |
08:23:34 | * | sendell joined #nim |
08:26:49 | Araq | data-man: what? sounds like a hack. instead add a comment with a date inside the code snippet |
08:27:02 | Araq | lying about file timestamps is a horrible idea |
08:27:59 | FromGitter | <data-man> Also I want a saveTime parameter to downloadFile. |
08:29:19 | Araq | the more features of an operating system I ignore, the happier I am. |
08:30:31 | FromGitter | <data-man> But Nim is a systems programming language. :) |
08:31:49 | Araq | alternatively 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:32 | Araq | or how to stop demon processes or how to spell them |
08:33:33 | FromGitter | <data-man> pathetic? We have truecolor! :-D |
08:34:26 | FromGitter | <alehander42> ohh func, finally |
08:34:48 | FromGitter | <alehander42> @Araq will there be v0.19 at all ? :D |
08:34:50 | FromGitter | <mratsim> Now @yglukhov cannot say “I think you are going overboard with noSideEffect” :D |
08:35:11 | yglukhov | huh |
08:35:14 | FromGitter | <alehander42> :D |
08:35:18 | yglukhov | why not? |
08:35:29 | yglukhov | ohh func, i see... |
08:35:30 | FromGitter | <mratsim> proc {.noSIdeEffect.} —> func |
08:35:52 | yglukhov | mratsim: well, i'm happy for you =) |
08:36:55 | FromGitter | <mratsim> @alehander42 I thought we still could do a 0.18.2 |
08:38:47 | FromGitter | <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:03 | FromGitter | <alehander42> we can converge the version to pi * 6 |
08:46:05 | * | MonsterAbyss quit (Ping timeout: 256 seconds) |
08:46:09 | FromGitter | <data-man> I remembered the question from the old math book: what is bigger, e*Pi or Pi*e? :) |
08:58:39 | FromGitter | <alehander42> I couldn't solve it @data-man , now i feel weak |
08:59:51 | FromGitter | <alehander42> but I used `nim secret` to solve it [cuts to a billboard in a weird advertisement] |
09:00:06 | FromGitter | <alehander42> calculate* |
09:00:43 | Araq | e^pi = -1 |
09:01:34 | FromGitter | <alehander42> I am sure there was an `i` there |
09:01:42 | FromGitter | <alehander42> but can't remember where exactly |
09:02:37 | FromGitter | <alehander42> e ^ (pi * i) |
09:03:23 | Araq | ah yeah lol |
09:05:17 | FromGitter | <krux02> Araq: https://github.com/nim-lang/Nim/pull/7585 |
09:06:16 | * | dddddd joined #nim |
09:06:35 | * | SenasOzys joined #nim |
09:13:07 | Araq | hint: close+reopen to trigger a rebuild |
09:14:56 | FromGitter | <krux02> Ah ok, seems a good idea. can I also close and reopen? |
09:15:46 | Araq | sure |
09:16:01 | FromGitter | <krux02> Araq: can you close this? it is just the introduction of dead code with no functionality |
09:16:03 | FromGitter | <krux02> https://github.com/nim-lang/Nim/pull/7572 |
09:16:22 | Araq | hey it's data-man, he is around |
09:16:55 | Araq | but I agree, data-man please create PRs when you've got something to show :-) |
09:17:00 | FromGitter | <krux02> @data-man hey I just talk about your pr |
09:19:11 | * | MonsterAbyss joined #nim |
09:31:30 | narimiran[m] | any news about for-statement maybe? |
09:33:19 | * | vivus quit (Quit: Leaving) |
09:38:46 | FromGitter | <mratsim> the repo is growing at a rate of 5~10 bugs a day :O |
09:39:01 | FromGitter | <mratsim> @narimiran for-expression you meant? |
09:41:38 | narimiran[m] | i mean for on the right-hand side of a = |
09:41:50 | FromGitter | <mratsim> yes, that’s an expression ;) |
09:42:28 | narimiran[m] | any news about for-expression maybe? :) |
09:42:40 | FromGitter | <mratsim> you can use my package for that at the moment: https://github.com/numforge/loop-fusion |
09:43:36 | FromGitter | <mratsim> Feel free to add your input on what name to give: https://github.com/numforge/loop-fusion/issues/2 |
09:45:03 | Araq | narimiran[m]: it's tricky, so no. the parser additions looked easy enough but how to design it is tricky. |
09:46:27 | FromGitter | <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:01 | narimiran[m] | thanks guys, i know about both libraries, but i was interested if we could have something like that built-in |
09:48:41 | narimiran[m] | i guess we won't, at least not for v1 |
09:48:58 | FromGitter | <alehander42> :D vote for small goverment, vote for no more stdlib/language features |
09:49:23 | FromGitter | <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:20 | Araq | let x = @[for a in s: if cond: a] |
09:52:25 | Araq | let x = @[for a in s: if cond: yield a] ? |
09:52:43 | narimiran[m] | without yield |
09:53:27 | FromGitter | <mratsim> yield would make that more in line with inline iterators |
09:53:38 | FromGitter | <mratsim> toSeq(for a in s: if cond: yield a) |
09:53:46 | * | xet7 quit (Ping timeout: 264 seconds) |
09:53:52 | narimiran[m] | and this look nicer than current LC, imo |
09:54:07 | * | jaco60 quit (Ping timeout: 260 seconds) |
09:54:46 | FromGitter | <mratsim> but it’s too that no expression (if or block) uses yield so |
09:58:12 | FromGitter | <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:07 | FromGitter | <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:39 | FromGitter | <mratsim> also this: https://github.com/nim-lang/Nim/blob/devel/lib/system/gc.nim#L393 |
10:05:26 | * | SenasOzys joined #nim |
10:08:54 | FromGitter | <mratsim> but I think you can just use GCC/Clang: -fmax-unroll-times flag |
10:09:39 | FromGitter | <mratsim> ah no it’s a —param max-unroll-times=n |
10:09:42 | FromGitter | <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:44 | Araq | that blindly unrolls everything I think |
10:10:00 | FromGitter | <mratsim> I’d rather have the {.unroll: n.} pragma working ;) |
10:10:06 | FromGitter | <data-man> How about unrolling for js? |
10:10:15 | * | Vladar joined #nim |
10:10:16 | FromGitter | <mratsim> people don’t use JS for performance |
10:10:19 | Araq | js has a JIT |
10:10:27 | Araq | JITs excel at these things |
10:10:27 | FromGitter | <mratsim> and V8/node is probably doing something about it |
10:10:32 | Araq | yup. |
10:10:57 | Araq | unrolling is only for static compilers really that lack profile information |
10:12:00 | Araq | that said, I don't know why C++ has no JIT available :-) |
10:12:14 | FromGitter | <mratsim> too slow to compile already :D |
10:12:25 | Araq | you have the LLVM IR |
10:12:31 | Araq | which is the same for everything. |
10:12:34 | FromGitter | <data-man> I think that manual unrolling is better. And more reliable. :) |
10:12:58 | FromGitter | <mratsim> then try to get {.unroll: n.} pragma working I think, currently it’s a stub |
10:13:06 | Araq | yes. |
10:17:08 | FromGitter | <alehander42> what happened to the of branches with shared fields idea btw |
10:17:23 | FromGitter | <data-man> With my PR not need to modify a sources for changing the unrolling step. |
10:17:56 | Araq | but that's a bad idea. usually I want "small code" unless it is "hot", then I want unrolling. |
10:18:05 | Araq | I don't want to unroll all my loops. |
10:18:33 | Araq | the unroll annotation needs to be attached to the loop. |
10:18:36 | FromGitter | <data-man> Just set step to 1 |
10:18:53 | Araq | otherwise you can indeed just use —param max-unroll-times=n |
10:18:59 | Araq | for clang. |
10:19:23 | FromGitter | <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:44 | FromGitter | <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:27 | FromGitter | <mratsim> related GCC bug loop unrolling + register pressure: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=20969 |
10:24:19 | FromGitter | <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:27 | Araq | also consider the fact that a modern CPU does out-of-order execution with register renaming |
10:24:42 | Araq | which is comparable to what loop unrolling does. |
10:25:24 | FromGitter | <mratsim> sequtils I’m not sure, seq\[float\] ok, but seq\[seq\[float\]\] is probably not ok |
10:26:47 | FromGitter | <mratsim> unless you add `when T is SomeNumber: {.unroll: 4.}`for example to have type-specific unrolling |
10:27:15 | FromGitter | <data-man> "For further optimizations." as it's written in my PR. :) |
10:27:19 | FromGitter | <alehander42> does `unroll` honor `debugInfo` or something like that? |
10:28:22 | FromGitter | <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:20 | FromGitter | <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:09 | FromGitter | <mratsim> or maybe {.unroll: n.} should just emit #pragma unroll n ? |
10:34:30 | Araq | seems wise. |
10:35:04 | Araq | we'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:38 | FromGitter | <alehander42> does `#pragma unroll n` always generates an unroll, or it depends on the compiler/env |
10:54:04 | Araq | better lc for you tinker with: https://gist.github.com/Araq/971a36d03fad0ed04e01282b4cee0bcb |
10:55:32 | FromGitter | <data-man> `````` [https://gitter.im/nim-lang/Nim?at=5ad08ca3109bb04332baf975] |
11:01:53 | Araq | once my semityped macros work we can make the type inference smarter ... |
11:13:26 | * | MonsterAbyss joined #nim |
11:14:42 | FromGitter | <AxDSan> legito |
11:20:40 | * | MonsterAbyss quit (Ping timeout: 256 seconds) |
11:21:21 | * | SenasOzys quit (Ping timeout: 256 seconds) |
11:22:30 | FromGitter | <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:52 | FromGitter | <data-man> @AxDSan: -d:release is defined? |
11:32:09 | * | floppydh quit (Ping timeout: 264 seconds) |
11:44:31 | * | floppydh joined #nim |
11:47:09 | FromGitter | <mratsim> @data-man you will skip computation for size 10 for example |
11:47:23 | FromGitter | <mratsim> you will only do 0..<8 |
11:48:00 | FromGitter | <mratsim> your last should be the biggest multiple of 8 below openarray.high |
11:48:17 | FromGitter | <mratsim> and then you have to special case your increment |
11:48:34 | FromGitter | <mratsim> unrolling for non divisor is a pain ;) |
11:49:15 | FromGitter | <AxDSan> @data-man Nope, `nim c -r "d:\DevStuff\NimDev\projects\learning-nim\nene.nim"` was specified |
11:49:23 | FromGitter | <mratsim> or decrement before the last while by the 8 - mod(high, 8) or something like that |
11:49:41 | FromGitter | <mratsim> @AxDSan you must use -d:release for benchmark |
11:50:26 | FromGitter | <AxDSan> with -d ⏎ ⏎ #``` ⏎ ⏎ #GlobalBenchmark relative time/iter iters/s ... [https://gitter.im/nim-lang/Nim?at=5ad09982df3e0fb547d2f1ea] |
11:50:34 | FromGitter | <mratsim> mod(high, 8) can be replaced by `high and 7` but the compiler should do that for you anyway |
11:51:54 | FromGitter | <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:01 | Araq | wow nobody cares about my 'lc' macro :-) |
12:07:51 | * | MonsterAbyss joined #nim |
12:08:09 | FromGitter | <mratsim> I will actually steal it and use it for loopfusion :P |
12:08:56 | FromGitter | <krux02> lc macro, you mean list comprehension? |
12:09:07 | FromGitter | <mratsim> this: https://gist.github.com/Araq/971a36d03fad0ed04e01282b4cee0bcb |
12:09:11 | FromGitter | <krux02> the use of the [] operator is just a bad idea |
12:09:33 | FromGitter | <mratsim> maybe reuse @[] and be done with it |
12:10:17 | Araq | hmmm? |
12:10:19 | * | leorize joined #nim |
12:10:28 | Araq | I don't use [] |
12:10:31 | FromGitter | <data-man> @mratsim: Thanks! Without ```mod``` - just to replace ```while x <= last:``` on ```while x <= last - 8:``` |
12:10:50 | FromGitter | <krux02> @mratsim what would be a good pattern to mach both nnkStmtList(therealpattern(...)) and therealpattern(...) |
12:11:03 | FromGitter | <krux02> I am asking about a cool syntax |
12:11:03 | FromGitter | <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:07 | FromGitter | <krux02> at the moment I don't know |
12:11:22 | FromGitter | <alehander42> is something like that possible here? lc(seq): .. |
12:11:58 | FromGitter | <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:09 | FromGitter | <alehander42> I need an example, but I think that can be solved, I haven't had such issues |
12:13:18 | Araq | alehander42: I don't know, I'd rather spend my time on semityped which is the right solution |
12:13:35 | FromGitter | <alehander42> @krux02 why can't it `of pattern, otherPattern:` |
12:13:53 | FromGitter | <alehander42> like now you can `of Enum, OtherEnum:` |
12:13:55 | FromGitter | <mratsim> @alehander42 latest example: https://github.com/numforge/loop-fusion just use a “if i mod 2 ==0" |
12:13:58 | FromGitter | <alehander42> (you can, right? ) |
12:13:59 | * | xet7_ is now known as xet7 |
12:14:13 | Araq | krux02: how do you deal with Pattern(x, x) ? |
12:14:39 | FromGitter | <mratsim> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ad09f2f01a2b40f382ebe4f] |
12:14:40 | Araq | that requires a notion of equality and for Nim's Nodes there is not only one notion of equality |
12:14:44 | FromGitter | <krux02> what do you mean with pattern(x,x) |
12:15:05 | Araq | plus(x,x) --> x*2 |
12:15:23 | Araq | it means I bind 'x' to the first argument and then check the second argument is the same |
12:15:37 | FromGitter | <krux02> well I don't deal with it at all |
12:15:45 | FromGitter | <krux02> at the moment it would fail to compile I think |
12:15:53 | Araq | pity but good enough. |
12:16:16 | FromGitter | <krux02> nnkInfix(`x`,`x`) would generate two variables both named x |
12:16:31 | FromGitter | <krux02> the if could solve it |
12:16:42 | FromGitter | <alehander42> ok, maybe Araq needs plus(`x`, `x`) ? |
12:16:53 | FromGitter | <krux02> of nnkInfix(`x`, `y`) if `x` == `y`: |
12:17:00 | FromGitter | <alehander42> ```plus(`x`, `x`)``` |
12:17:16 | Araq | yeah that's good enough, albeit not as sexy |
12:17:27 | FromGitter | <krux02> well first of all it needs to work |
12:17:35 | FromGitter | <alehander42> yeah, having plus(`x`, `x`) would be nice, but it can get in a next version |
12:17:41 | FromGitter | <krux02> I use astspec.txt as test case |
12:18:35 | FromGitter | <krux02> so I cant o create a test that verifies that the astspec is correct |
12:19:54 | FromGitter | <zacharycarter> @krux02 - what problems? |
12:19:59 | FromGitter | <zacharycarter> you mean with my work? |
12:20:12 | FromGitter | <zacharycarter> or the ones on the test? |
12:23:52 | FromGitter | <alehander42> @mratsim shoudln't it be @[7] ? |
12:25:05 | FromGitter | <alehander42> anyway I see |
12:26:39 | FromGitter | <mratsim> yeah forgot to change the assert |
12:27:52 | FromGitter | <krux02> @zacharycarter I don't remember |
12:27:57 | FromGitter | <mratsim> by the way, any comment @alehander42 for @krux02 proposal: https://github.com/numforge/loop-fusion/issues |
12:27:58 | FromGitter | <krux02> I think it was your work |
12:28:09 | FromGitter | <mratsim> sorry: https://github.com/numforge/loop-fusion/issues/2 |
12:29:06 | FromGitter | <zacharycarter> oh yeah - I was bitching about how no one at my job has any low level programming / native programming knowledge |
12:29:16 | FromGitter | <krux02> yes that one |
12:29:20 | FromGitter | <zacharycarter> and they don't care to understand anything lower than the code they write |
12:29:27 | FromGitter | <krux02> that is very very common heared it from so many people |
12:29:30 | FromGitter | <zacharycarter> they don't even really know about the JVM memory model etc |
12:29:43 | FromGitter | <zacharycarter> yeah - it's bad |
12:30:14 | FromGitter | <krux02> well when you know about it, you can humiliate them, maybe then they will be less arrogant |
12:30:29 | FromGitter | <zacharycarter> they humiliate themselves |
12:30:40 | FromGitter | <zacharycarter> I quoted one of our devs the other day saying - |
12:30:52 | FromGitter | <zacharycarter> > All code is garbage, and should be treated as such. |
12:31:09 | FromGitter | <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:16 | FromGitter | <zacharycarter> ok... |
12:31:28 | FromGitter | <krux02> well I don't know the context |
12:31:32 | FromGitter | <krux02> could also mean something else |
12:31:35 | FromGitter | <zacharycarter> we were just talking about different programming languages |
12:31:45 | FromGitter | <zacharycarter> no he was trying to insinuate that you shouldn't spend time trying to write good code |
12:31:49 | FromGitter | <krux02> could be an expression of frustration about the bad code quality |
12:31:51 | FromGitter | <zacharycarter> and that no one writes "good code" |
12:31:55 | FromGitter | <data-man> @Araq: #7545 ⏎ The man worked. Any comments? |
12:32:12 | FromGitter | <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:56 | FromGitter | <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:07 | FromGitter | <zacharycarter> but again - in order to do that - you have to check the project out and add code to it |
12:33:11 | FromGitter | <zacharycarter> and tests |
12:33:19 | FromGitter | <zacharycarter> while other teams are trying to do the same thing |
12:33:46 | FromGitter | <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:09 | Araq | https://github.com/nim-lang/Nim/pull/7545 that one? |
12:34:36 | FromGitter | <data-man> unicode stuff |
12:36:00 | FromGitter | <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:02 | FromGitter | <krux02> well yea I recently heared the term "sales prevents office" |
12:36:12 | FromGitter | <alehander42> but if it's about threating if as an expression |
12:36:13 | Araq | these tables need to be generated from the unicode standard |
12:36:29 | FromGitter | <alehander42> maybe you can just inject `sdfsdf.add(code)` in `if test: code` |
12:36:32 | Araq | I hesitate to have more of these that require manual maintainance. |
12:36:33 | FromGitter | <alehander42> when there is no else ? |
12:36:48 | FromGitter | <mratsim> @alehander42 it was just about the name `forEach` vs `forZip` |
12:36:56 | FromGitter | <alehander42> no I am talking about your example |
12:36:59 | FromGitter | <alehander42> and the compiler |
12:37:33 | FromGitter | <mratsim> yes, I will probably do it like Araq did, a recursive inspection to detect the variable and replace it by add |
12:37:49 | FromGitter | <alehander42> yeah |
12:38:47 | FromGitter | <krux02> well for me it is a no brainer to call it `forZip` |
12:38:54 | FromGitter | <krux02> but it's me who created that issue |
12:39:26 | Araq | krux02: have you looked at 'patty' from andreaferretti? |
12:41:01 | FromGitter | <data-man> @Araq: In PR the tables from unicode 10.0 (the last official) |
12:43:34 | FromGitter | <alehander42> yeah, forZip or forEachZip might be more precise |
12:44:34 | Araq | Nim's 'for' is always 'for each' |
12:44:41 | Araq | forZip is fine. |
12:45:18 | Araq | data-man, so what, we would need to adapt them manually for Unicode 11.0 |
12:45:27 | Araq | and that's bad. |
12:45:43 | FromGitter | <data-man> And we need to update the tables for alphas, spaces, etc. |
12:45:54 | Araq | yep. |
12:46:03 | Araq | we have staticRead and compiletime parsing |
12:46:26 | Araq | and what do we do? have manual data arrays in unicode.nim? it's pathetic. |
12:47:13 | Araq | FYI 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:44 | FromGitter | <data-man> I wonder what's faster: binary searching in a tables or case's ranges? |
12:51:47 | Araq | the 'fast' binary search for a power of two? :-) |
12:52:19 | Araq | compilers translate the case ranges into binary searches but I bet they don't know about fastBinarySearch |
12:52:50 | FromGitter | <data-man> Maybe. :) ⏎ @Araq: In other languages, a tables are updated only with the new version of unicode. |
12:53:27 | Araq | Golang generates its tables from the Unicode spec. |
12:53:34 | Araq | FreePascal does it too. |
12:54:10 | Araq | it's easy to regenerate if from the .txt files. I'm not asking for downloading the spec at compile-time... |
12:55:57 | FromGitter | <data-man> My copy of Go contains generated tables.go |
12:56:13 | Araq | yes, *generated*. |
12:56:23 | Araq | I'm asking for the same. |
12:57:30 | FromGitter | <data-man> But unicode.nim also contains generated. We just to regenerate them for 10.0. :) |
12:58:27 | Araq | and then what do you? delete, copy&paste manually? |
12:58:43 | Araq | see the problem? it's not generated when you do manual work. |
12:59:13 | Araq | you can either use a macro to produce these tables or have it in an 'include' file |
12:59:31 | FromGitter | <data-man> New tool? gentables in tools? |
12:59:59 | Araq | if you can't do it in a macro. |
13:00:31 | FromGitter | <data-man> It's slowly |
13:01:44 | * | DarkArctic_ quit (Read error: Connection reset by peer) |
13:04:16 | Araq | krux02: (?nnkStmtList)(therealpattern(...)) |
13:04:46 | Araq | it's an optional nnkStmtList you want to skip, so prefix ? seems good |
13:13:23 | * | nixfreak joined #nim |
13:17:04 | FromGitter | <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:11 | FromGitter | <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:32 | FromGitter | <krux02> doesn't solve everything, but I don't want to make the project too big for now |
13:21:29 | Araq | 'skip' is everywhere in the compiler, yes. |
13:25:30 | FromGitter | <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:56 | FromGitter | <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:36 | FromGitter | <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:58 | FromGitter | <narimiran> btw, `forEach` can be also used with only one container, right? (`let x = forEach(x in a): x+10`) |
13:42:38 | FromGitter | <narimiran> if so, `forZip` might not be a good name |
13:45:26 | FromGitter | <narimiran> maybe `forAll`? |
13:47:09 | Araq | meh. |
13:47:31 | Araq | moar features for fmt, no thanks |
13:48:45 | FromGitter | <mratsim> @narimiran yes you can use it with only one container |
13:48:52 | * | couven92 joined #nim |
13:48:59 | FromGitter | <mratsim> forAll is a good name |
13:50:02 | FromGitter | <mratsim> I want to use this: ∀ |
13:50:39 | FromGitter | <mratsim> post it as a suggestion in the RFC thread |
13:50:48 | Yardanico | ∀ ? |
13:51:10 | FromGitter | <narimiran> Yardanico : maths way of saying for all |
13:51:14 | FromGitter | <mratsim> ∀ means for all |
13:52:11 | shashlick | data-man: looks like we have similar code? |
13:52:12 | FromGitter | <mratsim> ∀x ∈ ℕ means for all x (natural numbers) |
13:52:31 | FromGitter | <mratsim> fun time at school :P |
13:54:56 | FromGitter | <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:12 | FromGitter | <alehander42> maybe it has been some kind of type theory connections with set theory thing |
13:55:33 | FromGitter | <mratsim> probably category theory / Monads from Haskell |
13:56:41 | FromGitter | <mratsim> Monoid / Group / Ring comes from Math category theory |
13:56:50 | FromGitter | <alehander42> no, not really related to that |
13:56:52 | FromGitter | <mratsim> Monad I’m not sure, never saw that in my math classes |
13:56:55 | FromGitter | <mratsim> oh |
13:57:11 | FromGitter | <alehander42> maybe more related to curry howard isomorphism |
13:57:22 | FromGitter | <alehander42> but I am just googling it now , so I might be mistaken again |
13:58:08 | FromGitter | <AxDSan> where is `format`? |
13:58:10 | FromGitter | <alehander42> yes, you can view universal quantification as generalised product type (Π type) and existential quantification as generalised sum type (Σ type) |
13:58:13 | FromGitter | <AxDSan> as in echo `format` |
13:58:33 | FromGitter | <alehander42> and similarly function type as implication |
13:58:54 | FromGitter | <alehander42> it seemed very elegant, I have to brush up my logic |
13:58:57 | FromGitter | <AxDSan> was looking at https://forum.nim-lang.org/t/1235/2 for string interpolation but I get a undeclared identifier |
14:01:57 | FromGitter | <data-man> @shashlick: I started earlier, but you finished before :) |
14:03:01 | FromGitter | <mratsim> @AxDSan strformat module, import it |
14:03:21 | FromGitter | <mratsim> it’s called `fmt` or `&` |
14:03:23 | FromGitter | <AxDSan> @mratsim Thank you so much :D |
14:03:27 | FromGitter | <AxDSan> sweet |
14:03:46 | FromGitter | <AxDSan> like the syntactic sugar for `&` |
14:03:55 | shashlick | data-man: do you see how we can consolidate? what was your goal? I am yet to see your code in detail |
14:04:05 | FromGitter | <mratsim> @AxDSan keep that as a bookmark: https://nim-lang.org/docs/theindex.html |
14:04:37 | FromGitter | <data-man> @AxDSan: https://nim-lang.org/docs/strformat.html |
14:04:39 | FromGitter | <mratsim> it’s different say you have a myvar defined you can use `&”printing {myvar}”` |
14:05:40 | FromGitter | <AxDSan> legit :D bookmarked :D |
14:06:45 | FromGitter | <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:25 | Araq | data-man: I'm waiting for your "close #x compiler crashes" PR |
14:08:40 | shashlick | so 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:54 | shashlick | it also creates a log of the snippet and output for further analysis |
14:09:45 | * | Trustable quit (Remote host closed the connection) |
14:09:56 | Araq | shashlick: it's now a competition |
14:09:59 | * | endragor quit (Remote host closed the connection) |
14:10:19 | FromGitter | <genotrance> well, so now that i have a list, what action do you want the script to take? |
14:10:25 | Araq | who closes most bugs for the upcoming release. every tool is allowed. |
14:12:01 | shashlick | I need to improve some of the checks of the output, then I can tell if the code crashes or times out |
14:12:04 | FromGitter | <data-man> Yesterday my IP was blocked for GitHub's API access :-D |
14:12:34 | shashlick | but I'm curious what action - just post a comment saying it no longer crashes |
14:12:43 | * | endragor joined #nim |
14:14:23 | Araq | shashlick: to say "closes #123" in a PR you have to add a test that proves that the bug is gone |
14:15:26 | shashlick | okay so take that snippet and make a test out of it? |
14:15:34 | Araq | exactly. |
14:15:53 | shashlick | do you traditionally add such tests in new files or append to an existing file? any specific dir for compiler crashes? |
14:16:20 | Araq | most crashes turn into better errmsgs/ |
14:16:36 | Araq | and error messages is something we don't have collective tests for. |
14:17:16 | Araq | but I tried to "enrich" existing tests if possible. |
14:17:29 | Araq | in 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:13 | FromGitter | <data-man> Hmm, maybe to collect an issues to db? |
14:26:10 | shashlick | Ok so data-man how do you want to collaborate here |
14:26:46 | FromGitter | <krux02> shashlick: I prefer to apeend the tests to an already existing file |
14:27:32 | FromGitter | <krux02> new test files increase the time for tests to run through. |
14:27:57 | shashlick | I need to improve detection of failure types during compile and exec. That can be used to categorize better. |
14:28:22 | shashlick | Also need to cache GitHub issues instead of downloading every time |
14:28:48 | shashlick | I'll find a file to append tests to |
14:29:17 | Araq | btw 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:27 | shashlick | Which db? |
14:31:31 | FromGitter | <data-man> OMG, I need to finish the new SQLite's wrapper :) |
14:34:01 | Araq | there is only sqlite. |
14:37:13 | * | miran joined #nim |
14:38:07 | shashlick | no 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:37 | Araq | you need to create it. |
14:48:57 | Araq | it doesn't exist yet. |
14:52:01 | * | athenot joined #nim |
14:56:33 | FromGitter | <data-man> Did you manually write bindings for SQLite? ⏎ ⏎ `````` [https://gitter.im/nim-lang/Nim?at=5ad0c5215f188ccc156057b3] |
14:57:51 | Araq | probably I pas2nim'ed it. |
15:03:00 | shashlick | so you want a database of all nim fixed issues in an sqlite file? |
15:05:00 | FromGitter | <data-man> Maybe to rename all functions in the wrapper to accord with SQLite's API? And to fix db_sqlite.nim |
15:08:10 | shashlick | i'm still lost - is the goal to improve/complete the sqlite wrapper and the github issues are just a test bed? |
15:11:55 | FromGitter | <data-man> @shashlick: No, the github issues more important. |
15:12:13 | Araq | why would I like a database full of fixed bugs? |
15:12:25 | Araq | it should contain open bugs. |
15:12:42 | Araq | like a structured todo list. |
15:12:48 | shashlick | oh okay, so you want a DB with all github data so that you can filter better |
15:13:03 | Araq | yes, but it's not as important as closing/fixing bugs |
15:13:18 | Araq | ;-) |
15:13:20 | shashlick | well, getting the json and converting to csv is super easy |
15:13:26 | shashlick | but then that's spreadsheet hell |
15:14:23 | shashlick | you want sqlite so that you can run queries? and perhaps generate a site out of it? |
15:15:19 | FromGitter | <data-man> @Araq: Do you use any GUI-app for for viewing a DBs? |
15:15:41 | Araq | sometimes. |
15:15:54 | Araq | shashlick: yeah to run queries, but as I said, it's not important |
15:16:14 | shashlick | well, json => csv is easy, and there's csv => sqlite converts available |
15:16:23 | Araq | alternatively we can import the github issues to a github repository |
15:18:20 | shashlick | well, 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:55 | shashlick | what columns do you want to see? how do you expect to use the data |
15:19:10 | shashlick | if you give some use cases, it will help |
15:19:16 | FromGitter | <data-man> Ha-ha, GUI-app "IssueTracker" written on pure Nim. :) |
15:19:44 | FromGitter | <mratsim> wasn’t there a startup doing data viz on Nim issues just next to us on FOSDEM? |
15:20:31 | shashlick | i 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:46 | miran | keep it simple |
15:21:23 | FromGitter | <mratsim> the proper tool is NimData: https://github.com/bluenote10/NimData/blob/master/docs/viewer_example.png :D |
15:21:34 | FromGitter | <mratsim> buggy gitter |
15:21:46 | FromGitter | <zetashift> that's a big face on gitter |
15:21:56 | FromGitter | <data-man> @shashlick: I'm using https://github.com/sqlitebrowser/sqlitebrowser |
15:21:57 | FromGitter | <krux02> lol |
15:22:29 | FromGitter | <alehander42> :D I can't argue with this |
15:23:34 | shashlick | data-man: makes sense |
15:25:41 | shashlick | data-man: so are you working on this github => sqlite tool? seems different than the nim crash tool i'm working on |
15:32:34 | FromGitter | <data-man> @shashlick: I thought about DB an hour ago. It's a fresh idea. :) |
15:38:40 | FromGitter | <data-man> And now I remembered about the ormin library. |
15:42:17 | miran | alehander42: zero-functional is not in nimble?! |
15:42:57 | miran | ahhh, _ instead of - |
15:45:08 | FromGitter | <alehander42> yep it's https://nimble.directory/pkg/zero_functional |
15:45:50 | miran | will make quick PR to address this |
15:46:50 | Araq | more good news for FP'lers. (1,) now produces a tuple |
15:47:43 | * | jaco60 joined #nim |
15:47:54 | miran | should 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:56 | FromGitter | <data-man> Wow ```29 files changed, 99 insertions(+), 64 deletions(-)``` :) |
15:49:38 | miran | Araq: next step with tuples - better unpacking in loops? (https://github.com/nim-lang/Nim/issues/7486) :) |
15:50:56 | Araq | miran: for a, b in items(x) does unpack. |
15:51:19 | Araq | for (a, b) in x is too ambiguous, could be pairs, could be unpacking for items. |
15:51:28 | miran | see the link |
15:52:29 | Araq | I know it. |
15:52:35 | FromGitter | <krux02> Araq: for loops, and a) ... d) quirky |
15:52:40 | Araq | > If mySeq is container of tuples, we currently need to do |
15:52:44 | Araq | no we don't. |
15:52:53 | Araq | all it takes is to spell out the 'items'. |
15:53:25 | * | aguspiza joined #nim |
15:54:10 | FromGitter | <krux02> I wish a new container type woudn't be required to implement all four iterators items mItems pairs mpairs |
15:54:28 | FromGitter | <krux02> it would be cool if pairs and mpairs would have a default implementation somehow |
15:55:08 | FromGitter | <krux02> in scala for example there is zipWithIndex, that works on everything with an iterator |
15:55:42 | miran | as 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:46 | Araq | yeah yeah yeah, will have that when we decide to use 'concept' in the stdlib |
15:56:27 | Araq | miran: that's an iterator chaining problem more than a tuple unpacking problem |
15:58:48 | FromGitter | <alehander42> @miran yeah, we should add a note indeed |
15:59:13 | Araq | krux02: what's quirky about them? |
15:59:19 | miran | alehander42: on it! |
16:04:26 | miran | PR submitted |
16:06:37 | miran | (don't merge it yet, will add some more corrections) |
16:15:01 | * | yglukhov quit (Remote host closed the connection) |
16:21:39 | FromGitter | <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:41 | FromGitter | <krux02> Araq: well a lot. |
16:32:19 | FromGitter | <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:58 | FromGitter | <krux02> when you want to iterate with indices, you better hope that iterator has a pairs version |
16:33:41 | shashlick | data-man: okay I'll continue with my work then |
16:33:55 | FromGitter | <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:49 | shashlick | is it possible to read from streams in a non-blocking fashion? |
16:42:21 | * | smt quit (Ping timeout: 264 seconds) |
16:44:06 | miran | alehander42: pushed. there are fewer changes than it looks like :) |
16:46:34 | FromGitter | <data-man> @shashlick: Maybe https://nim-lang.org/docs/asyncfile.html ? |
16:47:10 | shashlick | cool |
16:51:05 | Araq | krux02: that's all about to be fixed. |
16:51:25 | Araq | with yet another new feature ... :-) |
16:51:43 | Araq | but 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:19 | shashlick | streams.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:08 | shashlick | streams.nim(94) getPosition |
17:12:08 | Araq | an outputstream does not support peeking |
17:14:13 | shashlick | ok then looking at asyncfile |
17:15:32 | shashlick | don't think that will work either |
17:16:42 | shashlick | araq: is there a nonblockig way to read from outputstream of process? |
17:21:11 | Araq | osproc.hasData(p) |
17:21:42 | Araq | maybe check nimedit's console.nim |
17:21:52 | shashlick | yep it's right there :P |
17:22:36 | * | vlad1777d joined #nim |
17:25:30 | * | birdspider quit (Quit: Leaving) |
17:25:47 | FromGitter | <abijahm> btw the asyncstream module look very different from streams shouldn't they unified like file and asyncfile |
17:28:18 | FromGitter | <mratsim> Did other get conversion problem with: https://github.com/nim-lang/Nim/commit/f6df2d9956a79eda048639107274ce60cbcf3542 ? |
17:28:46 | FromGitter | <mratsim> We have CI broken on Windows and Mac but working on Linux for the whole day |
17:35:04 | yglukhov | Araq: hot code reloading is awesome. Any ideas of implementing it for native targets? |
17:36:29 | FromGitter | <alehander42> Araq I will rebase sourcemaps when I get home |
17:38:36 | Araq | so ... tests are red ... let's see |
17:39:01 | Araq | alehander42: btw I'm renaming it to --hotCodeReloading |
17:39:11 | Araq | --hotReloading is just weird :P |
17:39:56 | miran | is code hot, or is reloading hot? |
17:40:36 | miran | because that rename sounds like the former ;) |
17:41:40 | FromGitter | <mratsim> Nim is hot, as is blockchain ;) |
17:45:01 | FromGitter | <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:28 | miran | flowck: in concepts (at the beginning), "choosenim basically: provideS..." |
17:47:40 | miran | btw, installing via apt-get - which version does it install? |
17:49:38 | shashlick | I'm on Ubuntu artful and it has 0.17.2 |
17:50:05 | shashlick | https://github.com/genotrance/tissue |
17:50:09 | FromGitter | <flowck> Thanks @miran |
17:50:43 | FromGitter | <flowck> I have the 0.18.0 installed on my environment |
17:51:22 | FromGitter | <flowck> Installing via apt-get should get you the latest version |
17:54:02 | miran | shashlick: any specific reason why you sometimes use `var` block, and sometimes each variable has its own `var`? |
17:54:18 | shashlick | not used to blocks yet :) |
17:55:54 | FromGitter | <alehander42> @Araq I haven't worked on the hotReloading PR, but I agree hotCodeReloading is hotter |
17:56:07 | shashlick | miran: is there any convention? |
17:56:14 | FromGitter | <alehander42> redHotReloadingPeppers |
17:56:26 | miran | :D :D |
17:56:55 | FromGitter | <alehander42> would be also a very scientific name |
17:57:13 | miran | shashlick: i'm looking at https://nim-lang.org/docs/nep1.html and i don't see it. to me it looks nicer |
17:59:23 | miran | btw, 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:33 | Araq | hah, 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:32 | FromGitter | <alehander42> Cold loads would be just depressing now |
18:08:41 | FromGitter | <data-man> @shashlick: if you replace ```$someJsonNode[...]``` to ```someJsonNode[...].getStr``` then you'll not need to do ```replace("\\r\\n", "\n")``` |
18:09:15 | shashlick | nice |
18:11:24 | * | jaco60 joined #nim |
18:13:22 | miran | btw, isn't there some package which would do cli parsing for you? :) |
18:14:46 | * | Vladar quit (Quit: Leaving) |
18:17:49 | miran | (i ask because i might need it relatively soon) |
18:20:31 | Araq | cligen iirc, check nimble |
18:21:41 | FromGitter | <data-man> @miran: cligen, docopt.nim, commandeer, lib/pure/parseopt :) |
18:21:57 | miran | cc shashlick |
18:22:36 | miran | cligen looks quite nice! |
18:24:48 | * | yglukhov joined #nim |
18:27:06 | dom96 | miran: nep1 needs many changes. I didn't write it |
18:28:03 | Araq | apis.html should be part of nep1 |
18:28:25 | Araq | or maybe not. |
18:28:44 | Araq | but then apis.rst needs to be made more well known. |
18:29:56 | miran | this is the first time i hear about it. it might be a part of new, more detailed nep1, imo |
18:30:09 | Araq | yglukhov: 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:37 | Araq | --hint[source]:on is also not known. |
18:31:50 | yglukhov | Araq: 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:24 | yglukhov | that involves dylibs and so on. |
18:32:47 | Araq | the way we implement dylibs is excellent for hot code reloading |
18:33:06 | yglukhov | also 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:12 | Araq | we only need to expose reloadDll("namehere.dll") |
18:33:17 | yglukhov | yep |
18:34:46 | yglukhov | so 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:12 | Araq | well it would be comparable to how we build nimrtl.dll, no? |
18:38:15 | yglukhov | exactly. but I'm curious if it's possible to do this without explicit annotations. |
18:38:29 | yglukhov | and if it's really needed to in the first place :) |
18:39:37 | yglukhov | or maybe that were an ide should come into play... |
18:39:45 | yglukhov | *that's where |
18:40:25 | Araq | I need to figure out whether I prefer REPL or hot code reloading first. |
18:40:35 | Araq | and where the difference is... |
18:41:53 | yglukhov | like I said nim as it is is absolutely repl compatible, as i'm seeing it. |
18:42:31 | dom96 | It's not like REPL and hot code reloading are mutually exclusive features |
18:42:41 | yglukhov | ah, but i get your point. you mean code reloading could make repl useless? |
18:43:19 | Araq | no, my point is: |
18:43:29 | Araq | I understand what a REPL needs to do. |
18:43:59 | Araq | I don't understand what hot code reloading needs to do. not really, anyway, never really used it anywhere before. |
18:44:43 | Araq | I notice that Python's REPL doesn't change Python and doesn't add API calls like reload() |
18:45:06 | Araq | and I noticed Nim's hot code reloading brought us a 'once' template. |
18:45:08 | yglukhov | well, high-rate repeating code is subject to code reloading. like drawing, or game logic, or signal processing. |
18:45:32 | yglukhov | ah, that one. yes, it is weird. |
18:46:29 | yglukhov | tbh, i did not consider global code at all. thought only about functions so far. |
18:48:15 | yglukhov | but truth be told, python would behave in a similar way? i mean importing module will re-evaluate its globals, right? |
18:48:34 | Araq | well I do understand that you're testing a level and want to fix the AI on the fly :P |
18:49:09 | Araq | so you press a key to open an internal terminal and type in 'reload ai.dll' :P |
18:49:30 | Araq | that is mapped to what Nim offers. |
18:49:52 | Araq | dunno how Python's REPL deals with imports |
18:49:57 | dom96 | libffi? |
18:49:59 | yglukhov | nah, that's too difficult. it's just 'while true: reload ai.dll; sleep 1sec' |
18:50:30 | Araq | lol |
18:50:45 | shashlick | data-man - I've used docopt and commandeer, both are nice |
18:50:52 | shashlick | didn't feel like it was needed yet for this |
18:51:06 | Araq | I wrote a toy RTS game engine once. and even that one had a command window for these things |
18:51:16 | yglukhov | Araq: i mean, it should feel like it. it surely could use file system monitor under the hood. |
18:52:08 | yglukhov | well, ok, let's say both approaches should be possible =) |
18:52:55 | Araq | hmm I should port that engine to Nim... |
18:53:18 | yglukhov | oh, speaking about fs monitors. any thoughts on https://github.com/nim-lang/Nim/pull/7571? Araq, dom96, anyone? |
18:53:38 | Araq | it was written in Delphi back then with a preprocessor I wrote because Delphi sucked |
18:53:45 | Araq | :-) |
18:53:57 | yglukhov | haha, and that's how nim appeared? :D |
18:54:15 | Araq | it certainly had an influence on Nim. |
18:56:15 | yglukhov | bbl |
18:58:50 | Araq | dom96: you keep bringing it up. want to work on it? |
18:59:11 | dom96 | hah no |
18:59:17 | FromGitter | <krux02> Araq: Age of Wonders 2 is written in Delphi great game. |
18:59:52 | FromGitter | <krux02> and Age of Wonders 2 is great. so I like Delphi, indirectly. |
19:00:09 | Araq | Baldur's Gate was written in it too iirc |
19:00:58 | Araq | but don't quote me on that. |
19:08:10 | * | shashlick quit (Ping timeout: 264 seconds) |
19:10:26 | FromGitter | <krux02> well baldur's gate has a Linux port, and Delphi does not have that AFAIK |
19:10:43 | FromGitter | <krux02> so I don't think baldur's gate is a Linux port. |
19:10:50 | * | endragor joined #nim |
19:11:42 | Araq | 1. Delphi had a Linux port but it didn't sell well (because nothing sells well on Linux?) |
19:12:06 | Araq | 2. FPC is compatible enough with Delphi and runs pretty much everywhere. |
19:12:43 | Araq | 3. 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:03 | FromGitter | <krux02> I wonder is there anything really better in the Delphi world compared to c++? |
19:16:20 | FromGitter | <krux02> is it simpler, does it provide something c++ can't do? |
19:16:44 | FromGitter | <krux02> I would really like to know if there is something good about Delphi that I should know about. |
19:17:00 | Araq | but I'm probably wrong, https://en.wikipedia.org/wiki/Baldur%27s_Gate doesn't indicate anything |
19:17:32 | Araq | well Delphi compiled 100_000 LOC on a CPU you nowadays have in your toaster |
19:17:41 | FromGitter | <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:51 | Araq | LOC/s |
19:18:08 | FromGitter | <krux02> I have one boxed game that runs on Linux. And I basically bought only because if was for Linux. |
19:18:22 | FromGitter | <krux02> lines of code? |
19:18:28 | Araq | they got bug reports about the "compile" button doing nothing. |
19:18:29 | * | SenasOzys quit (Ping timeout: 256 seconds) |
19:18:45 | Araq | because it was too fast. :-) |
19:19:26 | FromGitter | <krux02> that's cool |
19:19:39 | Araq | also they had an IDE where you could drag&drop UI elements on a canvas |
19:19:59 | Araq | remember, that was before we had web apps. |
19:20:10 | Araq | UI development was a big thing then. |
19:20:41 | Araq | oh and it had bounds checking for its arrays |
19:22:00 | Araq | and a string type that know its length |
19:22:32 | FromGitter | <krux02> yay bounds checking. C doesn't really know it's bounds, so it can't really do do it |
19:23:12 | FromGitter | <krux02> collections that know it's size are generally a good thing |
19:23:19 | Araq | it also has subrange integer types and was memory safe, more or less. |
19:23:22 | FromGitter | <data-man> FreePascal has Lazarus and MSEide with MSEgui :) |
19:24:02 | Araq | the original Pascal had new() for heap allocation but lacked dispose() |
19:24:14 | * | SenasOzys joined #nim |
19:24:36 | Araq | so it stayed memory safe but you had to reuse your list nodes on your own or else you would leak memory. |
19:25:19 | Araq | but when you re-use the nodes on your own type/memory safety persists. pretty interesting design given its age. |
19:26:44 | FromDiscord | <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:25 | Araq | that's TP yeah. Delphi had "Ansi Strings", refcounted things |
19:27:40 | FromDiscord | <geckojsc> we must have been one of the only schools in the country who weren't using Python for that exam |
19:29:21 | Araq | nobody needs strings longer than 256 characters. :P |
19:29:42 | miran | ...on twitter |
19:30:10 | Araq | you 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:48 | FromDiscord | <geckojsc> :'( |
19:31:22 | Araq | full 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:31 | Araq | oh my bad |
19:31:48 | Araq | that should have been node^.next := node^.next^.next |
19:32:25 | FromDiscord | <geckojsc> I do remember being impressed by the module system in turbo pascal. Better than header files |
19:32:45 | FromDiscord | <geckojsc> (given how old the language was) |
19:32:59 | Araq | yeah. |
19:33:32 | Araq | 'unit' is a TP extension though. the original pascal had no module system. |
19:33:48 | Araq | nor #include, every solution was vendor specific. |
19:33:53 | Araq | :-) |
19:34:00 | FromDiscord | <geckojsc> D: |
19:34:23 | * | athenot quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
19:34:50 | FromGitter | <data-man> And units can to have initialization and finalization sections. |
19:35:20 | Araq | so yeah. 70's Pascal was memory safe without a GC. Take that Rust! |
19:36:38 | Araq | (it also was unusable...) |
19:37:22 | Araq | but hey, it was for teaching, and it was pretty good for teaching. |
19:40:05 | FromGitter | <data-man> TP produced .com files. Max size is 64KiB. :-D |
19:41:30 | FromGitter | <data-man> Early versions. Before the Windows era. |
19:46:08 | FromGitter | <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:31 | FromGitter | <krux02> @data-man I think a Hello world in c++ is bigger than that |
19:47:59 | Araq | echo "hello world" # hello.nim |
19:48:26 | Araq | # in order to compile it to the tinyest possible file, do this: |
19:48:39 | Araq | cp hello.nim hello && chmod +x hello |
19:49:14 | Araq | Nim's hello world binary size is almost unmatched :P |
19:49:51 | FromGitter | <krux02> well it's bash not nim |
19:49:58 | FromDiscord | <geckojsc> isn't that technically JIT? xD |
19:53:06 | FromDiscord | <geckojsc> wait actually what's happening there |
19:53:56 | FromDiscord | <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:05 | FromGitter | <data-man> > When my "Hello, World" programs are too large, I optimise them to "Hi, World". ⏎ ⏎ From Stack Overflow :-D |
19:59:57 | FromDiscord | <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:57 | FromDiscord | <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:01 | FromGitter | <data-man> Add library's path to nim.cfg |
20:03:54 | Araq | geckojsc: it depends on your setup but I don't use --path anymore |
20:04:28 | Araq | with the import "../lib" / [a, b, c] syntax I can always do what I need |
20:04:32 | Araq | to. |
20:07:53 | FromDiscord | <geckojsc> ah ok, yeah that works just fine |
20:12:03 | * | r3d9u11 quit (Remote host closed the connection) |
20:12:08 | FromDiscord | <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:28 | Araq | in the library dir: |
20:12:31 | Araq | nimble init |
20:12:34 | Araq | nimble develop |
20:12:55 | Araq | and then it's available, not need to "install" it via nimble |
20:13:15 | FromDiscord | <geckojsc> holy biscuits |
20:13:30 | * | yglukhov quit (Remote host closed the connection) |
20:13:37 | Araq | or you use --path then |
20:17:25 | FromDiscord | <geckojsc> nah, nimble develop is exactly what I was looking for, thank you :) |
20:39:03 | * | couven92 quit (Quit: Client disconnecting) |
20:46:53 | FromDiscord | <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:59 | FromGitter | <mratsim> oh I missed a conversation about Age of Wonders and Baldur’s Gate |
21:03:49 | FromDiscord | <geckojsc> how do I decide between clear(renderer) clear renderer renderer.clear renderer.clear() |
21:05:05 | Araq | good question, I don't know |
21:05:30 | FromGitter | <mratsim> listen to your heart |
21:05:38 | Araq | renderer.clear() is probably what others use most often. |
21:05:56 | Araq | as 'clear' is pretty attached to the renderer it uses the dot syntax. |
21:06:08 | Araq | and as it is an effectful call it gets the () |
21:06:20 | FromDiscord | <geckojsc> yeah, I guess that makes the most sense |
21:07:15 | FromDiscord | <geckojsc> the 3rd style probably makes most sense when the method is acting like a getter |
21:07:27 | Araq | yes |
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:40 | shashlick | do you need csources sitting around after bootstrapping once? |
21:42:03 | Araq | no. |
21:42:23 | shashlick | you can just use koch to compile after that right? |
21:42:29 | shashlick | nim to compile koch to compile nim |
21:45:41 | Araq | sure |
21:46:02 | shashlick | running out of space on my laptop, have to ditch some stuff |
21:47:03 | Araq | buy a new laptop? |
21:47:49 | shashlick | just lots of unnecessary data on it |
21:50:28 | FromDiscord | <treeform> `when defined(nimphp)` what? PHP? |
21:53:07 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
21:53:30 | Araq | the PHP backend never was official |
21:53:46 | Araq | and eventually somebody will clean up the code and throw it away |
21:54:04 | Araq | as you noticed, I'm not the guy who cleans up code. |
21:54:44 | Araq | (unless I fix related bugs or work on features touching it) |
21:54:57 | * | vlad1777d quit (Ping timeout: 265 seconds) |
21:55:39 | Araq | you can buy Nim plus a PHP backend for a 1000$ license for every development machine that you use |
21:56:43 | shashlick | why don't we have an update script in the nim dir? |
21:57:01 | Araq | 'koch update' used to be a thing |
21:57:28 | * | gokr joined #nim |
21:58:32 | * | gokr left #nim (#nim) |
21:59:34 | FromDiscord | <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:51 | FromDiscord | <treeform> This is an actual problem i run into: https://github.com/nim-lang/Nim/issues/7603 |
22:00:37 | Araq | well you know how to fix it, right? |
22:01:01 | shashlick | why does ./koch temp c fail at the end? the bin is generated though |
22:01:05 | FromDiscord | <treeform> I hope so. |
22:01:29 | shashlick | bin/nim_temp c => command expects a filename argument |
22:01:51 | Araq | well yes, strange question. |
22:02:03 | Araq | 'koch temp' is for testing single files |
22:02:48 | * | athenot joined #nim |
22:03:47 | FromGitter | <data-man> It's Friday, 13th :-D |
22:06:38 | Araq | it's not. it's saturday already |
22:06:45 | shashlick | ya 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:06 | FromDiscord | <geckojsc> hey, is there any reason to use ; over , in parameter lists? |
22:15:05 | * | Lord_Nightmare joined #nim |
22:15:33 | FromDiscord | <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:10 | Araq | shashlick: it's 'koch temp c foo.nim' |
22:16:29 | Araq | geckojsc: ; is slightly more readable |
22:16:53 | Araq | treeform: cmp returns == 0, < 0, > 0 |
22:17:30 | Araq | it's not specified which values so that cmp for integers can be implemented as x - y with no branches |
22:17:38 | FromDiscord | <treeform> does it need to follow some pattern though? |
22:17:49 | Araq | treeform: cmp returns == 0, < 0, > 0 |
22:17:57 | Araq | == 0 iff a == b |
22:18:02 | Araq | < 0 iff a < b |
22:18:06 | Araq | > 0 iff a > b |
22:19:01 | FromDiscord | <treeform> I guess my real question is should I do A or B and why? https://gist.github.com/treeform/77b8b92f2cab7cf321198ef82d123fdd |
22:21:18 | FromDiscord | <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:14 | shashlick | Oh I see |
22:25:41 | FromDiscord | <treeform> https://github.com/nim-lang/Nim/pull/7604 |
22:28:49 | Araq | huh? shouldn't it iterate over the minimum of the two lengths? |
22:30:46 | FromDiscord | <treeform> that too |
22:31:33 | FromDiscord | <treeform> just checked `a == b` is always false for arrays. |
22:31:40 | FromDiscord | <treeform> so that line does nothing |
22:42:48 | FromDiscord | <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:09 | FromGitter | <genotrance> :q |
22:57:34 | shashlick | vim isn't quitting for some reason... |
23:01:40 | Araq | treeform, rebase perhaps I just made the JS tests green |
23:08:55 | FromDiscord | <treeform> ok |
23:09:45 | FromDiscord | <treeform> Is my new bug related to the thing you just did ? https://github.com/nim-lang/Nim/issues/7605 |
23:10:12 | dom96 | Love 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:06 | FromDiscord | <treeform> Any one doing webasm work for nim? |
23:11:12 | FromDiscord | <treeform> Anyone doing webasm work for nim? |
23:11:36 | dom96 | https://github.com/stisa/nwasm |
23:11:46 | FromDiscord | <treeform> Neat |
23:12:36 | Araq | treeform: maybe |
23:14:01 | dom96 | Wishing this repo was a bit more minimal |
23:14:22 | dom96 | like https://github.com/arnetheduck/nlvm |
23:14:53 | FromDiscord | <treeform> That repo looks like a fork, maybe it could be merged in later? |
23:16:34 | dom96 | https://github.com/stisa/nwasm/issues/1 |
23:19:30 | Araq | as I said, little frontend changes to make the backend spinoffs easier to develop are fine with me. |
23:20:22 | Araq | https://github.com/nim-lang/Nim/issues/7301 we need somebody for this bug |
23:20:48 | Araq | supporting archaic systems is one of Nim's nichés |
23:21:33 | Araq | we even support __VXWORKS__ :-) |
23:22:04 | Araq | which is a pretty offensive name since nothing 'works' on it. |
23:24:23 | FromDiscord | <treeform> Araq, i rebased waiting for the CI to run. |
23:25:44 | Araq | don't wait for it, come back tomorrow |
23:25:54 | Araq | the CIs are overly busy |
23:28:05 | FromDiscord | <treeform> ok |
23:55:25 | * | user1101 quit (Quit: user1101) |