00:06:30 | * | vsantana quit (Remote host closed the connection) |
00:10:23 | * | vsantana joined #nim |
00:17:41 | FromGitter | <erhlee-bird> I'm trying to start hacking on the Nim compiler for the first time. ⏎ In particular, I'm looking at #6198. I'm working in compiler/ccgstmts.nim. ⏎ ⏎ Is it reasonable to sprinkle echo statements in the code or is there some other logging mechanism I haven't discovered yet for debugging the compiler? [https://gitter.im/nim-lang/Nim?at=5dcdeea56ba2347d2d958d7c] |
00:17:43 | disbot | https://github.com/nim-lang/Nim/issues/6198 |
00:17:45 | disbot | ^ is pragma constructor Unavailable? |
00:17:47 | disbot | ^ snippet at https://play.nim-lang.org/#ix=21DV 😏 |
00:17:57 | disruptek | use echo statements. |
00:18:31 | FromGitter | <erhlee-bird> cool, thank you |
00:19:12 | disruptek | hey, it works. |
00:20:24 | FromGitter | <erhlee-bird> totally, just wanted to make sure I wasn't missing out on some other awesome machinery |
00:21:00 | disruptek | i don't know of anything awesome and it seems that everyone just uses echo, so... 🤷 |
00:21:35 | FromGitter | <deech> @erhlee-bird There are better ways, https://github.com/nim-lang/Nim/blob/devel/compiler/msgs.nim#L245 for example. |
00:22:37 | FromGitter | <deech> If you're in a proc that has a `PContext` and `PNode` you can use that to make it so debug messages only print when you're in a test file, eg: ⏎ ⏎ ```if `??`(c.config,n.info,"my-test-file.nim"): ⏎ echo ...``` [https://gitter.im/nim-lang/Nim?at=5dcdefcdeeb63e1a83b51615] |
00:28:01 | FromGitter | <erhlee-bird> the procs in ccgstmts.nim are mostly `p: BProc, e: PNode)` and I'm not immediately seeing a way to go from either of those to a PContext though I see the PContext type used in some of the `sem{xxx}.nim` files |
00:28:56 | FromGitter | <erhlee-bird> @deech side note, I really enjoyed your lambda world talk |
00:30:06 | FromGitter | <deech> Hey thanks! |
00:30:25 | FromGitter | <deech> You can still use `config`. https://github.com/nim-lang/Nim/blob/39290cf88c5047e86dc4894e3190c63d5985f56f/compiler/cgendata.nim#L167 |
00:33:10 | FromGitter | <erhlee-bird> awesome, I'm going to try that out |
00:33:48 | * | uu91 quit (Read error: Connection reset by peer) |
00:34:03 | * | uu91 joined #nim |
00:44:23 | * | vsantana quit (Remote host closed the connection) |
00:49:35 | madprops | is vscode as annoying with python? |
00:49:41 | madprops | the automatic indentation thing is almost broken |
00:50:50 | disruptek | many of us use vim and emacs with excellent nim support. |
00:50:54 | * | vsantana joined #nim |
00:53:47 | * | Jjp137 quit (Read error: Connection reset by peer) |
01:00:41 | madprops | is there a preferred license for libraries? |
01:01:40 | disruptek | MIT |
01:02:55 | FromDiscord | <treeform> MIT |
01:04:43 | FromDiscord | <k1tt3hk4t> M I T |
01:06:34 | madprops | i read that as freeform MIT and got confused |
01:09:30 | disruptek | http://ix.io/21E2 |
01:11:07 | * | msmorgan quit (Ping timeout: 252 seconds) |
01:11:07 | * | euantor quit (Ping timeout: 252 seconds) |
01:11:13 | * | LyndsySimon quit (Ping timeout: 250 seconds) |
01:11:13 | * | nimblepoultry quit (Ping timeout: 250 seconds) |
01:11:13 | * | zielmicha__ quit (Ping timeout: 250 seconds) |
01:11:17 | * | msmorgan joined #nim |
01:11:30 | * | l1x quit (Ping timeout: 252 seconds) |
01:11:30 | * | zielmicha__ joined #nim |
01:11:51 | * | MD87 quit (Ping timeout: 252 seconds) |
01:11:52 | * | matti quit (Ping timeout: 252 seconds) |
01:12:05 | * | d10n-work quit (Ping timeout: 250 seconds) |
01:12:14 | * | euantor joined #nim |
01:13:14 | * | MD87 joined #nim |
01:13:16 | * | nimblepoultry joined #nim |
01:13:23 | * | LyndsySimon joined #nim |
01:13:25 | * | l1x joined #nim |
01:13:42 | * | matti joined #nim |
01:13:48 | * | d10n-work joined #nim |
01:14:50 | * | GordonBGood quit (Ping timeout: 240 seconds) |
01:16:35 | * | GordonBGood joined #nim |
01:23:51 | rockcavera | disruptek I found something similar already reported https://github.com/nim-lang/Nim/issues/11764 |
01:23:54 | disbot | ^ HashSet[uint64] slow insertion depending on values |
01:23:55 | disbot | ^ snippet at https://play.nim-lang.org/#ix=21E6 😏 |
01:28:57 | * | Kevin5 joined #nim |
01:29:36 | clyybber1 | erhlee: If you need more info on a node you can print its ast via `debug node` |
01:30:19 | clyybber1 | erhlee: Otherwise just echo the nodes and you will get the ast rendered as is |
01:30:37 | clyybber1 | as it would look as code |
01:30:39 | FromGitter | <erhlee-bird> thanks @clybb |
01:31:02 | FromGitter | <erhlee-bird> clyybber1 |
01:31:18 | clyybber1 | np |
01:31:44 | * | clyybber1 is now known as clyybber |
01:32:04 | FromGitter | <erhlee-bird> I wanted to see what flags were being set on a particular PSym and so I have ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5dce001452b73c7cb21cbe76] |
01:32:55 | clyybber | you should also be able to just do `echo v.flags` |
01:33:44 | FromGitter | <erhlee-bird> nice, I've changed to that |
01:39:42 | * | vsantana quit (Remote host closed the connection) |
01:40:51 | * | vsantana joined #nim |
01:45:43 | * | abm quit (Quit: Leaving) |
01:48:31 | * | crem quit (Ping timeout: 252 seconds) |
01:51:00 | * | crem joined #nim |
01:53:05 | * | clyybber quit (Quit: WeeChat 2.6) |
01:59:12 | madprops | wondering if you could take a look before sending the pull request https://github.com/madprops/nap |
02:02:27 | * | uu91 quit (Ping timeout: 252 seconds) |
02:03:04 | * | uu91 joined #nim |
02:08:02 | madprops | did some readme fixes |
02:16:20 | * | agohoth joined #nim |
02:16:29 | agohoth | hello |
02:16:59 | * | notgne2 quit (Quit: ZNC 1.7.4 - https://znc.in) |
02:17:22 | agohoth | https://github.com/pragmagic/karax where is the database connection part? |
02:22:37 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
02:24:23 | * | ng0_ joined #nim |
02:26:48 | * | ng0 quit (Ping timeout: 260 seconds) |
02:33:59 | disruptek | rockcavera: nice catch. |
02:43:44 | * | cgfuh quit (Quit: WeeChat 2.5) |
02:46:02 | * | lritter quit (Ping timeout: 240 seconds) |
02:47:11 | * | lritter joined #nim |
02:52:33 | * | agohoth quit (Remote host closed the connection) |
02:53:00 | * | Jjp137 joined #nim |
03:22:19 | * | endragor joined #nim |
03:25:38 | * | endragor quit (Remote host closed the connection) |
03:25:44 | * | endragor joined #nim |
03:50:13 | madprops | is {a:1, b:2} something? |
03:50:24 | madprops | or do i always need toTable to achieve some sort of hashmap |
04:14:30 | * | nif quit (Quit: ...) |
04:14:39 | * | nif joined #nim |
04:24:29 | * | Kevin5 quit (Ping timeout: 250 seconds) |
04:27:31 | FromDiscord | <Kaynato> Normal to find this inside nimcache? |
04:27:31 | FromDiscord | <Kaynato> https://cdn.discordapp.com/attachments/371759389889003532/644755333742592021/unknown.png |
04:42:51 | * | chemist69 quit (Ping timeout: 246 seconds) |
04:45:04 | * | chemist69 joined #nim |
04:48:04 | * | nsf joined #nim |
05:15:27 | * | nif quit (Quit: ...) |
05:15:36 | * | nif joined #nim |
05:28:55 | madprops | if i make a module's proc * is it * to the user if i import/use it in the main file? |
05:29:35 | disruptek | it's only exported from the module where it's exported. it's only imported into the module where it's imported. |
05:31:43 | * | Kevin5 joined #nim |
05:32:35 | madprops | ok i was moduralizing .. but most functions are from the public api |
05:32:44 | madprops | in the end i had an empty main file |
05:32:47 | madprops | which made no sense |
05:36:21 | * | dddddd quit (Remote host closed the connection) |
05:42:24 | * | theelous3 joined #nim |
05:45:23 | madprops | just discovered nim if/else returns an expression like rust, which is great |
05:45:34 | madprops | or returns a value i mean |
05:46:05 | disruptek | so does case and block. |
05:46:12 | madprops | awesome |
05:47:29 | FromDiscord | <demotomohiro> @Kaynato, it is normal in windows. |
05:49:23 | FromDiscord | <demotomohiro> @madprops, they are called if/when/case/block expression |
05:49:32 | FromDiscord | <demotomohiro> https://nim-lang.org/docs/manual.html#statements-and-expressions-if-expression |
05:51:09 | FromDiscord | <demotomohiro> there is also try expression |
05:52:48 | FromDiscord | <demotomohiro> There is forExpr in Grammar, but I don't know about for expression. |
05:52:49 | FromDiscord | <demotomohiro> https://nim-lang.org/docs/manual.html#syntax-grammar |
06:02:28 | * | uu91 quit (Read error: Connection reset by peer) |
06:02:42 | * | uu91 joined #nim |
06:03:20 | madprops | how can i do this better? https://play.nim-lang.org/#ix=21ED |
06:05:02 | madprops | is there a way to access variables by a string? |
06:07:25 | madprops | apart from making a table |
06:07:49 | * | narimiran joined #nim |
06:11:50 | madprops | how can i do what im trying to do? https://play.nim-lang.org/#ix=21EF |
06:12:02 | madprops | basically i want some to have an empty string seq |
06:19:16 | madprops | oh tables can't have mixed types |
06:19:43 | narimiran | use json for mixed types |
06:23:12 | * | ltriant quit (Quit: leaving) |
06:29:26 | * | oculuxe joined #nim |
06:30:52 | madprops | is there no way to have a redefined reusable variable for repetitive intermediary steps? |
06:30:54 | * | letto_ joined #nim |
06:31:53 | madprops | nvm |
06:31:59 | * | nif quit (Quit: ...) |
06:32:29 | * | jfoutais1 joined #nim |
06:32:58 | * | ng0_ quit (Remote host closed the connection) |
06:34:09 | * | ng0_ joined #nim |
06:34:10 | * | nif joined #nim |
06:37:30 | * | letto quit (*.net *.split) |
06:37:30 | * | sacredfrog quit (*.net *.split) |
06:37:30 | * | jxy quit (*.net *.split) |
06:37:30 | * | onionhammer quit (*.net *.split) |
06:37:30 | * | disbot quit (*.net *.split) |
06:37:31 | * | oculux quit (*.net *.split) |
06:37:31 | * | junland quit (*.net *.split) |
06:37:31 | * | dv^_^ quit (*.net *.split) |
06:37:31 | * | shadowbane quit (*.net *.split) |
06:37:31 | * | lj00nal quit (*.net *.split) |
06:37:31 | * | jfoutaise quit (*.net *.split) |
06:37:32 | * | mal`` quit (*.net *.split) |
06:37:32 | * | Mister_Magister quit (*.net *.split) |
06:37:38 | * | Araq quit (*.net *.split) |
06:37:38 | * | acidx quit (*.net *.split) |
06:37:38 | * | mipri quit (*.net *.split) |
06:37:39 | * | gsingh93 quit (*.net *.split) |
06:38:00 | * | shadowbane joined #nim |
06:39:03 | * | Kevin5 quit (Ping timeout: 246 seconds) |
06:42:06 | * | u9898287 joined #nim |
06:42:45 | * | mipri joined #nim |
06:42:45 | * | Araq joined #nim |
06:42:45 | * | acidx joined #nim |
06:42:45 | * | gsingh93 joined #nim |
06:43:19 | * | jfoutais1 quit (Quit: leaving) |
06:44:14 | * | solitudesf joined #nim |
06:46:56 | FromDiscord | <demotomohiro> I don't understand your question so much, but I think this macro and template are what you want. |
06:46:57 | FromDiscord | <demotomohiro> https://play.nim-lang.org/#ix=21Gj |
06:48:51 | * | sacredfrog joined #nim |
06:48:51 | * | jxy joined #nim |
06:48:51 | * | onionhammer joined #nim |
06:48:51 | * | disbot joined #nim |
06:48:51 | * | junland joined #nim |
06:48:51 | * | dv^_^ joined #nim |
06:48:51 | * | lj00nal joined #nim |
06:48:51 | * | mal`` joined #nim |
06:48:51 | * | Mister_Magister joined #nim |
06:50:44 | * | mipri left #nim (#nim) |
06:53:59 | * | uu91 quit (Ping timeout: 250 seconds) |
06:54:24 | * | uu91 joined #nim |
07:15:18 | * | uu91 quit (*.net *.split) |
07:15:18 | * | sacredfrog quit (*.net *.split) |
07:15:18 | * | jxy quit (*.net *.split) |
07:15:18 | * | onionhammer quit (*.net *.split) |
07:15:18 | * | disbot quit (*.net *.split) |
07:15:18 | * | junland quit (*.net *.split) |
07:15:19 | * | dv^_^ quit (*.net *.split) |
07:15:19 | * | lj00nal quit (*.net *.split) |
07:15:19 | * | mal`` quit (*.net *.split) |
07:15:19 | * | Mister_Magister quit (*.net *.split) |
07:16:57 | * | uu91 joined #nim |
07:16:57 | * | sacredfrog joined #nim |
07:16:57 | * | jxy joined #nim |
07:16:57 | * | onionhammer joined #nim |
07:16:57 | * | disbot joined #nim |
07:16:57 | * | junland joined #nim |
07:16:57 | * | dv^_^ joined #nim |
07:16:57 | * | lj00nal joined #nim |
07:16:57 | * | mal`` joined #nim |
07:16:57 | * | Mister_Magister joined #nim |
07:19:57 | * | nif quit (Quit: ...) |
07:20:07 | * | nif joined #nim |
07:22:36 | * | hemite left #nim (#nim) |
07:23:36 | * | letto_ quit (Quit: Konversation terminated!) |
07:25:10 | * | letto joined #nim |
07:25:49 | * | jjido joined #nim |
07:26:13 | * | theelous3 quit (Ping timeout: 252 seconds) |
07:30:00 | * | tane joined #nim |
07:44:28 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
07:45:59 | * | PMunch joined #nim |
07:47:33 | FromDiscord | <Kaynato> Thanks, demotomohiro |
07:49:01 | * | lritter quit (Ping timeout: 250 seconds) |
07:53:41 | * | lritter joined #nim |
08:00:00 | * | gmpreussner quit (Quit: kthxbye) |
08:00:28 | PMunch | Hmm, is it theoretically safe to have a global GC-ed variable that is initialised before threads and which is only read from in threads? |
08:01:49 | Araq | probably not |
08:02:09 | PMunch | Why not? |
08:02:23 | PMunch | If it never changes and the threads only read from it |
08:04:56 | * | gmpreussner joined #nim |
08:06:04 | PMunch | What is the correct way to do read-only GC-safe memory in Nim then? |
08:06:38 | Araq | don't use GC memory |
08:07:07 | Araq | refcounting turns reading operations into potential writes, it's not safe enough to allow it |
08:07:11 | PMunch | Is there a convenient way to do that? |
08:08:17 | PMunch | Take a string for example |
08:09:18 | * | ng0_ is now known as ng0 |
08:09:48 | PMunch | Of course I could allocate a cstring, but that means I need to convert it to a string every time I want to use it somewhere that only accepts strings.. |
08:14:24 | Araq | welll now you figured out Nim's main point of pain IMO :P |
08:16:08 | PMunch | Haha, I guess yeah.. |
08:16:57 | PMunch | I guess a ptr string isn't safe to read from either then? |
08:17:55 | * | lritter quit (Ping timeout: 252 seconds) |
08:18:25 | PMunch | It's so weird, everything else in Nim just feels so easy and correct. But doing anything multi-threaded just feels wrong |
08:18:54 | PMunch | It's immediately into passing pointers around, and throwing out a lot of safety |
08:24:51 | * | floppydh joined #nim |
08:28:16 | Araq | yup but --gc:arc is coming |
08:28:20 | FromGitter | <yglukhov> Hey guys, is there any way to "emulate" let behavior with a pointer? Like `const T&` in cpp. I tried `template foo: int = pInt[]`, but it still can be assigned to, despite the template "return" type is not var. |
08:28:28 | FromGitter | <yglukhov> Is it bug btw? |
08:28:41 | Araq | not in my opinion |
08:28:48 | PMunch | Araq, what is --gc:arc? And how soon is it coming? |
08:31:00 | FromGitter | <yglukhov> Araq: but then is there any difference between `T` vs `var T` when used as template return type? |
08:31:51 | Araq | no. templates have inlining semantics |
08:32:08 | PMunch | yglukhov: https://play.nim-lang.org/#ix=21Oi |
08:32:15 | Araq | likewise 'var T' as a template parameter type hardly matters |
08:32:38 | * | uu91 quit (Read error: Connection reset by peer) |
08:32:51 | Araq | but there are other bugs related to this so maybe we should flesh out the spec and change it, dunno |
08:32:54 | PMunch | By the way it doesn't need () on line 19 |
08:32:58 | PMunch | It could just be foo as well |
08:33:01 | PMunch | Same error |
08:33:07 | * | uu91 joined #nim |
08:33:28 | FromGitter | <yglukhov> PMunch: but it will make a copy on every reference. My goal is to make it a dereference |
08:33:39 | FromGitter | <yglukhov> i.e. to avoid copies |
08:36:04 | PMunch | Ah, well that probably isn't possible.. |
08:36:13 | * | uu91 quit (Read error: Connection reset by peer) |
08:36:26 | * | uu91 joined #nim |
08:36:29 | PMunch | For that functionality you would probably need to create some types and accessor templates |
08:36:55 | FromGitter | <yglukhov> Araq: yeah it feels like var should be accounted for during overload resolution, and return type semantics. I mean it just makes sense, no? :) |
08:37:28 | FromGitter | <yglukhov> In fact I thought it is the case already for overload resolution. |
08:38:07 | Araq | for OR it is respected I think |
08:38:41 | Araq | but mutability is not attached to a type so if you do template t(): int = xvar |
08:38:50 | Araq | then xvar is as mutable as it always was |
08:38:53 | FromGitter | <yglukhov> hmmm... The following works as expected ``` ⏎ template bar(a: var int) = a = 5 ⏎ ⏎ let b = 123 ⏎ bar(b) ... [https://gitter.im/nim-lang/Nim?at=5dce641d92a84f79fe6e2359] |
08:39:20 | Araq | it IS logical. |
08:39:22 | FromGitter | <yglukhov> error: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5dce643968ad1c4a0fcd1769] |
08:40:00 | FromGitter | <yglukhov> so var is checked during overload resolution, right? then why the var in res type not checked? :) |
08:40:12 | Araq | mutability is an aspect of the location, not of the type, there is no 'const int' type |
08:42:29 | FromGitter | <yglukhov> Aah i see. But then with `template foo: int = pFoo[]`, `foo` will produce a location, right? Can we add the var/let aspect at this point? |
08:43:51 | Araq | no because mutability is not even tied to a location, but to a symbol, pFoo can be "immutable", pFoo[] *never* is immutable |
08:45:25 | FromGitter | <yglukhov> ok, i see. |
08:48:21 | * | Vladar joined #nim |
08:52:51 | PMunch | But yeah Araq, what is --gc:arc, and when will it be available? |
08:53:13 | PMunch | Do you have a link to anything explaining it? I've seen you mention it, but never really seen an explanation of what it is :P |
08:57:05 | * | u9898287 quit (Quit: u9898287) |
08:57:23 | * | u9898287 joined #nim |
08:57:36 | PMunch | http://ix.io/21Om/nim <- that seems to work fine by the way |
08:57:46 | PMunch | Well, at least it doesn't corrupt the string |
09:03:07 | Araq | PMunch, https://github.com/nim-lang/RFCs/issues/177 |
09:04:35 | Araq | it exists in the permanent state of 'vaporware' |
09:19:18 | PMunch | So not coming anytime soon then.. |
09:22:35 | tane | Do I read the manual right in: UncheckedArray[T] results in a C-style array of type T? |
09:23:16 | PMunch | tane, pretty much yeah |
09:24:11 | PMunch | It's really only meant to be used for C interop I think |
09:24:34 | tane | yes, can I construct an UncheckedArray[T] from a ptr T + length? |
09:24:52 | PMunch | Well you don't really need the length |
09:24:57 | * | solitudesf quit (Ping timeout: 246 seconds) |
09:25:02 | PMunch | That's the "Unchecked" part |
09:25:31 | tane | ah yes, the length comes into play when using toOpenArray |
09:25:49 | tane | my point is: given that I'd get data from C, I'd like to use all the fancy stuff that works on openArrays |
09:25:55 | tane | e.g. "reverse" etc |
09:26:24 | PMunch | Yeah, then toOpenArray(myUncheckedArray, myLen) |
09:29:39 | tane | PMunch, so, let's say `var x : ptr int`, I performed `var y = cast[ptr UncheckedArray[int]](x)` and used converted it to an openArray of the right size. Is this the way to go? |
09:30:01 | tane | -used :) |
09:30:33 | tane | valgrind doesn't complain so far, so it works, question is, will it work in the future too |
09:31:57 | PMunch | Pretty much yeah: http://ix.io/21Ou/nim |
09:32:24 | tane | ok, this is great! :) thanks |
09:32:31 | PMunch | Not sure why you would have a "ptr int" to begin with though |
09:32:36 | PMunch | If it points to an array of integers |
09:32:55 | tane | PMunch, if you get such data from outside, i.e. a C library, you cannot do much |
09:33:12 | PMunch | Well you could declare that it was a ptr UncheckedArray[int] to begin with :P |
09:33:27 | tane | sure, but that's the same thing |
09:33:44 | tane | also, if you wanted to do manual management with `create` and `dealloc` you'd have the same problem |
09:34:01 | tane | for whatever reasons one would need that, all that matters to me is that it's possible |
09:34:10 | PMunch | You shouldn't use create and dealloc with C interop I think |
09:34:24 | PMunch | Well, you could in some cases I guess |
09:34:45 | PMunch | Oh yeah, anything is possible :) |
09:34:48 | tane | my point is: you can `create` memory and leverage the algorithms working on `openArray`s |
09:34:58 | PMunch | Yeah |
09:36:03 | tane | I work on optimization heuristics most of the time, after the obvious correctness requirement, speed is my main concern :) |
09:41:23 | dom96 | Araq: isn't ARC what Swift/ObjC does? |
09:48:30 | Araq | dom96, yup |
09:53:08 | FromGitter | <alehander92> hm, so thats why |
09:53:10 | FromGitter | <alehander92> its called arc |
09:54:26 | FromGitter | <alehander92> do you guys use nested loops often |
09:54:51 | FromGitter | <alehander92> i am trying to figure out if one feature i work on should support them specifically |
09:55:21 | FromGitter | <alehander92> i feel like they happen rarely, but it might be just my bias to not think of this case |
09:55:36 | Araq | they are everywhere |
09:56:10 | FromGitter | <alehander92> oh now i have to make statistics |
09:57:48 | narimiran | nested loops happen rarely? not in the code i write/read :'( |
09:58:18 | FromGitter | <alehander92> hmm, what i mean is that often |
09:58:33 | FromGitter | <alehander92> one has a for, another for but extracts the internal logic into another function |
09:58:38 | FromGitter | <alehander92> so its not directly nested sometimes |
09:58:49 | FromGitter | <me7> hi all, anyone can help answer me about using db_sqlite with jester? |
09:59:13 | FromGitter | <me7> I saw in htop that my app memory usage keep rising when run jester with sqlite |
09:59:44 | FromGitter | <me7> my question is how to properly return memory |
09:59:56 | FromGitter | <me7> e.g. close database with jester shutdown |
09:59:58 | FromGitter | <mratsim> @alehander92 nested loop happens so often for me that I wrote a million lines of code to deal with them and I'm still not happy :p |
10:00:17 | FromGitter | <mratsim> million LOC according to Nim when it compiles Arraymancer tests :p |
10:00:44 | FromGitter | <me7> my code open database at the top ⏎ let db = open("chinook.db","","","") |
10:00:59 | FromGitter | <alehander92> @mratsim yeea |
10:01:01 | FromGitter | <me7> get "/": ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5dce775dca778c1fbf0864d3] |
10:01:08 | FromGitter | <alehander92> in math-y code i expect it a lot indeed |
10:01:16 | * | endragor quit (Remote host closed the connection) |
10:01:22 | Araq | putting the for loop into a different proc happens frequently but not nearly frequently enough |
10:01:33 | Araq | your stuff is better ready for nested loops :P |
10:01:35 | FromGitter | <alehander92> yes, valuable feedback thanks |
10:02:12 | FromGitter | <alehander92> ugh, the problem it makes it like 3dimentional |
10:02:22 | Araq | hint: nesting 'if' statements is also common ;-) |
10:02:26 | FromGitter | <alehander92> and i cant even imagine 3-nested loops |
10:02:50 | FromGitter | <alehander92> if-s are ok, its' about repeated visits of the same line |
10:03:06 | FromGitter | <alehander92> (so label: ... goto also qualified |
10:07:24 | Araq | PMunch, use devel, avoid closures try --gc:arc |
10:09:45 | Araq | and I just found the closure problem |
10:09:47 | Araq | :-) |
10:10:48 | PMunch | Yay :) |
10:10:52 | Araq | how many bugs can there be in 700 lines? turns out. a lot. |
10:11:00 | livcd | fearless multithreading with Nim when ? |
10:11:08 | PMunch | Avoid closures because of the problem, or because it doesn't work with --gc:arc? |
10:11:27 | * | tklohna joined #nim |
10:13:20 | Araq | livcd, christmas but we don't know the year :P |
10:13:35 | Araq | PMunch, because of implementation bugs, in theory it'll work |
10:13:49 | PMunch | @me7, use a `close` on the database at the end of your program? |
10:16:45 | livcd | but unless i need to share data between the threads it is not that bad right ? right ? |
10:19:08 | Araq | right |
10:19:46 | Araq | but Nim users are not buying Erlang-like designs :P |
10:22:01 | FromGitter | <mratsim> let's do fearless concurrency first :p |
10:25:45 | Araq | mratsim: ever noticed that "trial deletion" and "can I move this ref to a different thread" are the same problem? |
10:26:55 | FromGitter | <mratsim> Regarding my progress on Picasso, I finished the spawn/sync mechanism yesterday after rebuilding the PoC from scratch. But I will probably have to redo it a 3rd time. The control flow is too tangle and even me often get lost. I.e. since 2 weeks ago (https://github.com/nim-lang/RFCs/issues/160#issuecomment-549199561). I've reimplemented all the logic while splitting them in coherent files, but while doing that I realized |
10:26:55 | FromGitter | ... that I still had mainainability problems which will require the following updates: ⏎ ⏎ 1) refactoring the bitsets to support more than 32 CPUs, while having efficient random number generation support or efficient uncompression into a stack array ⏎ 2) Removing globals because it's very bad for unit-testing ⏎ 3) I ... [https://gitter.im/nim-lang/Nim?at=5dce7d6f6ba2347d2d99873a] |
10:27:48 | FromGitter | <mratsim> @Araq, yes but from the other angle, can I take a raw pointer to this ref without the GC moving town |
10:29:22 | Araq | so ... do you need movable ref/closure based tasks? |
10:29:34 | Araq | because that's pretty much the problem I'm solving |
10:42:07 | FromDiscord | <mratsim> mmmmmm that would be one way |
10:42:41 | FromDiscord | <mratsim> but otherwise I prefer to serialize the value captured |
10:42:45 | FromDiscord | <mratsim> values* |
10:43:15 | FromDiscord | <mratsim> I don't want to have to deal with 2 Tasks structure, one for nimcall and one for closure |
10:43:34 | FromDiscord | <mratsim> and the potential memory management of GC. |
10:44:21 | FromDiscord | <mratsim> for example allocating Futures on the stack with alloca improved my perf reduced my overhead by a lot on short-lived task like Fibonacci |
10:44:40 | FromDiscord | <mratsim> 1s for fib(40) with heap and 0.4 with alloca |
10:44:50 | FromDiscord | <mratsim> Intel TBB is at 0.6 |
10:45:07 | FromDiscord | <mratsim> i.e. the less I have to deal with memory management, the better |
10:46:12 | Araq | but this stuff must be compatible with async, no? |
10:46:42 | * | tklohna left #nim ("Leaving") |
10:46:47 | Araq | you can't avoid closures and refs in the long run so they'd better be shareable |
10:47:31 | FromDiscord | <mratsim> for async, I think the best is to start an event loop per thread |
10:48:05 | FromDiscord | <mratsim> but passing closures between threads is useful |
10:48:27 | FromDiscord | <mratsim> passing refs, yes if you pass ownership and the source thread cannot access them anymore |
10:48:43 | FromDiscord | <mratsim> i.e. the Send/Sync traits in Rust |
10:52:28 | Araq | we don't need these traits once we moved to precise refcounting |
10:52:37 | Araq | you can simply check for refcount == 1 |
10:52:49 | Araq | well, not quite |
10:52:54 | Araq | but it's simple enough |
10:55:33 | FromDiscord | <mratsim> And assuming we move to threads:on by default, will it be possible for the dev to choose per type between Arc and Rc |
10:55:55 | FromDiscord | <mratsim> because lot of code will stay single-threaded and wouldn't need to pay the Arc tax |
10:56:40 | Araq | I'm still thinking about this |
10:57:39 | Araq | seems like we can live with non-atomic refcounting if we enforce moves between threads |
10:57:44 | * | Vladar quit (Quit: Leaving) |
10:58:15 | Araq | then atomic refcounting for sharing can remain the task of a dedicated shared pointer type |
10:58:37 | Araq | seems the best design so far |
11:00:14 | Araq | this move check needs to see if there are other outer refs pointing inside the-to-be-moved subgraph |
11:00:37 | Araq | which is the same thing as trail deletion for cycle detection ;-) |
11:00:42 | FromDiscord | <itmuckel> Hey guys, is there some documentation on how to document types? 🤔 |
11:01:29 | FromDiscord | <itmuckel> I tried this, but I'm not sure if this is right: |
11:01:29 | FromDiscord | <itmuckel> |
11:01:29 | FromDiscord | <itmuckel> Rotation* = object |
11:01:29 | FromDiscord | <itmuckel> ## Represents a rotation in degrees. |
11:01:29 | FromDiscord | <itmuckel> ## Cannot overflow/underflow. |
11:01:30 | FromDiscord | <itmuckel> value: int |
11:01:51 | narimiran | try this: Rotation* = object ## \ |
11:02:25 | Araq | so we solve both problems with the same algorithm, quite elegant. beating Swift and Rust... *cough* |
11:03:55 | * | krux02 joined #nim |
11:04:00 | FromDiscord | <mratsim> We need a new slogan "Fearless ???" |
11:05:56 | Araq | "Fearless heap memory" |
11:06:08 | FromDiscord | <mratsim> I agree that shared data structure should be done in libraries, we can provided a Arc wrapper, but stuff like shared tables, shared queues requires a lot of work |
11:06:11 | FromDiscord | <itmuckel> @narimiran Tried that, still VSCode doesn't pick it up. Which is weird, because the nimble package sdl2_nim does the exact same thing, but I can get its docstrings, when I hover its types. |
11:06:25 | Araq | because as far as I'm concerned Rust doesn't model a heap. |
11:06:27 | FromDiscord | <mratsim> and then you get into hazard pointers, and other fancy memory management schemes |
11:06:50 | FromGitter | <alehander92> i never understood well this `rust doesnt model a heap well` thing |
11:06:53 | Araq | yeah but once the allocs are shared you can put a lock around the std tables and sets and it works ok'ish |
11:06:59 | * | solitudesf joined #nim |
11:07:11 | FromDiscord | <mratsim> when you have 2-4 threads |
11:07:13 | FromGitter | <alehander92> can you give a short example where it shows |
11:07:56 | FromDiscord | <itmuckel> Guys, can we get more channels here? Like "editors", "beginners", "compiler" etc.? I feel like everything is stuffed into "general". 😄 |
11:09:10 | FromDiscord | <mratsim> I think we should start on the forum for that, to get a feel of the size of each community |
11:09:23 | FromGitter | <alehander92> we had several requests for that, but i am not sure if people would find a `nim-beginner` chat easily |
11:09:44 | FromGitter | <alehander92> e.g. in slack it's obvious , but no idea how people find new channels in irc |
11:10:12 | FromDiscord | <itmuckel> In Discord it's the same thing |
11:10:12 | FromDiscord | <itmuckel> https://cdn.discordapp.com/attachments/371759389889003532/644856668794126369/unknown.png |
11:10:12 | FromDiscord | <mratsim> there can be a message in the welcome message |
11:10:30 | FromDiscord | <mratsim> yes but we don't want a discord only beginner questions |
11:10:37 | FromGitter | <alehander92> maybe with `#nim` which cant be usable and just points to "choose one of those channels" |
11:10:43 | FromDiscord | <mratsim> and we also want them logged into irclogs.nim-lang.org |
11:10:44 | FromGitter | <alehander92> but i guess this is a no-go |
11:10:56 | * | nsf quit (Quit: WeeChat 2.6) |
11:11:07 | FromDiscord | <itmuckel> Lisp Discord does it really well |
11:11:07 | FromDiscord | <itmuckel> https://cdn.discordapp.com/attachments/371759389889003532/644856901477335080/unknown.png |
11:11:27 | FromDiscord | <mratsim> but do they have IRC and Gitter relay? |
11:11:43 | FromGitter | <alehander92> yeah a lot of nim community is on irc |
11:11:45 | FromDiscord | <itmuckel> I think so. A lot of people moved to IRC or so 😦 |
11:12:02 | FromGitter | <alehander92> from what ive seen usually some channels are mapped to irc |
11:12:09 | FromGitter | <alehander92> e.g. in proglangdesign |
11:12:24 | FromDiscord | <mratsim> That would be a good bot project 😉 the Discord <-> IRC relay is a bit flacky |
11:12:28 | FromDiscord | <itmuckel> At least in the gamedev channel I get a lot of relay messages which look like shit^^ |
11:12:46 | FromDiscord | <itmuckel> Compare this |
11:12:46 | FromDiscord | <itmuckel> https://cdn.discordapp.com/attachments/371759389889003532/644857308417097728/unknown.png |
11:12:52 | * | u9898287 quit (Quit: u9898287) |
11:13:04 | FromDiscord | <itmuckel> To this |
11:13:04 | FromDiscord | <itmuckel> https://cdn.discordapp.com/attachments/371759389889003532/644857390717468689/unknown.png |
11:13:26 | FromDiscord | <mratsim> That's the bot |
11:13:34 | FromGitter | <alehander92> this can be easy to solve |
11:13:38 | FromGitter | <alehander92> by using 2 bots |
11:13:46 | FromDiscord | <itmuckel> Yeah, but it feels like I'm reading through a text file instead of using a chat program. lol. |
11:13:47 | FromGitter | <alehander92> which pass to each other |
11:13:50 | FromGitter | <alehander92> on each change of name |
11:13:55 | FromDiscord | <mratsim> The bot doesn't create a new context per person that writes a message on Gitter/IRC |
11:13:57 | FromGitter | <alehander92> thats what i mean |
11:14:11 | FromGitter | <alehander92> that it can create at least two contexts and switch between them |
11:14:13 | FromDiscord | <itmuckel> @mratsim exactly^^ |
11:14:16 | FromGitter | <alehander92> if creating a new one for each nick |
11:14:18 | FromGitter | <alehander92> is too much |
11:14:37 | FromGitter | <alehander92> but notice that its similar for us on gitter/irc |
11:14:43 | FromGitter | <alehander92> e.g. discord edits / code pastes look bad |
11:14:50 | FromGitter | <alehander92> but this can be fixed quite well |
11:15:00 | FromGitter | <alehander92> with some additional logic |
11:15:03 | FromDiscord | <mratsim> So the solution is to find a better bot. |
11:15:03 | FromDiscord | <mratsim> At Status we have one that relay Gitter <-> discord, it works well, it supports Discord code and even message edition |
11:15:17 | FromDiscord | <mratsim> but for Ni we have Discord <-> IRC <-> Gitter AFAIK |
11:15:20 | FromDiscord | <mratsim> Nim* |
11:15:25 | FromGitter | <alehander92> autobot |
11:15:31 | FromGitter | <alehander92> yeah i've noticed its different |
11:16:27 | FromDiscord | <itmuckel> (And this discussion could be moved out of general, because all this Arc/Rc/parallelism discussion from a few minutes ago is now buried.^^) |
11:16:50 | FromGitter | <alehander92> i think threaded conversations in the same channel are even better |
11:16:56 | FromDiscord | <mratsim> yes but moving it out would prevent people from interacting |
11:17:00 | FromGitter | <alehander92> but this is almost impossible for gitter/irc/discord combo |
11:17:02 | FromGitter | <alehander92> i think |
11:17:06 | FromDiscord | <mratsim> yeah, but that would require slack |
11:17:12 | FromDiscord | <mratsim> maybe when IRCv3 |
11:17:13 | FromGitter | <alehander92> yeah or zulip |
11:17:14 | FromDiscord | <mratsim> 😛 |
11:17:21 | FromGitter | <alehander92> does discord have those |
11:17:24 | FromDiscord | <mratsim> no |
11:17:45 | FromDiscord | <itmuckel> Nah "Let's move to channel xy" and people interested in the conversation move to the same channel to read on. Works well in Lisp Discord. |
11:17:57 | FromGitter | <alehander92> but even when talking about compilers |
11:18:01 | FromGitter | <alehander92> sometimes you can have 2-3 |
11:18:05 | FromGitter | <alehander92> different topics in the same time |
11:18:11 | FromDiscord | <itmuckel> Yeah, that's okay |
11:18:15 | FromGitter | <alehander92> that's why i think the thread thing is better |
11:18:37 | FromGitter | <alehander92> and with threads you can quickly see all the different topics in the same place even if from quite different fields |
11:18:46 | FromGitter | <alehander92> but yeah, they're not an option |
11:18:50 | FromDiscord | <mratsim> One thing is that, I've seen here and there that one of Nim quality is its IRC channel that really felt lively |
11:19:11 | FromDiscord | <mratsim> anyway, I suggest you start a forum thread |
11:19:30 | FromDiscord | <mratsim> Give a number to your proposition/issues |
11:19:37 | FromDiscord | <mratsim> like issue 1. multiple channels |
11:19:47 | FromDiscord | <mratsim> issue 2. The bot quality on Discord |
11:20:03 | FromDiscord | <mratsim> this way people can pick apart what they want to discuss on |
11:20:04 | FromGitter | <alehander92> yeah thats true other irc-s seem lower traffic to me |
11:20:20 | FromGitter | <alehander92> which on the other hand is not perfect as often stuff becomes lost |
11:20:39 | FromDiscord | <mratsim> ping @kodkuce as well as he was also in favor of having more channels |
11:24:21 | FromDiscord | <kodkuce> i personaly used irc before, i like it more just it sux it doset have code formating 😦 |
11:25:23 | FromDiscord | <kodkuce> discord is good only cuz its mainstream a lot of people on it, and atm has better UI then matrix/riot |
11:30:18 | FromDiscord | <kodkuce> so running detached processes, arguments for it example like in terminal, ./mailchecker --mypass="kifla" --myserver="1.1.22.33" , does this get loged if running from "proc execProcess" am asking security wise |
11:30:53 | FromDiscord | <kodkuce> ofc i would not run lxterminal -e some command just insted just command |
11:31:14 | FromDiscord | <kodkuce> am asking cuz would sux if somone can read my pass |
11:31:56 | FromDiscord | <kodkuce> i know if running form terminal i would have it in history, but am asking if running with "execProcess" |
11:32:01 | krux02 | Araq: why did you rename alignas? |
11:33:31 | FromDiscord | <kodkuce> and hmm is there startProcess detached or am i blind |
11:35:05 | * | tane quit (Quit: Leaving) |
11:35:25 | Araq | krux02, because it should be 'align' |
11:36:12 | Araq | we're not restricted to C++'s silly "must have ugly words so that it doesn't bite older vendor specific words" |
11:38:13 | krux02 | but align was something else |
11:39:07 | krux02 | when a type is imported, it might make sense to declare the size and the alignment, so that the sizealignment algorithm can do its work. |
11:41:09 | Araq | variables, fields and types can have 'align', no need for 2 separate pragmas for that |
11:43:26 | krux02 | it causes less trouble, if they are separate words. |
11:44:31 | FromDiscord | <mratsim> if it's imported it can be called aligned though |
11:45:01 | Araq | how so? types are not variables |
11:45:26 | krux02 | thanks to `typedesc` variables may be types |
11:45:29 | Araq | we also use a single 'importc' for vars/types/fields |
11:46:20 | Araq | and then you expect anybody to understand align vs alignas when it comes typedesc? I don't understand it |
11:49:37 | * | ponyrider is now known as eponyrider |
11:49:51 | * | eponyrider is now known as ponyrider |
11:56:53 | * | clyybber joined #nim |
11:57:45 | clyybber | I would also vote for one align, alignas is ugly and inconsistent |
11:58:13 | FromDiscord | <mratsim> it's consistent with C++ and C though |
11:58:44 | FromDiscord | <mratsim> I prefer align as well but that's really bikeshedding, it's not something that I typ that often |
11:59:27 | clyybber | still |
11:59:41 | clyybber | now we have the ability to still change it |
11:59:56 | FromDiscord | <mratsim> you broke my code 😉 |
12:00:11 | FromDiscord | <mratsim> (joking, I didn't use it yet) |
12:03:55 | * | Hideki_ joined #nim |
12:22:26 | * | disruptek quit (Ping timeout: 240 seconds) |
12:23:01 | * | disbot quit (Ping timeout: 268 seconds) |
12:25:05 | FromDiscord | <kodkuce> can cligen somhow magicly handle passwords? |
12:25:52 | * | disbot joined #nim |
12:26:28 | solitudesf | what does that mean |
12:26:39 | * | disruptek joined #nim |
12:29:13 | FromDiscord | <kodkuce> hmm, means am kinda lost how do i hendle passwords for cli app, if i make it as argument its insecure cuz sombody can read history log, and if i make it ask for pasword on run, then duno if i can start as detached |
12:29:58 | solitudesf | what |
12:30:19 | solitudesf | what shell history has to do with your application? |
12:30:33 | Araq | terminal.readPasswordFromStdin |
12:31:02 | * | u9898287 joined #nim |
12:31:07 | livcd | or you could use env variables |
12:32:23 | * | krux02 quit (Remote host closed the connection) |
12:32:38 | * | krux02 joined #nim |
12:38:10 | * | vivus joined #nim |
12:39:01 | * | vivus quit (Remote host closed the connection) |
12:42:39 | FromGitter | <alehander92> align |
12:42:47 | FromGitter | <alehander92> does it do something different to alignas |
12:43:00 | FromGitter | <alehander92> if it does, it should be at least with different argument |
12:43:15 | FromDiscord | <kodkuce> am trying to make a scalable app gameserver, so example i have authserver , reg/profile server, loobyserver, 200 instance of gameserver, so am thinking how to spread config for each, i first did just next to authserver make a conf.json and it reads it up, then thought maybe i should make loobyserver spawn detached processes for 200 gameservers and on spawn pass arguments for stuff gamserver needs like db url/pass(here i thought if i put |
12:48:35 | federico3 | kodkuce: are you on #nim-offtopic ? |
12:49:22 | FromDiscord | <kodkuce> irc or discord, can be anyway why? |
12:50:22 | federico3 | IRC - in order not to spam this channel discussing configuration management |
12:50:25 | FromDiscord | <kodkuce> or asking if i should i go there |
12:50:58 | * | Vladar joined #nim |
12:51:04 | FromDiscord | <kodkuce> sure sorry, anyway i finished my tribestorm xD |
13:02:45 | * | drewr quit (Ping timeout: 250 seconds) |
13:04:36 | * | skelett quit (Quit: WeeChat 2.5) |
13:13:37 | * | disbot quit (Ping timeout: 240 seconds) |
13:13:49 | * | disruptek quit (Ping timeout: 252 seconds) |
13:17:49 | * | disruptek joined #nim |
13:18:51 | * | disbot joined #nim |
13:24:53 | * | solitudesf quit (Ping timeout: 245 seconds) |
13:27:46 | * | vsantana quit (Remote host closed the connection) |
13:29:02 | * | vsantana joined #nim |
13:31:35 | * | nsf joined #nim |
13:37:04 | * | dddddd joined #nim |
13:45:08 | * | Kaivo joined #nim |
13:50:38 | narimiran | @mratsim: this seems like something you might want to watch: http://cds.cern.ch/record/2157242 (i just started watching, don't know how good it is) |
13:53:57 | clyybber | narimiran: Is it the one where luajit is faster than C++? |
13:54:09 | narimiran | clyybber: exactly that one |
13:57:27 | * | ehmry quit (Ping timeout: 252 seconds) |
14:03:50 | * | solitudesf joined #nim |
14:11:44 | * | ehmry joined #nim |
14:12:18 | FromDiscord | <mratsim> I did look into LuaJIT code when I wrote my interpreter optimization resources: https://github.com/status-im/nimbus/wiki/Interpreter-optimization-resources |
14:13:07 | FromDiscord | <mratsim> But the LuaJIT backend is really too complex to use |
14:13:50 | FromDiscord | <mratsim> However this is nice: http://lua-users.org/lists/lua-l/2011-02/msg00742.html |
14:16:10 | FromDiscord | <mratsim> About what 3.5 years ago, i tried to use Lua for neural networks as well |
14:16:11 | * | zacharycarter[m] joined #nim |
14:17:00 | FromDiscord | <mratsim> When the state-of-the art Go playing bot was from Facebook (before Alpha Zero) and developed in Lua: https://github.com/facebookresearch/darkforestGo |
14:17:24 | FromDiscord | <mratsim> I failed at "luarocks" and never touched Lua again 😛 |
14:17:34 | clyybber | torch was really nice to work with back when I used lua a bit more |
14:17:45 | FromGitter | <alehander92> hm, luarocks did work for me |
14:17:46 | FromGitter | <alehander92> iirc |
14:18:00 | clyybber | I never felt the need for luarocks |
14:18:12 | clyybber | But thats because torch had its own updating method |
14:18:20 | FromGitter | <alehander92> ah interesting |
14:18:20 | FromDiscord | <mratsim> It was required for image libraries and Cuda bindings |
14:18:24 | FromGitter | <alehander92> i think i used char-rnn |
14:18:29 | FromGitter | <alehander92> but i dont remember what did it use |
14:18:38 | clyybber | also loeve2d is a beautiful framework |
14:18:52 | clyybber | I could run my "games" even on the 3ds |
14:18:56 | FromGitter | <alehander92> ah it shows you're a german |
14:19:07 | FromGitter | <alehander92> you actually know how to transcribe umlaut to english |
14:19:29 | clyybber | alehander92: heh. My keyboard is actually a german one, but I changed the layout |
14:19:38 | clyybber | because the german layout is batshit insane |
14:19:39 | krux02 | as a German, I usually type them: löve2D, even though it creats funny sounds in my head. |
14:20:06 | clyybber | krux02: So you use the german keyboard layout? |
14:20:14 | krux02 | I use de neo for the same reason. |
14:20:24 | krux02 | I don't use standard layout. |
14:20:53 | FromGitter | <alehander92> interesting, is it only the yz |
14:20:54 | FromGitter | <alehander92> thing |
14:20:55 | krux02 | de neo is good for German,English and programming |
14:21:15 | FromDiscord | <mratsim> I didn't check the German Layout but I know that the Swiss one is good, you don't need contorsions to use numbers, and you have access to French accentuations |
14:21:17 | krux02 | the yz thing doesn't matter, the placement of {} sucks. |
14:21:45 | FromGitter | <alehander92> wow i cant imagine not direct numbers |
14:21:56 | FromGitter | <alehander92> i see |
14:22:10 | FromDiscord | <mratsim> the French layout is so bad for programmation. I think Nim would appeal to French due to the dumb bracket placement |
14:22:15 | FromGitter | <alehander92> interesting, we are pretty much used to double layouts |
14:22:19 | clyybber | alehander92: The worst thing about the standard german layout is having to press right alt and numbers for brakcets |
14:22:23 | FromGitter | <alehander92> but they would be confusing for latin lang |
14:22:31 | clyybber | mratsim: Looks like de and fr have the same problem |
14:22:31 | krux02 | ^^ |
14:22:39 | FromDiscord | <mratsim> https://en.wikipedia.org/wiki/AZERTY#/media/File:KB_France.svg |
14:22:53 | clyybber | ok wtf is that |
14:23:16 | FromDiscord | <mratsim> I don't know why square is such a priority for example |
14:23:43 | krux02 | there was a reason for the keyboard to have two ctrl, two alt, two shift. The inventor of the German layout was like "ah two alt keys, then we can repurpose one of them for something else" |
14:23:58 | clyybber | mratsim: How do you do a circomflex? (sorry for the spelling, my french sux) |
14:24:00 | FromGitter | <alehander92> i always thought this is kinda the reason |
14:24:16 | FromGitter | <alehander92> i dont really use my right alt/ctrl shift usually |
14:24:43 | FromDiscord | <mratsim> it's a deadkey |
14:24:48 | clyybber | ah |
14:24:50 | FromDiscord | <mratsim> press the hat and then a "e" |
14:25:13 | FromDiscord | <mratsim> I deactivated that, that's a pain for development |
14:25:19 | clyybber | yeah |
14:25:30 | FromDiscord | <mratsim> Caps lock should be compose instead |
14:26:23 | FromGitter | <alehander92> https://upload.wikimedia.org/wikipedia/commons/9/9e/Bulgarian_BDS_layout.svg |
14:26:29 | FromGitter | <alehander92> i am not sure if we even *have* {} [] |
14:26:33 | FromGitter | <alehander92> by default |
14:26:54 | narimiran | AltGr+G, AltGr+shift+G |
14:26:54 | krux02 | alehander92: the inventer of the German layout din't use the right alt/ctrl/shift either. Thats why he did't bother to kick out one of them. |
14:27:15 | krux02 | but the recommended way to press modufiers is to always press them on the opposite side of the keyboard. |
14:27:17 | narimiran | or something like that, i'm not using croatian layout for a long time now |
14:27:35 | FromDiscord | <kodkuce> is ref object same as ref object of Root object ? |
14:27:40 | krux02 | no |
14:28:00 | FromGitter | <alehander92> hm, that sounds strange to me leftctrl+e is just |
14:28:04 | FromGitter | <alehander92> easier than rightctrl+e |
14:28:11 | FromDiscord | <mratsim> TIL: https://gizmodo.com/france-is-getting-a-new-algorithmically-designed-keybo-1833806064 |
14:28:14 | FromGitter | <alehander92> i guess its about efficient two hand typing |
14:28:43 | FromDiscord | <mratsim> @kodkuce ref object of RootObj are inheritable ref object are not |
14:28:46 | leorize | we have yet another pragma called `{.since.}`? |
14:29:05 | FromDiscord | <mratsim> for backward compat |
14:29:13 | clyybber | mratsim: Cool, but brackets on the 6 looks a bit annoying, its a far key |
14:29:25 | krux02 | anyway, neo layout is the best layout I found so far. |
14:29:33 | leorize | any documentations for `{.since.}`? |
14:29:52 | krux02 | It is so good, I could even convice several people to use it as well. |
14:29:59 | krux02 | and they switched. |
14:30:17 | FromGitter | <alehander92> @mratsim interesting like it |
14:30:23 | clyybber | krux02: Do you think its better than the us layout? I don't need umlauts anyways |
14:30:29 | narimiran | leorize: it is for new features so (for now) you can know when they were introduced |
14:30:38 | narimiran | later on it might even make it to the docs too |
14:30:50 | FromDiscord | <kodkuce> ty |
14:30:55 | FromGitter | <alehander92> and it makes it compatible with 1.0 iirc |
14:31:21 | leorize | narimiran: asking so I'd know if I have to add it to nim.nvim hardcoded highlighting list |
14:31:53 | krux02 | I think I told it once. I had a party at my house once. PC for music but with neo keyboard layout. All of my guests were already using de neo, except one. He was the stragne guy not using neo and his face when he realized he was the only person who could not handle the keyboard on that computer was priceless |
14:32:01 | FromDiscord | <mratsim> I'm not too sure how it's used, but basically if you want to enable a code path for since specific nim version that's what you need to use |
14:34:32 | PMunch | Is there a way to load the winsock header in Nim? |
14:36:11 | clyybber | TIL ctrl-I and ctrl-M are tab and enter |
14:36:22 | clyybber | in a terminal |
14:40:42 | FromGitter | <alehander92> krux02 surreal |
14:41:15 | FromGitter | <alehander92> i still prefer plain old qwerty for english tho |
14:41:46 | * | floppydh quit (Quit: WeeChat 2.6) |
14:44:53 | * | GordonBGood quit (Ping timeout: 245 seconds) |
14:48:35 | krux02 | clyybber: there is no universal better there is always a drawback. The biggest drawback is, it is non standard. In games you often have to remap keys, sometimes you can't do that when it is in the browser. And since you are not using äöü three keys have basically no purpose. But that can also be an advantage. When you know you will never use äöü you can map then in emacs to compile or to open a file in the pr |
14:48:35 | krux02 | oject or semthing else that you regularly do. |
14:48:48 | * | Vladar quit (Quit: Leaving) |
14:50:13 | FromGitter | <alehander92> i am surprised people dont write games for emacs |
14:50:22 | FromGitter | <alehander92> they do, right i am just naive |
14:51:10 | krux02 | emacs has a builtin tetris |
14:51:16 | krux02 | and there are other games for emacs. |
14:51:26 | * | k0mpjut0r joined #nim |
14:51:26 | * | MrAxilus joined #nim |
14:51:26 | * | nergal[m] joined #nim |
14:51:26 | * | M948e5[m] joined #nim |
14:51:27 | * | BitPuffin joined #nim |
14:51:27 | * | lqdev[m] joined #nim |
14:51:27 | * | isaac[m]1 joined #nim |
14:51:27 | * | GitterIntegratio joined #nim |
14:51:28 | * | Demos[m] joined #nim |
14:51:28 | * | LEdoian[m] joined #nim |
14:51:28 | * | leorize[m] joined #nim |
14:51:32 | * | nc-x[m] joined #nim |
14:51:32 | * | skrylar[m] joined #nim |
14:51:32 | * | spymasterd[m] joined #nim |
14:51:32 | * | xomachine[m] joined #nim |
14:51:32 | * | d-nice2[m] joined #nim |
14:51:32 | * | Manny8888 joined #nim |
14:51:33 | * | TheManiac[m] joined #nim |
14:51:33 | * | joachimschmidt55 joined #nim |
14:51:33 | * | narimiran[m] joined #nim |
14:51:33 | * | Miguelngel[m] joined #nim |
14:51:33 | * | Asbrn[m] joined #nim |
14:51:33 | * | zielmicha[m]1 joined #nim |
14:51:33 | * | pigmej joined #nim |
14:51:33 | * | meff[m] joined #nim |
14:51:33 | * | Connor[m] joined #nim |
14:51:33 | * | planetis[m] joined #nim |
14:51:34 | krux02 | But really you don't want to write games that run in emacs lisp. |
14:51:34 | * | salotz[m] joined #nim |
14:51:34 | * | lasso[m] joined #nim |
14:51:34 | * | macsek1911[m] joined #nim |
14:51:34 | * | shashlick[m] joined #nim |
14:51:34 | * | yglukhov[m] joined #nim |
14:51:34 | * | Balu[m] joined #nim |
14:51:36 | FromGitter | <mratsim> Something like this? https://github.com/jmoon018/PacVim |
14:52:44 | FromGitter | <mratsim> otherwise for learning new keyboard layout there is Typing of the dead (https://en.wikipedia.org/wiki/The_Typing_of_the_Dead) |
14:52:57 | krux02 | there is something easier |
14:53:01 | krux02 | zty.pe |
14:53:05 | krux02 | ^^ that is an url |
14:54:45 | FromGitter | <alehander92> cool idea |
14:54:53 | FromGitter | <alehander92> otherwise ie xpected stuff like chess etc in emacs |
14:54:59 | FromGitter | <alehander92> not really FIFA |
14:55:08 | FromGitter | <alehander92> (but i can imagine that ) |
14:55:44 | FromGitter | <alehander92> now i am surprised there is no terminal football multiplayer |
14:56:12 | krux02 | I would be like to develop browser games in the early 2000s. But with the disadvantage that it is not in the internet and people can only play it when they use emacs. |
14:56:29 | krux02 | don't do it. |
14:56:35 | FromGitter | <alehander92> of course, i agree |
14:56:39 | FromGitter | <alehander92> i dont even use emacs anyway |
14:57:10 | FromGitter | <alehander92> thats why now we put our editors into our browsers where its easier to make games |
14:57:16 | FromGitter | <alehander92> :) |
14:57:42 | krux02 | emacs can show images, so there are sprites. But animating them and positioning them is hard. And then it sucks in performace. It really isn't a good idea to do games here. |
14:58:01 | krux02 | yea, I don't understand this browser hype. |
14:58:08 | krux02 | I don't play browser games. |
14:58:16 | FromGitter | <alehander92> well, you're talking about serious games, i can imagine stuff like letters moving dots as "football" |
14:58:28 | krux02 | it should be easy to distribute games, yes. |
14:58:45 | FromGitter | <alehander92> well its a big plus especially for casual gaming |
14:58:53 | FromGitter | <alehander92> and multiplaying seems easier as well |
14:59:05 | krux02 | But I think we should develop some kind of virtual console that isolates processes properly where games can be playet. |
14:59:06 | FromGitter | <alehander92> otherwise it seems to me each platform has its own system/technology for that |
14:59:11 | FromGitter | <alehander92> which is usually probably paid |
14:59:29 | FromGitter | <alehander92> i think google were doing something like that |
14:59:36 | clyybber | TIL That Ctrl + Leftbracket is escape? |
14:59:46 | krux02 | no multiplayer in browser games isn't easier. You have to do the exact same networkin stuff for local games. |
14:59:48 | FromGitter | <alehander92> making a platform which can easily multiplayer-ize games on various platforms |
14:59:59 | krux02 | unless you make a table based games. |
15:00:00 | FromGitter | <alehander92> google stadia |
15:00:08 | clyybber | krux02: It's easier to get players :p |
15:00:16 | FromGitter | <alehander92> i know but it seems easier to me as a user |
15:00:26 | FromGitter | <alehander92> but it depends on the type of game i guess |
15:00:38 | krux02 | yea the browser might be good to gather and coordinate players for a game. |
15:00:49 | krux02 | But the game dosn't need to run in the browser. |
15:01:17 | FromGitter | <alehander92> maybe my point is, if it runs well enough in the browser, thats great, if not, maybe think of a desktop variant |
15:01:54 | FromGitter | <alehander92> and with wasm etc i guess the difference will become smaller |
15:02:40 | krux02 | For example, on saturday I played a 16 hour board game for 16 people. One session the hole day. For this the internet is great, because you can find people who actually do that. But the game itself doesn't need a browser it is a board game with a room full of people playing it. |
15:03:10 | krux02 | if wasm would be so great, I think we would have seen already more games using it. |
15:03:55 | krux02 | wasm is too isolated right now to be usable. |
15:04:02 | krux02 | and the tooling is too complicated. |
15:05:19 | FromGitter | <alehander92> yeah, but i think this would be solved with time |
15:05:36 | FromGitter | <alehander92> i dont insist the the biggest AA games |
15:05:38 | FromGitter | <alehander92> would use it |
15:05:58 | FromGitter | <alehander92> what board game supports 16 people btw |
15:06:06 | krux02 | I think we should have our own wasm backend for nim. |
15:06:17 | krux02 | but not a full backend. |
15:06:36 | FromGitter | <alehander92> i agree, i hoped llvm can help with that |
15:06:37 | krux02 | more like, I have this function, I want it to run in wasm, not in js, compile it to wasm and then call it from js |
15:07:01 | krux02 | I have done something like that already, but with a glsl backend. |
15:07:26 | Araq | nlvm does produce wasm |
15:07:30 | FromGitter | <alehander92> well, you can just have two nim programs, one which exposes a wasm api |
15:07:38 | FromGitter | <alehander92> and the other which consumes with from the js backend |
15:07:53 | FromGitter | <alehander92> with a nice sugar-ized lib for interaction if needed |
15:08:39 | FromGitter | <alehander92> yeah, just i am not sure how mature is nlvm wasm, does it e.g. support much of the stdlib / any kind of gc? |
15:08:47 | krux02 | yea the interaction from js to wasm is probably what causes most trouble if it would be written manually. I know this, because that is the major pain point in GLSL. |
15:10:23 | krux02 | Araq: nlvm does not solve the hybrid js and wasm compilation target. |
15:10:27 | krux02 | as far as I know. |
15:10:41 | FromGitter | <alehander92> iirc the status people need a lot of this wasm / js stuff |
15:10:58 | FromGitter | <alehander92> and i think they were trying to do something like that but i might be wrong |
15:11:22 | Araq | compile parts of your program via 'nim js' the others with nlvm, I do the same for the client/server split |
15:11:41 | Araq | 'nim js' for Karax, 'nim c' for the server. it works |
15:12:11 | Araq | yeah it could be a single compiler invokation, whatever. |
15:12:23 | FromGitter | <alehander92> yeah, i can imagine splitting them in modules and building with a tool/specific client framework might be easier |
15:12:49 | Araq | my GCC understands __attribute__((aligned(x))) and not _Alignas, thanks for nothing ANSI "standard" |
15:13:31 | Araq | why not encode existing practice? because fuck you, we're ANSI C, we don't understand standards or good taste. |
15:19:37 | FromDiscord | <kodkuce> hmm i forgot i want to use array cuz i know that i will have fixed number of elements all time but is array like seqs on heep or it goes to stack, i think someone told me something like that long ago |
15:23:43 | clyybber | Araq: Yay, standards: https://stackoverflow.com/questions/46518575/applying-alignas-to-an-entire-struct-in-c |
15:24:00 | clyybber | The second answer goes a bit into detail |
15:24:16 | * | Hideki_ quit (Remote host closed the connection) |
15:25:00 | * | Hideki_ joined #nim |
15:25:03 | krux02 | clyybber: the alignas directive in C is for variables and struct/union members only. |
15:25:36 | krux02 | when you want to align an entire struct, put the alignof experssion before the very first field declaration. |
15:29:26 | * | Hideki_ quit (Ping timeout: 265 seconds) |
15:31:42 | clyybber | krux02: Did your PR also add align support for the whole struct? |
15:32:05 | krux02 | id does align the whole struct, yes. |
15:32:12 | krux02 | but that is implicit |
15:32:34 | krux02 | the alignment of the struct is the maximum of the alignment values from all fields. |
15:33:00 | krux02 | interestingly, you can also use align in a packed struct. |
15:33:14 | krux02 | and align just a few fields. |
15:33:19 | clyybber | Thats cool |
15:33:37 | clyybber | Btw, is there some alignment difference between tuples and objects? |
15:33:48 | krux02 | no |
15:33:55 | krux02 | tuples are simpler though |
15:34:02 | krux02 | there is no custom field alignment in tuples |
15:34:11 | clyybber | There could be :) |
15:34:17 | krux02 | no |
15:34:18 | krux02 | there can't |
15:34:30 | clyybber | Why? They are C structs |
15:34:41 | krux02 | not for nim |
15:34:59 | krux02 | in nim tuples are a collection of members, nothing else. |
15:35:28 | krux02 | it will make type equality for tuples much harder with no added benefit. |
15:35:37 | clyybber | Yeah, I wasn't arguing for doing it |
15:35:46 | clyybber | Just that its *theoretically* possible |
15:35:52 | clyybber | Its probably a bad idea |
15:36:20 | krux02 | ye |
15:36:23 | krux02 | s |
15:38:42 | krux02 | it is probably bad to mix packed and alignof as well. |
15:38:47 | * | PMunch quit (Quit: Leaving) |
15:39:35 | krux02 | for binary interface types you should align float64 and int64 fields to 8 bytes so that it is consistent on all backends. |
15:57:50 | FromDiscord | <kodkuce> so is array on stack or heep? |
15:58:57 | krux02 | kodkuce: array is on the stack |
15:59:01 | krux02 | it is a value type |
15:59:16 | FromDiscord | <kodkuce> ok then i should use heep |
15:59:23 | FromDiscord | <kodkuce> *seq |
15:59:26 | krux02 | heep? |
15:59:38 | krux02 | a seq is on the heap, |
16:00:12 | krux02 | it is comparible to std::vector |
16:01:17 | clyybber | kodkuce: Keep in mind that seq and string still have value semantics |
16:01:28 | * | ITChap joined #nim |
16:01:28 | FromDiscord | <kodkuce> yep i have no reason storing a array/seq of 500player connections on stack |
16:02:18 | FromDiscord | <kodkuce> clyybber: i literally duno what you wanted to say with that 🙂 |
16:02:40 | clyybber | They are copied when you assign them |
16:03:20 | FromDiscord | <kodkuce> oh you mean they are not refs |
16:03:25 | clyybber | yeah |
16:03:49 | * | Hideki_ joined #nim |
16:04:04 | clyybber | you can make them ref though if you want that. |
16:04:13 | FromDiscord | <kodkuce> no really |
16:04:41 | clyybber | :p |
16:04:50 | FromDiscord | <kodkuce> 🙂 i go work work work |
16:06:06 | clyybber | kodkuce: What are you doing? |
16:06:13 | clyybber | /creating/making |
16:06:36 | FromDiscord | <kodkuce> am making a gameserver for casual games |
16:06:56 | FromDiscord | <kodkuce> atm am making a poker game instance |
16:07:10 | clyybber | nice |
16:07:21 | FromDiscord | <kodkuce> duno will see 🙂 |
16:07:24 | FromDiscord | <kodkuce> you ? |
16:07:25 | clyybber | (don't forget to provide telnet access) |
16:07:54 | clyybber | clyybber: A daw for the terminal |
16:07:56 | FromDiscord | <kodkuce> telnet wtf would need telent for or is it some joke i dont know about |
16:08:04 | clyybber | yeah, I was kidding |
16:08:09 | clyybber | would still be cool though |
16:08:15 | FromDiscord | <kodkuce> for client i plan to use godot |
16:08:36 | clyybber | ah. Theny why don't you use it for the server too? |
16:09:06 | clyybber | Nvrmind, there are probably a lot of reasons not to |
16:09:18 | FromDiscord | <kodkuce> hmm duno kinda think its too OP for card games and stuff |
16:09:42 | clyybber | The remote procedure call way of networking in godot is very nice |
16:09:59 | clyybber | But I don't get why godot had to make its own lang |
16:11:19 | FromDiscord | <kodkuce> i didnet try networking in godot only websockets, ye its horor jumping from gdscript to nim xD , did you try GDnativ with Nim? |
16:12:03 | clyybber | I tried, but that was when the godot bindings for nim weren't up to date with the (then) newly released 3.0 or 3.1 |
16:15:21 | FromDiscord | <kodkuce> and now are? |
16:25:32 | clyybber | working on a terminal DAW |
16:25:53 | clyybber | or rather, a library I want to use for it and for a rogulie |
16:26:00 | clyybber | s/lie/like |
16:30:02 | * | Hideki_ quit (Ping timeout: 240 seconds) |
16:31:42 | FromDiscord | <kodkuce> DAW? |
16:31:53 | clyybber | Digital Audio Workstation |
16:32:49 | federico3 | ...terminal? |
16:32:59 | clyybber | yeah |
16:35:48 | madprops | how can i specify in the nimble file to always check the github source for changes? |
16:35:50 | FromDiscord | <kodkuce> what lib you using for making layout/menus in terminal |
16:35:59 | madprops | i put the direct link, but then it won't update it on install |
16:36:13 | solitudesf | you cant |
16:36:41 | FromDiscord | <kodkuce> nimble install package will owerite to latest, tought duno why would you want even to do that |
16:37:10 | madprops | for instance i link to a library i made. then i push to the library repo. nimble install won't detect it as a new version |
16:37:11 | clyybber | kodkuce: I'm currently making my own |
16:37:14 | FromDiscord | <kodkuce> you can make a bash or whatwer cript to do nimble list packages , then nimble install eachpackage and run it on chron or whatwer |
16:37:31 | madprops | what im doing is just installing the github link directly each time |
16:38:14 | madprops | for instance i have this: requires "https://github.com/madprops/nap" |
16:38:23 | madprops | but `nimble install` won't check for updates |
16:38:44 | FromDiscord | <kodkuce> hmm, so you have your lib on github and you want |
16:39:23 | solitudesf | if its your lib, you should `nimble develop` it |
16:39:43 | FromDiscord | <kodkuce> oh you mean if you update your lib on github and do nimble install https://github.com/madprops/nap it wont notice that repo one is newer and wont install |
16:39:51 | madprops | exactly |
16:40:13 | FromDiscord | <kodkuce> then probbaly listend to solitudesf cuz i duno 🙂 |
16:40:36 | madprops | maybe im missing @master or something |
16:40:43 | * | ITChap quit (Ping timeout: 250 seconds) |
16:41:16 | solitudesf | nimble has no mechanism to update the dependency if its already satisfied, you should use nimble develop |
16:42:20 | FromDiscord | <kodkuce> you can alwies nimble unistall then install but that kinda sux |
16:43:23 | madprops | where does nimble develop put the files? |
16:43:45 | madprops | ok in the root dir |
16:44:34 | madprops | so how do i make users of my program automate `nimble develop` should i include the `requires` in the nimble file at all? |
16:48:04 | * | NimBot joined #nim |
16:50:56 | solitudesf | nimble develop is for developers, not the users |
16:51:24 | madprops | right, it will be in the repo anyway |
16:51:27 | solitudesf | if you expect users to install your program you should properly tag the releases |
16:51:46 | solitudesf | of it and all the dependencies |
16:52:06 | madprops | i can release programs (not libraries) ? |
16:52:32 | * | solitudesf quit (Quit: Leaving) |
16:52:57 | madprops | hmm apparently i can't run nimble develop again |
16:53:01 | madprops | because the dir already exists |
16:53:10 | madprops | thought it would check for updates |
17:12:49 | FromDiscord | <kodkuce> if i have 2 seqs of ints whats easywes what to get diference, should i use filter or there better way |
17:14:11 | * | ITChap joined #nim |
17:14:45 | FromDiscord | <kodkuce> or to sets and then - |
17:18:54 | narimiran | IntSet |
17:30:08 | FromDiscord | <kodkuce> i allreayd did with filterIt tough will check that IntSet too |
17:55:52 | FromDiscord | <kodkuce> is there some short magic for doing like 0..22.toSeq() or something to get a seq with 0,1,2,3..22 |
17:57:10 | narimiran | toSeq(0..22) |
17:58:04 | FromDiscord | <kodkuce> ty |
18:11:21 | * | Vladar joined #nim |
18:12:48 | donpdonp | what am i doing wrong with sort("a","b") -> but expected one of: sort(OrderedTable...sort(CountTable.. |
18:12:59 | FromGitter | <zacharycarter> is there any way to assign a slice of a sequence to an array? |
18:13:39 | FromGitter | <zacharycarter> like if I have a sequence of 5 elements, assign those elements to elements with indices 0-5 of the array |
18:13:46 | * | Hideki_ joined #nim |
18:14:44 | narimiran | @zacharycarter come on, you know this one, you're not even trying |
18:14:45 | narimiran | https://play.nim-lang.org/#ix=21QQ |
18:15:05 | donpdonp | ah its sorted([]) |
18:15:21 | FromGitter | <zacharycarter> oh I forgot I could use the range operator on the array too - thanks narimiran |
18:17:57 | * | Hideki_ quit (Ping timeout: 240 seconds) |
18:30:47 | madprops | nimble directory install check fails with: Error: Unsatisfied dependency: nim (>= 1.0.2) |
18:38:34 | * | jjido joined #nim |
18:53:10 | FromDiscord | <kodkuce> what version of nim you have installed? |
18:57:28 | madprops | 1.0.2 - im talking about the directory page |
18:57:33 | madprops | probably has some outdated compiler |
18:59:36 | narimiran | federico3: ^ |
19:00:22 | narimiran | madprops: for some quick fix, you can make your package >= 1.0.0 |
19:09:32 | * | Vladar quit (Quit: Leaving) |
19:09:55 | * | MightyJoe joined #nim |
19:10:59 | * | nsf quit (Quit: WeeChat 2.6) |
19:11:14 | * | cyraxjoe quit (Ping timeout: 240 seconds) |
19:14:11 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
19:15:09 | federico3 | madprops: is that a real requirement? :) 1.0.2 instead of .0 ? |
19:15:45 | * | MightyJoe is now known as cyraxjoe |
19:16:07 | * | u9898287 quit (Quit: u9898287) |
19:16:15 | federico3 | I'll do an official backport and update it anyways |
19:16:21 | * | u9898287 joined #nim |
19:24:32 | * | njoseph quit (Ping timeout: 252 seconds) |
19:25:19 | FromDiscord | <Anuke> Anyone here familiar with nimterop? I'm attempting to create a statically linked wrapper for a C library, but it's not linking properly and giving me "undefined reference to XXXX" errors. Code: https://hastebin.com/inixoleser.cpp |
19:25:38 | madprops | federico3: that was just put there by default by nimble. i guess i don't really need it |
19:25:38 | FromDiscord | <Anuke> The specific library is the Discord RPC |
19:27:38 | * | lritter joined #nim |
19:29:17 | * | ITChap quit (Ping timeout: 276 seconds) |
19:29:17 | * | uu91 quit (Ping timeout: 276 seconds) |
19:29:19 | Araq | Anuke: wait until shashlick is around |
19:29:25 | * | uu91 joined #nim |
19:29:44 | FromDiscord | <Anuke> Are there any specific times when he is around? |
19:31:06 | Araq | maybe in half an hour |
19:31:39 | FromDiscord | <Anuke> Alright, thanks |
19:34:56 | * | ITChap joined #nim |
19:35:19 | * | ITChap is now known as Guest71347 |
19:39:44 | disruptek | shashlick is away, fwiw. |
19:45:16 | * | njoseph joined #nim |
19:52:28 | * | thomasross_ joined #nim |
19:52:28 | * | thomasross is now known as Guest78629 |
19:52:28 | * | Guest78629 quit (Killed (card.freenode.net (Nickname regained by services))) |
19:52:28 | * | thomasross_ is now known as thomasross |
20:02:00 | federico3 | madprops: not good, it should default to 1.0.0 |
20:02:32 | disruptek | file an issue. |
20:02:39 | federico3 | yup |
20:02:47 | madprops | btw, I'm not sure if im passing stuff in a correct manner. So far I haven't bothered with references at all, i just pass stuff around freely thinking the compiler will handle that internally. Should I be more careful about that? |
20:08:11 | * | GordonBGood joined #nim |
20:12:08 | krux02 | madprops: you can live a happy life without using `ref` at all. |
20:12:18 | krux02 | but you should be more careful. |
20:12:33 | * | GordonBGood quit (Ping timeout: 252 seconds) |
20:12:34 | krux02 | You should know what the compiler is able to do and what it isn't' |
20:20:18 | * | jwm224 quit (Ping timeout: 245 seconds) |
20:20:23 | madprops | hmm what am i doing wrong here? https://play.nim-lang.org/#ix=21Rz |
20:20:31 | * | nsf joined #nim |
20:20:47 | madprops | "Error: expression has no address; maybe use 'unsafeAddr'" |
20:22:16 | * | jwm224 joined #nim |
20:24:28 | FromDiscord | <IanIAnIAN> is that the opt is not initialised error? |
20:31:24 | madprops | maybe im supposed to iterate differently? |
20:34:32 | madprops | the object exists because it's matching key == opt.name |
20:34:57 | madprops | it exists in the seq at least. im not using new to create it though .. just MyOjbect(name:..) etc |
20:42:11 | * | narimiran quit (Quit: Leaving) |
20:42:40 | * | lritter quit (Quit: Leaving) |
20:43:09 | madprops | found the answer reading some old irc logs |
20:43:16 | madprops | i needed an intermediary variable |
20:48:25 | madprops | dumb question but, what can how i access what a ptr points to? |
20:48:29 | madprops | how* |
20:49:58 | stefantalpalaru | https://nim-lang.org/docs/manual.html#types-reference-and-pointer-types |
20:50:10 | stefantalpalaru | somePointer[] |
20:54:46 | madprops | im doing something terribly wrong here https://play.nim-lang.org/#ix=21RD |
20:55:03 | * | Hideki_ joined #nim |
20:58:02 | madprops | if i try to use myptr[].value it goes out of memory |
20:59:29 | * | Hideki_ quit (Ping timeout: 252 seconds) |
21:03:30 | clyybber | well |
21:03:38 | clyybber | then your pointer isn't pointing to something |
21:03:49 | clyybber | or do you mean literally OOM? |
21:05:18 | clyybber | madprops: I think the issue is that you are returning a pointer to a variable that is local to argref |
21:05:44 | clyybber | And after argref has finished, it will disappear |
21:05:56 | * | lritter joined #nim |
21:06:04 | clyybber | But I can't test your snippet since its missing the types |
21:07:20 | FromDiscord | <kodkuce> "template/generic instantiation of `async` from here" << why does this spawn in my vscode whenwer i use async, can i suppress it? |
21:10:07 | madprops | clyybber: this is what im doing https://play.nim-lang.org/#ix=21RG except i return "o" to another file |
21:11:44 | madprops | but yeah i guess it's returning the address of a temporary var |
21:11:51 | madprops | not sure how to do it properly though |
21:17:33 | madprops | im wondering if there's a way to iterate through references |
21:19:08 | krux02 | madprops, when you access a member variable, you can write `myptr.value` instead of `myptr[].value`. |
21:19:54 | madprops | cool |
21:20:07 | madprops | this works btw https://play.nim-lang.org/#ix=21RK |
21:20:11 | madprops | what im wondering is why it has to be unsafe |
21:20:29 | clyybber | Because the variable is not mutable |
21:20:42 | clyybber | And you could theoretically modify its value via an address |
21:21:00 | clyybber | You can use .mitems as an iterator if you really want to get rid of the unsafe part |
21:22:15 | krux02 | madprops, I would use `var NapArg` instead |
21:22:36 | madprops | hm ? |
21:22:52 | madprops | same name as the class? |
21:23:04 | krux02 | https://play.nim-lang.org/#ix=21RL |
21:23:32 | krux02 | `var` means mutable reference. |
21:23:44 | krux02 | that is a hidden pointer. |
21:24:40 | madprops | hmm just tried that. doesn't seem to be referenced when used. as in, the values didn't change |
21:24:49 | madprops | it keeps showing the initial values |
21:24:55 | madprops | im returning `var NapArg` |
21:26:13 | madprops | actually with the previous reference method, i can also mutate it |
21:43:49 | FromGitter | <s0kil> Does Nim `compressdwarf` by default, like Go? |
21:47:03 | FromDiscord | <kodkuce> http://ix.io/21RT << template/generic instantiation of `async` from here, Warning: 'cbIter' is not GC-safe as it accesses 'govno' which is a global using GC'ed memory Can i ignore this or will this really make some issue for me |
21:51:29 | * | nsf quit (Quit: WeeChat 2.6) |
21:55:50 | FromDiscord | <kodkuce> do i have to {.threadvar.} it or can i ignore? |
21:59:03 | Araq | s0kil: no because Nim produces tiny binaries without compression hacks |
22:00:45 | * | sealmove joined #nim |
22:02:18 | FromDiscord | <treeform> Araq, can I talk to you about https://github.com/nim-lang/cairo ? |
22:02:37 | Araq | shoot |
22:02:38 | FromDiscord | <treeform> I made a huge PR request: https://github.com/nim-lang/cairo/pull/9 |
22:02:51 | FromDiscord | <treeform> But I want to do more. Like change some of the API around. |
22:02:56 | FromDiscord | <treeform> How much will you allow me to do? |
22:03:29 | FromDiscord | <treeform> This PR changes nothing but just ads tests and samples to the read me. |
22:03:37 | FromDiscord | <treeform> But I want to change the API |
22:04:14 | FromDiscord | <treeform> like `surface.create()` create what? change that to `surface.createContext()` |
22:04:57 | FromDiscord | <treeform> and like `setSource*()` just dispatch on types not have `setSourceRGB` `setSourceRGBA` ... etc. |
22:05:16 | madprops | theres' no ! negation operator at all? |
22:05:26 | madprops | apart from not i mean |
22:05:32 | lqdev[m] | madprops: `not` |
22:05:34 | lqdev[m] | no, there isn't |
22:05:39 | lqdev[m] | you can define one |
22:05:48 | Araq | don't break code, treeform, introduce new procs and .deprecate what you think should be deprecated |
22:05:52 | lqdev[m] | template `!`(x: bool): bool = not x |
22:08:45 | FromDiscord | <treeform> Araq, there is also a ton of like TMatrix and PMatrix (is this an old style?) ... could there just be one Matrix and ptr Matrix when you need it? |
22:08:58 | Araq | yup |
22:09:10 | FromDiscord | <treeform> Can I change it? |
22:10:59 | lqdev[m] | treeform, Araq: also, the procs should be in camelCase. it's not a breaking change, but it matters when using nimsuggest |
22:11:34 | FromDiscord | <treeform> lqdev, Araq, Yes that's another big thing I want to do. Can I camelCase everything? |
22:11:43 | FromDiscord | <treeform> Our case rules should handle that and not break code? |
22:11:53 | disruptek | why would that break nimsuggest? |
22:11:53 | FromDiscord | <treeform> Well nim's case rules 🙂 |
22:12:03 | Araq | true |
22:12:15 | Araq | seems fine. |
22:12:26 | FromDiscord | <treeform> disruptek, it wants me to type clip_preserve, but I want to type clipPreserve... |
22:12:35 | lqdev[m] | disruptek: it doesn't break nimsuggest, it's that nimsuggest autocompletes using the original proc's casing, no conversion is done |
22:12:46 | disruptek | aha. |
22:12:56 | lqdev[m] | as treeform says |
22:12:57 | disruptek | your change makes sense. |
22:16:46 | FromDiscord | <treeform> Araq, so you agree with the massive case change, and the lesser P&T change, and the random API fixes? I guess i'll get started on that after you approve my first PR. |
22:17:17 | FromDiscord | <treeform> As long as I do everything with{.depricated.} and not break old code? |
22:19:22 | lqdev[m] | I wonder why doing `--stackTrace:off` makes such a big performance difference and why `-d:release -d:danger` doesn't |
22:19:29 | Araq | or maybe make it version 2.0 and break stuff, my Nimble dependency will have >= 1.0 & < 2.0 |
22:19:41 | Araq | right? muhahahaha |
22:19:46 | FromDiscord | <treeform> Araq, I could do that too. Up to you? |
22:20:02 | Araq | dunno, I don't believe in semver |
22:20:09 | FromDiscord | <treeform> I would vote for a breaking change. I don't know how many people use use the Cairo library. |
22:20:15 | FromDiscord | <treeform> It only has 6 stars. |
22:20:39 | FromDiscord | <treeform> I did not use it at first because I could not get it to compile. But that some how was fixed. |
22:20:54 | FromDiscord | <treeform> Then it has awkward not quite C not quite Nim API. |
22:21:14 | disruptek | thank you, semver is stupid. |
22:21:15 | FromDiscord | <treeform> It was hard to get samples from C ported. |
22:21:26 | Araq | I vote for backwards compat |
22:21:42 | Araq | unless it means > 100 deprecated symbols |
22:21:57 | FromDiscord | <treeform> let me see |
22:22:13 | lqdev[m] | Araq: can you explain why I observe that behavior? |
22:22:39 | lqdev[m] | nim.cfg disables stack traces when `release` or `danger` is defined. |
22:23:01 | Araq | lqdev[m]: hum |
22:23:14 | FromDiscord | <treeform> Looks like 24+19 depreciated symbols. |
22:25:40 | FromDiscord | <treeform> Some symbols like `PBool*` are not used for anything |
22:27:12 | lqdev[m] | oh wait. `-d:release` and `-d:danger` don't work inside config.nims, right? |
22:27:20 | lqdev[m] | because the default config is loaded first |
22:27:30 | FromDiscord | <Generic> how well is the newruntime tested? |
22:28:20 | FromDiscord | <treeform> @Generic looks like nim is not going to go with the --newruntime thingy. Some thing else is being worked on at the moment. |
22:29:12 | FromDiscord | <Generic> I know, though afaik there are overlaps |
22:29:26 | FromDiscord | <Generic> *overlappings |
22:29:45 | FromDiscord | <Generic> anyhow it's a bit of an adventure |
22:31:29 | clyybber | --newruntime is essentially --gc:destructors + owned refs |
22:33:03 | Araq | most bugs that I fix affect both "runtimes" likewise |
22:33:15 | Araq | as it's the same implementation |
22:39:45 | * | exelotl joined #nim |
22:44:02 | * | jjido joined #nim |
22:46:39 | madprops | having this weird problem were references break if i set them in different orders, don't know why https://play.nim-lang.org/#ix=21Sd |
22:46:47 | madprops | if i use it like that, only tree maintains a reference |
22:46:54 | madprops | but if i move boo at the bottom, it works for boo |
22:58:03 | FromGitter | <s0kil> I'm getting an error from a profiler when compiling in debug mode: `Ignoring DWARF format error when reading line table: DW_FORM_sec_offset not expected for attribute (DW_AT)0x2119` |
23:01:01 | * | u9898287 quit (Quit: u9898287) |
23:08:42 | * | vsantana quit (Remote host closed the connection) |
23:08:44 | madprops | does adding objects to a seq mess with references? |
23:09:50 | * | vsantana joined #nim |
23:09:58 | madprops | because that's the only thing i can think of about my problem |
23:13:13 | lqdev[m] | madprops: don't use `ptr` in normal code. |
23:13:35 | lqdev[m] | if you want to pass an object by reference, either rethink your code, or make the object a `ref object` |
23:22:56 | madprops | lqdev[m]: how would I return a reference to an obj, from a function, if I make the object ref ? |
23:29:44 | donpdonp | required type for x: var seq[T]; but expression 'market.bqbook' is immutable, not 'var' |
23:30:00 | * | clyybber quit (Quit: WeeChat 2.6) |
23:30:21 | donpdonp | my type has a property, bqbook*: seq[Offer], and the object gets passed to the function |
23:30:34 | donpdonp | i dont know how to satisty the var field |
23:30:50 | donpdonp | market.bqbook.add(x) being a seq, i thought add() would just work |
23:31:59 | * | drewr joined #nim |
23:32:43 | madprops | is there such a thing as `ref object` or do i have to always base it on other object? |
23:38:56 | lqdev[m] | madprops: just declare it as `ref object`, and it will be passed by reference |
23:39:12 | lqdev[m] | you don't have to base it on another object |
23:39:38 | krux02 | all objects are passed by reference |
23:39:44 | lqdev[m] | donpdonp: make sure the seq you're passing is from a `var` variable, and not a `let` variable |
23:40:16 | krux02 | you do a reference with `var`. |
23:42:02 | donpdonp | lqdev[m]: im passing an object, so i assume the object param must be type var ? |
23:42:31 | krux02 | no |
23:42:59 | krux02 | all object parameters are passed by reference to functions |
23:43:14 | krux02 | doesn't matter if it is var not var or ref |
23:43:40 | donpdonp | how do i specify market.bqbook is var when all im passing is market? |
23:43:51 | krux02 | proc foo(arg: var MyType) # you can modify it. |
23:44:04 | krux02 | proc foo(arg: MyType) # you can't modify it from foo |
23:44:16 | donpdonp | ok. the problem is the level higher up |
23:44:34 | krux02 | proc foo(arg: ref MyType) # MyType must be heap allocated. |
23:44:48 | donpdonp | map(mySeq, myfunc) => required type for op: proc (x: T): S{.closure.} expression is of type: proc (m: var Market){.closure, locks: <unknown>.} |
23:45:35 | donpdonp | im iterating through table.mpairs and the value is seq[Market], so im doing map(value, proc{...}) |
23:47:21 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
23:50:24 | madprops | lqdev[m]: thanks, that seemed to work |
23:56:22 | donpdonp | i think my map proc was missing a return value |
23:56:35 | donpdonp | but i dont need map anymore so i've moved on :) |