00:05:59 | * | xet7 joined #nim |
00:24:04 | * | gokr quit (Ping timeout: 256 seconds) |
00:30:38 | * | def-pri-pub joined #nim |
00:36:49 | * | def-pri-pub quit (Ping timeout: 240 seconds) |
00:38:39 | * | yglukhov joined #nim |
00:38:56 | * | def-pri-pub joined #nim |
00:43:20 | * | yglukhov quit (Ping timeout: 256 seconds) |
00:49:41 | * | dyson joined #nim |
00:50:05 | * | dyson is now known as Guest99171 |
00:50:08 | * | Trioxin quit (Ping timeout: 256 seconds) |
01:00:01 | * | Matthias247 quit (Read error: Connection reset by peer) |
01:03:55 | * | def-pri-pub quit (Ping timeout: 255 seconds) |
01:05:35 | * | def-pri-pub joined #nim |
01:05:35 | * | def-pri-pub quit (Changing host) |
01:05:35 | * | def-pri-pub joined #nim |
01:09:14 | * | Trioxin joined #nim |
01:09:40 | * | Guest99171 quit (Ping timeout: 258 seconds) |
01:33:27 | * | def-pri-pub quit (Ping timeout: 252 seconds) |
01:35:16 | * | def-pri-pub joined #nim |
01:35:16 | * | def-pri-pub quit (Changing host) |
01:35:16 | * | def-pri-pub joined #nim |
01:39:49 | * | sz0 quit (Quit: Connection closed for inactivity) |
01:41:31 | * | Jesin quit (Read error: Connection reset by peer) |
01:54:48 | * | pregressive joined #nim |
01:54:54 | * | pregressive quit (Remote host closed the connection) |
01:55:08 | * | pregressive joined #nim |
02:04:06 | * | devted joined #nim |
02:11:18 | * | sz0 joined #nim |
02:23:51 | * | chemist69 quit (Ping timeout: 276 seconds) |
02:30:00 | * | devted quit (Quit: Sleeping.) |
02:32:43 | * | devted joined #nim |
02:37:23 | * | chemist69 joined #nim |
02:38:43 | * | synshroud quit (Quit: ZNC 1.6.4 - http://znc.in) |
02:40:34 | * | synshroud joined #nim |
02:40:47 | * | yglukhov joined #nim |
02:45:10 | * | yglukhov quit (Ping timeout: 256 seconds) |
02:54:36 | * | Trioxin quit (Ping timeout: 240 seconds) |
02:57:30 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
03:11:07 | * | Trioxin joined #nim |
03:18:30 | * | Kingsquee joined #nim |
03:19:37 | * | devted quit (Quit: Sleeping.) |
03:38:42 | * | brson quit (Quit: leaving) |
03:41:36 | FromGitter | <barcharcraz> is there a way to overload based on the value of a compile time string |
03:42:01 | FromGitter | <barcharcraz> so like proc(x : "yolo") ⏎ and proc(x: "lol") |
03:45:56 | FromGitter | <barcharcraz> ah I can do it with when |
03:46:09 | FromGitter | <barcharcraz> and {.fatal.} |
03:46:10 | FromGitter | <barcharcraz> cool |
03:46:30 | FromGitter | <barcharcraz> ah metaprogramming in nim is so simple |
03:58:17 | * | vasher_ quit (Quit: Connection closed for inactivity) |
04:05:03 | subsetpark | Elementary question: the basic concept of the {.async.} pragma and `await` calls is, you enter the polling loop with runForever, and then every await call automatically yields to a giant list of futures somewhere, which resumes execution at the first future with a returned value? |
04:11:06 | * | ftsf_ quit (Ping timeout: 255 seconds) |
04:11:32 | * | ftsf_ joined #nim |
04:14:26 | * | kulelu88 quit (Quit: Leaving) |
04:38:06 | * | ftsf_ quit (Ping timeout: 255 seconds) |
04:38:24 | * | ftsf_ joined #nim |
04:42:21 | * | chemist69 quit (Ping timeout: 245 seconds) |
04:44:25 | * | yglukhov joined #nim |
04:48:41 | * | yglukhov quit (Ping timeout: 240 seconds) |
05:03:18 | * | Trioxin quit (Ping timeout: 255 seconds) |
05:03:27 | * | dyson joined #nim |
05:03:50 | * | dyson is now known as Guest8182 |
05:09:36 | * | chemist69 joined #nim |
05:40:17 | * | def-pri-pub quit (Quit: leaving) |
05:42:35 | Araq | subsetpark: I think you can put it this way |
05:56:20 | * | aedigix quit (Remote host closed the connection) |
05:56:46 | * | aedigix joined #nim |
05:57:59 | * | chemist69 quit (Ping timeout: 255 seconds) |
05:58:24 | * | chemist69 joined #nim |
05:59:40 | * | aedigix quit (Remote host closed the connection) |
06:00:06 | * | aedigix joined #nim |
06:27:55 | * | nsf joined #nim |
06:38:23 | * | fifr left #nim ("WeeChat 1.6") |
06:45:44 | * | yglukhov joined #nim |
06:50:24 | * | yglukhov quit (Ping timeout: 255 seconds) |
07:00:48 | * | ftsf_ quit (Remote host closed the connection) |
07:14:26 | FromGitter | <Varriount> Subsetpark: that's the current model in a nutshell, yes |
07:20:16 | * | Guest8182 quit (Ping timeout: 245 seconds) |
07:20:27 | * | filcuc joined #nim |
07:22:17 | cheatfate | subsetpark, is question is elementary, why you are asking it? |
07:30:06 | * | hcorion quit (Quit: Konversation terminated!) |
07:46:32 | * | gokr joined #nim |
07:56:10 | FromGitter | <gokr> @Varriount Nope |
07:57:48 | FromGitter | <gokr> @Araq Hehe (reference to Smalltalk) |
08:09:22 | * | rokups joined #nim |
08:09:28 | * | Guest89004 joined #nim |
08:11:31 | * | Andris_zbx joined #nim |
08:58:44 | * | Kingsquee quit (Read error: Connection reset by peer) |
08:59:03 | * | Kingsquee joined #nim |
09:08:05 | * | bjz joined #nim |
09:14:04 | * | yglukhov joined #nim |
09:14:19 | * | yglukhov quit (Read error: Connection reset by peer) |
09:15:23 | * | Matthias247 joined #nim |
09:15:30 | * | yglukhov joined #nim |
09:15:38 | * | yglukhov quit (Remote host closed the connection) |
09:15:53 | * | yglukhov joined #nim |
09:18:45 | * | byte512 joined #nim |
09:28:18 | * | yglukhov quit (Remote host closed the connection) |
09:31:54 | * | couven92 joined #nim |
09:35:45 | * | pregress_ joined #nim |
09:37:11 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
09:37:36 | * | pregressive quit (Ping timeout: 260 seconds) |
09:42:00 | * | yglukhov joined #nim |
09:48:14 | * | PMunch joined #nim |
09:48:46 | * | PMunch quit (Client Quit) |
09:48:55 | * | PMunch joined #nim |
09:51:45 | * | yglukhov quit (Remote host closed the connection) |
10:04:37 | * | mjanssen_ quit (Quit: Lost terminal) |
10:11:34 | * | mjanssen joined #nim |
10:21:37 | * | bjz joined #nim |
10:41:04 | * | yglukhov joined #nim |
10:43:53 | * | yglukhov quit (Remote host closed the connection) |
10:50:34 | * | yglukhov joined #nim |
10:52:07 | * | strikr joined #nim |
11:00:20 | rokups | Araq: if i add a simplest proc that returns nil to arch.nim (which is imported by gc.nim and friends) compilation fails with "Error: system module needs 'copyString'". Any way around that? I am trying here to get rid of that coroutine asm stuff. |
11:01:05 | Araq | when hacking system.nim the error messages can be unhelpful but the compiler is always right |
11:01:49 | * | yglukhov quit (Remote host closed the connection) |
11:01:56 | Araq | you cannot use strings at the point as the codegen doesn't know yet how to translate strings |
11:04:31 | * | strikr quit (Ping timeout: 260 seconds) |
11:05:00 | rokups | Araq: well yes, thing is this error caused by simplest proc a(): discard |
11:05:45 | rokups | that as you can see does not contain any strings. thats why its confusing |
11:06:12 | Araq | proc a(): discard is not even valid syntax |
11:08:36 | rokups | Araq: yeah forgot =, but that is not the problem here. it happens with "proc a() = discard". any ideas? |
11:13:31 | Araq | wrap it in .push stackTrace:off .pop |
11:26:10 | * | yglukhov joined #nim |
11:27:22 | * | yglukhov quit (Remote host closed the connection) |
11:27:32 | rokups | thank you |
11:30:32 | * | filcuc quit (Ping timeout: 255 seconds) |
11:33:02 | * | yglukhov joined #nim |
11:36:49 | * | Snircle joined #nim |
11:37:44 | * | yglukhov quit (Ping timeout: 255 seconds) |
11:38:12 | * | hendi joined #nim |
11:44:28 | * | hendi quit (Quit: hendi) |
11:44:33 | * | hendi joined #nim |
11:58:05 | * | yglukhov joined #nim |
11:58:17 | * | woona joined #nim |
11:59:06 | * | hendi quit (Ping timeout: 240 seconds) |
12:00:29 | * | yglukhov quit (Remote host closed the connection) |
12:01:13 | * | yglukhov joined #nim |
12:06:51 | * | woona left #nim ("Leaving") |
12:07:31 | * | yglukhov quit (Remote host closed the connection) |
12:08:33 | * | felic joined #nim |
12:09:31 | * | felic left #nim (#nim) |
12:12:15 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
12:13:16 | * | yglukhov joined #nim |
12:13:45 | * | yglukhov quit (Remote host closed the connection) |
12:15:01 | * | yglukhov joined #nim |
12:16:40 | * | yglukhov quit (Remote host closed the connection) |
12:16:52 | * | yglukhov joined #nim |
12:25:13 | * | yglukhov quit (Remote host closed the connection) |
12:25:49 | * | yglukhov joined #nim |
12:26:49 | * | byte512 quit (Ping timeout: 240 seconds) |
12:29:50 | * | yglukhov quit (Ping timeout: 240 seconds) |
12:38:28 | subsetpark | cheatfate: just making sure I understood! |
12:50:05 | * | ehmry joined #nim |
12:50:06 | * | yglukhov joined #nim |
12:54:24 | * | Vladar joined #nim |
12:55:45 | * | hendi joined #nim |
13:01:33 | * | yglukhov quit (Remote host closed the connection) |
13:02:06 | * | vlad1777d joined #nim |
13:02:28 | * | hendi quit (Quit: hendi) |
13:04:28 | * | yglukhov joined #nim |
13:07:45 | * | yglukhov quit (Remote host closed the connection) |
13:08:18 | * | yglukhov joined #nim |
13:12:30 | * | yglukhov quit (Ping timeout: 240 seconds) |
13:20:50 | * | yglukhov joined #nim |
13:28:34 | * | krux02 joined #nim |
13:31:00 | * | Guest8182 joined #nim |
13:53:38 | * | djellemah quit (Remote host closed the connection) |
13:59:00 | * | nsf quit (Quit: WeeChat 1.7) |
14:05:50 | * | yglukhov quit (Remote host closed the connection) |
14:06:25 | * | yglukhov joined #nim |
14:10:49 | * | yglukhov quit (Ping timeout: 240 seconds) |
14:14:59 | FromGitter | <endragor> @cheatfate why does one have to call unregister() on AsyncEvent given that there cannot be more than 1 callback at a time and if you `return true` from the callback, it gets unregistered; couldn't the event be unregistered, too, in such case? |
14:18:30 | cheatfate | endragor: sorry could not understand you |
14:20:48 | * | pregress_ quit (Remote host closed the connection) |
14:21:16 | * | pregressive joined #nim |
14:23:09 | FromGitter | <endragor> the flow for working with AsyncEvent, as I understand, is: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ so 1) naming-wise it's not very obvious that `unregister` matches `addEvent` 2) it's not clear why the user has to call unregister() - instead, the event could be unregistered automatically when the callback returns `true` [https://gitter.im/nim-lang/Nim?at=5888b4cbe836bf70108d81d8] |
14:24:50 | * | pregressive quit (Read error: Connection reset by peer) |
14:25:18 | vlad1777d | Is somewhere any documentation, how to use custom scanner\parser with Nim ? |
14:25:20 | * | pregressive joined #nim |
14:25:40 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
14:28:59 | FromGitter | <cheatfate> sometimes you make decision to not receive any more events not in event callback... so then you call unregister() |
14:31:49 | * | pregressive quit (Ping timeout: 256 seconds) |
14:33:00 | rokups | well this is odd. when i try to compile on windows with --cc:vcc i get this: "Requested command not found: 'vccexe.exe /c --platform: |
14:33:26 | FromGitter | <endragor> @cheatfate ok. and if I create the event in one thread, pass it to another, then call addEvent/unregister/close from there - should it work fine? |
14:33:29 | Araq | rokups: koch tools to produce the vccexe tool |
14:35:12 | rokups | trying, thank you |
14:35:48 | cheatfate | endragor: yep must work |
14:37:21 | Araq | vlad1777d: how could we document a "custom" parser? isn't that a contradiction in itself |
14:39:37 | vlad1777d | Araq, I mean instruction: how to connect them to Nim |
14:40:31 | Araq | well the FFI is extensively documented, but not parser specific (why would it) |
14:42:18 | vlad1777d | Araq, I don't know what is FFI, could you give some links to manuals\readme ? |
14:43:12 | vlad1777d | (I read only Tutorial part 1 and 2, Manual, standard library reference, Nim by example) |
14:44:58 | FromGitter | <endragor> @cheatfate Could you please check why this fails? https://gist.github.com/endragor/e7a4d167264651e9ba543a1a71a1e28e It ends up throwing "Too many open files" error, even though the flow seems to be correct. |
14:46:43 | FromGitter | <endragor> (tested on macOS only) |
14:48:55 | Araq | vlad1777d: FFI is the "foreign function interface" |
14:49:16 | Araq | I don't understand your question. what's a "custom" parser for you? |
14:51:51 | vlad1777d | Araq, I mean parser, which from sources builds abstract syntax tree. I would try to learn their structure\building. They told us basics in University, but I would like to know it wider. |
14:52:35 | FromGitter | <dom96> @endragor what are you using AsyncEvents for? |
14:54:23 | FromGitter | <dom96> For example, can't you simply use channels instead? |
14:54:27 | Araq | vlad1777d: read Nim's stdlib. it's full of parsers. parsexml, json. or compiler/lexer.nim and compiler/parser.nim |
14:55:10 | FromGitter | <endragor> @dom96 no, channels are blocking. I need to use both channels and asyncdispatch's poll() loop. So the threads hang in the poll() loop and events are used to wake them up when something arrives to the channel |
14:55:54 | vlad1777d | Araq, ok, thanks |
14:56:27 | FromGitter | <dom96> @endragor they are not. Check |
14:56:48 | FromGitter | <dom96> My chat app example in book. Bbl |
14:56:52 | FromGitter | <endragor> @dom96 what I meant is that you can't do tryRecv() and poll() at the same time. poll blocks |
14:58:57 | niv | dom96: any plans/interest in making the streams module work with async? |
15:03:08 | FromGitter | <endragor> @dom96 the chat example, if I'm looking at the right one, is not multi-threaded. and I don't think there is an example that involves using threads that can do async IO and communicate with each other. |
15:08:07 | euantor | niv: It's planned as far as I know |
15:08:19 | niv | okay |
15:08:25 | euantor | It's been talked about recently as being a task that needs doing |
15:09:06 | niv | there's also a bug in the documentation/semantics of stream.readLine |
15:09:26 | * | devted joined #nim |
15:17:32 | Sentreen | Stupid question of the day: I'm looking at the hashes module, and I see that it has a hash proc for pointers (proc hash(x: pointer): Hash {..}), is there any way I can use this to hash a ref? Or do I have no choice but to hash whatever my ref points to? |
15:18:17 | Sentreen | (I'm not entirely sure about the "pointer" type and how much it differs from ptr) |
15:20:07 | Araq | cast[pointer](myref) |
15:20:12 | Araq | watchpoint set expression --size 4096 -- 0x00000001001ec000 |
15:20:12 | Araq | error: invalid enumeration value, valid values are: "1", "2", "4", "8" |
15:20:31 | Araq | seriously ... how can anybody claim debuggers are useful with watchpoints? |
15:20:37 | Araq | they are not. |
15:21:56 | niv | compiler optimisation question: this gets optimised away, i think this is a bug? while "" == readLine(): discard; this works: while "" == readLine(): echo "skip"; discard |
15:22:43 | Sentreen | Okay, thanks :) |
15:23:15 | FromGitter | <Varriount> Sentreen: As araq said, you can just cast the reference to a pointer. It might be a nice addition to the hashes module to add a generic ref version though, for simplicity's sake. |
15:24:17 | FromGitter | <Varriount> Though, then you might run into confusion, since it's the actual reference being hashed, not the content. |
15:24:41 | Sentreen | In this case I can be sure that there will only be one reference to that content, so it should not be a problem. |
15:25:42 | Araq | niv: optimized away? unlikely |
15:25:52 | niv | i have proof! |
15:26:17 | Araq | show me. |
15:26:20 | FromGitter | <Varriount> Sentreen: *nudge* PR *nudge* |
15:28:08 | Araq | no PR please. 'ref object' is very common and nobody agrees with whether it has pointer or value semantics in general |
15:28:18 | niv | Araq: https://gist.github.com/niv/aee805ba5879e50e1b901aae55b46022 |
15:28:29 | niv | just flip the commented out line between the single read and the while loop |
15:28:52 | niv | you can add something with side effects to the discard statement inside the while to make it work |
15:29:05 | niv | but line() should already have a side effect that requires it to run, right? |
15:30:47 | * | djellemah joined #nim |
15:31:24 | niv | Araq: actually, nevermind. i made a oops. why do only ever notice these when being rubberducked? |
15:31:31 | FromGitter | <Varriount> Araq: Then a documentation note, perhaps |
15:31:35 | FromGitter | <Varriount> ? |
15:32:04 | niv | clearly i'm lacking coffee |
15:34:23 | * | rupil joined #nim |
15:37:00 | Araq | varriount: ok |
15:37:26 | Xe | niv: get the IV coffee drip model |
15:38:08 | * | EastByte quit (Quit: WeeChat 1.6) |
15:38:12 | niv | Xe: :D |
15:39:28 | * | EastByte joined #nim |
15:39:37 | * | strikr joined #nim |
15:44:13 | FromGitter | <Varriount> Araq: I was just thinking about a procedure like `proc hashT (r: ref T)`, that way it doesn't prevent more specific procedures from being created |
15:45:02 | cheatfate | endragor: your source works on freebsd |
15:45:17 | cheatfate | endragor: but for some reason fails on macos |
15:46:52 | Araq | varriount: yes, but I don't like it. it's safer to not have a fallback for unclear semantics |
15:48:13 | cheatfate | endragor: i think main problem is that asyncdispatch do not have closeDispatcher() procedure because never suited for execution in multithreaded environment |
15:48:26 | cheatfate | so it not closing kqueue handles |
15:48:48 | cheatfate | and maybe macos has some kind of limit on kqueue handles |
15:48:54 | cheatfate | because freebsd dont have such limits |
15:49:45 | * | arnetheduck quit (Ping timeout: 258 seconds) |
15:51:11 | * | yeeve joined #nim |
16:02:19 | * | yglukhov joined #nim |
16:02:58 | rokups | did some work on coroutines: https://github.com/nim-lang/Nim/compare/devel...rokups:feature/coroutines?expand=1 |
16:03:35 | rokups | it should cover compilers better as its using inline asm for everything except vcc on x64, that one is handled by masm64. so no more external dependency on fasm |
16:03:54 | rokups | though i bet some other less used compilers will need some tuning to get working |
16:07:41 | Araq | rokups: wow this is cool :-) |
16:08:00 | rokups | \o/ |
16:08:22 | rokups | wish gcc wasnt weird though. sometimes it seems to ignore naked attribute, other times not.. |
16:08:36 | rokups | and there is 4 year old bug requesting implementing naked on x86 |
16:09:55 | Araq | I would prefer to not rely on jmp_buf for this feature but that's a minor nitpick |
16:10:03 | cheatfate | rokups, there is no ml64.exe |
16:10:04 | * | devted quit (Ping timeout: 258 seconds) |
16:10:11 | cheatfate | in my visual studio 2015 |
16:10:19 | cheatfate | there is only ml.exe |
16:10:26 | FromGitter | <endragor> @cheatfate so I think a recently added onThreadDestruction() feature could be used to fix that |
16:10:37 | rokups | hmm. there is ml64 in vs2010. this microsoft.. |
16:11:04 | cheatfate | endragor: asyncdispatch needs to close(selector) |
16:11:14 | Araq | some platforms xor the pointers in the jmp_buf for "security" |
16:11:19 | Araq | iirc |
16:11:55 | Araq | also: what about ARM support? :-) |
16:12:04 | rokups | yeah Araq but in this case it does not really matter as there is custom proc for getting registers for using in gc |
16:12:29 | rokups | maybe after compiler can bootstrap with -d:nimCoroutines we can think of arm? :p |
16:12:31 | FromGitter | <endragor> @cheatfate yeah so onThreadDestruction() would allow to set up the callback which does that when a thread exits |
16:13:28 | rokups | Araq: is it possible that inline assembly on tcc is broken? because i get error like: stdlib_arch.c:47: error: '(' expected (got "{") |
16:13:43 | cheatfate | endragor: you don't need onThreadDestruction() because you can call `asyncdispatch.closeGlobalDispatcher()` at the end of thread |
16:13:55 | * | krux02 quit (Remote host closed the connection) |
16:14:31 | * | filcuc joined #nim |
16:14:35 | cheatfate | and i have not checked `onThreadDestruction()` yet, is it called in context of destructed thread? |
16:14:38 | FromGitter | <endragor> @cheatfate true but that's a bit more fragile because users will have to keep that in mind |
16:14:46 | FromGitter | <endragor> @cheatfate yes |
16:16:58 | * | strikr_ joined #nim |
16:17:05 | Araq | rokups: sure. also TinyC is not "officially supported" even though many claim it is |
16:17:05 | cheatfate | endragor: anyway developer needs to integrate this onThreadDestruction() by himself, so i think he can keep in mind to `closeGlobalDispatcher` at the life end of thread... |
16:17:57 | rokups | Araq: so which compiles are officially supported? i would love to know which ones i can just ignore |
16:18:01 | rokups | gcc/clang/vcc/icl? |
16:18:05 | cheatfate | endragor: imho, `onThreadDestruction()` is weird thing |
16:18:09 | * | strikr_ quit (Client Quit) |
16:18:11 | cheatfate | and not needed |
16:19:00 | Araq | rokups: clang on OSX, GCC on linux, mingw and vcc on Windows |
16:19:31 | rokups | great. less things to worry about ^_^ |
16:19:39 | * | strikr quit (Ping timeout: 258 seconds) |
16:21:30 | FromGitter | <endragor> @cheatfate the developer doesn't need to do that, it would be part of the library |
16:21:57 | cheatfate | rokups, is it possible not to use setjmp/longjmp on windows? |
16:22:38 | rokups | cheatfate: fiber api could be abused i guess, but why? |
16:22:47 | GaveUp | must be a reason but I'm missing it ... why does something like echo case x: of 0: "0" compile fine, but wrapping the case in a template t(): typed = case ... cause a value must be discarded compile error? |
16:22:55 | FromGitter | <endragor> just at the top scope `onThreadDestruction do (): if not gDisp.isNil: gDisp.close()` |
16:25:55 | cheatfate | endragor: gDisp is not public |
16:26:10 | FromGitter | <endragor> @cheatfate yes, that code would be inside asyncdispatch |
16:27:50 | * | Guest89004 quit (Ping timeout: 240 seconds) |
16:32:23 | * | Guest8182 quit (Ping timeout: 240 seconds) |
16:34:42 | Araq | GaveUp: wrap the case in () in the template. sucks, I know |
16:37:14 | * | yglukhov quit (Remote host closed the connection) |
16:37:20 | GaveUp | compiler quirk/bug? |
16:39:29 | * | Trustable joined #nim |
16:40:45 | cheatfate | rokups, because on windows when you use setjmp/longjmp binary will got one more dependency on msvcrt.dll |
16:41:39 | Araq | GaveUp: yes |
16:42:58 | rokups | cheatfate: so what? msvcrt.dll is present everywhere. those version-specific runtimes can be installed. and lastly nim probably statically links anyway because i do not see any other import than kernel32 ;) |
16:43:44 | cheatfate | msvcrt.dll will not be present everywhere in the future... |
16:44:11 | cheatfate | and nim dont like statically |
16:44:16 | cheatfate | dont link statically |
16:45:40 | * | krux02 joined #nim |
16:45:46 | * | brson joined #nim |
16:45:57 | * | Jesin joined #nim |
16:46:48 | FromGitter | <andreaferretti> any nim library to deflate gz files? |
16:48:15 | * | PMunch quit (Quit: leaving) |
16:49:24 | * | yglukhov joined #nim |
16:50:40 | GaveUp | hmmm parens didn't seem to have any effect |
16:50:40 | * | Andris_zbx quit (Read error: Connection reset by peer) |
16:58:55 | rokups | cheatfate: rest assured msvcrt is here for a loooooong stay... It was phased out with vc6. Its still there and windows components depend on it. |
17:00:10 | rokups | nim itself imports bunch of c stuff and since dll aint in import table it sure must be static linking |
17:02:42 | cheatfate | rokups, we are going to remove all this c stuff from windows code |
17:02:59 | cheatfate | and we are moving in this direction slowly |
17:03:15 | rokups | hmm i see, thats cool |
17:03:36 | rokups | no reason why setjmp/longjmp cant be bundled rly. it is already |
17:04:11 | * | yglukhov quit (Remote host closed the connection) |
17:05:52 | cheatfate | rokups, heh, if you can't do it why just not say, sorry but i can't do it |
17:06:35 | * | pregressive joined #nim |
17:07:17 | * | pregressive quit (Read error: Connection reset by peer) |
17:07:38 | * | pregressive joined #nim |
17:14:14 | rokups | what? |
17:19:33 | * | filcuc quit (Ping timeout: 276 seconds) |
17:22:32 | FromGitter | <zetashift> is there a reverse proc for Arrays? |
17:23:42 | Vladar | http://nim-lang.org/docs/algorithm.html#reverse,openArray[T],Natural,Natural |
17:24:14 | FromGitter | <zetashift> woop thanks! |
17:24:25 | FromGitter | <zetashift> looked at the wrong section in the docs area it seems |
17:25:25 | cheatfate | rokups, you wasted 1 hour of your and mine time on dispute about "is there reason on implementing setjmp/longjmp"... as i said there is a plans to remove msvcrt.dll dependency from nim, and we are implementing this plan. |
17:27:20 | rokups | didnt notice any dispute, thought you are just asking random questions. though you could have mentioned that plan from the start as i am not aware of whats going in development ¯\_(ツ)_/¯ |
17:29:14 | enthus1ast | noob question, remove msvcrt.dll means implementing c library functions in nim? |
17:29:55 | FromGitter | <PabClsn_twitter> hi guys just a stupid question how do you do a cin like in C++ ? |
17:30:04 | cheatfate | rokups, i dont see any `random` questions from me, if you think i'm just throwing random questions, then maybe i need to stop talk with you.. |
17:30:16 | FromGitter | <barcharcraz> @cheatfate msvcrt is NOT a system component. It's actually an internal dll that's not supposed to be used by non-system programs |
17:30:31 | rokups | jesus cheatfate chill. whats wrong with you |
17:30:36 | FromGitter | <barcharcraz> you're supposed to use the versioned ones, but ofc they are all ABI incompatible and require various redists |
17:31:04 | cheatfate | @barcharcraz, its why we want to remove dependency from msvcrt.dll, |
17:31:09 | FromGitter | <barcharcraz> yeah |
17:31:25 | FromGitter | <barcharcraz> the new "universal runtime" is a system component tho |
17:31:35 | FromGitter | <barcharcraz> but still, no reason nim needs to depend on msvcrt |
17:31:39 | FromGitter | <barcharcraz> or any libc |
17:33:13 | cheatfate | enthus1ast, there not so many c library functions nim needs on windows... we need to replace FILE* functions and setjmp/longjmp |
17:33:39 | FromGitter | <barcharcraz> also note that you won't see C dll's in nim's import tables. Nim prefers to call dlopen and dlsym (LoadLibrary/whatever on windows) in NimMain |
17:34:32 | FromGitter | <PabClsn_twitter> hi guys just a stupid question how do you do a cin like in C++ with an int in user entry ?? |
17:34:47 | rokups | barcharcraz check out setjmp/longjmp implementation in glibc. noone will be willing to maintain that in nim. windows case is easy enough betcause its just x86/64. but for linux and other platforms avoiding libc would not make much sense |
17:34:51 | cheatfate | @barcharcraz everything Nim imports via dlopen/dlsym is core windows dlls, like (kernel32.dll/advapi32.dll/user32.dll/ws2_32.dll) |
17:35:34 | FromGitter | <barcharcraz> yeah, I mean on linux libc is DEFINATELY a system component |
17:36:46 | FromGitter | <barcharcraz> @PabClsn_twitter readLine(stdin) followed by parseInt (from strutils) |
17:37:21 | FromGitter | <barcharcraz> so something like: ⏎ import strutils ⏎ var inp = readline(stdin) ⏎ var int = inp.parseInt [https://gitter.im/nim-lang/Nim?at=5888e250074f7be76318a726] |
17:37:32 | FromGitter | <PabClsn_twitter> ok men thanks :) |
17:37:36 | FromGitter | <barcharcraz> or just: ⏎ import strutils ⏎ var inp = stdin.readline.parseint() |
17:37:38 | FromGitter | <barcharcraz> or something like that |
17:39:32 | FromGitter | <PabClsn_twitter> ok i try thx |
17:39:34 | * | cheatfate_ joined #nim |
17:42:34 | FromGitter | <PabClsn_twitter> I tried all the things you just gave me plus var question = readLine(stdin) ⏎ ⏎ var nbEtages = parseint(question) |
17:42:42 | FromGitter | <PabClsn_twitter> and it’s not working ... |
17:42:48 | * | cheatfate quit (Ping timeout: 256 seconds) |
17:43:28 | FromGitter | <PabClsn_twitter> it compile but when i write 5 for example and press return northing append |
17:43:41 | FromGitter | <PabClsn_twitter> like he was waiting for an other thing |
17:45:34 | FromGitter | <barcharcraz> I just tried that and it worked |
17:45:52 | FromGitter | <PabClsn_twitter> send me your line please ;) |
17:45:59 | FromGitter | <barcharcraz> import strutils ⏎ ⏎ var str = readline(stdin) ⏎ var t = parseInt(str) ⏎ echo str ... [https://gitter.im/nim-lang/Nim?at=5888e455074f7be76318b3cf] |
17:46:21 | FromGitter | <PabClsn_twitter> ok thanks |
17:47:08 | FromGitter | <PabClsn_twitter> did you use like terminal or sublime text ? |
17:47:16 | FromGitter | <barcharcraz> I use vscode |
17:47:25 | FromGitter | <barcharcraz> I hear the sublime addon is good |
17:47:42 | FromGitter | <PabClsn_twitter> ok thats strange because i copy past your lines and nothing is happening |
17:47:44 | FromGitter | <barcharcraz> I wish code could highlight stuff like sql""" SELECT * FROM lol""" as SQL |
17:48:08 | FromGitter | <barcharcraz> are you in secret or something? |
17:48:15 | FromGitter | <PabClsn_twitter> secret what ? |
17:48:19 | FromGitter | <barcharcraz> never mind |
17:48:29 | FromGitter | <barcharcraz> (it's the nimvm rpel) |
17:48:34 | FromGitter | <barcharcraz> and it's not supported |
17:48:54 | FromGitter | <PabClsn_twitter> i’m just a noob i’m not understanding that ;) |
17:49:00 | FromGitter | <barcharcraz> don't worry about it |
17:49:03 | * | cheatfate joined #nim |
17:49:04 | FromGitter | <PabClsn_twitter> (https://files.gitter.im/nim-lang/Nim/zmTx/Capture-d__cran-2017-01-25-_-18.48.24.png) |
17:49:22 | FromGitter | <PabClsn_twitter> it’s like he was waiting something else |
17:49:38 | enthus1ast | @barcharcraz in sublime one could "Set syntax SQL" maybe vs code can do the same. |
17:49:51 | * | cheatfate_ quit (Ping timeout: 245 seconds) |
17:50:18 | FromGitter | <barcharcraz> right but I want just the sql part highlighted |
17:50:26 | FromGitter | <barcharcraz> for when I embed queries into my application |
17:50:41 | FromGitter | <barcharcraz> it's a minor gripe |
17:51:10 | FromGitter | <barcharcraz> idk looks like the problem is not in your int parsing code pablo |
17:51:16 | * | nsf joined #nim |
17:51:51 | FromGitter | <PabClsn_twitter> ok it’s sublime text |
17:52:02 | FromGitter | <PabClsn_twitter> i tried with a term and it’s working $ |
17:52:07 | FromGitter | <barcharcraz> oh yeah |
17:52:10 | FromGitter | <barcharcraz> that could do it |
17:53:11 | FromGitter | <PabClsn_twitter> (https://files.gitter.im/nim-lang/Nim/HgW5/Capture-d__cran-2017-01-25-_-18.52.48.png) |
17:53:15 | enthus1ast | @barcharcraz switching back and forth sql and nim does the trick for me |
17:53:39 | FromGitter | <PabClsn_twitter> you know if there is a trick to making the user entry work in Sublime ?$ |
17:54:15 | FromGitter | <barcharcraz> probably not, maybe a terminal plugin or something |
17:54:17 | FromGitter | <barcharcraz> idk |
17:54:25 | * | hcorion joined #nim |
17:55:33 | FromGitter | <PabClsn_twitter> and an other question is there a way to give the binary file parameters like in c with main(int arg, int **argv) ? |
17:56:02 | FromGitter | <barcharcraz> yes |
17:56:27 | FromGitter | <PabClsn_twitter> you know how , |
17:56:29 | FromGitter | <PabClsn_twitter> ?? |
17:57:21 | FromGitter | <Varriount> @PabClsn_twitter The sublime syntax language makes dynamic embedding of other syntaxes within another nearly impossible |
17:57:54 | FromGitter | <barcharcraz> @Varriount but I've never seen any other editors do it at all |
17:58:18 | enthus1ast | @PabClsn_twitter paramStr from os module |
17:59:01 | FromGitter | <barcharcraz> and paramCount |
17:59:09 | FromGitter | <Varriount> Do what at all? |
17:59:17 | FromGitter | <PabClsn_twitter> ok thanks :) @Varriount |
17:59:27 | FromGitter | <barcharcraz> highlight different languages in different parts of a file |
18:01:43 | enthus1ast | by the way, i have strange issue with sublime plugin, it opens "thousands" of nimlime tabs, seen that before? |
18:01:58 | FromGitter | <PabClsn_twitter> nop never for me |
18:02:28 | FromGitter | <Varriount> Oh gosh, not again. |
18:02:35 | FromGitter | <barcharcraz> lol |
18:02:39 | enthus1ast | maybe its just me |
18:02:42 | enthus1ast | or old version |
18:03:00 | FromGitter | <Varriount> I can never seem to reproduce that bug |
18:03:04 | FromGitter | <Varriount> Have you updated? What version are you using? |
18:03:47 | enthus1ast | 1.2.11 |
18:04:35 | enthus1ast | sublime tells me its the newest version |
18:04:47 | FromGitter | <Varriount> Also: http://forum.nim-lang.org/t/2733 |
18:05:05 | FromGitter | <Varriount> @PabClsn_twitter What version are you using, and what operating system? |
18:05:09 | * | yglukhov joined #nim |
18:05:14 | FromGitter | <Varriount> enthus1ast: What OS are you using? |
18:05:50 | enthus1ast | win7 32bit |
18:06:00 | FromGitter | <PabClsn_twitter> how do i get the version in sublime i’m pretty new to this one |
18:06:06 | FromGitter | <PabClsn_twitter> and I’m on macOS |
18:06:57 | Araq | varriount: how hard is it to get the plugin to work on OSX? |
18:07:09 | FromGitter | <PabClsn_twitter> when i update the Sublime package nothing is happening so i guess the last one :) |
18:07:50 | FromGitter | <Varriount> Araq: It's Python-based Sublime Text plugin, so it should be as easy as a regular plugin. |
18:08:01 | FromGitter | <Varriount> The only catch is when using Nimsuggest |
18:08:03 | FromGitter | <PabClsn_twitter> euh the plugins well i follow the tutorial but with macOS i made an alias in bash_profile or bashrc to lauch sublime with an option |
18:08:08 | * | krux02 quit (Remote host closed the connection) |
18:08:25 | FromGitter | <PabClsn_twitter> alias sub='open -a "/Applications/Sublime Text.app" |
18:08:46 | FromGitter | <Varriount> enthus1ast: Can you give me a gist of your PATH variable and the NimLime settings file? |
18:08:53 | FromGitter | <PabClsn_twitter> someone gave me this tip beacuse i had a permissions denied when run nim compiler |
18:09:19 | FromGitter | <PabClsn_twitter> whats nim suggest ? |
18:09:23 | * | yglukhov quit (Ping timeout: 240 seconds) |
18:09:38 | FromGitter | <PabClsn_twitter> just a help to code like other ide ? |
18:09:44 | FromGitter | <Varriount> Yes. |
18:09:56 | dom96 | niv: planned but not in the short term. |
18:10:06 | FromGitter | <PabClsn_twitter> ah ok nice how do you install it with sublim ? |
18:10:34 | FromGitter | <Varriount> @PabClsn_twitter You won't want to. NimLime support is very experimental/unfinished. |
18:10:49 | FromGitter | <PabClsn_twitter> ah ok |
18:11:08 | dom96 | endragor: https://github.com/dom96/nim-in-action-code/blob/master/Chapter3/ChatApp/src/client.nim#L42 |
18:11:18 | FromGitter | <PabClsn_twitter> ah i didn’t check that you were the guy who did NimLime |
18:11:30 | FromGitter | <PabClsn_twitter> good job |
18:11:58 | FromGitter | <Varriount> @PabClsn_twitter Not a good enough job, unfortunately. |
18:12:27 | FromGitter | <Varriount> It needs another maintainer, as I won't have the time to develop for another year and a half. |
18:12:43 | enthus1ast | Varriount https://gist.github.com/enthus1ast/0b29d54e7a6c6e7c50a3470ad45efde5 |
18:12:47 | FromGitter | <PabClsn_twitter> no one can update your work ? |
18:13:20 | FromGitter | <barcharcraz> getting editor plugins to work well is actually really hard task |
18:13:44 | FromGitter | <Varriount> @PabClsn_twitter It's not that, no one has volunteered. |
18:14:01 | enthus1ast | the only thing i'm really useing is run/build .... |
18:14:07 | FromGitter | <PabClsn_twitter> to be honnest with you i can’t help you on this one ;) |
18:16:28 | FromGitter | <Varriount> enthus1ast: When do the tabs open? On save? |
18:16:31 | FromGitter | <PabClsn_twitter> there is nimEdit well it’s pretty ugly for now |
18:16:48 | FromGitter | <PabClsn_twitter> for now your plugin is the best i found |
18:16:49 | FromGitter | <Varriount> @PabClsn_twitter I like NimEdit, it's different. |
18:17:17 | FromGitter | <PabClsn_twitter> it’s very ugly and with macOS i have trouble running it well |
18:17:25 | enthus1ast | when NimEdit got multiple cursor support i'll give it another try : ) |
18:19:11 | FromGitter | <Varriount> (Psst, NimEdit is written by Araq) |
18:19:52 | enthus1ast | hey Araq multiple cursors are cool : ) |
18:20:39 | enthus1ast | mhhh i've closed the thousand tabs now, but its not opening it again |
18:21:12 | enthus1ast | if it does again i'll tell you what i have exactly done |
18:21:15 | FromGitter | <Varriount> enthus1ast: Does it open them all at once, or one at a time? |
18:21:24 | enthus1ast | one at a time |
18:21:55 | FromGitter | <Varriount> enthus1ast: This is the most annoying thing. Plugins like this are very hard to unit test, and bug reports are mostly a guessing game. |
18:22:07 | FromGitter | <PabClsn_twitter> Thanks Araq for the good job for now :) |
18:23:21 | GaveUp | Araq: is there an issue logged for that template/case quirk? |
18:24:38 | enthus1ast | Varriount, i still enoy useing it. |
18:24:43 | enthus1ast | enjoy |
18:25:05 | FromGitter | <Varriount> enthus1ast: I'm glad somebody does. I just wish I had time to work on it. |
18:28:11 | * | enthus1ast is now known as enthus1ast|trave |
18:40:33 | * | couven92 quit (Quit: Client disconnecting) |
18:45:27 | Araq | GaveUp: no, report it please |
18:46:14 | * | hendi joined #nim |
18:46:37 | Araq | yes yes yes, once NimEdit compiles again (*cough* compiler API changes) |
18:46:41 | Araq | I shall open source it |
18:46:55 | Araq | it's MIT anyway, I can always sell it later :P |
18:55:19 | * | yglukhov joined #nim |
18:57:10 | * | hendi_ joined #nim |
18:57:42 | * | hendi quit (Ping timeout: 276 seconds) |
18:59:30 | * | yglukhov quit (Ping timeout: 240 seconds) |
19:01:19 | * | Kingsquee quit (Excess Flood) |
19:01:40 | * | yglukhov joined #nim |
19:01:44 | * | Kingsquee joined #nim |
19:06:42 | * | RushPL joined #nim |
19:07:01 | * | yglukhov quit (Remote host closed the connection) |
19:16:16 | * | couven92 joined #nim |
19:17:10 | * | hendi_ quit (Ping timeout: 240 seconds) |
19:17:44 | * | couven92 quit (Client Quit) |
19:18:02 | * | couven92 joined #nim |
19:20:59 | * | kulelu88 joined #nim |
19:22:47 | * | gmpreussner quit (Ping timeout: 248 seconds) |
19:28:12 | * | yglukhov joined #nim |
19:28:40 | FromGitter | <zacharycarter> @Araq I'm guessing creating the wrapper for Urho3d was not trivial? Do you think attempting to update the wrapper to the latest version of Urho3d is something that'd be worth trying to do? |
19:28:48 | FromGitter | <zacharycarter> If so I might try my hand at it |
19:29:14 | Araq | the wrapper has been updated to support 1.6 iirc |
19:29:21 | Araq | what's the current version? |
19:29:24 | FromGitter | <zacharycarter> oooo okay sweet |
19:29:28 | FromGitter | <zacharycarter> I believe it is 1.6 |
19:30:18 | FromGitter | <barcharcraz> the included urho folder is labeled as 1.3 |
19:31:28 | Araq | hmmm, no sorry |
19:31:34 | Araq | I updated it to 1.4 |
19:31:36 | FromGitter | <zacharycarter> 1) 4 right |
19:31:37 | FromGitter | <zacharycarter> yeah |
19:32:10 | Araq | not sure about 1.5 and 1.6, but since it's C++ wrapped you get nice compile-time errors |
19:32:34 | FromGitter | <zacharycarter> okay I'll start digging |
19:32:42 | FromGitter | <zacharycarter> seems like the best option atm for cross platform 2d / 3d dev until - https://github.com/yglukhov/rod/tree/master/rod matures |
19:33:07 | * | gmpreussner joined #nim |
19:34:44 | * | bjz joined #nim |
19:35:59 | Araq | if you have the choice. |
19:36:19 | Araq | I would pick any half finished Nim project over a massive C++ project. |
19:36:43 | FromGitter | <zacharycarter> okay |
19:36:52 | FromGitter | <zetashift> especially for games! |
19:37:04 | FromGitter | <zetashift> Unreal Nim is one of my favorites |
19:37:19 | Araq | :P |
19:37:23 | FromGitter | <zacharycarter> well that's still using a massive C++ project :D |
19:37:48 | FromGitter | <zacharycarter> rod seems cool I just need to figure out how to run it :/ |
19:42:06 | * | demi- joined #nim |
19:42:50 | FromGitter | <zetashift> Unreal C++ is quite nice to work with tho since it is garbage collected |
19:44:57 | FromGitter | <zacharycarter> Unfortunately for me UE4 is not an option |
20:05:15 | cheatfate | Araq, i have one `half` finished :) |
20:05:22 | cheatfate | Araq, i have 2 `half` finished :) |
20:11:10 | Araq | congrats. |
20:15:29 | FromGitter | <khchen> hello, everybody |
20:15:36 | FromGitter | <zacharycarter> hello |
20:17:58 | Amun_Ra | moin |
20:21:47 | FromGitter | <khchen> @Varriount |
20:22:14 | FromGitter | <khchen> Is @Varriount still here? |
20:22:56 | dom96 | hey Calinou, you around? |
20:23:49 | * | Guest8182 joined #nim |
20:26:31 | FromGitter | <barcharcraz> so it seems to me we should be able to do an unreal binding |
20:26:38 | FromGitter | <barcharcraz> like even without wrapping the C++ |
20:27:03 | FromGitter | <barcharcraz> figure out wtf UHT is doing then do that ourselves |
20:27:18 | FromGitter | <barcharcraz> and I /think/ they define something of an ABI |
20:29:43 | Araq | "able to do"? it exists and is used for commercial game development |
20:29:47 | * | sz0 quit (Quit: Connection closed for inactivity) |
20:32:03 | Calinou | hey dom96 |
20:32:13 | Calinou | tomorrow I have a seminar on "corporate social networks", which lasts all day |
20:32:31 | FromGitter | <barcharcraz> oh my gosh |
20:32:33 | FromGitter | <barcharcraz> wonderful |
20:32:35 | Calinou | :/ |
20:32:36 | FromGitter | <barcharcraz> did not know about that |
20:33:13 | * | Trioxin joined #nim |
20:33:23 | * | Guest8182 quit (Ping timeout: 264 seconds) |
20:33:51 | dom96 | Calinou: bah |
20:33:54 | * | hcorion quit (Quit: Konversation terminated!) |
20:33:57 | * | devted joined #nim |
20:34:10 | dom96 | Calinou: Any ideas when you'll have time to finish off the website? |
20:34:51 | Calinou | a few pages are remaining, according to https://github.com/nim-lang/website/issues/4 which I created |
20:34:55 | Calinou | (if I missed some, please add them) |
20:39:04 | * | bjz_ joined #nim |
20:39:59 | * | bjz quit (Ping timeout: 255 seconds) |
20:42:05 | * | rokups quit (Quit: Connection closed for inactivity) |
20:42:27 | * | hendi_ joined #nim |
20:42:48 | * | yglukhov quit (Read error: Connection reset by peer) |
20:43:14 | * | yglukhov joined #nim |
20:48:38 | * | vlad1777d quit (Quit: Leaving) |
20:52:37 | FromGitter | <Varriount> @wiffel Yes? |
20:52:46 | FromGitter | <Varriount> @khchen Yes? |
20:55:06 | * | vlad1777d joined #nim |
20:56:01 | FromGitter | <zacharycarter> @barcharcraz https://github.com/pragmagic/nimue4 |
21:01:41 | * | vlad1777d quit (Remote host closed the connection) |
21:04:18 | * | vlad1777d joined #nim |
21:05:38 | * | krux02 joined #nim |
21:10:15 | krux02 | Araq: I have a nasty bug for you, I just posted it in the issue tracker |
21:10:27 | * | synshroud quit (Ping timeout: 252 seconds) |
21:10:38 | * | synshroud joined #nim |
21:12:40 | Calinou | dom96: do we know what will happen to the forum, too? |
21:17:00 | dom96 | Calinou: I will likely create a new design for that based on yours. |
21:17:05 | Araq | krux02: I don't think you know what "nasty bug" means |
21:17:08 | Araq | :D |
21:18:01 | krux02 | It least is was very nasty to actually get to know what was causing the bug |
21:18:21 | krux02 | so may times the bug just slipped away when I was doing modifications that I assumed to be harmless |
21:18:40 | FromGitter | <Varriount> Sounds like memory corruption |
21:20:16 | Araq | nah, it's just signature hasing |
21:20:19 | Araq | *hashing |
21:25:33 | * | lenstr joined #nim |
21:32:59 | * | hendi_ quit (Quit: hendi_) |
21:38:52 | krux02 | Araq: I am not sure if it is just signature hashing |
21:39:53 | krux02 | It is not that my code doesn't work generally, it is that it needs this very explicit state to be in, so that the error occurs. |
21:56:19 | Araq | two identifiers are mapped to the same name |
21:56:27 | Araq | that's signature hashing. |
22:04:03 | * | synshroud quit (Ping timeout: 240 seconds) |
22:06:14 | * | synshroud joined #nim |
22:06:48 | * | rupil quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
22:08:33 | * | Vladar quit (Quit: Leaving) |
22:14:30 | euantor | Regarding https://github.com/nim-lang/Nim/pull/5280 - this would be useful to me, but would maybe be better named `getOrElse` to prevent clashing with the tables API |
22:24:47 | Araq | it's getOrDefault because that's what was choosen |
22:25:37 | Araq | and it doesn't "clash" with the tables API, it is consistent with the tables API |
22:27:56 | Araq | and it should remain consistent because many people think that's the most important thing in the world |
22:28:36 | krux02 | not as important, as "it works at all", but still pretty important |
22:30:00 | krux02 | I like consistency, it removes cognitive load |
22:30:16 | Araq | only if you notice it. |
22:30:19 | krux02 | feels satisfying when it is so consistent |
22:30:20 | euantor | I meant the new version where you can pass a default value Araq |
22:30:43 | euantor | So the existing `getOrDefault` remains, returning the default type for the value stored (e.g.: empty string) |
22:30:45 | Araq | euantor: well the obvious solution is that every getOrDefault should actually support a default value .... |
22:30:59 | Araq | makes sense, doesn't it? |
22:31:02 | euantor | Yes, that would be the obvious approach |
22:31:05 | dom96 | indeed, there is no reason to create a new proc just for that. |
22:31:18 | dom96 | That said, I do think the proc should be renamed to just `get`. |
22:31:31 | euantor | I thought you were opposed to changing the signature of getOrDefault(), but obviously read your comment wrong |
22:31:36 | dom96 | but meh |
22:31:49 | dom96 | it's not important right now, `getOrDefault` can stay |
22:31:55 | euantor | I would personally expect `get` to error on a key not existing |
22:32:03 | Araq | dom96: .get vs [] is pretty subtle though |
22:32:29 | Araq | and tables support both. |
22:32:30 | krux02 | not sure with the just get, I mean there is still people who would expecet a panic when the key is not found |
22:32:56 | Araq | personally I never use the version that raises, I think |
22:33:12 | dom96 | This is how it works in Python though IIRC |
22:33:15 | Araq | except when it's the 'var' version, that one has to raise |
22:33:24 | krux02 | bth I like the name geOrElse it is consistent with the programming language scala ;P |
22:33:33 | dom96 | So I would say that people would have a good understanding of `[]` vs. `get` coming from Python |
22:34:08 | dom96 | and yeah, `getOrDefault` is common |
22:34:14 | dom96 | It doesn't make sense for it to be this long |
22:34:33 | krux02 | I never wrote Python, do I need to be ashamed? |
22:34:36 | Araq | I don't want to rename it |
22:34:41 | Araq | it's lots of work. |
22:34:51 | Araq | toUpperAscii already is so annoying |
22:35:02 | krux02 | realls so annoying? |
22:35:10 | krux02 | it could be done in sed |
22:35:25 | Araq | I can do it with nimgrep |
22:35:28 | Araq | not the point. |
22:35:41 | Araq | to automate I need to find all my Nim projects first |
22:35:49 | Araq | on 3 different machines |
22:35:52 | krux02 | people might hate it that they need to update their codebase |
22:36:00 | Araq | yup. I do. |
22:36:17 | Araq | pointless work, doesn't improve anything. |
22:36:51 | krux02 | I imagine the programming language of the future to be able to change the names of its api functions without breaking any old code |
22:37:16 | Araq | we don't break it, we generate "nice" deprecation warnings |
22:37:25 | krux02 | yay,... |
22:37:27 | Araq | that you even can turn off. |
22:37:36 | krux02 | yay again |
22:37:38 | Araq | but the problems remain. |
22:37:43 | dom96 | Araq: okay, we can save the rename for the future |
22:37:49 | Araq | it creates work. |
22:37:55 | krux02 | future us will be thankful |
22:38:09 | dom96 | *we can save the rename for maybe the future |
22:38:19 | * | APT69 joined #nim |
22:39:24 | Araq | we should have added 'def' as "common" abbrev for "default" and picked "getOrDef" |
22:39:34 | Araq | that would be the most Nim'ish solution |
22:39:40 | Araq | but we didn't. |
22:39:43 | krux02 | def? |
22:40:22 | Araq | and then krux02 would have told us that 'Else' is only 1 char longer and no abbrev so 'getOrElse' is best |
22:40:46 | krux02 | Ok to be honest, I think getOrDefault could be a bit shorter, but it is really not that important, and it is very readable, so I would just stick to it |
22:41:01 | krux02 | there is no objective reason to change to anything else |
22:41:11 | Araq | good. |
22:41:30 | Araq | could always overload {} for this. |
22:41:44 | Araq | tab{"foo"} |
22:41:55 | krux02 | and who should know that {} means that? |
22:42:19 | Araq | did I mention that the {} accessor is one of my favorite features? |
22:42:31 | * | Trustable quit (Remote host closed the connection) |
22:42:41 | krux02 | I don't think so |
22:43:08 | krux02 | I remember that you once recommended me to use it for something, but I forgot what it was |
22:43:20 | Araq | lol |
22:43:24 | euantor | Please not `{}` |
22:43:54 | Araq | calm down, it won't make it into the stdlib |
22:44:18 | Araq | but as a personal shortcut I might use it in my non-stdlib code |
22:44:36 | euantor | I have a hard enough job remembering what day of the week it is, trying to remember or even notice a curly bracket means something else is a surefire way to make my brain explode |
22:44:50 | euantor | I like nice readable names that I have no chance of forgetting |
22:45:11 | euantor | like `stringIsNilOrEmpty` ;) |
22:45:21 | krux02 | when there is a useless feature that I want, to just make me feel better, but without any objective reasons to support them, then it is the tokens ¬ ∨ ∧ in the parser as alias for not or and |
22:45:30 | euantor | or `stringIsNilOrWhitespace` |
22:45:46 | krux02 | And I want it just because I can type those symbols |
22:47:13 | krux02 | euantor: I would recomment this name "proc isUseless(arg: string)" |
22:48:31 | euantor | I already managed to force it into strutils ;) Very similar to .NET's `string.IsNullOrEmpty` - any clues where I took the naming from? |
22:48:55 | Araq | ah so that was you... |
22:49:02 | Araq | I hate it :P |
22:49:05 | euantor | Or what I spend most of my time writing for work |
22:49:10 | euantor | And I love it ;) |
22:50:21 | Araq | euantor: (a, b) is already different from [a, b] and that is different from {a, b} and that holds for pretty much *every* language out there |
22:51:02 | Araq | so your argument makes no sense whatsoever to me. either your font clearly distinguishes between these or you should get glasses or ... |
22:51:24 | euantor | Yep, I'm used to seeing `{a,b}` with the braces marking scope. |
22:51:32 | euantor | And I have glasses, just maybe not good enough ones |
22:51:35 | Araq | even worse '.' is very different from ',' too |
22:51:39 | krux02 | I think the problem is, that strings can be nil. I don't like that strings can be nil |
22:51:42 | Araq | a,b a.b |
22:51:48 | Xe | euantor: https://blog.golang.org/go-fonts these fonts help me a lot |
22:52:18 | euantor | Xe: Thanks. I currently just use whatever the default font is in VS Code |
22:52:21 | Xe | krux02: it's something i miss when working without it |
22:53:02 | krux02 | Xe you want strings to have a valid nil state? |
22:53:03 | Xe | nil implies "no data" where as "" implies "blank data" |
22:53:29 | Xe | when working in go with error returns, you can see where this falls apart quickly |
22:53:30 | Araq | nil will eventually die anyway. it's days are numbered. |
22:53:31 | krux02 | Yes I know, but when is "no data" important? |
22:53:36 | Araq | *its |
22:53:37 | * | pregressive quit (Remote host closed the connection) |
22:53:38 | Xe | return "", err |
22:54:02 | Xe | krux02: when API calls have failed |
22:54:13 | * | pregressive joined #nim |
22:54:20 | Xe | it prevents the result from being processed, even accidentally |
22:54:28 | Araq | it's important for regexes, no match vs match of 0 length |
22:54:30 | krux02 | Xe: I think that can be much better solved with an equivalent to this type: https://doc.rust-lang.org/std/result/ |
22:54:46 | Araq | ^ that's true. |
22:55:15 | Xe | krux02: yeah, i was giving examples from real-world cases of writing shit in languages that don't have parameterized types (like go) |
22:56:00 | * | nsf quit (Quit: WeeChat 1.7) |
22:56:02 | Araq | you don't need parameterized types, but using a product type for a sum type is incredibly ignorant |
22:56:30 | Araq | it's one of these things only Go can get away with. |
22:56:41 | Xe | that's the difference between a sum type and a product type again? |
22:56:46 | krux02 | I wouldn't call it ignorant, but it is definitively not a good solution |
22:57:02 | Xe | what's* |
22:57:44 | krux02 | I think it is struct vs tagged enum |
22:58:35 | krux02 | you either have a result, or an error, but never both |
22:58:47 | krux02 | so you should not return an error and a result |
22:58:48 | * | pregressive quit (Ping timeout: 252 seconds) |
22:59:15 | krux02 | In go you have no choice, the language tells you to return both |
23:00:10 | * | APT69 quit (Read error: Connection reset by peer) |
23:00:26 | Xe | i'm very open to having things generically return "forall a. Either Error a" |
23:02:03 | krux02 | I am not sure what you mean by that |
23:03:39 | * | manjaroi3 joined #nim |
23:03:46 | dom96 | proc foo(): Either[A] |
23:03:50 | dom96 | Feel free to code like this |
23:04:47 | Xe | you can apply only one type to a generic type? |
23:06:21 | dom96 | nope |
23:06:25 | dom96 | Either[A, B] |
23:06:48 | Xe | also, can you limit things in nim like you can in haskell where `a => (Read a, Show a) -> String -> Either Error a` |
23:07:27 | Xe | this sets the constraint that the given argument a must instansiate the Read and Show typeclasses |
23:09:51 | dom96 | proc foo[A: Constraint, B: Blah](): Either[A, B] |
23:10:09 | dom96 | where Constraint is a concept |
23:10:48 | Xe | can concepts be combined? |
23:11:13 | Xe | so I could make ReadShow as a combination of Read and Show |
23:14:07 | Xe | https://github.com/vegansk/nimfp |
23:16:17 | dom96 | no idea |
23:16:25 | * | devted quit (Quit: Sleeping.) |
23:16:30 | Araq | sure why not? |
23:16:46 | Araq | concepts can "call" other concepts |
23:18:08 | krux02 | type ReadWrite = concept x: x is Read; x is Write |
23:18:39 | FromGitter | <zetashift> Is there a way to store each number from an int in an array?(Feel kinda dumb, might have made a mistake learning Nim after C#) |
23:18:47 | FromGitter | <zetashift> though I am enjoying |
23:18:54 | Xe | "store each number"? |
23:19:14 | Xe | oh i see |
23:19:19 | krux02 | zetashift: that's a tough job on 64 bit |
23:19:40 | krux02 | wait even on 32 bit it's impossible |
23:20:07 | FromGitter | <zetashift> like 999 and then an array of [9,9,9] |
23:20:09 | krux02 | there are too many, you don't have enough virtual memory to do that |
23:20:21 | krux02 | ah ok, you main the digits |
23:20:26 | krux02 | yes I know how to do that |
23:20:45 | FromGitter | <zetashift> Hehe could you tell me pretty please! :D |
23:21:23 | krux02 | x mod 10 ---> last digit |
23:21:38 | krux02 | x div 10 ---> number without the last digit |
23:21:45 | krux02 | rest is on your own |
23:22:27 | FromGitter | <zetashift> alright thanks |
23:31:47 | * | pregressive joined #nim |
23:35:36 | * | Snircle joined #nim |
23:37:29 | * | def-pri-pub joined #nim |
23:39:38 | * | arnetheduck joined #nim |
23:41:05 | * | vlad1777d quit (Quit: Leaving) |
23:45:39 | Araq | krux02: workaround rename the i for loop variable to ii |
23:46:06 | krux02 | ow, ok |
23:46:22 | krux02 | I will try it |
23:49:52 | krux02 | I should mention that in older versions of Nim, this did work without problems |
23:49:54 | * | pregressive quit (Remote host closed the connection) |
23:50:03 | * | Matthias247 quit (Read error: Connection reset by peer) |
23:50:30 | * | pregressive joined #nim |
23:53:52 | Araq | yes, signature hashing has its downsides |
23:54:08 | Araq | as I said, took months to get this feature right |
23:54:15 | Araq | and apparently it still isn't |
23:54:18 | krux02 | but it works now |
23:55:26 | Xe | Araq: signature hashing? |
23:55:34 | krux02 | no the workaround |
23:55:35 | * | pregressive quit (Ping timeout: 264 seconds) |
23:55:59 | krux02 | I initially removed the inline |
23:56:13 | krux02 | but I didn't like that as much as renaming the i |
23:56:29 | krux02 | I had no idea I could just rename it |
23:56:47 | krux02 | I thought it was just a bug that for some reasons that identifier got duplicated |
23:56:50 | Araq | the i bites with the i the for loop iterator uses |
23:57:03 | Araq | and usually conflicts are resolved |
23:57:19 | Araq | but not for this inline wrapped in a template instantiated in 2 modules |
23:57:20 | krux02 | what I think is so weird, is that even the templat that instanciates the proc itself is important |
23:57:31 | krux02 | without that, there is no problem anymore |
23:57:52 | Araq | sure the "path" that produces the identifier is important |
23:58:01 | Araq | it's what is used to generate a unique name |
23:59:17 | Araq | proper fix will take some time, I don't want to fix it, I will rewrite parts of the compiler to produce shorter names |
23:59:29 | Araq | which is better for debugging too |