00:02:25 | * | rnrwashere quit (Ping timeout: 246 seconds) |
00:03:41 | * | rockcavera quit (Remote host closed the connection) |
00:08:06 | * | rockcavera joined #nim |
00:19:15 | * | thomasross_ joined #nim |
00:19:15 | * | thomasross quit (Killed (barjavel.freenode.net (Nickname regained by services))) |
00:19:15 | * | thomasross_ is now known as thomasross |
00:28:05 | * | rnrwashere joined #nim |
00:32:23 | * | rnrwashere quit (Ping timeout: 246 seconds) |
00:33:58 | * | rnrwashere joined #nim |
00:37:12 | * | rnrwashere quit (Remote host closed the connection) |
00:40:06 | FromDiscord | <demotomohiro> iirc, GC cannot handle memory in GPU. Becaue we cannot have custom destructor to free GPU memory. |
00:41:11 | FromDiscord | <demotomohiro> Owned refs allow custom destructor and it is called as soon as it is no logner referenced. |
00:43:05 | * | rnrwashere joined #nim |
00:43:05 | FromDiscord | <demotomohiro> Even if GC allow making custom destoractor, calling destoractor can be delayed and it might called after OpenGL context was destoryed |
00:45:04 | FromDiscord | <demotomohiro> It seems GC can handle only main memory. They cannot be used to free other resource like opengl objects, window handle, socket, file handle and etc. |
00:50:34 | * | rnrwashere quit (Remote host closed the connection) |
00:53:11 | * | rnrwashere joined #nim |
01:45:36 | * | sealmove joined #nim |
01:45:52 | sealmove | Hey, I logged in just to say how hilarious I found V-Nim comparison xD +1 |
01:46:35 | sealmove | planetis: do you know about python's while ... else? comment? |
02:03:30 | * | jasom quit (Ping timeout: 264 seconds) |
02:06:45 | * | banc quit (Quit: Bye) |
02:15:45 | * | rnrwashere quit (Remote host closed the connection) |
02:16:04 | * | rnrwashere joined #nim |
02:23:52 | * | tiorock joined #nim |
02:23:52 | * | rockcavera is now known as Guest44991 |
02:23:52 | * | tiorock is now known as rockcavera |
02:27:07 | * | Guest44991 quit (Ping timeout: 245 seconds) |
02:27:59 | * | banc joined #nim |
02:31:28 | FromGitter | <jivank> i am crosscompiling my application for a openwrt mips cpu. in gdb i am getting `Program received signal SIGILL, Illegal instruction. ⏎ 0x0040f3c4 in newSeq ()` |
02:31:53 | * | couven92 quit (Read error: Connection reset by peer) |
02:37:32 | * | Cthalupa quit (Ping timeout: 250 seconds) |
02:38:02 | * | Cthalupa joined #nim |
02:42:16 | leorize | how are you cross compiling it? |
02:47:00 | FromGitter | <jivank> i downloaded the sdk and added its bin to my path. i use the --cpu and --os flags |
02:49:53 | FromGitter | <jivank> i also get a lot of warnings: `uses -msoft-float (set by /tmp/OpenWrt-SDK-15.05-ar71xx-generic_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/bin/../lib/gcc/mips-openwrt-linux ⏎ -uclibc/4.8.3/crtbegin.o), /home/jivank/.cache/nim/sambalshare_r/utils.c.o uses -mhard-float` |
02:52:48 | FromGitter | <jivank> ok i cleared the cache and i dont get that anymore. hopefully this works :) |
03:03:20 | * | dddddd quit (Remote host closed the connection) |
03:04:49 | FromGitter | <jivank> nice, after installing librt and libpthread it seems to work |
03:37:35 | * | noeontheend joined #nim |
03:44:42 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
04:09:40 | * | rnrwashere quit (Remote host closed the connection) |
04:36:53 | * | nsf joined #nim |
04:48:32 | * | noeontheend quit (Ping timeout: 250 seconds) |
05:01:52 | * | narimiran joined #nim |
05:08:50 | * | cornfeedhobo quit (Quit: ZNC - https://znc.in) |
05:23:44 | * | I_Right_I quit (Remote host closed the connection) |
05:28:30 | * | disruptek quit (Ping timeout: 246 seconds) |
05:30:51 | * | cornfeedhobo joined #nim |
05:34:11 | * | Cthalupa quit (Ping timeout: 244 seconds) |
05:35:18 | * | Cthalupa joined #nim |
05:38:10 | * | solitudesf joined #nim |
05:42:25 | * | disruptek joined #nim |
06:18:20 | * | rnrwashere joined #nim |
06:22:34 | * | rnrwashere quit (Ping timeout: 250 seconds) |
06:23:16 | * | sealmove quit (Quit: WeeChat 2.4) |
06:27:58 | * | solitudesf quit (Ping timeout: 245 seconds) |
06:37:54 | * | krux02 joined #nim |
06:38:40 | * | MightyJoe quit (Quit: No Ping reply in 180 seconds.) |
06:39:55 | * | cyraxjoe joined #nim |
06:43:11 | * | PMunch joined #nim |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:04:36 | * | gmpreussner joined #nim |
07:42:01 | * | Vladar joined #nim |
08:08:15 | * | Cthalupa quit (Ping timeout: 255 seconds) |
08:10:09 | * | Cthalupa joined #nim |
08:33:32 | * | stefanos82 joined #nim |
08:36:10 | PMunch | Hmm, I want to create a template to avoid having to retype some error handling stuff. It works great, but I'm stuck between making it too general to really save on typing, or too specific so I need to copy the template around. |
08:36:46 | PMunch | Can I have global static variables that I can set to things in order for this to work? |
08:40:11 | leorize | a bit of copying wouldn't hurt :p |
08:41:12 | PMunch | Of course it does |
08:41:25 | PMunch | It introduces all kinds of workflow error sources |
08:43:53 | PMunch | Oooh, a GCC crash: http://ix.io/1Fhg/ |
08:44:02 | PMunch | Those are getting few and far between nowadays |
08:46:04 | PMunch | Minimal example: http://ix.io/1Fhi/ |
08:46:37 | PMunch | http://ix.io/1Fhi <- link that isn't a single line |
08:47:05 | leorize | what kind of error handling are you working on? |
08:47:52 | leorize | also to answer your question, it's possible, but rather buggy the last time I tried and might not work well when incremental compiling is introduced |
08:48:45 | leorize | instead of a global variable you can just pass the state around, no? if it's too much typing then just create yet another template for your template :p |
08:50:29 | PMunch | http://ix.io/1Fhl/Nim |
08:51:35 | Araq | bug report |
08:52:23 | PMunch | That's what I'm working on leorize, so basically I want to move the checkSegment template out of that procedure and generalize header and message |
08:53:10 | PMunch | But without changing all those calls to header.checkSegment(0, 2, "SYNTAX IDENTIFIER", syntax, "UNB interchange header field") |
08:53:27 | PMunch | Araq, I'm not sure what the expected behaviour there would be though |
08:53:34 | PMunch | Apart from not crashing GCC of course |
08:55:03 | leorize | PMunch: As a starter, may be turn it into a "dirty" template? |
08:55:17 | PMunch | Hmm, yeah that's an option |
08:55:31 | PMunch | Or I could create a second template as you said |
08:58:54 | leorize | that also works :) |
09:01:43 | PMunch | http://ix.io/1Fhn/Nim |
09:02:03 | leorize | PMunch: regarding the bug you found, it can be reproduced without a template on nim devel |
09:02:12 | PMunch | Can it |
09:02:19 | PMunch | ? |
09:03:46 | leorize | http://ix.io/1Fhq/nim |
09:03:48 | leorize | same error |
09:04:21 | * | abm joined #nim |
09:05:02 | leorize | also that error handling scheme is really nice :) |
09:07:56 | PMunch | Thanks :) |
09:10:59 | * | ng0 joined #nim |
09:15:23 | PMunch | Gotta show of the power of Nim if any of my collegues ever want to have a look at this code ;) |
09:23:57 | PMunch | Had to add support for optional fields as well: http://ix.io/1Fht/Nim |
09:31:13 | * | dddddd joined #nim |
09:32:00 | livcd | PMunch: why did you have to create another odbc wrapper ? sorry i did not fllow the discussion |
09:51:04 | * | a_b_m joined #nim |
09:54:31 | * | abm quit (Ping timeout: 258 seconds) |
09:55:45 | * | dom96_w joined #nim |
10:12:40 | * | sz0 joined #nim |
10:20:37 | * | mosORadi joined #nim |
10:26:35 | * | neceve joined #nim |
10:35:46 | PMunch | livcd, I ended up not doing it. I just didn't know one existed already :P |
10:35:55 | PMunch | Now I'm using coffeepots library |
10:42:19 | * | lritter joined #nim |
10:50:38 | * | clyybber joined #nim |
11:18:32 | * | floppydh joined #nim |
11:21:43 | * | tdc quit (Ping timeout: 245 seconds) |
11:21:59 | PMunch | leorize, http://ix.io/1FhX/Nim getting better and better. The actual parsing components are now almost 100% logic while all the common checking functionality is put away in templates |
11:25:46 | FromGitter | <kayabaNerve> So. I was working on some code, and had a 64 byte number represented as a 171 char string. |
11:26:18 | FromGitter | <kayabaNerve> It took me a while to find the bug, but I did. `str &= rand(255)` |
11:26:18 | FromGitter | <kayabaNerve> This bug is my fault; don't get me wrong. |
11:26:44 | FromGitter | <kayabaNerve> I was trying to fill a string with random data, forget a char cast, and Nim called $ for me. |
11:26:52 | FromGitter | <kayabaNerve> Is it just me or is that against convention? |
11:27:12 | PMunch | Hmm, that does seem strange |
11:27:14 | FromGitter | <kayabaNerve> I mean, I can't pass an uint to an int function, but I can combine an int with string. |
11:27:23 | FromGitter | <kayabaNerve> I can't access an array with an uint |
11:27:23 | PMunch | Since $ doesn't automatically convert why would &= |
11:27:33 | FromGitter | <kayabaNerve> But I can combine an int with a string. |
11:27:40 | FromGitter | <kayabaNerve> This isn't & behavior either |
11:28:00 | PMunch | Oh you're right |
11:28:07 | * | kapil____ joined #nim |
11:28:11 | PMunch | Wait, what causes it? |
11:28:12 | FromGitter | <kayabaNerve> `Error: type mismatch: got <string, int>` |
11:28:29 | PMunch | Does rand return something that can be automatically converted to a string? |
11:28:37 | FromGitter | <kayabaNerve> It's an int from the stdlib |
11:28:56 | FromGitter | <kayabaNerve> `str &= rand(255)` doesn't throw an error as `str = str & rand(255)` does. |
11:29:07 | FromGitter | <kayabaNerve> &= will call $ |
11:29:29 | PMunch | I just tried myStr &= 5 in "nim secret" and it threw an error |
11:30:02 | FromGitter | <kayabaNerve> It fails for me to in nim secret |
11:30:09 | FromGitter | <kayabaNerve> It worked when I compiled it though |
11:30:25 | FromGitter | <kayabaNerve> Mind doing me a favor and testing Nim, not Nimscript? |
11:30:36 | PMunch | Ah, but not in regular Nim |
11:30:40 | PMunch | Yeah I just tried it |
11:30:45 | FromGitter | <kayabaNerve> I'm filing a bug |
11:31:15 | PMunch | var myStr = "Hello "; myStr &= 10; echo myStr |
11:31:24 | PMunch | Echos "Hello 10" for me |
11:31:51 | PMunch | !exec var myStr = "Hello "; myStr &= 10; echo myStr |
11:32:04 | PMunch | NimBot, you there? |
11:32:13 | PMunch | !help |
11:33:24 | PMunch | !eval var myStr = "Hello "; myStr &= 10; echo myStr |
11:33:24 | NimBot | Compile failed: <no output> |
11:34:30 | FromGitter | <kayabaNerve> PMunch: You on 0.19.X or devel? |
11:34:37 | FromGitter | <kayabaNerve> If devel, how old is your devel? |
11:35:14 | PMunch | 0.19.0 |
11:35:24 | narimiran | same on devel compiled 2 days ago |
11:35:33 | FromGitter | <kayabaNerve> Thanks narimiran |
11:35:41 | FromGitter | <kayabaNerve> Did you also test devel Nimscript? |
11:35:50 | PMunch | Same on devel compiled 2019-03-06 |
11:40:03 | FromGitter | <kayabaNerve> https://github.com/nim-lang/Nim/issues/10963 |
11:40:06 | FromGitter | <kayabaNerve> Thanks for the help |
11:42:52 | clyybber | PMunch: Looks like I found another C compiler crashing bug: https://hastebin.com/tiyokexiqo.coffeescript |
11:46:01 | PMunch | Hmm, that link doesn't appear to work |
11:52:17 | clyybber | huh wierd |
11:53:20 | Araq | there is a variant of 'add' that takes a string and an int, that's why |
11:53:31 | Araq | bad idea, we need to deprecate it, yay |
11:53:49 | FromGitter | <alehander42> i suspect it makes sense |
11:53:56 | FromGitter | <alehander42> because otherwise people would use $number |
11:54:02 | FromGitter | <alehander42> which would be slower than number.char? |
11:54:11 | FromGitter | <alehander42> but yeah thats not the stdlib problem |
11:55:07 | PMunch | That does two different things though right? |
11:55:32 | FromGitter | <alehander42> but for add they would be equivalent |
11:55:42 | FromGitter | <alehander42> wait but most numbers are not 1 byte |
11:55:43 | FromGitter | <alehander42> nvm |
11:55:56 | PMunch | number.char would convert number to the ASCII character it represents. And $number would give you a text representation of the number |
11:56:14 | FromGitter | <alehander42> woudnt ord do that? |
11:58:01 | PMunch | chr would do that |
11:58:05 | PMunch | ord is the other way around |
11:58:14 | PMunch | ord('A') returns 65 |
11:58:22 | PMunch | while chr(65) returns 'A' |
11:59:17 | clyybber | PMunch: Reported it on github now: https://github.com/nim-lang/Nim/issues/10964 |
11:59:57 | FromGitter | <alehander42> yeah exactly |
12:00:48 | PMunch | clyybber, wait, can you do that for sequences? |
12:01:15 | clyybber | Yeah |
12:02:01 | * | tdc joined #nim |
12:04:27 | * | tdc quit (Remote host closed the connection) |
12:04:51 | FromGitter | <kayabaNerve> @alehander42 Most numbers aren't one byte. If you want this behavior, it should be done with `$` |
12:04:51 | * | tdc joined #nim |
12:04:58 | FromGitter | <kayabaNerve> I'm saying the compiler should error |
12:05:25 | FromGitter | <alehander42> yes, i agree |
12:05:28 | FromGitter | <alehander42> sorry |
12:05:29 | FromGitter | <kayabaNerve> Araq: So this has a historical reason, which I don't fully understand myself but okay, but it's going to be phased out? |
12:05:36 | FromGitter | <kayabaNerve> Marked deprecated for now, deleted later? |
12:05:44 | FromGitter | <kayabaNerve> Just trying to make sure I understood your comments. |
12:05:45 | Araq | yes |
12:05:47 | FromGitter | <kayabaNerve> @alehander42 All good |
12:05:51 | FromGitter | <kayabaNerve> Thanks Araq |
12:06:01 | Araq | we need a custom addInt or something |
12:06:31 | Araq | or we optimize 's.add $i' instead |
12:08:24 | clyybber | Araq: Are you ok with removing `end` from the list of keywords? |
12:08:50 | Araq | but then how could we ever have 'end if' ? |
12:09:00 | FromGitter | <kayabaNerve> Is that a real thing:? |
12:09:10 | FromGitter | <kayabaNerve> (in Nim) |
12:09:32 | FromGitter | <kayabaNerve> Why do we need that when we have identation? Just trying to learn the purpose of it. |
12:09:51 | FromGitter | <kayabaNerve> As someone who has `.start` and `.endX`, I'd love to remove `end` from the keywords list. |
12:10:23 | FromGitter | <kayabaNerve> Also `block` but eh, you win some, you lose some. I also don't actually expect either to be removed... |
12:10:53 | Araq | because 10 years from now people will wake up and see that there is no reason they cannot look at source code in their preferred style |
12:12:01 | FromGitter | <kayabaNerve> If end wasn't a keyword, you could write an end macro to achieve your preferred style. |
12:12:40 | Araq | I doubt this would work but I never considered it, nice idea |
12:12:50 | clyybber | Also 10 years from now, I believe editors would support source code restyling |
12:13:39 | Araq | the editors have an easier time to render 'end' if 'end' isn't a taken word in your source code |
12:16:17 | clyybber | it's really easy either way, if the editor has a concept of scope. |
12:16:33 | clyybber | just paint an end when a scope closes. |
12:17:22 | FromGitter | <arnetheduck> you can already get seamless local code restyling in most modern languages (within the bounds of their syntax) using their native formatter (`clang-format` etc) and git checkout filters.. but even the most ardent my-own-style-supporters I've worked with give up after a while because it's such a bother... it's not like one style or another makes *that* much difference once you've gotten used to them (as long as |
12:17:22 | FromGitter | ... they're both logically consistent) |
12:17:26 | clyybber | and if people don't write `end if` now, why should they do so in the future. |
12:20:43 | * | rnrwashere joined #nim |
12:25:16 | * | rnrwashere quit (Ping timeout: 250 seconds) |
12:26:20 | Araq | arnetheduck: clang-format and git checkout filters are intrusive, I dream about editor-only views |
12:27:10 | Araq | it's not that important of course but if your editor is a billion lines of code it might as well try to solve some "social" problems |
12:29:03 | WilhelmVonWeiner | is there a way to assign the result of a call to a variable and use that in a while at the same time |
12:29:57 | WilhelmVonWeiner | so instead of something like `while x = function(): # do thing |
12:30:07 | narimiran | var sth = true; while sth: sth = func() ? |
12:30:20 | WilhelmVonWeiner | *so, something like |
12:32:07 | clyybber | Araq: So yay or nay for a PR removing `end` from keywords? |
12:32:34 | clyybber | Would it break source code filters or nim.cfg ? |
12:32:45 | Araq | no. |
12:32:47 | WilhelmVonWeiner | narimiran: is there no way to make that one line then |
12:33:25 | Araq | while (x = function(); x): iirc |
12:36:15 | WilhelmVonWeiner | thanks |
12:41:14 | narimiran | PMunch: binaryparse doesn't work with nim devel, don't know if i already told you? |
12:41:28 | PMunch | Oh, no I didn't know that |
12:41:51 | narimiran | binaryparse.nim(476, 22) Error: internal error: environment misses: :tmp |
12:42:36 | PMunch | Hmm, that's not good |
12:43:46 | PMunch | What does that error even mean :S |
12:44:20 | FromGitter | <arnetheduck> btw, is there a way to make a conditional include? for wasm, I'm using os:standalone which requires a panicoverride which is kind of annoying. |
12:44:53 | PMunch | As in "when something: include whatever"? |
12:45:00 | FromGitter | <arnetheduck> and b) do we already have a feature to use a different system.nim? I've been thinking about making an exception-free version of it |
12:45:14 | FromGitter | <arnetheduck> no, as in, "include this file if it exists" |
12:45:23 | FromGitter | <arnetheduck> for "soft" extension points |
12:45:56 | FromGitter | <mratsim> when defined(foo): import bar else: import baz |
12:46:37 | FromGitter | <mratsim> and you can do when compiles(import foo): import foo |
12:46:56 | FromGitter | <arnetheduck> right, when compiles might work |
12:47:01 | PMunch | arnetheduck, when fileExists("file.nim"): include "file" |
12:47:23 | FromGitter | <arnetheduck> when fileExists won't take include path into account, I suspect |
12:47:29 | FromGitter | <mratsim> like here: https://github.com/mratsim/Arraymancer/blob/master/src/io/io.nim#L5-L17 |
12:47:33 | PMunch | No it won't |
12:47:54 | FromGitter | <arnetheduck> @mratsim spot on |
12:48:52 | PMunch | when compiles is a but dodgy though.. |
12:49:13 | PMunch | If the library had an error in it then it would just silently not got included |
12:49:16 | FromGitter | <mratsim> well it's the workaround of the last resort |
12:49:32 | PMunch | True |
12:49:43 | FromGitter | <mratsim> I also use it to check if something returns void because type(foo) crashes when foo is void |
12:49:59 | PMunch | I'd make it when compiles or defined(overrideImport) or something like that at least |
12:50:17 | PMunch | So if you get errors and can't understand why it doesn't import it then you can force it to |
12:51:09 | PMunch | mratsim, I used it for the same thing when playing around with options. If it had a return value then it would return Some(value) otherwise it wouldn't return anything. |
12:51:28 | PMunch | That should probably be implemented as it's own check though.. |
12:51:52 | FromGitter | <alehander42> i used it in gara |
12:51:53 | FromGitter | <alehander42> afaik |
12:52:10 | FromGitter | <alehander42> to generate different code depending on the types of different runtime values |
12:52:23 | FromGitter | <alehander42> but maybe it was just when something is X |
12:52:27 | FromGitter | <alehander42> not compiles |
12:57:19 | Araq | arnetheduck: there is --lib for the path to system.nim but you need to try it, I don't remember using it |
12:59:55 | * | dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:00:22 | * | mosORadi quit (Quit: Connection closed for inactivity) |
13:01:51 | PMunch | Hmm, alehander42, gara looks interesting |
13:03:26 | narimiran | PMunch: don't tell me you haven't heard off gara before, and you never used it? |
13:03:44 | PMunch | Nope, never heard of it |
13:06:04 | narimiran | it is one of the few nimble packages i have installed and used |
13:07:47 | clyybber | Nice, using bitops' trailing zeros smoothsort is now ~10% faster |
13:07:57 | clyybber | thats intrinsics for ya |
13:10:44 | shashlick | PMunch how is nimlsp doing |
13:10:58 | shashlick | Am thinking of adding suggest to feud |
13:11:02 | PMunch | shashlick, well it still works :) |
13:11:42 | PMunch | Haven't really added much to it lately though |
13:11:48 | shashlick | Does it also handle linting or is that separate |
13:12:29 | shashlick | Syntax checking |
13:12:35 | PMunch | Every time the file is saved it runs a check on it and notifies of any potential errors |
13:13:13 | shashlick | Ok so the lsp handles both suggestions as well as syntax - that's good |
13:13:28 | shashlick | Is that part of the standard protocol |
13:13:32 | PMunch | Yup |
13:14:17 | PMunch | Well, it isn't really syntax checking. It pretty much just compiles the project and returns any errors |
13:15:36 | PMunch | narimiran, looking at binaryparse now. Not quite sure what the issue is though.. |
13:15:59 | narimiran | me neither (just by reading the error message) |
13:16:32 | PMunch | I tried copy-pasting the output from the macro into the code and that works fine |
13:16:48 | PMunch | It seems like something changed around generated symbols.. |
13:20:34 | shashlick | PMunch will be cool to get into this table |
13:20:38 | shashlick | https://langserver.org |
13:22:33 | PMunch | Should just be to make a PR to github.com/langserver/langserver.github.io/pulls |
13:22:36 | * | nsf quit (Quit: WeeChat 2.4) |
13:24:56 | PMunch | Hmm, I should set up a git-bisect script for Nim versions |
13:25:11 | PMunch | To figure out which exact commit causes my code to break |
13:32:00 | clyybber | How can I provide both arguments of a template with two untyped arguments as a code block? |
13:33:22 | clyybber | Nevermind, figured it out. |
13:33:43 | narimiran | block? |
13:38:23 | clyybber | I did it like this now: |
13:38:41 | clyybber | sometempl (var some = 1): |
13:38:50 | clyybber | someothercode... |
13:39:17 | clyybber | where `var some = 1` is the first, and `someothercode...` the second untyped parameter |
13:45:21 | PMunch | clyybber, the do syntax should do that |
13:46:34 | PMunch | http://ix.io/1FiI/Nim <- like that |
13:50:49 | clyybber | PMunch: Thanks! |
13:51:04 | PMunch | No problem :) |
13:51:21 | livcd | hmm google shows Araq's pic next to some german archeologist from Potsdam |
13:51:34 | PMunch | Haha, where? |
13:56:33 | livcd | just google Araq ^^ |
13:57:47 | PMunch | It just autocorrected me to Arak, the drink |
13:58:46 | PMunch | Guess that says more about my googling history than anything else.. |
13:59:41 | PMunch | Hmm, same thing happens with a private window |
14:05:46 | PMunch | Hmm, if I want to find all 6 character numbers in a bunch of strings, what would you use |
14:05:59 | PMunch | I guess a good ol' regex would work |
14:06:16 | narimiran | "i know, i'll use regex!" :D :D |
14:08:18 | * | seni joined #nim |
14:14:12 | Zevv | no no no |
14:14:14 | Zevv | use PEGs |
14:14:38 | Zevv | PMunch: give me your string, I make you a parser :) |
14:14:44 | Zevv | I need testers |
14:15:14 | PMunch | I have a bunch of random strings |
14:17:31 | * | kali___ is now known as kaliy |
14:17:32 | Zevv | 6-digits only, no less no more, right? |
14:17:45 | PMunch | Yup |
14:18:11 | Zevv | http://paste.ubuntu.com/p/yqqMwZwz8x/ |
14:18:40 | Zevv | or, if you don't want them in a seq but want to handle them in code: http://paste.ubuntu.com/p/QpqF2Bs2BK/ |
14:18:45 | * | Trustable joined #nim |
14:18:55 | PMunch | narimiran, according to git bisect e8747059710370819800bdc0742fa86761c6737b was the first commit that broke binaryparse |
14:19:53 | PMunch | Zevv, I stillk think [0-9]{6} is easier.. |
14:20:01 | Zevv | :) |
14:22:06 | * | PMunch quit (Remote host closed the connection) |
14:25:43 | * | PMunch joined #nim |
14:25:57 | PMunch | narimiran, https://github.com/nim-lang/Nim/issues/10192 that seems related |
14:26:00 | * | PMunch quit (Remote host closed the connection) |
14:28:33 | * | sealmove joined #nim |
14:30:11 | * | I_Right_I joined #nim |
14:30:32 | livcd | where do I place the libwinpthread*.dlls ? It says on the website to place it where I have nim.exe but I do not have nim.exe yet i am building from source |
14:31:09 | Araq | not nim.exe, <yourprogram>.exe |
14:32:37 | livcd | i am just building the compiler |
14:33:11 | leorize | then you wouldn't need it? |
14:33:29 | leorize | a mingw installation should have that library included |
14:35:29 | livcd | hmm it has but i just installed the whole mingw. Restarted the cmd and re-ran the build.bat and it works |
14:48:45 | * | a_b_m quit (Ping timeout: 255 seconds) |
14:49:12 | sealmove | why ` numChars*: set[char] = {'0'..'9', 'a'..'z', 'A'..'Z'}` in the lexer? |
14:49:33 | sealmove | shouldn't it be `'a'..'f'`? |
14:51:42 | FromGitter | <mratsim> where is this and what is it used for? |
14:51:59 | Zevv | sealmove: that's for hexatrigesimal numbers |
14:52:14 | FromGitter | <mratsim> You at least need to be able to parse 0o123 for octals |
14:52:41 | FromGitter | <mratsim> and 0xABCDEF for hexa |
14:53:07 | sealmove | Zevv: nice one :D mratsim: thx for explanation, missed that |
15:40:34 | * | vlad1777d quit (Ping timeout: 250 seconds) |
15:40:35 | clyybber | Anybody know if c-blake is on IRC? |
15:44:38 | * | Cthalupa quit (Ping timeout: 245 seconds) |
15:47:31 | * | Cthalupa joined #nim |
15:48:13 | dom96 | so yesterday I actually had a pretty nice experience getting openssl DLLs for Windows. Bintray is awesome. Highly recommend for anyone else still running super old openssl DLLs |
15:55:12 | planetis[m] | hey sealmove what's up? |
16:02:44 | Araq | https://www.youtube.com/watch?v=OFgxAFdxYAQ |
16:12:48 | * | nsf joined #nim |
16:13:23 | * | rnrwashere joined #nim |
16:21:44 | * | rnrwashere quit (Remote host closed the connection) |
16:23:37 | * | a_b_m joined #nim |
16:25:02 | * | neceve quit (Ping timeout: 245 seconds) |
16:25:16 | * | solitudesf joined #nim |
16:25:43 | * | neceve joined #nim |
16:28:55 | * | rnrwashere joined #nim |
16:33:27 | * | rnrwashere quit (Remote host closed the connection) |
16:50:58 | * | rnrwashere joined #nim |
16:52:19 | Zevv | "what can you cram in your own cache, that's where your performance goes" |
16:55:25 | * | rnrwashere quit (Ping timeout: 258 seconds) |
17:00:09 | * | rnrwashere joined #nim |
17:03:35 | * | neceve quit (Ping timeout: 246 seconds) |
17:03:57 | * | neceve joined #nim |
17:04:12 | * | chimez joined #nim |
17:08:44 | * | rnrwashere quit (Remote host closed the connection) |
17:09:22 | * | rnrwashere joined #nim |
17:12:05 | * | rnrwashere quit (Remote host closed the connection) |
17:12:53 | * | rnrwashere joined #nim |
17:18:24 | clyybber | I hope that RISC-V gets an extension for control over L-Caches |
17:18:40 | clyybber | s/control/manual control |
17:22:43 | * | rnrwashere quit (Remote host closed the connection) |
17:23:55 | Zevv | how would |
17:24:14 | Zevv | you typically use that? |
17:24:44 | clyybber | no, but I imagine ICC uses it |
17:25:11 | Zevv | ah right |
17:25:20 | clyybber | I mean "manual" control as in some compiler could use it |
17:25:29 | clyybber | to get more performance |
17:25:34 | Zevv | yeah that makes sense |
17:27:26 | Araq | clyybber: it's not clear it can help that much, what's the compiler gonna do? "Please load this value, it'll be used 300 instructions later on" .. well you can produce a load instruction already |
17:31:38 | clyybber | Araq: Extending loading values in cache to whole memory regions which can be specified manually? |
17:32:41 | clyybber | The compiler should also be able to make much more sane assumptions about which values are gonna be used in the future as opposed to some often undeterministic heuristics. |
17:33:03 | clyybber | which are found on todays processors |
17:34:08 | * | rnrwashere joined #nim |
17:34:48 | CcxWrk | How do I register filedescriptors with eventloop? |
17:37:15 | * | rnrwashere quit (Remote host closed the connection) |
17:38:32 | dom96 | CcxWrk: Which event loop? Asyncdispatch? |
17:39:06 | CcxWrk | Yeah. I want to handle stdio and pipes to spawned child in async manner. |
17:39:32 | * | rnrwashere joined #nim |
17:39:43 | CcxWrk | I could write own select loop, but I figured I might as well try asyncdispatch. |
17:42:22 | FromGitter | <arnetheduck> regarding modules and names.. what would the chances be of adding nesting? we're starting to have a bit of a problem in that if we have module_a/util and module_b/util, they're.. hard.. to import or name sanely (yeah, can rename every time but it's a bother).. |
17:42:42 | CcxWrk | Ah, asyncdispatch.register() apparently. |
17:43:53 | FromGitter | <arnetheduck> also, error message is slightly confusing.. if I create `a/util.nim` and `b/util.nim`, then import both, error message complains about nimble, even though there's no nimble in sight: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ca64258a0790b29c95fd3d7] |
17:46:08 | disruptek | wrt editors, i don't see why we can't write in any syntax we want and then pass AST to the compiler. |
17:46:56 | disruptek | i mean, we can compile brainfuck to binary with xpegs. seems like we aren't that far away, right? |
17:47:03 | clyybber | disruptek Thats an interesting idea. I don't know any editor that does this though. |
17:47:58 | CcxWrk | Is it possible to switch to the poll implementation? It would make the debugging slightly easier. |
17:52:19 | * | Trustable quit (Remote host closed the connection) |
17:52:31 | disruptek | no editor does it, because it's not the job of the editor per se. |
17:52:42 | disruptek | it would be an extension to langserver. |
17:54:41 | disruptek | Araq: any thoughts on this? https://github.com/nim-lang/needed-libraries/issues/104 |
17:55:42 | * | clyybber quit (Quit: WeeChat 2.4) |
17:56:22 | * | clyybber joined #nim |
17:56:24 | FromGitter | <alehander42> Disrupted ⏎ I |
17:56:36 | FromGitter | <alehander42> Ve worked on a idea like this |
17:57:14 | FromGitter | <alehander42> It let's you define bidir grammars to parser and generate the same ast in different syntaxes |
17:57:50 | FromGitter | <alehander42> But it was very prototype |
17:58:16 | disruptek | did it work? |
17:58:17 | CcxWrk | There was a period when the idea of AST-based editing was popular. They... weren't very good usability-wise. |
17:58:37 | Araq | arnetheduck: it was on my todo but got cancelled, I need package.module.identifier to be unique |
17:58:42 | CcxWrk | But that might be slightly off from what you are talking about. |
17:59:35 | disruptek | i'm just thinking you could hack the syntax a bit with a simple patch, say to introduce curly braces if you wanted them, etc. but, you could of course go further, too... |
17:59:39 | CcxWrk | Is there an easy way to drop into gdb (or any other debugger) on assertion error? |
18:00:11 | disruptek | run your binary with gdb? |
18:01:52 | * | kobi7 joined #nim |
18:02:17 | CcxWrk | Inferior 1 (process 32550) exited with code 01 |
18:02:54 | Araq | break exit |
18:04:36 | CcxWrk | Thanks. :) |
18:05:37 | Araq | so my motherboard has a plug it says "D-Link" |
18:06:04 | Araq | and there is a cable that would fit in, is it a good idea to do that? |
18:06:04 | disruptek | lucky. |
18:06:35 | CcxWrk | addRead and addWrite say that returning false from callback will make it not run again. Either my logic is wrong (quite possible), or that's not what happens. |
18:16:13 | disruptek | cliff says memory latency hasn't improved. well, duh, the speed of light is a constant. o.O |
18:16:38 | Zevv | thats his point. nothing to be gained there |
18:16:59 | disruptek | i know, but it was embarassing to hear him say it. :-P |
18:18:04 | Zevv | Nah, it's nice to be remenbered that a computer is still a physical machine in the physical world. |
18:19:09 | * | narimiran sings Zevv's comment in Madonna's voice |
18:21:12 | Zevv | The meter is just not quite right :) |
18:21:14 | CcxWrk | Yeah, it seems that my read callback is getting called despite returning false. Do I need to go out of my way and unregister() and register() the fd? |
18:21:35 | * | theelous3_ joined #nim |
18:22:26 | narimiran | Zevv: gaaah, i know, and it bothers me to. but when i saw "a X Y in a X world", the melody started in my head automatically |
18:22:40 | Zevv | musical pattern matching |
18:22:51 | disruptek | so let's see if we can guess your age. |
18:23:02 | disruptek | you're about 40? |
18:23:31 | narimiran | disruptek: haha, nah, i just behave like one :P |
18:26:12 | narimiran | (disclaimer: i'm *younger* than 40, not older :P) |
18:26:27 | * | chimez quit (Quit: chimez) |
18:37:34 | * | clyybber quit (Quit: WeeChat 2.4) |
18:38:22 | * | clyybber joined #nim |
18:44:13 | clyybber | arnetheduck: How did chaos unicorn day go? |
18:44:17 | * | clyybber quit (Quit: WeeChat 2.4) |
18:44:58 | * | clyybber joined #nim |
18:45:35 | FromGitter | <arnetheduck> clyybber, well, devs where happy - gonna make it regular most likely: https://notes.status.im/DeeWO2TGSVy7PeJiNIfmpQ?view |
18:46:53 | clyybber | nice |
18:59:27 | * | tdc quit (Quit: Leaving) |
19:01:42 | * | cyraxjoe quit (Ping timeout: 245 seconds) |
19:02:08 | * | cyraxjoe joined #nim |
19:10:42 | disruptek | is there a nim.cfg statement that relaxes !tabulators? |
19:11:23 | CcxWrk | How do I generate .c file without compiling? |
19:12:09 | disruptek | CcxWrk: check your ~/.cache/nim |
19:13:00 | shashlick | -c, --compileOnly compile Nim files only; do not assemble or link |
19:13:01 | Zevv | -c |
19:13:41 | CcxWrk | Thanks. |
19:13:49 | Zevv | --your-welcome |
19:14:03 | Zevv | ooh, --youre-welcome, of course |
19:16:40 | disruptek | it's odd that statement lists on the righthand side of an assignment are special expressions, so you cannot `foo = "bar" & case ...` |
19:20:24 | Zevv | true, I never noticed that |
19:20:36 | Zevv | put it in brackets and all is fine |
19:21:20 | * | uvegbot quit (Read error: Connection reset by peer) |
19:21:32 | Zevv | http://paste.debian.net/1076130/ |
19:23:01 | disruptek | i can't decide if it's a bug, but in terms of behavior of least surprise, this ain't it. ;-) |
19:27:46 | FromGitter | <liquid600pgm> I guess the rough EBNF notation for this would be: ⏎ ⏎ ```expr → caseExpr | ifExpr | infix | ...``` [https://gitter.im/nim-lang/Nim?at=5ca65ab231aec969e8516e94] |
19:28:01 | FromGitter | <liquid600pgm> that's why it's disallowed |
19:28:50 | disruptek | yes, but it seems like a defect. in any case, the error message should be polished. |
19:29:27 | disruptek | we cannot call an if statement an expression in one instance and then complain that an expression was not found in another. |
19:29:55 | Zevv | just wondering: when someone pastest something on gitter, I get a link on IRC showing this ᵗᶦⁿʸ little window with the code |
19:30:01 | Zevv | is that how everybody sees it on gitter? |
19:30:06 | * | mosORadi joined #nim |
19:30:30 | Zevv | https://zevv.nl/div/tiny.png |
19:30:48 | narimiran | no, link on gitter is of normal size for me |
19:31:02 | narimiran | oh, it is narrow for you |
19:31:07 | narimiran | bottom-right, click on it |
19:31:08 | disruptek | i got that too, but i suppose if you sign in to gitter, it's a little nicer looking. |
19:31:14 | * | crem quit (Ping timeout: 250 seconds) |
19:31:35 | narimiran | this "fake hamburger menu" will collapse the right column |
19:32:19 | Zevv | yes that helps a bit, thanks |
19:32:29 | Zevv | I'd love to get a link to only the snippet, more pastebin like |
19:32:51 | * | kobi7 quit (Quit: Leaving) |
19:33:14 | disruptek | the gitter link adds nothing. i'd rather see a syntax-highlit rendering at worst, and a paste with syntax highlight at best. |
19:33:39 | FromGitter | <liquid600pgm> (https://files.gitter.im/nim-lang/Nim/3dsz/image.png) |
19:33:43 | FromGitter | <liquid600pgm> so I tried using Srain for IRC |
19:33:56 | FromGitter | <liquid600pgm> to see how code blocks look |
19:34:00 | disruptek | try channel #nim. |
19:34:08 | * | lqdev joined #nim |
19:34:15 | FromGitter | <liquid600pgm> oh seriously!? |
19:34:17 | disruptek | hooray |
19:34:53 | FromGitter | <liquid600pgm> what's the `#` for, I thought it was implicit |
19:35:15 | disruptek | it denotes `channel`. |
19:36:06 | FromGitter | <liquid600pgm> I understood that part, I'm asking why is it needed when connecting |
19:36:36 | disruptek | because otherwise, the irc client doesn't know how to resolve the symbol. |
19:37:15 | FromGitter | <liquid600pgm> anyways, here goes the test: ⏎ ⏎ ```proc abc(a, b: int): int = a * b + int(a / b) ⏎ echo abc(1, 2)``` [https://gitter.im/nim-lang/Nim?at=5ca65ceb016a930a45635812] |
19:37:25 | disruptek | i mean, there may not be a valid technical reason for it; it's convention. |
19:37:34 | FromGitter | <liquid600pgm> thank you, good to know |
19:38:23 | disruptek | test from irc land: ```proc abc(a, b: int): int = a * b + int(a / b) |
19:38:26 | disruptek | echo abc(1, 2)``` |
19:38:40 | disruptek | test from irc land: ```proc abc(a, b: int): int = a * b + int(a / b); echo abc(1, 2)``` |
19:38:49 | FromGitter | <liquid600pgm> yeah, that code fence doesn't work, it shows up as two separate messages |
19:39:11 | disruptek | or as if i merely `backticked it`. |
19:41:25 | * | clyybber quit (Quit: WeeChat 2.4) |
19:42:09 | lqdev | fence test from IRC: ``` |
19:42:23 | lqdev | yeah that won't work, shift+enter doesn't make a line break |
19:45:17 | FromGitter | <liquid600pgm> I'm staying with Gitter for now, even though I don't like their web app |
19:45:28 | FromGitter | <liquid600pgm> it allows me to share code rather easily |
19:45:54 | * | rnrwashere quit (Remote host closed the connection) |
19:53:41 | * | lqdev quit (Remote host closed the connection) |
20:04:00 | * | narimiran quit (Remote host closed the connection) |
20:06:24 | CcxWrk | Why does repr() for string containing newline ends with \10", then literal newline and then ""? |
20:08:51 | * | matthiaswh quit (Quit: matthiaswh) |
20:11:00 | FromGitter | <bluenote10> I have a nimble question: How can I exit/quit from a nimble task with an error code? If I do `return` the task stops, but I cannot find a way to return a non-zero exit code. |
20:12:10 | * | sz0 quit (Quit: Connection closed for inactivity) |
20:14:29 | FromGitter | <bluenote10> and using `quit(1)` gives an annying hint "quit called" that I don't want |
20:16:08 | * | jjido joined #nim |
20:19:28 | disruptek | bluenote10: quit("", 1) |
20:20:34 | * | kapil____ quit (Quit: Connection closed for inactivity) |
20:21:24 | * | NimBot joined #nim |
20:22:25 | * | floppydh quit (Quit: WeeChat 2.4) |
20:25:53 | * | matthias__ joined #nim |
20:26:32 | * | matthias__ quit (Client Quit) |
20:29:36 | FromGitter | <bluenote10> That still prints the hint |
20:30:07 | disruptek | not for me. |
20:30:44 | disruptek | are you calling system.quit or some other quit? |
20:31:36 | FromGitter | <bluenote10> according to the hint I've called system.quit |
20:31:50 | disruptek | actually, system quit doesn't produce any output at all in devel. |
20:32:53 | FromGitter | <liquid600pgm> disruptek: are you checking `system.quit` with nimble? it never produced any output AFAIK, it may be nimble that's printing the hint |
20:32:53 | disruptek | oh sorry, i missed that this was a nimble question. i don't use nimble. :-/ |
20:33:55 | FromGitter | <bluenote10> `hint("QuitCalled", false)` also doesn't work, I guess I give up |
20:34:38 | * | d10n-work joined #nim |
20:35:43 | CcxWrk | Hrm, epoll doesn't know how to write to /dev/null |
20:35:44 | * | vlad1777d joined #nim |
20:35:51 | disruptek | to me, nawabs makes much more sense if you value reproducability. |
20:36:07 | CcxWrk | > epoll_ctl(3, EPOLL_CTL_ADD, 1, {EPOLLOUT|EPOLLRDHUP, {u32=1, u64=1}}) = -1 EPERM (Operation not permitted) |
20:36:09 | CcxWrk | > Error: unhandled exception: Operation not permitted (code: 1) [IOSelectorsException] |
20:36:10 | * | Perkol joined #nim |
20:36:22 | CcxWrk | Could I just use poll() instead? Is there some define I can use? |
20:38:30 | CcxWrk | or select() according to docs, but I see ioselectors_poll.nim and it's using posix.poll() |
20:38:35 | FromGitter | <bluenote10> yes I also like nawabs more, but I still want to offer a nimble config |
20:39:10 | * | nsf quit (Quit: WeeChat 2.4) |
20:55:48 | * | Cadey joined #nim |
20:57:17 | * | Cadey quit (Client Quit) |
20:57:31 | * | Cadey joined #nim |
21:10:18 | * | Cadey quit (Quit: WeeChat 1.9.1) |
21:11:19 | * | Cadey joined #nim |
21:12:26 | * | solitudesf quit (Ping timeout: 246 seconds) |
21:14:26 | FromDiscord | <exelotl> god |
21:15:01 | FromDiscord | <exelotl> my arch nemeses shl/shr strike again |
21:16:36 | FromDiscord | <exelotl> I get left and right mixed up a lot... so I make far fewer mistakes in languages that use << and >> |
21:23:17 | * | cyraxjoe quit (Ping timeout: 246 seconds) |
21:23:44 | * | cyraxjoe joined #nim |
21:26:13 | * | Perkol quit (Quit: Leaving) |
21:27:50 | * | Vladar quit (Remote host closed the connection) |
21:39:48 | * | mosORadi quit (Quit: Connection closed for inactivity) |
21:53:45 | FromGitter | <zetashift> I prefer shl/shr, but you could just define those as operators no? |
21:54:22 | * | Xe quit (Quit: *.yolo *.swag) |
21:57:01 | * | Cadey quit (Quit: WeeChat 1.9.1) |
21:57:11 | * | Xe joined #nim |
22:18:45 | * | a_b_m quit (Quit: Leaving) |
22:23:41 | * | rnrwashere joined #nim |
22:43:31 | * | jjido quit (Quit: Connection closed for inactivity) |
22:48:34 | FromGitter | <arnetheduck> btw, Araq, the new owner thing, would it cover the following scenario: ⏎ ⏎ 1) I have some `state` which is a ref object ⏎ 2) I compute a cache over that `state` ⏎ 3) I want to make sure that the `state` does not change while the cache "exists" (by scoping cache object) ... [https://gitter.im/nim-lang/Nim?at=5ca689c2759abc043c696dc1] |
22:52:38 | * | jjido joined #nim |
22:55:00 | * | krux02 quit (Remote host closed the connection) |
22:55:16 | * | sealmove quit (Quit: WeeChat 2.4) |
22:55:26 | * | seni quit (Quit: Leaving) |
23:04:49 | federico3 | can I get the compiler to list unused procs in a imported module? |
23:08:35 | * | rnrwashere quit (Remote host closed the connection) |
23:11:42 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
23:32:24 | I_Right_I | I come from a C back ground. In the past when I have used libraries in c++ that use "try & catch" I have seen all sorts of trouble with it oppose to most c error handling schemes. Should I have such concerns when using nim's "raise,try & except"? |
23:33:16 | * | lritter quit (Quit: Leaving) |
23:41:33 | * | Xe quit (Quit: WeeChat 1.9.1) |
23:41:45 | * | Xe joined #nim |
23:44:21 | * | Cthalupa quit (Ping timeout: 244 seconds) |
23:45:42 | * | Cthalupa joined #nim |
23:51:07 | * | noeontheend joined #nim |
23:55:57 | * | stefanos82 quit (Remote host closed the connection) |