00:16:46 | * | gangstacat joined #nim |
01:05:02 | * | beatmox quit (Ping timeout: 268 seconds) |
01:05:39 | * | beatmox joined #nim |
01:18:36 | FromGitter | <arnetheduck> switch to https://github.com/arnetheduck/nim-result and you wont need any of that crap :) |
01:32:08 | * | rnrwashere joined #nim |
01:32:11 | * | rnrwashere quit (Remote host closed the connection) |
01:33:14 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
02:08:12 | * | banc quit (Quit: Bye) |
02:14:06 | * | [rg] joined #nim |
02:17:32 | * | dddddd quit (Remote host closed the connection) |
02:29:01 | * | banc joined #nim |
02:32:28 | * | cyraxjoe joined #nim |
02:48:20 | * | rockcavera joined #nim |
03:26:03 | * | rnrwashere joined #nim |
03:32:16 | * | rnrwashere quit (Remote host closed the connection) |
03:51:53 | * | rnrwashere joined #nim |
03:56:59 | * | leorize joined #nim |
04:03:02 | * | rnrwashere quit (Remote host closed the connection) |
04:11:48 | * | rnrwashere joined #nim |
04:36:51 | * | nsf joined #nim |
05:04:00 | * | rnrwashere quit (Remote host closed the connection) |
05:20:20 | * | narimiran joined #nim |
05:24:35 | * | leorize quit (Quit: WeeChat 2.3) |
05:47:06 | * | solitudesf- joined #nim |
05:52:33 | * | leorize joined #nim |
06:02:04 | * | [rg] quit (Quit: Leaving) |
06:03:41 | FromGitter | <kayabaNerve> Exceptions are zero cost, and that doesn't tell me by the proc def the absolute list of what the function can raise. |
06:04:42 | Araq | hint: it doesn't fucking matter. |
06:04:59 | Araq | yes it can raise any kind of exception. you handle it. the end. |
06:05:11 | FromGitter | <mratsim> what? exceptions are zero cost? |
06:06:31 | Araq | they are "negative cost" compared to excessive ifs |
06:06:51 | Araq | they have non-zero cost compared to 'on error abort' |
06:07:05 | Araq | (assuming 'nim cpp') |
06:07:17 | Araq | many many people do not understand this... |
06:08:38 | * | krux02 joined #nim |
06:12:53 | FromGitter | <alehander42> well if you can't differentiate between exceptions in your effect system, there is not much point in using anything which is not Exception |
06:13:04 | FromGitter | <alehander42> (maybe i am reading the discussion wrong) |
06:13:21 | FromGitter | <alehander42> otherwise i agree, exceptions are becoming underrated these days |
06:16:25 | FromGitter | <kayabaNerve> @mratsim Nim exceptions, when using the C++ backend, are C++ exceptions, and C++ exceptions are zero cost. |
06:16:37 | FromGitter | <kayabaNerve> Sorry, I always use C++. I forgot C is default. |
06:16:48 | FromGitter | <mratsim> I'm curious how C++ exceptions are implemented in assembly |
06:19:04 | FromGitter | <kayabaNerve> Exceptions are very useful, and forcing myself to handle them has me write cleaner code which is less likely to be disrupted. I force myself because I suck at error handling when it's not forced. |
06:19:29 | FromGitter | <kayabaNerve> The raises pragma cleanly identifies what errors I need to handle. Nim-Result doesn't have that feature. |
06:20:27 | FromGitter | <kayabaNerve> I've never had a case where I can't differentiate exceptions. Just a case where I'm forced to include Exception, and since Exceptions are hierarchical... |
06:26:06 | FromGitter | <kayabaNerve> As a quick question, what are the odds of `await asyncProc()` throwing Exception, assuming the proc itself doesn't throw anything pre-async macro? |
06:26:30 | FromGitter | <kayabaNerve> I'm guessing it's only even possible if someone steps into the async inner workings but wanted to check |
06:43:22 | * | PMunch joined #nim |
06:48:31 | FromGitter | <gogolxdong> How to parse `"["a","b"]"` to array or seq? |
06:49:37 | * | solitudesf- quit (Ping timeout: 245 seconds) |
06:49:40 | FromGitter | <gogolxdong> assuming it's a varchar stored in mysql as ["a","b"] |
06:50:54 | leorize | I'd say it's not trivial |
06:51:18 | leorize | shouldn't you use a table for that? |
06:51:25 | Zevv | do you care about properly handling quotes in your string? |
06:53:07 | Zevv | if no, http://paste.debian.net/plain/1079244 |
06:53:10 | Zevv | if yes, let me know :) |
06:55:31 | FromGitter | <gogolxdong> asked this before, like parseStmt or something to parse the symbol to array or seq directly. |
06:56:09 | * | leorize quit (Ping timeout: 256 seconds) |
06:56:22 | Zevv | I assume you want to do this at run time, not at compile time, right? |
06:56:51 | FromGitter | <gogolxdong> sure |
06:57:37 | * | leorize joined #nim |
06:59:18 | Zevv | I guess there's no Nim there to interpret Nim code for you, so you'd have to parse it yourself |
06:59:47 | Zevv | see the above paste for one possible solution |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:01:36 | Zevv | http://p.zevv.nl/?92ff also handles \\ and \" |
07:04:51 | * | gmpreussner joined #nim |
07:06:42 | Zevv | Could you not parse as json? |
07:06:46 | Zevv | would be more robust |
07:07:17 | Zevv | http://p.zevv.nl/?0559: much simpler |
07:15:35 | FromGitter | <gogolxdong> json is a good approach. |
07:18:54 | FromGitter | <alehander42> hmm i love how easy is to work with nim parser runtime |
07:19:08 | FromGitter | <alehander42> it's basically almost the same as macros, but you use PNode instead Node |
07:21:22 | Araq | alehander42: my point is mostly that exceptions are not understood by many and most arguments against them are terrible. |
07:21:31 | narimiran | @alehander42 https://github.com/nim-lang/Nim/pull/11094 is ready for some testing if you want.... |
07:21:57 | FromGitter | <mratsim> rawGetKnownHCImpl :? |
07:22:00 | FromGitter | <alehander42> parsing nim on runtime might be an overkill tho, have to benchmark |
07:22:39 | leorize | afaik the only way to have multi-line statement in Nim is to use a trailing binary operator right? |
07:22:45 | FromGitter | <alehander42> ah Araq yeah kinda, still i'd argue it's subjective, one can always prefer a more explicit style of error handling, nothing wrong with that |
07:23:03 | leorize | I'm gonna look into implementing NEP1 and some context awareness for nim.nvim's indent script |
07:23:08 | FromGitter | <mratsim> any operator works @leorize |
07:23:19 | Araq | as does ';', leorize |
07:23:21 | * | jjido joined #nim |
07:23:26 | FromGitter | <alehander42> narimiran, thanks, i'll try to rebase languist on this branch on my next succesful build |
07:23:52 | narimiran | @mratsim "rawGetKnownHCImpl" was there before, 98% of the diff is just moving some code around |
07:24:48 | Araq | alehander42: there is plenty of "wrong" with that, it's so bad that nobody seriously does it and languages weasel out. |
07:25:44 | Araq | any time Go's + does an integer wrap around "for you" it's because of language design hubris. |
07:25:48 | * | xet7 joined #nim |
07:26:35 | Araq | if Option[T] would be the answer why does Rust's '+' not produce one? |
07:26:38 | FromGitter | <alehander42> well i mean more like Result-based stuff (most fun langs, rust etc) |
07:26:47 | FromGitter | <alehander42> well what does rust do for overflows |
07:27:05 | Araq | it dies in debug mode, it wraps around in release mode |
07:28:00 | FromGitter | <alehander42> is there an option to disable wrapping around in release? |
07:28:17 | Araq | probably but here is the problem: |
07:28:46 | FromGitter | <alehander42> well, "test in debug mode, do one of those other things in release" rings a bell to me .. |
07:28:47 | FromGitter | <alehander42> :D |
07:28:51 | Araq | if your code does do(); stuff(); undo() because either the language "has no exceptions" or 'stuff cannot raise' |
07:29:07 | Araq | then stuff can still die and your code is still wrong |
07:29:29 | Araq | not to mention that later on 'stuff' could start to raise/die |
07:29:31 | FromGitter | <mratsim> integer wraps around because of x86 :p |
07:29:38 | FromGitter | <alehander42> how can stuff `die` ? |
07:29:40 | jjido | Are you talking about exceptions for arithmetic operations? |
07:29:50 | FromGitter | <alehander42> if it's statically proved that it should not |
07:30:12 | Araq | really? you prove every integer operation to never overflow? |
07:30:24 | Araq | not even Ada can do that. |
07:30:38 | FromGitter | <alehander42> overflowing is not dying |
07:30:54 | FromGitter | <alehander42> and this approach sounds exactly like the nim owned ref approach |
07:30:57 | Araq | it is in Rust |
07:31:02 | jjido | I am working on a language where the solution is to error out if there is an error handler, or just return (wrong) result otherwise |
07:31:05 | Zevv | unless it's in your morphine pump |
07:31:34 | Araq | when you don't die on overflow it's even worse... |
07:31:49 | Araq | when you don't die/raise on overflow it's even worse... |
07:32:00 | FromGitter | <alehander42> that's why you test |
07:32:17 | FromGitter | <alehander42> i can say the same about memory segfaults/corruption and owned refs |
07:32:36 | Araq | yes you can do that but |
07:32:48 | Araq | (a) I never claimed it's THE solution for everything |
07:33:02 | FromGitter | <alehander42> and integer overflow doesn't just happen all the time, you can't say "X error handling" doesnt make sense because it doesnt work perfectly for one edge case |
07:33:12 | Araq | (b) owned refs are easier to test extensively. Integer arithmetic is harder. |
07:33:46 | FromGitter | <alehander42> you can fuzz the shit out of it i guess |
07:34:12 | FromGitter | <alehander42> or even quickcheck-test your important functions/entrypoints |
07:34:17 | Araq | ok, so you fuzz it and |
07:34:33 | Araq | tada. the result is that "yeah, really it can overflow, surprise" |
07:34:39 | Araq | what do you do? |
07:34:54 | FromGitter | <mratsim> Sacrifice a lamb to the Nim gods |
07:34:59 | FromGitter | <alehander42> no |
07:35:02 | FromGitter | <alehander42> you debug |
07:35:20 | FromGitter | <alehander42> i mean, what do you do when you find out you have a memory corruption problem |
07:35:37 | FromGitter | <alehander42> you reproduce and you decide on a fix |
07:36:10 | Araq | there is no fix. You die with an error message. |
07:36:18 | Araq | like you do for out-of-memory. |
07:36:29 | Araq | and then your undo() is not called. |
07:36:41 | jjido | Change the variable type? |
07:37:29 | leorize | Araq: does the "error when rc count > 0" of newruntime works? |
07:37:58 | Araq | leorize, it's implemented and sometimes triggers. I'm testing it for more complex examples |
07:39:13 | FromGitter | <alehander42> well maybe the overflow is unintended |
07:39:26 | FromGitter | <alehander42> but yeah, that's the point: you can decide what to do in this situation |
07:39:40 | FromGitter | <alehander42> ok added miran as remote |
07:39:49 | FromGitter | <alehander42> that would be easier for me to test other branches |
07:39:58 | FromGitter | <alehander42> not really sure if that's how people test pr-slocally |
07:40:20 | Araq | alehander42: well without exceptions you "can't decide what to do" as the language decided for you, the program dies |
07:40:38 | PMunch | Hmm, why doesn't this work? http://ix.io/1H9J/Nim seems like overloading the macro confuses things.. |
07:41:11 | FromGitter | <alehander42> but isn't the point that with exceptions you can't find out when it can overflow statically |
07:41:12 | FromGitter | <alehander42> anyway |
07:41:16 | FromGitter | <alehander42> so you still need to test it |
07:41:29 | FromGitter | <alehander42> and in other langs if you decide you want to do something else |
07:41:42 | FromGitter | <alehander42> you can e.g. use different operators/functions |
07:41:46 | FromGitter | <alehander42> custom* |
07:41:54 | FromGitter | <alehander42> other error handling systems* |
07:41:56 | Araq | no the point is you *must* wrap your 'undo' in a 'finally' or maybe an 'atexit' handler |
07:42:08 | Araq | and you cannot blame exceptions for this need. |
07:42:45 | FromGitter | <alehander42> ah |
07:42:49 | Araq | the point is that not having exceptions does not make the problems disappear, they are only even more cumbersome to solve |
07:43:41 | FromGitter | <alehander42> well, i have to think about the overflowing problem |
07:45:17 | Araq | overflow is much more like out-of-memory, you have too few bits available |
07:45:38 | Araq | it's not a "bug" like a dangling pointer |
07:45:45 | Araq | or an array index out of bounds |
07:49:50 | leorize | Araq: `discard new RootObj` SIGSEGV on newruntime |
07:49:59 | leorize | on the latest commit rn |
07:52:08 | FromGitter | <alehander42> sometimes it's a bug: sometimes it just shows you don't process your data correctly and unusually big / small numbers appear somewhere |
07:52:20 | FromGitter | <alehander42> narimiran, it seems to work for me , your branch |
07:52:33 | narimiran | nice to hear, thanks for testing it! |
07:52:33 | FromGitter | <alehander42> the weird thing is my older nim seems to also not need initTable in some cases |
07:52:38 | leorize | Araq: the following didn't crash on newruntime, is that a bug? http://ix.io/1H9M/nim |
07:52:42 | FromGitter | <alehander42> not very sure if i am not doing something wrong |
07:54:17 | FromGitter | <alehander42> anyway i stop using initTable for now, awesome, just need to do the same with JsAssoc if it seems possible |
07:55:26 | Araq | leorize, not sure yet |
07:56:07 | leorize | if I add `discard r`, it will crash, but `echo r[]` wouldn't |
07:57:13 | Araq | well the 'discard new RootObj' surely is a bug |
07:57:22 | Araq | why would it fail? |
07:57:53 | leorize | system.nim(1637) new |
07:58:00 | Araq | also the ref testing doesn't produce a SIGSEGV but a decent error message |
07:58:29 | leorize | I'm on Linux if that makes any difference |
07:58:54 | livcd | PMunch: did you already make your web+file whatever that was? |
08:05:01 | * | floppydh joined #nim |
08:07:47 | PMunch | livcd, web+file? |
08:08:47 | livcd | PMunch: you did some frontend with file processing for some payments file did not you? |
08:10:08 | PMunch | Oh right, yes that's done |
08:10:32 | PMunch | But I just went with using Jester and made the site with Javascript, didn't create the little framework I was talking about |
08:17:24 | PMunch | Hmm, reordering the two macros seems to work.. |
08:17:27 | PMunch | Is that a bug? |
08:17:38 | Araq | probably :-) |
08:18:02 | * | slugm joined #nim |
08:18:48 | PMunch | Hmm, so depending on the order it will match one or the other. While the other creates an error |
08:33:33 | * | floppydh quit (Quit: WeeChat 2.4) |
08:33:43 | * | floppydh joined #nim |
08:34:13 | * | floppydh quit (Client Quit) |
08:34:40 | * | floppydh joined #nim |
08:35:52 | * | floppydh quit (Client Quit) |
08:36:06 | * | floppydh joined #nim |
08:36:22 | * | floppydh quit (Client Quit) |
08:36:34 | * | floppydh joined #nim |
08:36:44 | * | Vladar joined #nim |
08:44:50 | * | Minimisthupper joined #nim |
08:48:33 | * | slugm quit (Remote host closed the connection) |
08:56:07 | * | Minimisthupper97 joined #nim |
08:57:05 | * | Minimisthupper97 quit (Remote host closed the connection) |
09:03:49 | * | iLiquid joined #nim |
09:07:57 | * | dddddd joined #nim |
09:16:37 | * | i7sDream joined #nim |
09:26:17 | couven92 | @shashlick, you looked for me yesterday? |
09:26:18 | * | jasper__ quit (Remote host closed the connection) |
09:32:13 | PMunch | Yes, I told him that you might've tried to compile nimble for Android |
09:32:32 | PMunch | I remember you compiling Nim for Android, so I figured you might've tried that as well |
09:32:47 | * | tdc joined #nim |
09:35:05 | PMunch | Hmm, is there a way to detect if Nim is creating documentation? I want to hide some symbols when that happens |
09:35:43 | leorize | `when defined(nimdoc)` |
09:36:16 | * | iLiquid_ joined #nim |
09:36:17 | * | iLiquid quit (Read error: Connection reset by peer) |
09:36:30 | * | iLiquid_ is now known as iLiquid |
09:41:47 | couven92 | PMunch, huh... yeah, I remember there being some issues with nimble on android, which is basically why I troduced the android architecture to nim... |
09:42:04 | couven92 | But I do also remember that I got it working in the end... Hmmm |
09:50:00 | * | pwntus joined #nim |
09:50:00 | * | pwntus quit (Changing host) |
09:50:00 | * | pwntus joined #nim |
09:56:15 | leorize | new indent feature https://asciinema.org/a/Xe46stggKpPmAPP7yYSrmlxGh for nim.nvim :) |
09:57:26 | leorize | anyone wants a test drive? |
09:57:47 | narimiran | of course :) |
09:59:03 | FromGitter | <alehander42> oh that's good for aligning field types etc |
09:59:34 | FromGitter | <alehander42> i'd love if there was a lint check for it |
10:01:04 | leorize | there are plenty of linter plugins for nvim already, so I didn't add that feature |
10:02:43 | leorize | narimiran: pushed to master :) |
10:03:20 | leorize | I wish vimscript was typed :p I stumble into more type-related bugs while making this than logic bugs |
10:04:46 | leorize | a lot of fuzzing and tests would be needed :P |
10:04:59 | leorize | I've only tested this on short sources |
10:07:47 | * | i7sDream quit (Ping timeout: 246 seconds) |
10:12:13 | leorize | agh this broke autoindent :/ |
10:22:39 | * | jjido quit (Quit: Connection closed for inactivity) |
10:23:59 | PMunch | leorize, thanks :) |
10:24:31 | * | leorize quit (Quit: WeeChat 2.3) |
10:27:54 | * | avanderneut quit (Remote host closed the connection) |
10:29:10 | * | lritter joined #nim |
10:36:17 | * | avanderneut joined #nim |
10:44:06 | * | seni joined #nim |
10:52:14 | * | Minimisthupper quit (Remote host closed the connection) |
10:53:55 | PMunch | Hmm, is there a way to output just an rst version of the documentation? |
10:54:01 | PMunch | For a specific module |
10:54:31 | * | stefanos82 joined #nim |
11:04:51 | * | Snircle joined #nim |
11:22:12 | PMunch | https://github.com/PMunch/explanations |
11:22:16 | PMunch | Mode a new little module |
11:23:14 | * | tdc quit (Remote host closed the connection) |
11:23:36 | * | tdc joined #nim |
11:31:27 | * | Cthalupa quit (Ping timeout: 258 seconds) |
11:31:54 | * | Cthalupa joined #nim |
11:32:07 | FromGitter | <alehander42> btw why doesnt table define `contains` <=> hasKey |
11:32:11 | FromGitter | <alehander42> so in can work |
11:32:27 | FromGitter | <alehander42> currently it's strange because `in` doesnt lead to type error |
11:32:36 | FromGitter | <alehander42> but it just doesnt do the same which leads to logical errors which is bad |
11:32:47 | FromGitter | <alehander42> so i think it should either be a type error, or be supported |
11:34:35 | FromGitter | <alehander42> hm it seems it does the same |
11:34:42 | FromGitter | <alehander42> then i shuld stop using hasKey all the time nvm |
11:34:52 | * | tdc quit (Remote host closed the connection) |
11:35:17 | * | tdc joined #nim |
11:36:48 | FromGitter | <alehander42> hmm maybe i found a remaining todo @narimiran |
11:38:13 | * | sz0 joined #nim |
11:39:05 | FromGitter | <alehander42> https://paste.ofcode.org/BgTeDBcMPSRtrrGSjACE55 |
11:39:20 | FromGitter | <alehander42> hasKey returns false instead of true for the first one |
11:47:01 | narimiran | ouch. can you paste that in a comment under PR? |
11:49:22 | FromGitter | <alehander42> done |
12:07:14 | livcd | what the heck |
12:07:28 | livcd | I just watched a video about Haxe where they say there is a Nim target in development |
12:15:23 | FromGitter | <alehander42> nim is a pretty flexible target language, not surprising |
12:15:30 | FromGitter | <alehander42> do you have a link? |
12:17:24 | * | neceve joined #nim |
12:20:17 | FromGitter | <arnetheduck> @mratsim https://monoinfinito.wordpress.com/series/exception-handling-in-c/ - how exceptions are implemented.. it's pretty good |
12:23:49 | FromGitter | <arnetheduck> Araq, rust has https://doc.rust-lang.org/std/primitive.i32.html#method.checked_add if you want the `Option` variant of add |
12:24:19 | FromGitter | <arnetheduck> (and wrapped_add, and saturated_add etc) |
12:27:40 | * | nc-x joined #nim |
12:27:55 | nc-x | @alehander42 https://github.com/RapidFingers/Craxe |
12:28:28 | nc-x | It is not official haxe backend |
12:28:42 | nc-x | but uses haxe macros instead |
12:29:22 | nc-x | I don't think anybody is working on a "proper" nim target for haxe |
12:29:57 | * | nc-x quit (Client Quit) |
12:30:15 | livcd | i do not know if he meant craxe |
12:30:17 | livcd | just a sec |
12:30:36 | livcd | he just mentions it like by the way |
12:31:12 | FromGitter | <alehander42> "RapidFingers/ (location Mother Russia)" |
12:31:16 | FromGitter | <alehander42> oh mother russia.. |
12:32:32 | FromGitter | <arnetheduck> > the weird thing is my older nim seems to also not need initTable in some cases ⏎ ⏎ for a while the behavior was that you could add things into the table but not get (it would not find them) if you didn't call initTable.. |
12:32:52 | FromGitter | <arnetheduck> I think 0.19 might be like this |
12:34:10 | livcd | https://youtu.be/TbhkHrcslrE?t=2129 |
12:34:42 | FromGitter | <alehander42> @arnetheduck yeah, that's the bug i experienced as well |
12:35:59 | FromGitter | <arnetheduck> and zero-cost exceptions (in c++) have a cost, generally - code bloat, missed optimizations etc. they just don't have a direct cycles-cost on try entry, like setjmp (no need to save jump point for alternative control flow etc) |
12:40:12 | FromGitter | <arnetheduck> but regardless of their cost, what an async transformation does is basically catch the exception, stash it away in a variable then retrow in the "handler". that's certainly not zero-cost - the future object is larger, becomes ref / can't be non-ref etc etc.. |
12:41:21 | FromGitter | <arnetheduck> and that's a cost everyone has to pay, even those that don't need the exceptions |
12:48:42 | narimiran | "the behavior was that you could add things into the table but not get (it would not find them)" -- something like that is what happens in my PR |
13:01:05 | narimiran | @alehander42 i think i have a fix. let me test it a bit more first.... |
13:04:38 | FromGitter | <gogolxdong> Production database is attacked by hacker, asking for 0.1bitcoin. |
13:37:36 | * | leorize joined #nim |
13:46:59 | * | drewr quit (Remote host closed the connection) |
13:48:15 | Zevv | that's a fair price |
13:55:22 | FromDiscord_ | <Zireael> the examples from documentation aren't quite true when it comes to properties: https://nim-lang.org/docs/manual.html#procedures-properties . I followed it when it came to getting, and it ignored the getter in favor of just getting the variable - I had to rename the function to something else for it to start working |
13:58:54 | leorize | then wouldn't that be a bug? |
13:59:39 | FromDiscord_ | <Zireael> probably, I was just checking that I hadn't misunderstood something... |
13:59:41 | leorize | Zevv: IIRC you're using nim.nvim indent script, right? |
14:00:32 | Zevv | I never got to switch to nvim, sorry |
14:00:36 | Zevv | too many machines |
14:00:50 | leorize | well, but you're using the indent script, right? :p |
14:00:53 | Zevv | oh wait, I do use the ident I believe, let me check |
14:00:59 | FromGitter | <gogolxdong> Not much ,neither we have. I think He picked the wrong one, exactly the wrong country , bitcoin is sealed in China. |
14:01:21 | Zevv | leorize: ack |
14:01:47 | leorize | I've made quite a lot of updates to the script, so please test the latest one :) |
14:02:00 | leorize | now featuring NEP #1 indentation :) |
14:02:04 | Zevv | what are the changes? I never ran into any issues? |
14:02:53 | leorize | https://asciinema.org/a/Xe46stggKpPmAPP7yYSrmlxGh |
14:03:01 | leorize | more of a feature update actually :p |
14:03:41 | FromGitter | <gogolxdong> Database is always backuped.This trick is out of date. |
14:03:42 | Zevv | ah that's sweet |
14:04:01 | Zevv | Tell him he has to send you 0.1 bitcoin or you'll tell his mom |
14:04:37 | FromGitter | <gogolxdong> lmao |
14:04:47 | Zevv | Yesterday I was looking for an exim log to do a performance test, I ran into a open rootfs from a hosting provider. I've been trying to get them to understand they have a security issue for the last 24 hours, but I can't get past first line customer support because I do not have a password |
14:04:55 | Zevv | Now I'm cracking the passwords so I can tell my password to support |
14:05:14 | Zevv | euh, *their* password |
14:05:37 | Zevv | ooh look, I just found one. 'test123' |
14:07:02 | FromGitter | <gogolxdong> image a world has no password. |
14:07:16 | FromGitter | <gogolxdong> imagine |
14:08:16 | FromGitter | <gogolxdong> like a house without door |
14:10:01 | Araq | > and zero-cost exceptions (in c++) have a cost, generally - code bloat, missed optimizations etc. |
14:10:25 | Araq | that's a cost that you have to compare against excessive if-statements |
14:10:33 | Araq | not against "on error die" |
14:10:50 | Araq | obviously "on error die" wins for code size and optimizations |
14:11:29 | Araq | and as I said, it can be fine for applications and so -fno-exceptions is widely used. |
14:13:14 | FromGitter | <arnetheduck> sure, and that bloat is probably less than explicit error handling - also because you end up ignoring more errors that you didn't know could happen :) |
14:15:11 | Araq | the hard part is library development, you easily end up playing a human compiler passing errors up your callstack because the library user might want to handle it in some form that is not 'die' |
14:17:51 | * | i7sDream joined #nim |
14:18:37 | * | noonien joined #nim |
14:18:50 | noonien | hello |
14:18:59 | noonien | how can i get the highest number of an int type? |
14:19:01 | FromGitter | <arnetheduck> yeah. I tend to think that libraries should very rarely die, better offer that choice to the user of the api. but I think the same about exceptions - core libraries can be exception-free and then offer an exception layer on top - it's easy to turn one into the other, but not the other way around. |
14:19:23 | couven92 | noonien, `high(int)`? |
14:19:28 | noonien | i tried high(varName) and high(uint6), both resulting in an ambigous call when compiling |
14:19:37 | FromGitter | <arnetheduck> specially core libraries, to maximize their usefulness (at the expense of implementation cost in the library of course, but that's fair that libraries have a higher quality bar) |
14:20:57 | noonien | `Error: ambiguous call; both system...(a: uint64, b: uint64)[declared in ../../../../../../nix/store/0ig4fx5vnndrg2qqbr2yfhxcmz3lj7jr-nim-0.19.4/lib/system.nim(2118, 13)] and system...(a: uint32, b: uint32)[declared in ../../../../../../nix/store/0ig4fx5vnndrg2qqbr2yfhxcmz3lj7jr-nim-0.19.4/lib/system.nim(2118, 13)] match for: (int literal(3), uint16)` |
14:22:13 | Araq | so get your types right, 3'u16..high(uint16) |
14:22:18 | * | i7sDream quit (Ping timeout: 250 seconds) |
14:22:55 | * | solitudesf- joined #nim |
14:25:29 | noonien | Araq: this is the code that causes the issue: http://vpaste.net/raGDY |
14:25:44 | noonien | OH, the for is the issue, not the high() |
14:25:57 | * | floppydh quit (Read error: Connection reset by peer) |
14:27:14 | noonien | is there a way to cause an error at compile time if a constant condition is met? |
14:28:26 | FromGitter | <liquid600pgm> yes, use the `{.error.}` pragma: https://nim-lang.github.io/Nim/manual.html#pragmas-error-pragma |
14:30:00 | noonien | thank you! |
14:36:37 | * | PMunch quit (Remote host closed the connection) |
14:39:35 | * | fanta1 joined #nim |
14:49:19 | * | floppydh joined #nim |
14:54:35 | FromGitter | <mratsim> high for unsigned? no way :p |
15:06:33 | * | flaviu quit (Remote host closed the connection) |
15:07:29 | federico3 | how can I detect the "main" .nim file in a project to run nim doc --project ... ? |
15:11:10 | WilhelmVonWeiner | public announcement, please stop abbreviating "string" to "strng" kthxbai |
15:12:58 | * | rnrwashere joined #nim |
15:13:32 | xace | does anyone know if you can use nim with nginx as a cgi? |
15:14:15 | Zevv | you can do CGI with virtually all languages; nginx is the problem here |
15:14:23 | FromGitter | <jrfondren> nginx doesn't support cgi as a rule. |
15:14:26 | Zevv | as it does not do cgi |
15:14:55 | xace | Zevv: i shouldve reformatted the quesiton, is there a existable setup for using nim as a cgi for website related projects? |
15:15:09 | FromGitter | <jrfondren> there's a cgi module packaged with nim. |
15:15:22 | xace | well doesn't have to be cgi, just a decent interface would suffice |
15:15:43 | FromGitter | <jrfondren> echo "Content-type: text"; echo(); echo "Hello, CGI" |
15:15:58 | xace | oh shit, i didn't expect it to be included |
15:16:27 | xace | nvm, ill google it, it seems like someone else thought of this already :) |
15:16:42 | livcd | Do you guys think the era of Electron apps will end soon ? |
15:17:18 | xace | livcd: unfortunately not. but that also depends on how long you are willing to stretch your definition of soon ;) |
15:17:42 | FromGitter | <jrfondren> the new Google Chat uses electron and it's bad enough to justify total war... but somehow there's no war. Google HQ remains unattacked. This doesn't inspire a lot of hope for the future in me. |
15:18:56 | livcd | i guess that means flutter is not ready? or the chat team decided on electron hmm |
15:19:03 | FromGitter | <jrfondren> the "I don't care about past activity, stop highlighting these channels" step takes half a minute in Google Chat. seconds+ in response time to clicks. clicks going through UI elements to open URLs. |
15:19:19 | FromGitter | <mratsim> Well, the choice is: Electron, QT, GTK+, Imgui/Nuklear, libui, Nigui, .... |
15:19:43 | livcd | mratsim: there are proprietary libraries as well |
15:19:45 | * | stefanos82 quit (Remote host closed the connection) |
15:19:50 | FromGitter | <jrfondren> maybe it's flutter. VS Code isn't anywhere near as bad. |
15:19:58 | FromGitter | <mratsim> finding a frontend dev and a designer familiar with HTML/JS/CSS is much easier |
15:20:19 | livcd | jrfondren: opening a larger log file in VS Code is terrible |
15:20:25 | livcd | larger like -> 50mb |
15:20:31 | FromGitter | <mratsim> you didn't try Atom |
15:20:55 | * | rnrwashere quit (Remote host closed the connection) |
15:20:56 | FromGitter | <mratsim> Atom freezes for minutes, at least vscode opens them |
15:21:38 | * | rnrwashere joined #nim |
15:26:23 | * | rnrwashere quit (Remote host closed the connection) |
15:26:36 | livcd | I really want to explore sciter seems to always go under the radar |
15:27:12 | FromGitter | <mratsim> I have a plan to use the webview that is underneath sciter since a year ago :p |
15:27:30 | FromGitter | <mratsim> This one: https://github.com/oskca/webview |
15:27:53 | * | Vladar quit (Remote host closed the connection) |
15:28:04 | livcd | it looks really capable |
15:28:15 | * | Vladar joined #nim |
15:28:20 | * | [rg] joined #nim |
15:28:20 | * | Vladar quit (Read error: Connection reset by peer) |
15:28:43 | * | Vladar joined #nim |
15:31:12 | * | Vladar quit (Read error: Connection reset by peer) |
15:31:34 | * | Vladar joined #nim |
15:31:36 | livcd | mratsim: what are you going to create ? |
15:31:59 | FromGitter | <mratsim> https://github.com/numforge/monocle |
15:32:33 | FromGitter | <mratsim> transform that proof of concept into a full fledge data-viz and charting library |
15:32:39 | FromGitter | <mratsim> fledged* |
15:32:56 | disruptek | better than vega because...? |
15:33:13 | Zevv | mratsim: what's vega? |
15:33:18 | FromGitter | <mratsim> it uses vega |
15:33:25 | Zevv | h |
15:33:41 | FromGitter | <mratsim> http://vega.github.io @Zevv |
15:33:54 | Zevv | sweet |
15:33:55 | disruptek | so what's the win? |
15:33:57 | FromGitter | <mratsim> Vega and Vega-lite are a json format for dataviz |
15:34:14 | FromGitter | <mratsim> the win is that it works in Nim and would be integrated with Arraymancer |
15:34:34 | FromGitter | <mratsim> i.e. it would be similar to Altair not Vega: https://github.com/altair-viz/altair |
15:34:35 | disruptek | json works in nim?! |
15:35:29 | disruptek | what's good about altair versus the vega suite? |
15:36:00 | FromGitter | <mratsim> Vega/Vega-lite is just grammar a description of what you want to plot |
15:36:10 | FromGitter | <mratsim> you have to convert your data into those descriptions |
15:36:32 | disruptek | when i say vega, i mean the whole ecosystem of vega-consuming viz apps. |
15:36:34 | FromGitter | <mratsim> Altair is that converter, it convert arrays into plottable json in the vega/vega-lite grammar |
15:36:51 | FromGitter | <mratsim> you can't feed a Numpy array to vega |
15:37:41 | disruptek | so the win is that it's not interative like voyager or the other one i can't remmeber... |
15:37:47 | disruptek | lyra |
15:38:35 | FromGitter | <mratsim> The win is that I can use display the tensors I have |
15:39:04 | disruptek | i see, it's just for your arrays. |
15:39:18 | disruptek | it's altair-which-eats-arrays, but for nim. |
15:39:26 | FromGitter | <mratsim> yes |
15:39:32 | disruptek | cool. :-) |
15:40:35 | disruptek | i got interested in nim because i needed faster ai for stock trading, but i still haven't messed with arraymancer. it was the first project that drew me into the language, though. looks so promising. |
15:41:28 | FromGitter | <mratsim> qqtop is using Nim for trading but it might be only to monitor the ticker on the HK exchange |
15:41:33 | FromGitter | <mratsim> tickers* |
15:41:49 | FromGitter | <mratsim> and cooldome is using it as well |
15:41:54 | FromDiscord_ | <Zireael> my 2 cents: Electron is really big and heavy, and I pretty much replaced it with the webview that someone already linked for mratsim |
15:42:10 | disruptek | i was working with LEAN and just got disgusted with the python<->c# interop. |
15:42:38 | FromDiscord_ | <Zireael> I work every day with Python and Python's great until the moment that you need to ship it to consumers/players |
15:42:55 | FromGitter | <mratsim> That's Arraymancer readme :p |
15:43:38 | * | floppydh quit (Quit: WeeChat 2.4) |
15:43:48 | FromDiscord_ | <Zireael> at work, Python's just the backend to a web frontend, so it doesn't have that hurdle, but for hobby stuff, well, I don't think there's anything that lets you ship Python apps without hassle |
15:43:50 | disruptek | that's why there are so many make-your-model-in-python-and-then-compile-it-to-a-real-language projects now. |
15:44:07 | * | floppydh joined #nim |
15:45:01 | FromDiscord_ | <Zireael> yep, and that's how I found Nim in the first place - at first I was wading through a sea of transpilers, most of them to or via JS, so I started thinking, why not use something that compiles to JS natively in the first place....? |
15:45:01 | FromGitter | <mratsim> The whole scientific community had this issue with Matlab and now Julia as well. |
15:45:39 | FromDiscord_ | <Zireael> actually at first I was looking at targeting C, but then I thought, I do frontend at work more and more, time to learn, so I went with targeting JS instead |
15:46:01 | FromGitter | <Vindaar> @mratsim reg. monocle, you never commented on that PR of mine :P |
15:46:13 | FromGitter | <mratsim> I never saw it :p |
15:46:19 | FromGitter | <Vindaar> haha |
15:46:32 | * | rnrwashere joined #nim |
15:46:50 | disruptek | https://github.com/BayesWitnesses/m2cgen |
15:47:11 | FromGitter | <mratsim> merged @Vindaar |
15:47:41 | disruptek | i am targeting IR. i want zero-cost inter-vm interop between janusgraph and other code running under graal. |
15:47:58 | FromGitter | <Vindaar> thanks! then I guess the same is true for the loop fusion one: https://github.com/numforge/loop-fusion/pull/8 |
15:48:27 | disruptek | being able to run the same code in my server and on mobile or web is just icing at this point. |
15:48:36 | FromGitter | <mratsim> Well, for ML IR if deep learning you have a lot of choice, if classic ML you have nothing :p |
15:49:39 | disruptek | it's ai winter for classic, ai summer for nn. |
15:51:21 | FromGitter | <mratsim> I've listed all the IRs I came across here: https://github.com/mratsim/Arraymancer/issues/347#issuecomment-459351890 and there is the new Tensorflow MLIR spearheaded by Chris Lattner (original author of LLVM and Swift and headhunted by Google) |
15:51:32 | FromGitter | <mratsim> in "related projects" |
15:51:46 | * | rnrwashere quit (Ping timeout: 276 seconds) |
15:52:38 | disruptek | nice work, thanks for the link. |
15:52:58 | FromGitter | <mratsim> I'm writing my own ML compiler ;) |
15:57:27 | FromGitter | <mratsim> If you need some stuff for finance feel free to request them btw. I'll probably implement them in Laser with a ptr+len low-level API (https://github.com/numforge/laser) and Arraymancer will be a high level APi on top. |
15:57:35 | disruptek | seems like a logical addition to your projects. |
15:57:57 | disruptek | what's the status of laser at the moment? |
15:58:46 | FromGitter | <mratsim> Main issue is that it's completely lacking regression tests, I was hoping to use arraymancer tests for that |
15:59:07 | FromGitter | <mratsim> I'm mostly trying to nail down the compiler here: https://github.com/mratsim/compute-graph-optim and what's that done I'll implement it in Laser |
15:59:55 | disruptek | wow this gives me some ideas. >:-) |
16:00:22 | FromGitter | <mratsim> what works is what is in those examples: https://github.com/numforge/laser/tree/master/examples |
16:01:39 | disruptek | i'm probably too inexpert to contribute much to this stuff, but i will try to build something with it, at least. |
16:02:16 | FromGitter | <mratsim> At the moment, laser is just low-level SIMD programming |
16:02:36 | FromGitter | <mratsim> and high level macros for "forEach" which works quite well |
16:04:19 | FromGitter | <mratsim> the JIT is also not too bad and should be easy to expand to new x86 opcodes |
16:08:02 | disruptek | it looks like building the compiler into laser might yield real state-of-the-art performance. |
16:13:19 | livcd | hmm just realized the sciter author was also behind evernote |
16:16:14 | * | rnrwashere joined #nim |
16:16:46 | disruptek | this is really impressive work. |
16:20:58 | FromGitter | <mratsim> The compiler is mostly a way to fuse all loops and also autodetect the runtime SIMD architecture only once and not at every sin/cos/log/exp call at first |
16:21:40 | FromGitter | <mratsim> Later I might add some Halide like possibilities, mostly for optimizing convolutions but that's a stretch goal. |
16:22:20 | FromGitter | <mratsim> The tricky part is handling RNNs because the loop iteration is not known at compile-time but apparently the new MLIR by Google has some ideas for that |
16:22:43 | disruptek | seems like you can already fetch that from the pytorch cpuinfo thing. why do you need to check it more than once? |
16:23:50 | FromGitter | <mratsim> assume I implement sigmoid = 1/(1 + exp(-x)) |
16:24:29 | FromGitter | <mratsim> I would need to check the SIMD for divide, add, exp and negate |
16:25:22 | FromGitter | <mratsim> or use Nim overloading, but that makes it cumbersome for custom functions(I would need sigmoid for SSE m128, sigmoid for AVX m256) |
16:26:06 | disruptek | i get it. so the compiler allows you to put everything into the scope as far as simd capabilities go; never needing to pollute that code with checks, flags, etc. |
16:26:13 | FromGitter | <mratsim> yes |
16:26:27 | shashlick | @couven92: was trying to run nimble on android, ran into ssl issues |
16:26:47 | * | jjido joined #nim |
16:26:50 | FromGitter | <mratsim> "forEach" macro already allows easy loop fusion but I couldn't expand it for SIMD beyond SIMD flags available at compile-time |
16:27:10 | disruptek | of course. |
16:28:08 | disruptek | so why not add more opcodes? no point as long as you cannot optimize them? |
16:28:32 | FromGitter | <mratsim> what kind of opcodes are you thinking about? |
16:29:25 | disruptek | i dunno. i'd be surprised if there wasn't something that could shave could shave cycles in some scenario or another. |
16:29:34 | disruptek | save some, too. |
16:29:56 | * | rnrwashere quit (Remote host closed the connection) |
16:30:22 | * | rnrwashere joined #nim |
16:30:26 | FromGitter | <mratsim> The basic IR will have add/mul/div and also transcendental functions like sin/cos/exp/log ... |
16:31:05 | disruptek | oh, i meant x86_64 codes. |
16:31:14 | FromGitter | <mratsim> ah right |
16:31:55 | * | rnrwashere quit (Remote host closed the connection) |
16:32:14 | FromGitter | <mratsim> the JIT was a proof of concept because several ML backends (Intel MKL-DNN, Intel libxsmm and PyTorch Glow) and papers are jitting convolutions. |
16:33:10 | FromGitter | <mratsim> but the compiler will generate either Nim code at compiletime or LLVM bitcode at runtime. |
16:33:12 | * | rnrwashere joined #nim |
16:33:17 | leorize | To users of nim.nvim, I'd need some help in testing an upcoming feature. More details here: https://forum.nim-lang.org/t/4596#30114 |
16:33:19 | * | rnrwashere quit (Remote host closed the connection) |
16:33:26 | leorize | narimiran: in case you're interested ^ |
16:33:38 | disruptek | leorize: if i ever enter my editor today, i'll be testing it. ;-) |
16:34:09 | disruptek | so if we implement more opcodes, can the graph optimizer optimize them? |
16:34:18 | FromGitter | <mratsim> The jit code that Intel is doing is just ugly: https://github.com/intel/mkl-dnn/blob/master/src/cpu/gemm/f32/jit_avx_gemm_f32.cpp |
16:34:59 | disruptek | yeah, that's insane. |
16:34:59 | FromGitter | <mratsim> so for now it's there but the main use for it will be emitting LLVM bitcode not x86 |
16:35:13 | disruptek | that would be awesome. |
16:50:45 | * | floppydh quit (Quit: WeeChat 2.4) |
17:08:20 | * | Trustable joined #nim |
17:18:38 | * | NimBot joined #nim |
17:21:57 | * | fanta1 quit (Quit: fanta1) |
17:29:23 | Zevv | leorize: indenting makes me happy |
17:29:57 | shashlick | Does indenting belong in a per programming language module or globally |
17:30:14 | Zevv | you mean vim? per language |
17:30:50 | * | i7sDream joined #nim |
17:31:05 | shashlick | In general |
17:31:24 | leorize | Zevv: I've isolated the latest changes to a separate indentexp branch if you'd like to play with it :) |
17:31:35 | Zevv | let me fetch that |
17:31:36 | leorize | it's kinda buggy atm but I hope I've fixed them all |
17:31:51 | Zevv | oh then I don't :) |
17:32:22 | leorize | shashlick: it's usually per language, because every language have a different rule |
17:33:03 | leorize | Zevv: you should give it a shot :P it won't burn your PC, trust me :) |
17:33:16 | disruptek | nerdcommenter was a good vim addition; i'm getting more automatic features while writing comments, which really makes a difference. |
17:33:45 | shashlick | @leorize: do you use nimsuggest or nimlsp? |
17:33:51 | leorize | nimsuggest |
17:34:15 | shashlick | okay don't mind me stealing your code for my editor |
17:34:46 | leorize | vimscript is a mess to write, but hopefully it's readable :p |
17:34:49 | Zevv | leorize: you should make a vimscript backend for nim, that'd make your indent scripts typesafe |
17:35:22 | leorize | lol :p |
17:35:56 | shashlick | will port to nim |
17:36:17 | shashlick | do you also face the same memory issues with nimsuggest? |
17:36:28 | shashlick | also 1 proc per file or 1 globalproc |
17:36:46 | leorize | 1 per project |
17:37:18 | leorize | since nvim does not have any idea about project, so here's how I do it: |
17:37:58 | leorize | for file '~/proj/main.nim' |
17:38:31 | leorize | if there's an instance running for '~', use it |
17:38:46 | leorize | if not, check for a '~/proj' instance |
17:38:55 | leorize | if no instance is available, spawn a new one |
17:39:08 | shashlick | nice |
17:39:16 | leorize | I actually check from the inner most to outer most :p |
17:39:28 | shashlick | why not use one global proc? cause nimsuggest looks at neighboring files? |
17:39:43 | shashlick | kind of like a .git search? |
17:41:07 | leorize | nimsuggest use a module graph for the main project and a disposable one for outside files (per speculation, I haven't read the code yet) |
17:41:50 | leorize | also, on first run, nimsuggest will cache the modulegraph of the project file, speeding up subsequent ops on the same project |
17:42:05 | leorize | it doesn't do the same when files are outside of the main project afaict |
17:43:26 | shashlick | okay, i am hoping to use nimlsp and implement an lsp client instead, let's see |
17:43:33 | shashlick | still a long list of stuff to get done in feud |
17:43:42 | shashlick | but it is more than functional already |
17:44:44 | * | i7sDream quit (Remote host closed the connection) |
17:45:09 | * | i7sDream joined #nim |
17:46:25 | leorize | my method of project detection is not really precise, and I'm looking at using nimble to help, but then there are two main problems: |
17:46:47 | leorize | recurse backwards until you find a nimble file is not really a nice thing to do |
17:47:05 | leorize | there's no way to get the project file from .nimble file |
17:48:49 | Calinou | recursing doesn't sound too slow to me, it's probably going to iterate like 10 steps at most |
17:50:04 | * | i7sDream quit (Remote host closed the connection) |
17:50:29 | * | i7sDream joined #nim |
17:51:20 | leorize | yea, the second point is the bigger problem |
17:52:23 | * | i7sDream quit (Remote host closed the connection) |
17:52:47 | * | i7sDream joined #nim |
17:53:27 | * | Trustable quit (Remote host closed the connection) |
17:54:42 | * | i7sDream quit (Remote host closed the connection) |
17:55:07 | * | i7sDream joined #nim |
17:59:02 | * | i7sDream quit (Remote host closed the connection) |
17:59:27 | * | i7sDream joined #nim |
18:00:40 | Zevv | 17:07 #nim: < federico3> how can I detect the "main" .nim file in a project |
18:01:03 | Zevv | that is a good question indeed. |
18:02:47 | FromGitter | <jrfondren> the file's called "foo.nimble" and the main .nim is called "src/foo.nim" |
18:03:17 | FromGitter | <jrfondren> but nimble even still supports .babel files so I don't know how many projects follow that |
18:03:45 | FromGitter | <jrfondren> and for a non-bin nimble project, maybe there's no foo.nim at all |
18:04:08 | Zevv | exactly |
18:05:22 | * | i7sDream quit (Remote host closed the connection) |
18:05:28 | Zevv | you could go guess, open up all files and check if there is only one with top level statements |
18:05:50 | * | i7sDream joined #nim |
18:07:36 | leorize | what if all of them has top-level statements? :p |
18:07:46 | leorize | I thought of doing the nimble file matching |
18:07:55 | leorize | then I was working on the compiler at the time |
18:08:11 | leorize | of which `nim.nim` is the main file, not `compiler.nim` :p |
18:08:41 | Zevv | yeah right :) |
18:10:10 | leorize | I'll look into implementing the nimble feature |
18:10:21 | disruptek | if we get the playground working again, we should have code sections automatically run and output automatically included below the code. we can include hints to show details of when/how it was compiled, and maybe even let users specify options to the compile/invocation. |
18:10:23 | leorize | (tbh running nimble to parse is kinda unsafe) |
18:10:37 | disruptek | i mean, for the nim lang forum. |
18:10:38 | FromGitter | <arnetheduck> any chances that https://github.com/nim-lang/Nim/pull/8010 can be backported to a 0.19.6 release? @narimiran? |
18:10:53 | leorize | then running nim itself is already unsafe |
18:12:44 | * | i7sDream quit (Remote host closed the connection) |
18:13:10 | * | i7sDream joined #nim |
18:13:23 | * | natrys joined #nim |
18:13:24 | disruptek | water is unsafe. |
18:17:05 | * | i7sDream quit (Remote host closed the connection) |
18:17:32 | * | i7sDream joined #nim |
18:19:27 | * | i7sDream quit (Remote host closed the connection) |
18:19:57 | * | i7sDream joined #nim |
18:21:03 | Zevv | Nim did good on HN yesterday, 105 comments makes for a nice thread, mostly positive, and *no* discussions about case insensitivity |
18:24:27 | FromGitter | <jrfondren> the reddit thread was 100% about the title though |
18:27:57 | dom96 | Some more Nim mentions here https://news.ycombinator.com/item?id=19750507 |
18:28:32 | * | neceve quit (Read error: Connection reset by peer) |
18:29:50 | disruptek | definitely noticed some new visitors to irc, so you gotta figure there are orders of magnitude more who don't visit irc but do check out the language. |
18:32:05 | * | drewr joined #nim |
18:33:24 | dom96 | yep, visitors to nim-lang.org are up 65% |
18:34:53 | * | i7sDream quit (Remote host closed the connection) |
18:35:21 | * | i7sDream joined #nim |
18:39:13 | * | i7sDream quit (Remote host closed the connection) |
18:39:25 | federico3 | Zevv: not having a way to detect the "main" file also impact the ability to extract the required .nim files from a source tree and/or flag the ones that are unneded |
18:39:42 | * | i7sDream joined #nim |
18:42:37 | * | i7sDream quit (Remote host closed the connection) |
18:43:05 | * | i7sDream joined #nim |
18:44:39 | dom96 | choosenim 0.4.0 is here. I finally uploaded the binaries that shashlick produced |
18:44:49 | dom96 | update via `choosenim update self` |
18:45:01 | FromGitter | <arnetheduck> any changelog? |
18:45:09 | dom96 | https://github.com/dom96/choosenim/blob/master/changelog.markdown#040---18042019 |
18:47:00 | * | i7sDream quit (Remote host closed the connection) |
18:47:28 | * | i7sDream joined #nim |
18:56:23 | * | i7sDream quit (Remote host closed the connection) |
18:56:23 | narimiran | nice job shashlick! |
18:56:36 | * | sz0 quit (Quit: Connection closed for inactivity) |
18:56:40 | FromGitter | <arnetheduck> 👍 |
18:56:48 | * | i7sDream joined #nim |
19:00:42 | * | i7sDream quit (Remote host closed the connection) |
19:01:12 | * | i7sDream joined #nim |
19:03:07 | * | i7sDream quit (Remote host closed the connection) |
19:03:35 | * | i7sDream joined #nim |
19:07:30 | * | i7sDream quit (Remote host closed the connection) |
19:07:55 | * | i7sDream joined #nim |
19:09:50 | * | i7sDream quit (Remote host closed the connection) |
19:10:14 | * | i7sDream joined #nim |
19:14:09 | * | i7sDream quit (Remote host closed the connection) |
19:14:37 | * | i7sDream joined #nim |
19:15:00 | * | SenasOzys joined #nim |
19:16:32 | * | i7sDream quit (Remote host closed the connection) |
19:17:00 | * | i7sDream joined #nim |
19:19:55 | * | i7sDream quit (Remote host closed the connection) |
19:20:12 | * | SenasOzys quit (Remote host closed the connection) |
19:20:23 | * | i7sDream joined #nim |
19:20:44 | * | SenasOzys joined #nim |
19:22:18 | * | i7sDream quit (Remote host closed the connection) |
19:22:45 | * | i7sDream joined #nim |
19:25:04 | FromGitter | <mratsim> @dom96, your HN thread is using Nim 0.14.2, :O |
19:25:23 | FromGitter | <mratsim> where did the author even find this prehistoric version |
19:26:52 | * | glassofethanol joined #nim |
19:28:43 | disruptek | 0.14.2 is the cheapest available. |
19:29:57 | * | abm joined #nim |
19:31:40 | * | i7sDream quit (Remote host closed the connection) |
19:32:08 | * | i7sDream joined #nim |
19:34:03 | * | i7sDream quit (Remote host closed the connection) |
19:34:26 | * | i7sDream joined #nim |
19:35:09 | * | nsf quit (Quit: WeeChat 2.4) |
19:37:21 | * | i7sDream quit (Remote host closed the connection) |
19:37:46 | * | i7sDream joined #nim |
19:41:20 | shashlick | wow awesome! |
19:42:08 | narimiran | ...yes you are ;) |
19:43:18 | shashlick | now need to test that choosenim works in travis windows git bash |
19:47:14 | noonien | how can i make a generic proc for numbers only? |
19:48:41 | * | i7sDream quit (Remote host closed the connection) |
19:49:05 | * | i7sDream joined #nim |
19:49:48 | FromGitter | <kaushalmodi> @mratsim That HN post leads indirectly to this 2016 post: https://eccentricdevelopments.com/programming-language-comparison-summary/ |
19:50:24 | FromGitter | <kaushalmodi> noonien: `proc foo[T: SomeInteger | SomeFloat] ..` ? |
19:50:25 | Zevv | noonien: use SomeNumber |
19:50:34 | FromGitter | <kaushalmodi> or that :) |
19:50:36 | noonien | oh, awesome! |
19:50:46 | noonien | what are these called? how can i look them up in the manual? |
19:50:53 | noonien | or, are these concepts? |
19:50:56 | FromGitter | <kaushalmodi> generics\ |
19:50:56 | Zevv | https://nim-lang.github.io/Nim/system.html#SomeNumber |
19:51:12 | Zevv | These are just types. Somenumber is defined as SomeInteger | SomeFloat |
19:51:24 | noonien | no, i mean the `T: SomeNumber | Somefloat part` |
19:51:24 | Zevv | and these boil down to even more types or'ed |
19:51:59 | noonien | oh, ok |
19:52:09 | noonien | so basically T: int | int8, etc.. |
19:52:18 | noonien | awesome, thanks! |
19:52:37 | Zevv | I think you'd have to gather the specifics from the manual and the system lib |
19:52:56 | noonien | yup, https://nim-lang.org/docs/system.html#SomeSignedInt |
19:53:27 | Zevv | you found it :) |
19:53:29 | FromGitter | <kaushalmodi> noonien: https://nim-lang.github.io/Nim/manual.html#generics-type-classes |
19:53:46 | narimiran | noonien: pro tip - use devel docs at https://nim-lang.github.io/Nim/ |
19:54:00 | FromGitter | <kaushalmodi> noonien: scroll down to find: ⏎ ⏎ > Nim also allows for type classes and regular types to be specified as type constraints of the generic type parameter: |
19:54:12 | * | SenasOzys quit (Remote host closed the connection) |
19:54:37 | noonien | interesting |
19:54:58 | * | SenasOzys joined #nim |
19:55:02 | Zevv | that's advanced stuff. I never needed that ever, but that might be my own fault |
19:55:55 | FromGitter | <kaushalmodi> Zevv: I happened to need type constraints in real work just last week |
19:56:18 | Zevv | hehe. One day, one day I will :) |
19:56:24 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5cc210e88790b0307eff811b] |
19:57:25 | Zevv | that's not constraints, right? Thats just a list of types (where you should have used SomeNumber :) ) |
19:57:28 | * | narimiran_ joined #nim |
19:58:04 | FromGitter | <kaushalmodi> the manual seems to call them "type constraints" |
19:59:06 | Zevv | yeah, you're right. But only three occurences in the manual, not sure if that is intentional then |
19:59:16 | disruptek | they are constraints in that they represent a selection mask of possible types. |
19:59:31 | disruptek | ie. they constrain the acceptable types. |
19:59:35 | Zevv | well, I use *that* all the time :) |
19:59:41 | * | narimiran quit (Ping timeout: 255 seconds) |
20:00:15 | disruptek | yes, it may not be mentioned much in the manual because the phrase does not convey any particular special meaning beyond the literal. |
20:00:49 | Zevv | oh, what I was thinking of are type *classes* - those I never needed yet |
20:02:56 | FromGitter | <kaushalmodi> yeah, I have never those either |
20:03:20 | FromGitter | <kaushalmodi> duh, oh well |
20:03:40 | noonien | hm, how would one implement this? `proc foo*[T : SomeInteger](max: T = high(T)): T =`? |
20:04:52 | * | narimiran_ is now known as narimiran |
20:05:10 | Zevv | elaborate |
20:05:44 | noonien | i'm getting this error: http://vpaste.net/tgjY5 |
20:06:09 | narimiran | i'm guessing this has to do with uint64 |
20:06:27 | narimiran | try your example with SomeSignedInteger |
20:06:46 | noonien | well, i need unsinged as well |
20:06:52 | FromGitter | <kaushalmodi> `got <type type(high(T))>` doesn't look right |
20:06:55 | Zevv | I'm not even sure what has to happen here - I'd expect 'max' to get the max value for the passed type, but I get zero |
20:07:02 | FromGitter | <kaushalmodi> somehow looks like that type vs typedesc issue |
20:07:05 | Zevv | it compiles for me, but I'm using latest devel |
20:07:32 | noonien | i'm using Nim Compiler Version 0.19.4 [Linux: amd64] |
20:07:46 | Zevv | narimiran: http://p.zevv.nl/?1b53, is that a bug? |
20:07:55 | Zevv | or should that not even compile |
20:08:07 | Zevv | it returns 0 |
20:08:07 | narimiran | noonien: it works for me too |
20:08:19 | Zevv | yeah, but max(int32) is not 0 |
20:08:28 | Zevv | sorry, high(int32) |
20:08:52 | noonien | Zevv: you're passing it 0 |
20:09:13 | noonien | high(t) should be the default value |
20:09:17 | Zevv | the default value of max is high(int32) |
20:09:20 | Zevv | oh darn |
20:09:22 | Zevv | am I stupid |
20:09:26 | Zevv | sorry about that :) |
20:09:36 | Zevv | I was up at 05.00, is that a good excuse |
20:09:52 | noonien | hehe, no worries |
20:10:14 | narimiran | noonien: and if you don't pass anything, how can compiler resolve which integer you want? |
20:10:23 | noonien | passing it a number works for me too |
20:10:35 | noonien | narimiran: T is the interger type |
20:10:42 | noonien | var x: int32 = foo() |
20:10:49 | narimiran | T is *some* integer |
20:10:53 | noonien | shuld that not resolve T to int32? |
20:11:27 | Zevv | no, instantition does not work for results - althoug I sometimes wish it would |
20:11:32 | FromGitter | <mratsim> there is no return value type deduction |
20:11:51 | Zevv | I guess there is a good reason for that, otherwise it would already be available |
20:11:58 | FromGitter | <kaushalmodi> unsigned ints don't work there |
20:12:02 | FromGitter | <kaushalmodi> (https://files.gitter.im/nim-lang/Nim/YpUk/image.png) |
20:12:26 | FromGitter | <mratsim> uint64 does not have a high(uint64) defined |
20:12:29 | FromGitter | <arnetheduck> @mratsim you can return `auto`: `proc x(): auto = 42` works afair |
20:12:55 | FromGitter | <kaushalmodi> @mratsim so that's a bug? |
20:13:03 | FromGitter | <mratsim> feature request |
20:13:36 | FromGitter | <mratsim> @arnetheduck the example would be var x: int32 = x() and x() would return int32 instead of int |
20:14:01 | FromGitter | <arnetheduck> oh in that direction. hm. |
20:14:30 | Zevv | that would be super-duper-cool and handy |
20:15:00 | narimiran | kaushalmodi has the solution ;) |
20:15:56 | narimiran | `foo[int32]()` does the trick |
20:16:12 | FromGitter | <mratsim> lol |
20:16:19 | Zevv | true, true |
20:16:44 | narimiran | and unsigned work, unless you use uint|uint64 (as already stated earlier) |
20:17:23 | FromGitter | <mratsim> I wonder why high(uint64) PR is still pending |
20:17:40 | FromGitter | <mratsim> we can have an overload that says not defined at CT |
20:18:09 | Zevv | why is it cauing troubles at ct? |
20:18:22 | FromGitter | <mratsim> because the VM uses int64 |
20:18:33 | FromGitter | <mratsim> and high(uint64) would be -1 in the VM |
20:18:38 | Zevv | hmm, nasty |
20:18:42 | Zevv | baaad vm |
20:18:55 | noonien | wait, VM? |
20:19:02 | * | clyybber joined #nim |
20:19:04 | Zevv | the solution is to have it use int128 of course :) |
20:19:18 | Zevv | yeah, Nim is just an interpreted language, did noone tell you? |
20:19:18 | FromGitter | <mratsim> Nim VM @noonien |
20:19:32 | Zevv | All the talk about compilation is just gossip |
20:19:37 | noonien | hehe |
20:19:54 | Zevv | Nim runs nim at compile time, by running it in the vm |
20:20:03 | noonien | oh! |
20:20:08 | noonien | that makes sense |
20:20:25 | FromGitter | <mratsim> I'm surprised you are not confused :p |
20:20:30 | Zevv | so if you do for example `proc twice(a: int) = a * a` and then `const v = twice(3)`, the vm does the work and you have a const getting `6` |
20:20:59 | Zevv | but the same VM also runs your macros, or can read and parse files or whatever. |
20:21:29 | Zevv | So getting assets in your binary is just a matter of `const foo = readFile("somefile")`, and you have the contents of the file available in your code - at compile time |
20:21:53 | Zevv | it is so cool and intuititive that you barely have to thin about it |
20:21:59 | noonien | mratsim: i'm only new to nim |
20:22:29 | noonien | i should have thought about it being the compile-time VM, idk if VM is what i'd call it though |
20:23:02 | Zevv | well, the VM is just the implementation - it might have been interpreting without a VM |
20:23:06 | FromGitter | <mratsim> it has registers and a stack |
20:23:39 | Zevv | which are only int64 |
20:23:53 | Zevv | I just learned |
20:23:54 | noonien | i'm actually working on implementing a language not to dissimillar with nim in features, running things at compile time is a big plus, i do take inspiration fro other languages though |
20:24:37 | Zevv | I never got beyond a Forth and a Basic :( |
20:24:49 | Zevv | although I'm actually quite proud about the forth, ghehe |
20:34:00 | * | i7sDream quit (Remote host closed the connection) |
20:34:23 | * | i7sDream joined #nim |
20:36:17 | * | i7sDream quit (Remote host closed the connection) |
20:36:44 | * | i7sDream joined #nim |
20:38:38 | * | i7sDream quit (Remote host closed the connection) |
20:39:04 | * | i7sDream joined #nim |
20:43:59 | * | i7sDream quit (Remote host closed the connection) |
20:44:26 | * | i7sDream joined #nim |
20:45:55 | shashlick | @dom96 - i got the nocompiler branch working with import nimscript but have to except every single nimble var from system |
20:46:54 | * | narimiran quit (Ping timeout: 258 seconds) |
20:47:19 | * | iLiquid quit (Quit: iLiquid) |
20:48:21 | * | i7sDream quit (Remote host closed the connection) |
20:48:48 | * | i7sDream joined #nim |
20:49:19 | shashlick | import system except getCommand, setCommand, switch, `--`, packageName, version, author, description, license, srcDir, binDir, backend, skipDirs, skipFiles, skipExt, installDirs, installFiles, installExt, bin, foreignDeps, requires, task, packageName |
20:49:22 | shashlick | makes no sense |
20:49:38 | * | sentreen quit (Ping timeout: 255 seconds) |
20:50:43 | * | i7sDream quit (Remote host closed the connection) |
20:51:08 | * | i7sDream joined #nim |
20:53:02 | * | i7sDream quit (Remote host closed the connection) |
20:53:28 | * | i7sDream joined #nim |
20:56:38 | * | Etheco- quit (Ping timeout: 250 seconds) |
20:58:48 | * | krux02 quit (Remote host closed the connection) |
21:00:42 | * | glassofethanol quit (Ping timeout: 258 seconds) |
21:03:22 | * | i7sDream quit (Remote host closed the connection) |
21:03:47 | * | i7sDream joined #nim |
21:05:41 | * | fredrik92 joined #nim |
21:07:07 | * | couven92 quit (Disconnected by services) |
21:07:12 | * | fredrik92 is now known as couven92 |
21:07:33 | * | fredrik92 joined #nim |
21:08:42 | * | i7sDream quit (Remote host closed the connection) |
21:09:07 | * | i7sDream joined #nim |
21:10:34 | * | i7sDream quit (Remote host closed the connection) |
21:12:50 | * | sentreen joined #nim |
21:20:37 | * | SenasOzys quit (Ping timeout: 246 seconds) |
21:46:22 | * | clyybber quit (Quit: WeeChat 2.4) |
21:55:58 | * | solitudesf- quit (Ping timeout: 246 seconds) |
22:06:17 | * | lritter quit (Quit: Leaving) |
22:13:53 | * | Vladar quit (Remote host closed the connection) |
22:36:31 | * | luis_ joined #nim |
22:45:28 | * | Jesin quit (Quit: Leaving) |
22:47:16 | * | luis_ quit (Ping timeout: 258 seconds) |
22:51:42 | * | natrys quit (Quit: natrys) |
22:56:53 | * | xet7 quit (Quit: Leaving) |
22:59:42 | * | luis_ joined #nim |
23:03:38 | * | luis_ is now known as lf-araujo |
23:05:03 | * | lf-araujo quit (Quit: lf-araujo) |
23:05:55 | * | lf-araujo joined #nim |
23:06:20 | * | jjido quit (Quit: Connection closed for inactivity) |
23:08:22 | * | abm quit (Ping timeout: 250 seconds) |
23:10:48 | * | Jesin joined #nim |
23:21:14 | * | couven92 quit (Read error: Connection reset by peer) |
23:28:43 | * | lf-araujo quit (Ping timeout: 276 seconds) |
23:34:34 | * | lf-araujo joined #nim |
23:40:16 | * | lf-araujo quit (Ping timeout: 246 seconds) |
23:48:50 | shashlick | @dom96 - i've made all changes for nimble nocompiler, please review |