| 00:02:07 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
| 00:02:20 | * | laaron quit (Remote host closed the connection) |
| 00:22:17 | * | laaron joined #nim |
| 00:29:04 | * | Hideki joined #nim |
| 00:33:50 | * | laaron quit (Remote host closed the connection) |
| 00:35:43 | * | laaron joined #nim |
| 00:37:33 | * | Hideki quit (Ping timeout: 258 seconds) |
| 01:45:56 | * | owl_000 joined #nim |
| 01:46:00 | * | owl_000 quit (Client Quit) |
| 02:01:58 | * | endragor joined #nim |
| 02:03:28 | * | theelous3 quit (Ping timeout: 246 seconds) |
| 02:15:47 | * | Hideki joined #nim |
| 02:18:13 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
| 02:18:46 | * | laaron joined #nim |
| 03:19:09 | * | Hideki quit (Ping timeout: 252 seconds) |
| 03:32:36 | * | owl_000 joined #nim |
| 03:34:20 | owl_000 | what is the use of `do` , the context is `panel.wEvent_Size do ():` |
| 03:40:03 | * | chemist69 quit (Ping timeout: 252 seconds) |
| 03:42:07 | * | chemist69 joined #nim |
| 03:50:43 | FromGitter | <Obround> How do you make multi-typed tables? |
| 04:01:50 | * | gangstacat quit (Quit: Ĝis!) |
| 04:46:17 | * | narimiran joined #nim |
| 04:50:06 | * | nsf joined #nim |
| 04:58:51 | * | enthus1ast quit (Ping timeout: 264 seconds) |
| 05:01:23 | * | gangstacat joined #nim |
| 05:05:39 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
| 05:07:57 | * | laaron joined #nim |
| 05:09:50 | lqdev[m] | Obround: what do you mean by that? |
| 05:12:30 | * | solitudesf joined #nim |
| 05:15:22 | * | enthus1ast joined #nim |
| 05:15:25 | * | drewr quit (Ping timeout: 276 seconds) |
| 05:28:02 | FromGitter | <awr1> @owl_000: `do` is an alternative syntax for procedure literals |
| 05:28:34 | * | drewr joined #nim |
| 05:29:45 | FromGitter | <awr1> it's possible that it could be deprecated in the future |
| 05:29:57 | FromGitter | <awr1> (although if you ask me i don't have a problem w/ it) |
| 05:32:42 | owl_000 | as you said it is an alternative, can you please show me an example contrasting this two. |
| 05:45:46 | FromGitter | <awr1> certainly: https://play.nim-lang.org/#ix=1U2a |
| 05:46:38 | FromGitter | <awr1> `do` is a little bit weirder, you use `-> ReturnType` and not `: ReturnType` |
| 05:46:45 | * | dddddd quit (Remote host closed the connection) |
| 06:09:47 | * | PMunch joined #nim |
| 06:14:52 | owl_000 | thanks that is great help, do this **WEIRD** |
| 06:15:02 | owl_000 | *is |
| 06:19:26 | lqdev[m] | I still prefer `do` instead of passing closures directly as params. |
| 06:19:36 | lqdev[m] | it just looks nicer imo. |
| 06:20:21 | lqdev[m] | and I can see the reasoning behind using ->, if that wasn't done we'd have an ambiguity in the syntax |
| 06:25:48 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
| 06:28:15 | * | laaron joined #nim |
| 06:56:43 | Zevv | where is do documented? |
| 06:56:51 | Zevv | I only see references to the quote-do combi |
| 06:59:30 | * | krux02 joined #nim |
| 07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
| 07:04:17 | * | gmpreussner joined #nim |
| 07:06:27 | PMunch | Zevv, can't find any documentation for it, but essentially do passes a block of code to a macro. It can be used to pass two blocks of code to a single macro http://ix.io/1U2h/Nim |
| 07:06:43 | PMunch | Not entirely sure why it's used so much with "quote" though.. |
| 07:07:47 | Zevv | because the docs say so. I quote without do every now and then |
| 07:08:07 | Zevv | what two blocks to a macro! |
| 07:08:31 | PMunch | Yeah I've done that as well, I wonder if there actually is a difference between "do" and a simple ":" |
| 07:08:36 | Zevv | i have uses for that! |
| 07:09:20 | PMunch | Yes, two blocks :) Quite helpful if you want to emit something like an if/else statement and want to be able to pass two chunks of code |
| 07:10:06 | FromGitter | <arnetheduck> well you can use `do` without `quote` and `quote` without `do`.. ergo `do` is just one more way of doing the same thing, with different syntax giving you choice that you can argue about in style guides |
| 07:11:03 | PMunch | Well do has a use case when passing multiple blocks |
| 07:11:28 | PMunch | I just don't see if `do` does anything different in a call |
| 07:11:54 | * | ng0 joined #nim |
| 07:14:11 | FromGitter | <arnetheduck> you can pass multiple procs without do too: https://play.nim-lang.org/#ix=1U2j |
| 07:14:51 | PMunch | Oh, I've never seen do used for passing procs before :S |
| 07:16:15 | * | drewr quit (Ping timeout: 264 seconds) |
| 07:16:36 | FromGitter | <arnetheduck> it's just an alternate and limited syntax for `proc` |
| 07:16:51 | * | Hideki joined #nim |
| 07:17:33 | PMunch | https://play.nim-lang.org/#ix=1U2l I've only seen it used like this, to pass two blocks of statements to a template/macro |
| 07:18:50 | FromGitter | <arnetheduck> you can go nuts with that too: https://play.nim-lang.org/#ix=1U2m |
| 07:18:58 | PMunch | Unfortunately the do keyword isn't always obvious when you create your own macro. Take for example the case where you want to wrap a try/catch with some extra logic. You might want to have a "do this if everything went well" block and a "do this in case it failed". When you call this you will just pass two "do" blocks, and it isn't obvious what happens with which block. |
| 07:19:34 | PMunch | Oh yeah, you can pass as many as you like |
| 07:20:50 | FromGitter | <arnetheduck> anyway, there are some special extra rules with do, true |
| 07:21:20 | * | Hideki quit (Ping timeout: 244 seconds) |
| 07:21:47 | PMunch | What are they? |
| 07:21:47 | FromGitter | <arnetheduck> another way: https://play.nim-lang.org/#ix=1U2n |
| 07:22:06 | PMunch | Oh yeah, but that doesn't work for longer blocks |
| 07:24:07 | FromGitter | <arnetheduck> https://play.nim-lang.org/#ix=1U2p |
| 07:25:11 | PMunch | Well that just looks ugly :P |
| 07:25:59 | PMunch | And basides that is no longer the same ast |
| 07:26:11 | FromGitter | <arnetheduck> yeah so that's the magic of the do keyword |
| 07:26:33 | PMunch | If you look at the compile output of this you can see the block statement: https://play.nim-lang.org/#ix=1U2s |
| 07:26:48 | PMunch | Not that it would usually make a lot of difference, but it might in some special cases |
| 07:27:41 | PMunch | Yeah but I was thinking there might be some difference between "quote:" and "quote do:" for example, or if that was purely a stylistic choice by whoever wrote the documentation for quote |
| 07:28:53 | FromGitter | <arnetheduck> lol, right, that's beyond my intuition for `do` |
| 07:31:11 | owl_000 | total unintuitive |
| 07:31:37 | * | drewr joined #nim |
| 07:34:38 | FromGitter | <arnetheduck> well, that and macros in general allow you to construct ast's that are outside the "normal" rules of the parsed language.. this is quite annoying when doing a backend because nodes appear randomly in the tree where they don't belong - the c backend is pretty liberal about this and doesn't care for example that unreachable code is being generated, but in llvm, one has to explicitly deal with it |
| 07:36:29 | PMunch | Oh really? How strict is it with its definition of unreachable? |
| 07:50:14 | FromGitter | <arnetheduck> well.. you have to end each block with a particular terminator that says what to do after the block - one such terminator is `unreachable` meaning that you have to admit you won't be going there.. most often, this is after `noreturn` procs like `quit` - but it also happens with weird ast:s - for example, you might have something which looks like an expression on the right-hand side but the last ast entry doesn't |
| 07:50:14 | FromGitter | ... have a type - the language would prevent you from doing it, but when you're editing the ast manually in a macro, anything goes |
| 07:50:24 | livcd | hmm how come i get the warn in the same line like inf with chronicles ? https://glot.io/snippets/fflmgwghrv |
| 07:50:35 | FromGitter | <arnetheduck> often happens with template expansions |
| 07:51:21 | FromGitter | <arnetheduck> livcd - threads or unix line endings on windows? |
| 07:53:46 | livcd | hmm no threads that I am spawning |
| 07:54:03 | livcd | This is on windows i am not sure where would the unix line endigs come from |
| 07:54:21 | PMunch | arnetheduck, but wouldn't those things be caught by the Nim compiler step before codegen? |
| 07:54:30 | PMunch | Or are those interleaved? |
| 07:59:28 | FromGitter | <arnetheduck> @PMunch well, a lot of them are arguably bugs that would be prevented if ast node construction was checked correctly, but it's not - there are no rules for what goes into an ast node really - does an `nkAssign` have to have an rhs with a value? logically yes, but in the nim ast, not really - anything goes as long as the c codegen swallows it |
| 08:00:50 | PMunch | Well a value or something that resolves to a value, which might be hard to check.. |
| 08:12:39 | * | drewr quit (Ping timeout: 264 seconds) |
| 08:26:17 | * | alexander92 joined #nim |
| 08:26:33 | lqdev[m] | Zevv: it's in the experimental manual |
| 08:27:35 | * | drewr joined #nim |
| 08:27:51 | Zevv | ah right, thanks |
| 08:29:39 | FromGitter | <arnetheduck> @PMunch and sometimes for example the backend receives somethingl like a `nkStmtList` instead, where the actual rhs expression is one of the elements in the statement list - this doesn't make logical sense in the ast but the C backend swallows it because of how it's structured.. |
| 08:35:04 | livcd | arnetheduck: any other idea you can think of ? |
| 08:36:33 | FromGitter | <arnetheduck> @livcd not really - and we use chronicles extensively and I've never seen that so.. |
| 08:38:11 | livcd | You are probably running it only on linux right ? |
| 08:38:22 | FromGitter | <arnetheduck> nope |
| 08:39:24 | livcd | uhm |
| 08:39:54 | alexander92 | i also dont have chronicles issues |
| 08:41:39 | FromGitter | <arnetheduck> we run/test on win/linux/mac 32+64bit |
| 08:43:41 | FromGitter | <arnetheduck> but like mentioned, it's quite possible that we use unix line endings all over - I meaneven `notepad` has learned to deal with that (in 2018!) |
| 08:46:23 | livcd | I think i see it. |
| 08:46:56 | livcd | I have been doing: info "foo", exceptionMsg = scm.OpenService(foo) |
| 08:53:55 | FromGitter | <arnetheduck> uh, you don't want to do side effects inside the log statement, in general - log statements are removed from binary depending on compile flag |
| 08:54:26 | FromGitter | <arnetheduck> so if you compile that with logging disabled, `OpenService` will not be called |
| 08:57:27 | * | NimBot joined #nim |
| 09:14:54 | PMunch | Hmm, threadpool documentation links to the channel module, but the channel module has a note at the top reading: "Note: Channels are designed for the Thread type. They are unstable when used with spawn" |
| 09:15:22 | PMunch | What is this instability? It's still being run on a separate thread, no? |
| 09:15:40 | * | drewr quit (Ping timeout: 264 seconds) |
| 09:15:49 | * | alexander92 quit (Ping timeout: 258 seconds) |
| 09:17:23 | * | Hideki joined #nim |
| 09:18:42 | Araq | PMunch, people don't understand 'spawn' |
| 09:18:51 | Araq | or channels for that matter |
| 09:19:27 | PMunch | That's why I'm trying to understand them, so I can write my article series on the topic and help others understand it as well :) |
| 09:20:46 | PMunch | I would guess that spawn adds it as a task to a queue with a blacklisted thread (since it's not supposed to run on the calling thread), and then threads pick tasks from this queue and runs them? |
| 09:20:58 | PMunch | But I don't quite see why that wouldn't work with a channel.. |
| 09:21:48 | * | Hideki quit (Ping timeout: 252 seconds) |
| 09:27:15 | * | Vladar joined #nim |
| 09:30:13 | * | drewr joined #nim |
| 09:54:13 | * | actuallybatman quit (Ping timeout: 245 seconds) |
| 09:55:47 | livcd | arnetheduck: i know i was just thinking i would always do at least info :D |
| 09:57:11 | FromGitter | <arnetheduck> livcd: sure - "good luck" - just please never make that code public :) |
| 10:13:22 | PMunch | Araq, do you know why channels are unstable with spawn? |
| 10:15:53 | Araq | I don't really remember, but somebody found a way to write stupid code with it |
| 10:16:21 | PMunch | Well if it's stupid code it's not channels fault.. |
| 10:16:47 | Araq | ok, now I remember |
| 10:17:08 | PMunch | I only ask since a guy at work told me he had tried to do some stuff with spawn and had some questions about the GC and global memory. I mentioned channels and he said that they apparently didn't work with spawn |
| 10:17:20 | Araq | 'spawn' doesn't guarantee execution on a separate thread |
| 10:17:48 | Araq | the idea is that you can ignore the 'spawn's and still end up with a correct serial variant of the code |
| 10:17:54 | Araq | like "Cilk" does it. |
| 10:18:02 | PMunch | Oh, I thought that was the difference between spawn and spawnX |
| 10:18:14 | Araq | channels are fundamentally at odds with this idea |
| 10:18:22 | PMunch | Yeah, obviously |
| 10:18:33 | Araq | but yeah that's also about spawn and spawnX |
| 10:18:51 | PMunch | I mean the documentation for spawn says "Always spawns a new task, so that the call is never executed on the calling thread." |
| 10:19:02 | PMunch | So is that wrong? Or has something changed? |
| 10:19:22 | Araq | it's tricky |
| 10:19:51 | Araq | remember that we use a thread *pool* and so spawn can block if no thread of the pool is ready |
| 10:20:17 | PMunch | Yeah that makes sense |
| 10:20:42 | Araq | I think this blocking is enough to break people's assumptions about channels |
| 10:20:45 | PMunch | But it should still be executed on a separate thread once one becomes available, no? |
| 10:20:49 | PMunch | Ooh |
| 10:21:44 | PMunch | Well again, that's more about improper use of channels than an actual issue with them |
| 10:21:49 | Araq | in the past we had some deadlocks due to this |
| 10:22:01 | Araq | but since then 'spawn' has seen bugfixes, so I dunno |
| 10:22:16 | PMunch | Something that was waiting for data from a channel that was waiting to be spawn-ed |
| 10:22:30 | PMunch | Classic scenario |
| 10:24:22 | Zevv | araq: i understand untyped and overloading cant work if the candidates have the same number of argumens, but if i have two choices that differ in that, what is the reason that the compiler can not deduce which one to pick? |
| 10:24:58 | Araq | in theory it can work, the compiler is still not prepared to do this |
| 10:25:07 | Zevv | and it works ok with untypeds, but ntot with typedesc |
| 10:25:08 | Araq | it requires to undo some changes internally |
| 10:26:14 | Araq | Zevv, replace 'typedesc' by 'bool' and your snippet still fails |
| 10:26:52 | Zevv | ah ok. Well, I solved my initial problem diferently, so its not man issue anynyoanoymomore. thanskks |
| 10:32:15 | PMunch | Haha, Zevv why is your IRC client inserting backspace characters instead of removing a character? |
| 10:33:31 | * | laaron quit (Remote host closed the connection) |
| 10:33:38 | Zevv | Oh thats mosh messing up I think. My mobile was absurdly flakey |
| 10:35:48 | * | laaron joined #nim |
| 10:36:51 | * | laaron quit (Remote host closed the connection) |
| 10:41:28 | * | laaron joined #nim |
| 10:42:24 | * | laaron quit (Remote host closed the connection) |
| 10:44:48 | PMunch | federico3, I see that you're the one who added the line about channels being unstable with threadpool, do you remember why |
| 10:45:17 | federico3 | PMunch: where? |
| 10:46:26 | * | laaron joined #nim |
| 10:46:34 | livcd | arnetheduck: heh definitely |
| 10:47:38 | PMunch | federico3, github.com/nim-lang/Nim/blame/88a0edba4b1a3d535b54336fd589746add54e937/lib/system/channels.nim#L15 |
| 10:49:46 | federico3 | https://github.com/nim-lang/Nim/pull/10627 based on a conversation with Araq. I don't have an example handy but there are a lot of crashes around channels :-/ |
| 10:51:48 | PMunch | Hmm, I can't seem to find any examples.. |
| 10:58:04 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
| 10:59:24 | * | laaron joined #nim |
| 10:59:51 | * | laaron quit (Client Quit) |
| 11:01:22 | * | laaron joined #nim |
| 11:04:23 | * | laaron quit (Client Quit) |
| 11:06:39 | * | laaron joined #nim |
| 11:07:47 | * | Miguelngel[m] quit (Remote host closed the connection) |
| 11:07:56 | * | Demos[m] quit (Write error: Broken pipe) |
| 11:07:56 | * | LEdoian[m] quit (Write error: Connection reset by peer) |
| 11:08:00 | * | isaac[m] quit (Read error: Connection reset by peer) |
| 11:08:05 | * | yglukhov[m] quit (Write error: Connection reset by peer) |
| 11:08:09 | * | skrylar[m] quit (Remote host closed the connection) |
| 11:08:11 | * | GitterIntegratio quit (Write error: Connection reset by peer) |
| 11:08:12 | * | zielmicha[m]1 quit (Remote host closed the connection) |
| 11:08:12 | * | macsek1911[m] quit (Remote host closed the connection) |
| 11:08:12 | * | Connor[m] quit (Remote host closed the connection) |
| 11:08:13 | * | spymasterd[m] quit (Remote host closed the connection) |
| 11:08:13 | * | narimiran[m] quit (Write error: Connection reset by peer) |
| 11:08:13 | * | jaens[m] quit (Remote host closed the connection) |
| 11:08:14 | * | nergal[m] quit (Remote host closed the connection) |
| 11:08:15 | * | k0mpjut0r quit (Write error: Connection reset by peer) |
| 11:08:15 | * | planetis[m] quit (Remote host closed the connection) |
| 11:08:16 | * | encryptize[m] quit (Remote host closed the connection) |
| 11:08:18 | * | xomachine[m]1 quit (Read error: Connection reset by peer) |
| 11:08:18 | * | meff[m]1 quit (Write error: Connection reset by peer) |
| 11:08:19 | * | gh0st[m] quit (Write error: Connection reset by peer) |
| 11:08:22 | * | pigmej[m] quit (Remote host closed the connection) |
| 11:08:22 | * | TheManiac[m] quit (Write error: Connection reset by peer) |
| 11:08:23 | * | BitPuffin quit (Write error: Connection reset by peer) |
| 11:08:23 | * | lqdev[m] quit (Read error: Connection reset by peer) |
| 11:08:24 | * | leorize[m] quit (Read error: Connection reset by peer) |
| 11:08:38 | * | laaron quit (Client Quit) |
| 11:13:57 | * | lqdev[m] joined #nim |
| 11:14:41 | * | laaron joined #nim |
| 11:17:03 | * | nif quit (Quit: ...) |
| 11:17:12 | * | nif joined #nim |
| 11:37:21 | * | Demos[m] joined #nim |
| 11:37:21 | * | planetis[m] joined #nim |
| 11:37:21 | * | Connor[m] joined #nim |
| 11:37:21 | * | LEdoian[m] joined #nim |
| 11:37:21 | * | BitPuffin joined #nim |
| 11:37:21 | * | pigmej[m] joined #nim |
| 11:37:21 | * | GitterIntegratio joined #nim |
| 11:37:21 | * | k0mpjut0r joined #nim |
| 11:37:22 | * | gh0st[m] joined #nim |
| 11:37:22 | * | jaens[m] joined #nim |
| 11:37:22 | * | isaac[m]1 joined #nim |
| 11:37:22 | * | nergal[m] joined #nim |
| 11:37:22 | * | leorize[m] joined #nim |
| 11:37:28 | * | xomachine[m] joined #nim |
| 11:37:28 | * | narimiran[m] joined #nim |
| 11:37:28 | * | spymasterd[m] joined #nim |
| 11:37:28 | * | Miguelngel[m] joined #nim |
| 11:37:29 | * | encryptize[m] joined #nim |
| 11:37:29 | * | meff[m] joined #nim |
| 11:37:30 | * | skrylar[m] joined #nim |
| 11:37:30 | * | macsek1911[m] joined #nim |
| 11:37:30 | * | zielmicha[m]1 joined #nim |
| 11:37:31 | * | yglukhov[m] joined #nim |
| 11:37:33 | * | TheManiac[m] joined #nim |
| 11:38:39 | livcd | Do I need to keep something in mind when compiling for Windows 2008 R2 ? |
| 11:39:27 | PMunch | Probably |
| 11:47:24 | * | alexander92 joined #nim |
| 11:53:37 | Zevv | hehe |
| 12:06:43 | * | drewr quit (Ping timeout: 250 seconds) |
| 12:39:20 | disruptek | lol |
| 12:53:41 | * | nsf quit (Quit: WeeChat 2.5) |
| 13:12:07 | * | jfoutaise quit (Ping timeout: 245 seconds) |
| 13:13:41 | * | actuallybatman joined #nim |
| 13:13:57 | * | jfoutaise joined #nim |
| 13:16:48 | * | endragor quit (Remote host closed the connection) |
| 13:18:06 | * | actuallybatman quit (Ping timeout: 258 seconds) |
| 13:19:21 | * | Hideki_ joined #nim |
| 13:23:23 | * | Hideki_ quit (Ping timeout: 245 seconds) |
| 13:24:17 | * | dddddd joined #nim |
| 13:35:40 | * | floppydh joined #nim |
| 13:37:57 | * | theelous3 joined #nim |
| 14:04:41 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
| 14:05:53 | * | laaron joined #nim |
| 14:09:25 | * | PMunch quit (Remote host closed the connection) |
| 14:10:14 | * | theelous3 quit (Read error: Connection reset by peer) |
| 14:24:16 | * | arecaceae quit (Remote host closed the connection) |
| 14:24:18 | * | Hideki_ joined #nim |
| 14:24:40 | * | arecaceae joined #nim |
| 14:28:06 | * | endragor joined #nim |
| 14:32:28 | * | endragor quit (Ping timeout: 246 seconds) |
| 14:37:39 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
| 14:38:29 | * | laaron joined #nim |
| 14:43:39 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
| 14:44:11 | * | laaron joined #nim |
| 15:03:57 | * | owl_000 quit (Ping timeout: 250 seconds) |
| 15:04:17 | * | Trustable joined #nim |
| 15:12:39 | * | clyybber joined #nim |
| 15:13:04 | * | clyybber quit (Client Quit) |
| 15:13:11 | * | clyybber joined #nim |
| 15:15:54 | clyybber | Araq: Why should mitems(someSinkParam) be allowed/required? |
| 15:17:31 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
| 15:18:25 | * | laaron joined #nim |
| 15:18:54 | * | laaron quit (Client Quit) |
| 15:19:47 | clyybber | Nevermind, ofc we need to reset the original loc |
| 15:19:55 | * | laaron joined #nim |
| 15:20:18 | clyybber | Bur this doesnt require mitems.. |
| 15:20:47 | clyybber | Hmm, treating sink like var when it isn't is not a good idea IMO |
| 15:21:10 | clyybber | IMO we should rather special case `move` |
| 15:21:30 | clyybber | As in change its signature |
| 15:21:56 | * | laaron quit (Remote host closed the connection) |
| 15:22:18 | * | laaron joined #nim |
| 15:23:39 | narimiran | dom96: are you here maybe? |
| 15:26:20 | * | Hideki_ quit (Remote host closed the connection) |
| 15:28:39 | clyybber | Nevermind all the above.. got confused |
| 15:28:41 | Araq | clyybber: I considered it but thought it would be worse |
| 15:28:56 | disruptek | c'mon ... https://github.com/nim-lang/Nim/pull/12100 |
| 15:29:01 | Araq | if 'sink T' means "I become the owner" then mutability makes sense |
| 15:29:28 | clyybber | Araq: Yeah, but we still dont pass sink by ref so it doesnt |
| 15:29:46 | * | Hideki_ joined #nim |
| 15:30:53 | Araq | we do pass a copy |
| 15:31:00 | Araq | which the callee then owns |
| 15:31:04 | Araq | it makes sense |
| 15:32:02 | Araq | disruptek: I don't see the harm in typeof(nil), system.nim needed it too |
| 15:33:08 | disruptek | the harm is that now we have procs that can return a type that is valid for any ref type. so much for type-checking. |
| 15:33:24 | disruptek | "needed" it? |
| 15:33:49 | clyybber | Araq: Ah, right. I was confused by my own =move work. The proc taking a sink paramter is responsible for its destruction right? |
| 15:34:07 | Araq | right |
| 15:34:07 | disruptek | can we have a special sigil "nilref" type, then? just for nil refs? |
| 15:34:12 | * | Hideki_ quit (Ping timeout: 245 seconds) |
| 15:36:17 | disruptek | s/nilref/noref/ maybe |
| 15:39:04 | clyybber | IMO it should be 'nil literal' |
| 15:39:20 | clyybber | Just like 'int literal' |
| 15:39:37 | disruptek | maybe it should be `null`. |
| 15:39:49 | Araq | the type of 'nil' is 'typeof(nil)'. |
| 15:40:19 | Araq | what are we discussing again? that you dislike the language extension or that you dislike how it's spelt? |
| 15:40:57 | clyybber | Araq: I think people are confused why typeof(nil) exists |
| 15:41:20 | disruptek | i hate the extension. i don't care how you spell it. |
| 15:41:24 | clyybber | So naming it nil literal could make it a bit more obvipus |
| 15:41:43 | Araq | proc `==`*(x: string; y: type(nil) | type(nil)): bool {. |
| 15:41:43 | Araq | error: "'nil' is now invalid for 'string'; compile with --nilseqs:on for a migration period".} = |
| 15:41:43 | Araq | discard |
| 15:41:58 | clyybber | disruptek: How else would you make nil a valid value for pointer and ref? |
| 15:42:03 | clyybber | And ptr |
| 15:42:06 | disruptek | a proc that returns nil returns a valid type for any ref. |
| 15:42:12 | Araq | don't ask why we needed the | here, but that's what system.nim uses |
| 15:42:13 | disruptek | nim worked fine a week ago. |
| 15:42:31 | Araq | disruptek: actually I agree that as a return type it's silly, gonna revert it |
| 15:42:41 | disruptek | thank you. |
| 15:42:43 | Araq | but the PR didn't introduce this feature |
| 15:43:16 | clyybber | What is 'a valid type for any ref' |
| 15:43:23 | disruptek | nil |
| 15:43:38 | clyybber | Yeah, but nil is also the value itself |
| 15:43:58 | clyybber | So it makes sense to call the type typeof(nil) or 'nil literal' |
| 15:43:59 | disruptek | we used to be able to rely upon typechecking to catch this, but now we cannot. |
| 15:44:39 | Araq | well I replied |
| 15:44:53 | clyybber | Are procs that return 'int literal' currently allowed |
| 15:44:55 | clyybber | ? |
| 15:45:16 | disruptek | not as such. |
| 15:45:55 | FromDiscord_ | <DeltaPHC> Hm. Unrelated, but how does newruntime and the destructors GC option relate to each other? Does one imply the other? |
| 15:45:55 | FromGitter | <mratsim> if they are compile-time procs |
| 15:46:04 | disruptek | that | in system is breaking my brain. |
| 15:46:19 | FromGitter | <mratsim> newruntime implies destructors but destructors does not imply newruntime |
| 15:46:20 | Araq | disruptek: it's a hack we can remove now |
| 15:46:45 | Araq | DeltaPHC: I'm writing the RFC as we speak but in a nutshell |
| 15:46:56 | FromDiscord_ | <DeltaPHC> Ah, alright |
| 15:47:16 | Araq | --gc:destructors # use what works best from 'newruntime' but don't introduced the 'owned ref T' business |
| 15:48:58 | Araq | in other words, use the new better strings and seqs |
| 15:49:34 | FromDiscord_ | <DeltaPHC> I see. I'm just trying to wrap my head around the new stuff and how everything works together |
| 15:49:54 | Zevv | breaks this though: http://ix.io/1U43 |
| 15:50:14 | Araq | what? huh? |
| 15:50:32 | Zevv | can't seem to pass a string as openArray[char] |
| 15:50:58 | Araq | with --newruntime or --gc:destructors? |
| 15:51:03 | Zevv | --gc:destructors |
| 15:51:36 | Araq | does it work with --newruntime? |
| 15:51:39 | Zevv | yes |
| 15:52:49 | Araq | interesting |
| 16:02:26 | * | Hideki_ joined #nim |
| 16:03:53 | Araq | Zevv: compiles for me |
| 16:03:59 | Zevv | wut? |
| 16:04:00 | clyybber | disruptek: Ok then I agree typeof(nil) should not be a valid return type either |
| 16:04:24 | Zevv | let me pull my nim, but I did that yesterday i believe |
| 16:04:37 | clyybber | disruptek: AFAICT there also isn't any usecase for returning typeof(nil) |
| 16:04:50 | Zevv | Araq: you're right, compiles now! |
| 16:11:22 | * | clyybber quit (Ping timeout: 258 seconds) |
| 16:12:37 | * | clyybber joined #nim |
| 16:14:53 | disruptek | the rational behind https://github.com/nim-lang/Nim/pull/12075 is that i'm generating code in which parameter arguments may clash with keywords. |
| 16:15:01 | * | sagax quit (Ping timeout: 246 seconds) |
| 16:15:36 | disruptek | to put this another way, i believe it's a bug that valid ast generates invalid syntax. |
| 16:20:53 | * | clyybber quit (Ping timeout: 245 seconds) |
| 16:22:06 | * | Hideki_ quit (Ping timeout: 258 seconds) |
| 16:23:03 | * | solitudesf- joined #nim |
| 16:24:05 | * | clyybber joined #nim |
| 16:25:28 | * | solitudesf quit (Ping timeout: 245 seconds) |
| 16:33:58 | * | lmariscal joined #nim |
| 16:45:36 | * | actuallybatman joined #nim |
| 16:45:52 | Araq | disruptek: ok but the tests are red so ... :P |
| 16:46:31 | disruptek | worked for me locally except for ic, but i will look. |
| 16:50:43 | * | Hideki_ joined #nim |
| 16:52:30 | * | Trustable quit (Remote host closed the connection) |
| 16:54:50 | * | Hideki_ quit (Ping timeout: 244 seconds) |
| 17:00:53 | * | alexander92 quit (Ping timeout: 245 seconds) |
| 17:06:16 | disruptek | i guess this exposes a problem with parsing at least one keyword (`is`) as used in runnableExamples. |
| 17:08:45 | FromGitter | <deech> I just pulled from `dev` and get the following when I do `./koch boot -d:release -d:nimDebugDlOpen`: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d6d4c9d375cc34fde02061d] |
| 17:09:08 | FromGitter | <deech> Why does the compiler have a runtime dependency on SQLite? |
| 17:18:11 | * | sagax joined #nim |
| 17:20:39 | Zevv | incremental compilation |
| 17:23:18 | FromGitter | <deech> Thanks! |
| 17:28:55 | FromGitter | <deech> I got it working but it doesn't show up as a dependency with `ldd` probably because it is hot-loaded. This will make reasoning about runtime dependencies quite difficult: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d6d5156b596011df4ee8d47] |
| 17:29:48 | Zevv | nim always handles libraries runtime instead of linking |
| 17:31:23 | FromGitter | <deech> I understand. I'm just saying I use `ldd` to figure out exactly what libraries a binary is using at runtime and `libsqlite.so` isn't showing up here. Maybe I' |
| 17:31:36 | FromGitter | <deech> 'm misunderstanding how `ldd` and Nim's hot loading works. |
| 17:33:55 | FromGitter | <mratsim> dlopen is not linked |
| 17:40:45 | * | mattmurr quit (Read error: Connection reset by peer) |
| 17:41:13 | * | mattmurr joined #nim |
| 17:45:06 | Araq | `ldd` doesn't work with anything anyway, Python, Ruby, ... they all use dlopen in their FFIs |
| 17:54:42 | shashlick | @Araq what do you think about compiling in sqlite |
| 17:55:25 | Araq | working on it |
| 17:55:47 | shashlick | https://github.com/nim-lang/Nim/issues/12097 |
| 17:56:09 | shashlick | my only question was whether it would have to be compiled in for nimfind, nimsuggest and other tools as well |
| 17:56:31 | shashlick | but doesn't seem like those tools will depend on that portion of the code |
| 18:02:27 | * | wildtrees joined #nim |
| 18:06:17 | Araq | it affects all of these tools |
| 18:18:01 | * | nsf joined #nim |
| 18:18:44 | shashlick | Ok then maybe compile it as a shared library |
| 18:21:42 | * | narimiran quit (Ping timeout: 245 seconds) |
| 18:21:55 | * | narimiran joined #nim |
| 18:25:15 | * | floppydh quit (Quit: WeeChat 2.5) |
| 18:33:52 | FromDiscord_ | <Shield> 0++........00000000000000000000000002 |
| 18:34:01 | FromGitter | <mratsim> C and C++ uses linking though |
| 18:34:10 | FromGitter | <mratsim> it's a pretty big "anything" |
| 18:37:19 | Araq | well if dlopen exists and is widely used, guess what, it means ldd is fundamentally broken |
| 18:37:29 | Araq | instead use strace or whatever |
| 18:38:31 | FromGitter | <mratsim> "Well if C and C++ exist and are widely used, guess what, it means Nim is fundamentally brokend" ;) |
| 18:39:04 | Araq | yeah, well, switching words like that doesn't work out |
| 18:40:10 | FromGitter | <deech> Haha! Seems like SQLite is pretty safe to statically link in. That project will be around and kicking long for much longer than niche languages. :) |
| 18:41:33 | Araq | firstly, dlopen can be used from C and C++ too. secondly, the statement is "ldd claims to report the dependencies but doesn't" and when you switch the terms it becomes "Nim claims to compile to C(++) and it doesn't" (huh? to what else does it compile then?) |
| 18:43:30 | Araq | I could run 'ldd' on firefox's binary. would it report all the dependencies. We can't know, ergo broken tool. |
| 18:44:03 | disruptek | the tool works fine, it just might not be right for the purpose. |
| 18:45:23 | Araq | I don't know its purpose, but "list dependencies" can't be among these then |
| 18:45:41 | disruptek | `list static dependencies` might be accurate. |
| 18:47:48 | disruptek | how can i get access to ast/lexer stuff from the compiler for use in a macro? |
| 18:48:22 | disruptek | ie. i'm trying to easily determine if an identifier is a keyword. |
| 18:53:59 | * | solitudesf- quit (Quit: Leaving) |
| 18:54:17 | * | solitudesf joined #nim |
| 19:00:17 | FromGitter | <awr1> @disruptek `dumpTree()` |
| 19:01:08 | FromGitter | <awr1> or `quote do:` |
| 19:01:41 | disruptek | given a string "foo", i need to determine if it needs stropping. |
| 19:03:10 | FromGitter | <awr1> wait do you want to do this at runtime? |
| 19:03:17 | disruptek | nah. |
| 19:03:44 | Zevv | did `compiles()` not work for you? |
| 19:03:59 | FromGitter | <awr1> try `parseStmt()` |
| 19:04:04 | FromGitter | <awr1> or `parseExpr()` |
| 19:04:18 | disruptek | i don't need to parse an identifier. i need to render one. |
| 19:04:38 | FromGitter | <awr1> and then traverse the AST |
| 19:04:40 | FromGitter | <awr1> hmmm |
| 19:04:46 | disruptek | the easiest solution is to include `keywords.txt`, but that just feels like such a hack. |
| 19:05:15 | disruptek | the problem is that i need to generate ast that escapes symbol names that match keywords. |
| 19:05:42 | disruptek | and i cannot do this until i can determine that, say, "from" is a keyword. |
| 19:06:03 | FromGitter | <awr1> i'm still confused. the language you're trying to determine whether or not stropping is needed is still nim, right? |
| 19:06:09 | * | rockcavera quit (Remote host closed the connection) |
| 19:06:11 | disruptek | yes. |
| 19:07:31 | FromGitter | <awr1> and like, you want to intake a string, like `"proc"` or `"foo"`, of which one might be a keyword |
| 19:07:41 | FromGitter | <awr1> and you want to detect that. |
| 19:08:10 | disruptek | that's right. |
| 19:08:41 | FromGitter | <awr1> because if that is so, then `parseStmt()/Expr()` should potentially work for you, but the burden falls on you to investigate the following AST |
| 19:09:06 | * | rockcavera joined #nim |
| 19:09:25 | disruptek | how do you see that working? |
| 19:09:49 | * | Trustable joined #nim |
| 19:09:53 | disruptek | i cannot parse "var proc = 3", so i simply look for a parse failure? |
| 19:10:48 | FromGitter | <awr1> that is one way |
| 19:16:56 | Zevv | but seriously, why not just hardcode the list, what are you afraid of? |
| 19:17:21 | Zevv | nim is not adding keywords every three weeks? |
| 19:17:51 | disruptek | that's what i'm gonna do. i just prefer single-source-of-truth. |
| 19:18:23 | disruptek | there's some useful stuff in the compiler that i wish i could just import. |
| 19:33:29 | shashlick | I always felt the compiler should be accessible from the existing install instead of a separate package |
| 19:45:14 | * | skelett1 joined #nim |
| 19:46:18 | * | zedeus quit (Ping timeout: 245 seconds) |
| 19:46:18 | * | ehmry quit (Ping timeout: 245 seconds) |
| 19:46:55 | * | chemist69 quit (Ping timeout: 265 seconds) |
| 19:47:28 | * | skelett quit (Ping timeout: 264 seconds) |
| 19:47:39 | * | chemist69 joined #nim |
| 19:47:48 | * | zedeus joined #nim |
| 19:48:51 | * | ehmry joined #nim |
| 19:52:49 | FromGitter | <Obround> Is there a way to disable Nim's partial casing? |
| 19:53:25 | clyybber | No, unless you patch the compiler |
| 19:53:31 | clyybber | Why though? |
| 19:54:58 | FromGitter | <Obround> I'm writing a compiler that transpiles to Nim; I don't want it to be partially case sensitive. |
| 19:55:27 | * | vlad1777d quit (Ping timeout: 245 seconds) |
| 19:56:16 | Araq | so learn about compilers and come up with a simple name mangling |
| 19:56:24 | disruptek | or just gensym. |
| 19:57:24 | FromGitter | <Obround> Yeah, I'm am doing that, just wanted to see if there is another way to do it :) |
| 19:57:42 | FromGitter | <arnetheduck> it's only nims `{.dynlib.}` that uses the weird `dlopen` way.. you can link to libraries normally also, even if its a bit of a bother.. |
| 20:15:34 | * | clyybber quit (Quit: Quit) |
| 20:16:17 | * | ehmry quit (Ping timeout: 245 seconds) |
| 20:17:15 | * | Miguelngel[m] quit (*.net *.split) |
| 20:19:56 | * | Miguelngel[m] joined #nim |
| 20:26:33 | * | nsf quit (Quit: WeeChat 2.5) |
| 20:27:22 | * | narimiran quit (Ping timeout: 246 seconds) |
| 20:37:52 | * | alexander92 joined #nim |
| 20:52:24 | * | Hideki_ joined #nim |
| 20:56:46 | * | Hideki_ quit (Ping timeout: 246 seconds) |
| 21:04:15 | * | wildtrees quit (Quit: Leaving) |
| 21:09:02 | * | luis_ joined #nim |
| 21:33:22 | * | actuallybatman quit (Ping timeout: 258 seconds) |
| 21:36:25 | * | solitudesf quit (Ping timeout: 244 seconds) |
| 21:37:01 | * | Trustable quit (Remote host closed the connection) |
| 21:40:04 | * | actuallybatman joined #nim |
| 21:40:26 | * | Vladar quit (Remote host closed the connection) |
| 21:43:18 | * | krux02 quit (Remote host closed the connection) |
| 21:45:04 | * | actuallybatman quit (Ping timeout: 246 seconds) |
| 21:46:08 | shashlick | @dom96 - https://github.com/nim-lang/nimble/pull/686 |
| 21:51:54 | * | actuallybatman joined #nim |
| 21:52:43 | FromGitter | <mratsim> does that mean we can do nimble -d:my_define test? |
| 21:56:57 | FromGitter | <mratsim> btw @Araq or @krux02, for me that PR is ready for merging: https://github.com/nim-lang/Nim/pull/11816 |
| 22:07:51 | * | luis_ quit (Ping timeout: 264 seconds) |
| 22:17:00 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
| 22:17:58 | * | actuallybatman quit (Ping timeout: 246 seconds) |
| 22:25:09 | * | actuallybatman joined #nim |
| 22:30:55 | * | actuallybatman quit (Ping timeout: 246 seconds) |
| 23:00:46 | * | owl_000 joined #nim |
| 23:28:04 | * | actuallybatman joined #nim |
| 23:29:20 | * | Hideki_ joined #nim |
| 23:33:43 | * | Hideki_ quit (Ping timeout: 258 seconds) |