00:00:10 | ldlework | eh nm |
00:01:24 | Araq_ | well a couple of days ago I managed to convince you that you don't need inheritance nor case objects ;-) |
00:01:37 | ldlework | Araq_: yeah by using macros to generated unified types |
00:01:45 | ldlework | But there are some downsides to that method |
00:01:54 | ldlework | Since each entity is now the size of all possible components combined |
00:01:58 | ldlework | even if it uses one or two |
00:02:30 | ldlework | Araq_: what do you think about making Type names global enums when used in value positions? :D |
00:02:35 | Araq_ | not if you go for the "entity is just an ID" |
00:02:54 | Araq_ | and "have separate seqs to store the actual data" approach |
00:02:56 | ldlework | Where are the components then? |
00:03:10 | ldlework | eh |
00:03:14 | Araq_ | which is what is usually done |
00:03:31 | ldlework | Doing the basic ECS is boring and I can do that in any language. |
00:03:37 | ldlework | And is not egronomic |
00:08:00 | Araq_ | Nim doesn't revolutionize runtime aspects |
00:08:04 | * | thotypous quit (Ping timeout: 272 seconds) |
00:08:13 | ldlework | But it may allow me to express them more elegantly |
00:08:32 | Araq_ | yeah but under the hood you need to decide of how to store the data |
00:08:54 | Araq_ | and if space efficiency is your concern |
00:09:07 | Araq_ | inheritance wins over case objects for your case. |
00:09:10 | ldlework | There are a number of concerns. Trying to balance them out of course. |
00:09:46 | ldlework | I can probably afford one discriminator field of memory for each component, for gains in expressability |
00:10:01 | * | thotypous joined #nim |
00:10:05 | ldlework | But then variants are limited with the duplicate field problem |
00:10:10 | ldlework | I could use your suggestion above |
00:10:18 | Araq_ | case objects translate into unions |
00:10:23 | ldlework | But then every field access has to go through two dot-accesses |
00:10:31 | ldlework | sprite_component.sprite.img, etc |
00:10:33 | Araq_ | so you pay for more than just the discriminator |
00:10:46 | ldlework | Wait so each case instance is the size of all variants?! |
00:11:10 | Araq_ | how else would you be able to store them in an array? |
00:11:21 | ldlework | magic |
00:11:41 | Araq_ | template img(x): untyped = x.sprite.img |
00:11:59 | ldlework | then you need one for every field! |
00:11:59 | Araq_ | you can generate accessors for not ambiguous fields |
00:12:01 | ldlework | lol |
00:12:56 | Araq_ | when you use inheritance you save space |
00:12:57 | ldlework | hmmmmmmmmmmmmmmmmmmmmm |
00:13:12 | Araq_ | but you're forced to work with 'ref's because guess what |
00:13:14 | ldlework | yeah, and def-'s code was not terrible |
00:13:25 | Araq_ | otherwise you cannot store them in arrays either... |
00:13:34 | Araq_ | arrays only work with fixed sizes |
00:13:41 | ldlework | would a "with x as T" syntax be possible? |
00:13:54 | ldlework | Like lets say I accept an Animal as a parameter x |
00:13:57 | ldlework | I could do |
00:14:01 | ldlework | with x as Dog: |
00:14:05 | ldlework | echo x.dog_field |
00:14:28 | Araq_ | yeah but iirc 'with' is a keyword (don't ask me why) |
00:14:56 | ldlework | maybe, "when x is Dog" |
00:14:57 | Araq_ | so you cannot have a 'with' macro (ignoring the backticks notation) |
00:14:59 | ldlework | or something |
00:15:10 | Araq_ | 'when' is a keyword ... |
00:15:23 | ldlework | supposing x isa Dog: |
00:15:24 | ldlework | lmfao |
00:15:35 | Araq_ | 'wis x as Dog' |
00:16:25 | ldlework | take x as Dog: |
00:16:31 | ldlework | echo x.dog_field |
00:16:42 | ldlework | consider x a Dog: |
00:17:36 | ldlework | treat x as Dog: |
00:17:38 | ldlework | that's not bad |
00:18:01 | ldlework | but what if x is not a Dog... |
00:18:36 | ldlework | oh right that's why the block is only conditionally executed |
00:18:38 | ldlework | hrm |
00:19:32 | ldlework | wait |
00:19:34 | ldlework | can't you just do |
00:19:37 | ldlework | when x of Dog: ? |
00:19:47 | ldlework | Araq_: ^ |
00:19:53 | def- | ldlework: no, how could you know at compile time what will be passed at runtime? |
00:20:04 | ldlework | def-: right hence the conditional |
00:20:12 | ldlework | isn't when a conditional too? |
00:20:16 | Araq_ | if x of Dog: |
00:20:20 | def- | yes, a compile time conditional |
00:20:22 | Araq_ | Dog(x).foobar |
00:20:23 | ldlework | ah right |
00:20:32 | Araq_ | now let's see |
00:20:32 | ldlework | Araq_: :'( |
00:21:30 | ldlework | def-'s macro as syntax would be so nice tho.. |
00:21:55 | ldlework | with the {.inject.} thingie |
00:22:07 | def- | ldlework: well, that was a template, with a proper macro it's doable |
00:22:16 | ldlework | oh right |
00:22:17 | ldlework | duh |
00:22:28 | ldlework | just gotta parse the expr a bit |
00:22:37 | ldlework | def-: but what phraseology? |
00:22:48 | def- | ldlework: huh? |
00:25:37 | ldlework | heh what should the macro be named |
00:25:50 | def- | definitely something cryptic |
00:25:54 | ldlework | hehe |
00:26:25 | Araq_ | we could remove 'with/without' from the list of keywords |
00:26:48 | Araq_ | maybe I'm drunk but I don't think they are used for anything at all. |
00:26:53 | ldlework | lol |
00:26:58 | def- | Araq_: I guess "with" might have been for python's "with"? |
00:27:25 | Araq_ | no, it was always clear you could do that with a template |
00:27:29 | ldlework | It seems like the observation here is that all of these block-y things can be made with macros |
00:27:55 | Araq_ | it was done for a pragma alternative 'with boundChecks:' ... |
00:28:04 | Araq_ | 'without boundChecks' |
00:28:40 | ldlework | 'with' doesn't really connotate that the block is condition though :( |
00:28:47 | ldlework | conditionally executed that is |
00:29:14 | Araq_ | `as` is an operator that can be overloaded. iirc. |
00:29:25 | Araq_ | foo as Bar: ... |
00:29:31 | ldlework | like, its not possible to just detect the form "if nnkIdent of nnkTypeDesc" and do the inject thingie |
00:29:42 | ldlework | I guess that's bad, like if you didn't want it to be cast |
00:29:47 | * | gunn quit (Read error: Connection reset by peer) |
00:30:11 | def- | Araq_: cool, that works |
00:30:24 | * | gunn joined #nim |
00:30:25 | ldlework | how does that work? |
00:30:39 | ldlework | can you make an `as` macro? |
00:30:42 | def- | ldlework: yes |
00:30:45 | ldlework | lmfao |
00:30:52 | ldlework | so crazy |
00:31:07 | * | yglukhov quit (Remote host closed the connection) |
00:31:13 | Araq_ | I will call it "dark Nim" |
00:31:26 | ldlework | call what? |
00:31:26 | Araq_ | Nim's undocumented features. |
00:31:30 | ldlework | ah |
00:31:34 | ldlework | unreachable from the docs |
00:31:36 | ldlework | :D |
00:31:54 | ldlework | Well its not really a feature right |
00:32:00 | ldlework | since we can just implement it as a macro |
00:32:07 | ldlework | oh operators as macros |
00:32:22 | ldlework | I'm slow |
00:32:35 | Araq_ | that 'as' is a keyword infix operator certainly is a feature. |
00:33:12 | ldlework | def-: are you updating your thing |
00:33:17 | ldlework | just asking! |
00:33:24 | def- | ldlework: yeah, give me a few min to write up a proper macro |
00:33:53 | * | derka quit (Quit: derka) |
00:37:57 | def- | hm, it seems to work with a template after all |
00:38:55 | def- | here you go: https://gist.github.com/def-/aa8f2d2793d800920df6 |
00:39:16 | * | jaco60 quit (Ping timeout: 250 seconds) |
00:39:30 | ldlework | interesting |
00:41:24 | * | pregressive joined #nim |
00:42:47 | ldlework | Araq_: so type names as a global enum. Stupid idea? |
00:43:23 | ldlework | Imagine a table like Table[TypeDesc, Component] |
00:43:27 | ldlework | then I'd be able to do like |
00:43:42 | ldlework | t[CPhysics] = CPhysics(x:10, y:10) |
00:43:54 | ldlework | be like |
00:43:57 | ldlework | CPhysics in t |
00:43:59 | ldlework | and so on |
00:44:16 | Araq_ | you can do something similar with a .pure enum and a template that hides the qualification |
00:44:43 | * | ldlework looks up .pure enum |
00:45:08 | ldlework | I don't get it. |
00:45:11 | Araq_ | template `|`(x): untyped = TypeEnum.x |
00:45:30 | Araq_ | t[|Physics] = Physics(x: 10, y: 10) |
00:45:32 | ldlework | Oh so I'd have to generate an actual Enum |
00:45:44 | ldlework | That's not much better than |
00:45:46 | Araq_ | not sure it if it's a good idea |
00:45:53 | ldlework | t[EPhysics] = Physics(...) |
00:47:32 | ephja | bindings generation fun! |
00:47:46 | * | askatasuna quit (Ping timeout: 240 seconds) |
00:48:07 | ldlework | I guess there'd be no way to differentiate between referring to the type |
00:48:10 | ldlework | and calling the type |
00:48:15 | ldlework | what does |
00:48:29 | ldlework | `let foo = Physics` mean |
00:48:52 | ldlework | Unless that doesn't actually call the type |
00:51:50 | * | derka joined #nim |
01:02:02 | * | derka quit (Quit: derka) |
01:03:05 | * | pregressive quit (Remote host closed the connection) |
01:03:54 | ldlework | if type names were ordinal you could do case v.type, with typetraits |
01:08:43 | ldlework | ugh damn |
01:08:52 | ldlework | if I have a parameter of type Component |
01:09:01 | ldlework | v.type.name just gives me Component not the subclass |
01:09:06 | ldlework | crap |
01:12:06 | ldlework | ah just use an if statement |
01:15:39 | * | pregressive joined #nim |
01:17:24 | * | xtagon quit () |
01:19:41 | ldlework | How the hell do I convert "@" to a rune |
01:22:09 | * | girvo joined #nim |
01:22:35 | girvo | Hey all :) |
01:26:28 | ephja | ldlework: runeAt("@", 0) or toRunes("@")[0] |
01:27:16 | ldlework | So inheritance isn't gonna work I don't think |
01:27:34 | ldlework | Any time you pass a subclass to a superclass parameter it loses all the data. |
01:27:50 | ldlework | Like if I have a table of T[string, BaseClass] |
01:28:05 | ldlework | and I stick a bunch of inherited things in there, they seem to lose their data |
01:28:18 | ephja | are they not refs? |
01:28:39 | girvo | does anyone have any advice on what api's i should look at to let a nim app watch a directory for changes? inotify on Linux, etc. |
01:29:45 | ephja | girvo: http://nim-lang.org/docs/fsmonitor.html |
01:29:58 | bozaloshtsh | ldlework: isn't that how normal OOP behaves? |
01:30:03 | ldlework | ephja: what do you mean |
01:30:14 | ldlework | bozaloshtsh: seems useless |
01:30:55 | ephja | ldlework: are the keys values or references? |
01:31:42 | ldlework | ephja: that worked thanks |
01:32:44 | ephja | nre.replace sure seems slow |
01:34:36 | ephja | maybe it needs shallow copying |
01:35:47 | girvo | ephja: You're a champion, thanks! |
01:37:54 | girvo | does fsmonitor work with FSEvents on OS X? |
01:38:02 | girvo | Actually, don't answer |
01:38:06 | girvo | I'm going to go find out ;) |
01:39:08 | girvo | Ah, it's inotify only |
01:39:29 | girvo | Now time to look at FSEvent's API and see how easy it'll be to integrate! |
01:41:50 | bozaloshtsh | For some reason I can't return early from an async proc that returns Future[void]. If I do, I get a type mismatch. Any ideas? |
01:43:08 | Araq_ | bozaloshtsh: how do you return? |
01:45:06 | * | vqrs_ quit (Ping timeout: 240 seconds) |
01:46:06 | ldlework | def-: Check this out. I like the way entities are created, but to get a component out sucks: https://gist.github.com/dustinlacewell/fe99d77663ffb6266f96 |
01:46:10 | ldlework | can we do any better...? |
01:47:09 | * | vqrs joined #nim |
01:47:54 | ldlework | I suppose I could write a macro to generate entity with a field for every component and Entity wouldn't be that big since every field would be a reference. |
01:48:05 | ephja | np. bye |
01:49:42 | ldlework | Then whether a component is enabled or not is whether the field is null or not? |
01:50:14 | ldlework | then it would just be e.position.x etc |
01:51:08 | ldlework | You wouldn't even need cooperation from the definitions of components |
01:51:49 | ldlework | that's not bad.. |
01:52:59 | * | ephja quit (Ping timeout: 265 seconds) |
01:54:10 | * | satbyy_ left #nim ("Kumbhakarna mode ... zzzZ") |
01:55:46 | * | lompik joined #nim |
02:03:44 | * | jsudlow joined #nim |
02:13:21 | def- | ldlework: why is an Entity a table? |
02:13:29 | def- | I'm not sure I understand the motivation |
02:14:24 | ldlework | def-: Because it can contain instances of any of the component types. |
02:14:39 | ldlework | But I'm considering using a macro to generate a type that has a field for each component type instead |
02:14:56 | ldlework | then you can just do if e.position != nil: # do stuff with e.position |
02:15:01 | ldlework | or some nicer abstraction of that |
02:15:20 | ldlework | etc |
02:23:24 | def- | ldlework: this looks simpler to me and can still do the same: https://gist.github.com/def-/ab9bced6449106cf7cf1 |
02:23:54 | ldlework | def-: right that's what I was just describing... |
02:24:07 | ldlework | but using a macro to generate the entity type |
02:38:46 | bozaloshtsh | Araq_: I was just trying to return with "return" |
03:07:49 | * | brson quit (Quit: leaving) |
03:09:22 | * | brson joined #nim |
03:09:22 | * | brson quit (Client Quit) |
03:17:38 | * | pregressive quit (Remote host closed the connection) |
03:38:00 | * | vendethiel joined #nim |
03:58:51 | lompik | How do use iterators without loops ? |
03:59:11 | lompik | Trying to : A.items.toSeq where A is a set |
04:01:59 | * | vendethiel quit (Ping timeout: 264 seconds) |
04:05:01 | def- | lompik: by using a closure iterator and invoking it with () |
04:05:09 | def- | lompik: https://github.com/def-/nim-unsorted/blob/master/iteratorfinished.nim#L8 |
04:09:46 | * | Spector joined #nim |
04:11:34 | Spector | So just started to look at Nim. Worked for a bit after I got Windows Path to update. Now I am getting this no matter how try to compile it (using the suggested mingw(gcc) that was installed by the Nim installer. Error: unhandled exception: Requested command not found: 'gcc.exe -c -w -IC:\Nim\lib -o w:\scratchpad\nim\nimcache\scratch.o w:\scratchpad\nim\nimcache\scratch.c'. OS error: The system cannot find the file specified. |
04:11:52 | Spector | Any ideas on a solution |
04:12:08 | def- | That sounds like gcc.exe is not in PATH |
04:14:39 | Spector | default install path for that? doesn't seem to be in the Nim directory |
04:14:57 | * | pregressive joined #nim |
04:15:36 | def- | Nim/dist/mingw/bin |
04:16:04 | Spector | ok |
04:16:43 | Spector | so that makes sense its windows not recursing down like it should. Ok I will give that a try. Thanks for the help |
04:22:36 | lompik | def-: apparently toSeq(A.items) works. |
04:23:10 | * | zepolen quit (Remote host closed the connection) |
04:25:13 | * | nchambers joined #nim |
04:27:41 | Spector | def-: Thanks added gcc to my path fully and it now works. |
04:31:15 | def- | Spector: great |
04:37:55 | * | Spector quit (Quit: Page closed) |
04:47:22 | * | Sembei joined #nim |
04:49:54 | * | Pisuke quit (Ping timeout: 272 seconds) |
04:52:42 | * | kniteli quit (Ping timeout: 250 seconds) |
04:53:40 | * | kniteli joined #nim |
05:01:39 | * | vangroan__ joined #nim |
05:21:00 | * | pregressive quit (Remote host closed the connection) |
05:22:42 | * | pregressive joined #nim |
05:23:43 | * | zepolen joined #nim |
05:27:23 | * | girvo quit (Ping timeout: 276 seconds) |
05:28:22 | * | zepolen quit (Ping timeout: 256 seconds) |
05:28:43 | * | vangroan__ is now known as vangroan |
05:30:23 | * | s4 joined #nim |
05:32:16 | * | pregressive quit (Remote host closed the connection) |
05:40:50 | * | lompik quit (Ping timeout: 260 seconds) |
05:48:45 | * | girvo joined #nim |
06:11:05 | * | xet7 quit (Quit: Leaving) |
06:20:03 | * | xet7 joined #nim |
06:22:50 | * | kniteli quit (Ping timeout: 260 seconds) |
06:29:35 | * | darkf joined #nim |
06:31:35 | * | nchambers quit (Ping timeout: 260 seconds) |
06:40:55 | * | Demon_Fox quit (Ping timeout: 260 seconds) |
06:49:06 | * | Demon_Fox joined #nim |
06:59:32 | * | derka joined #nim |
07:04:15 | * | girvo quit (Ping timeout: 240 seconds) |
07:18:48 | * | derka quit (Quit: derka) |
07:24:50 | * | Demon_Fox quit (Quit: Leaving) |
07:37:24 | * | derka joined #nim |
07:44:32 | * | derka quit (Ping timeout: 276 seconds) |
07:46:44 | * | okovko joined #nim |
07:56:12 | * | okovko left #nim ("Leaving") |
08:03:24 | * | derka joined #nim |
08:03:39 | * | derka quit (Client Quit) |
08:20:30 | * | desophos quit (Read error: Connection reset by peer) |
08:21:07 | * | gokr joined #nim |
08:25:17 | * | zepolen joined #nim |
08:30:00 | * | zepolen quit (Ping timeout: 260 seconds) |
08:31:18 | * | girvo joined #nim |
08:36:32 | * | girvo quit (Ping timeout: 276 seconds) |
08:37:00 | * | strcmp1 joined #nim |
08:39:15 | * | Arrrr joined #nim |
08:43:55 | * | kniteli joined #nim |
08:55:04 | * | Trustable joined #nim |
09:09:44 | * | bjz joined #nim |
09:19:20 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
09:19:20 | * | yglukhov joined #nim |
09:19:34 | * | coffeepot joined #nim |
09:21:27 | * | ephja joined #nim |
09:26:49 | * | gokr quit (Quit: Leaving.) |
09:26:53 | * | gokr1 joined #nim |
09:27:43 | * | bjz joined #nim |
09:39:19 | * | derka joined #nim |
10:02:59 | yglukhov | Araq: I don't have a strong opinion regarding lua support. It just seems to me that it gets severely out of date, and it's unlikely that it will be supported in future by anyone. |
10:03:17 | Araq_ | JS is so close to Lua though |
10:03:53 | Araq_ | but yeah, I never even tested it and at this point moving from the VM to luajit is unrealistic |
10:04:07 | Araq_ | which was an idea I played with. |
10:05:46 | yglukhov | I can remove everything related to lua with one PR if you wish. Or i can leave it in place. Or i can remove it in places I modify as i did in last PR. |
10:07:10 | Araq_ | no worries |
10:07:12 | yglukhov | But i'm not likely to get lua going %) |
10:10:20 | yglukhov | I want to give some more attention to unsigned and bit ops in js, so ill do more prs on this shortly |
10:10:42 | yglukhov | And exceptions. |
10:23:58 | vegansk | Araq, why different case sections of the object cannot have fields with same name? |
10:25:05 | Araq_ | because it's not clear what that means |
10:25:32 | Araq_ | instead we may remove the "branch conditions have to be disjoint" condition |
10:25:45 | Araq_ | which accomplishes something similar without the ambiguity |
10:25:51 | Araq_ | and inefficiencies |
10:26:56 | * | zepolen joined #nim |
10:27:34 | Araq_ | https://github.com/nim-lang/Nim/issues/3629 |
10:28:18 | Araq_ | and the conclusion was not written down, yay |
10:28:24 | * | arnetheduck joined #nim |
10:32:02 | * | girvo joined #nim |
10:33:28 | yglukhov | Araq: when i've written nim shader translator it came to me that macros.nim kinda reflect compiler/ast.nim, but differ. Node -> NimNode. nkProc -> nnkProc, etc. And I thought that shader compilation would be great for both runtime and compile time. So the question is. How do I write code that works with Nim AST in both runtime and compile time? %) |
10:34:57 | vegansk | Araq, thanks. I'm thinking about scala like case class library. It seems better to use inheritance for it instead of object variants |
10:35:59 | vegansk | Btw, are there any plans to do pattern matching as a part of the language? |
10:36:47 | * | girvo quit (Ping timeout: 264 seconds) |
10:43:56 | Araq_ | when I need pattern matching, I use a macro. not sure why in a language that embraces macros everything needs to be builtin. |
10:44:33 | * | zepolen quit (Remote host closed the connection) |
10:45:30 | Araq_ | yglukhov: that nkProc differs from nnkProc is an unfortunate choice. |
10:45:59 | yglukhov | well, we have to something about it eventually =) |
10:46:32 | yglukhov | * to do |
10:46:49 | Araq_ | nowadays I would just share the enums |
10:47:17 | Araq_ | but type PNode = NimNode in the compiler would cause great trouble |
10:47:33 | Araq_ | since NimNode is now special cased and produces a .compileTime context |
10:48:50 | Araq_ | and there are lots of other problems |
10:49:33 | Araq_ | easiest way seems to be to build a bridge.nim module that either maps to macros.nim or uses the compiler API to translate things at runtime |
10:49:58 | Araq_ | bbs |
10:55:31 | * | bjz_ joined #nim |
10:57:42 | * | bjz quit (Ping timeout: 265 seconds) |
11:00:30 | * | coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
11:00:39 | * | coffeepot joined #nim |
11:01:56 | * | coffeepot quit (Client Quit) |
11:22:33 | * | lcm joined #nim |
11:25:01 | * | jaco60 joined #nim |
11:37:38 | * | razaaa joined #nim |
11:39:36 | * | girvo joined #nim |
11:44:15 | * | girvo quit (Ping timeout: 260 seconds) |
11:45:11 | * | zepolen joined #nim |
11:46:03 | * | razaaa left #nim ("Leaving") |
11:49:59 | * | zepolen quit (Ping timeout: 264 seconds) |
12:08:06 | Araq_ | yglukhov: you can try to make the compiler get rid of the global variables. they mean the core compiler is not .gcsafe and it also means the nimscript API cannot get stable. |
12:08:44 | Araq_ | with an even better nimscript we can perform shader compilation at runtime |
12:09:00 | Araq_ | that would be my suggestion of how to proceed. |
12:09:28 | yglukhov | Araq: im currently focused on my own tasks which implies js uints for now, but ill try to help in my spare time |
12:11:45 | Araq_ | sure. |
12:18:56 | * | arnetheduck quit (Remote host closed the connection) |
12:21:22 | * | arnetheduck joined #nim |
12:28:15 | * | BitPuffin|osx joined #nim |
12:42:01 | yglukhov | Araq: im gonna add some more changes to the js unsigned pr. It's a good time to put lua chunk back if you say. |
12:43:39 | Araq_ | nah, remove the Lua stuff. |
12:44:00 | Araq_ | it's unrealistic anybody will ever care about a Lua backend |
12:45:11 | * | vangroan quit (Ping timeout: 264 seconds) |
12:51:39 | * | joelmo left #nim (#nim) |
12:56:08 | * | nchambers_ joined #nim |
12:58:02 | * | nchambers_ is now known as nchambers |
12:59:26 | * | kniteli quit (Ping timeout: 256 seconds) |
13:00:53 | yglukhov | ok |
13:02:12 | * | ryan2 joined #nim |
13:02:46 | Araq_ | the other problem |
13:03:11 | Araq_ | well 'when x: proc (x: uint64) else: proc (x: uint32)' |
13:03:22 | Araq_ | what do you think can go wrong here? ;-) |
13:11:05 | * | vendethiel joined #nim |
13:17:01 | yglukhov | err... nothing worse than with 'when x: proc (x: uint64) else: discard'? |
13:18:17 | * | gokr1 quit (Quit: Leaving.) |
13:18:21 | dom96 | interesting. Does spawn block after more than some arbitrary number of spawns have been done? |
13:18:29 | dom96 | (In my case 4) |
13:19:35 | Araq_ | possible if it's CPU bound |
13:19:58 | Araq_ | if all cores are busy it waits until a core is ready |
13:20:05 | dom96 | ahh that's cool |
13:20:12 | Araq_ | it's parallelism, not concurrency. |
13:20:41 | Araq_ | it's also allowed to run it on the very same thread |
13:21:17 | dom96 | it is using 100% across all cores, so it is working as intended, my code is still wrong somewhere though |
13:22:59 | Araq_ | yglukhov: I disagree |
13:23:08 | yglukhov | Araq: what about just allowing proc $(uint64)? |
13:23:27 | Araq_ | yeah, requires a compiler patch |
13:23:36 | Araq_ | but seems to be way better |
13:23:43 | yglukhov | why patch? |
13:23:49 | yglukhov | ok, let me try and see |
13:23:54 | Araq_ | there is no magic for this op |
13:24:43 | yglukhov | no, i mean allow $(uint64) with magic on js, and without magic otherwise |
13:25:51 | yglukhov | IntToStr magic i mean |
13:26:23 | yglukhov | semantically this will reflect js %) |
13:27:16 | Araq_ | the other $'s for ints use compiler magic |
13:27:25 | Araq_ | uint64 shouldn't be a special case |
13:27:50 | yglukhov | why would not we be able to use the same magic for both procs? |
13:27:58 | Araq_ | we would. |
13:28:06 | Araq_ | but somebody needs to patch the compiler. |
13:28:56 | yglukhov | i still don't get your point. ill push another commit to show what i mean. |
13:29:12 | Araq_ | I want |
13:29:31 | Araq_ | proc `$`(x: uint64): string {.magic: Int64ToStr.} |
13:29:35 | Araq_ | in system.nim |
13:29:42 | Araq_ | or .magic: UInt64ToStr |
13:29:45 | Araq_ | doesn't matter |
13:29:56 | Araq_ | but no 'when's for the above declaration in system.nim |
13:30:05 | Araq_ | like it's done with the other integer types for $ |
13:31:13 | yglukhov | there: https://github.com/nim-lang/Nim/pull/3754/files#diff-5cfdfeab79c2d2b7bbc78af7060c38c3R1762 |
13:31:26 | yglukhov | Araq: ok, but why not whens? |
13:31:41 | Araq_ | because the others don't require it either |
13:31:58 | Araq_ | and the whens are creating a nightmare in system.nim |
13:32:10 | * | vendethiel quit (Ping timeout: 260 seconds) |
13:32:15 | Araq_ | this works at compile time, this only if the GC exists ... bla bli blub |
13:33:20 | * | askatasuna joined #nim |
13:33:50 | Araq_ | in general it's much better to have no 'when' in system.nim but instead in the particular backend 'not supported for GC:none' or something like that |
13:34:10 | Araq_ | because most restrictions are backend related and shouldn't concern compiletime evaluation |
13:34:18 | yglukhov | how does $uin64 currently work without magic? |
13:34:35 | Araq_ | implemented in sysstr.nim iirc |
13:35:07 | * | vendethiel joined #nim |
13:35:23 | yglukhov | maybe repr.nim? cant find it in sysstr |
13:38:08 | Araq_ | yeah |
13:38:08 | yglukhov | and then, why inttostr requires magic in the first place? isnt it something that can go to the lib? |
13:38:38 | yglukhov | and reduce locs in compiler =) |
13:39:04 | Araq_ | we cannot run it easily at compiletime otherwise |
13:39:24 | * | pregressive joined #nim |
13:40:21 | * | girvo joined #nim |
13:40:52 | * | s4 quit (Quit: Konversation terminated!) |
13:44:50 | * | girvo quit (Ping timeout: 250 seconds) |
13:48:24 | * | lompik joined #nim |
13:49:09 | * | zepolen joined #nim |
13:50:33 | * | zepolen quit (Remote host closed the connection) |
13:54:18 | * | zepolen joined #nim |
14:00:04 | * | vendethiel quit (Ping timeout: 272 seconds) |
14:05:04 | * | vendethiel joined #nim |
14:11:34 | * | derka quit (Quit: derka) |
14:12:50 | * | derka joined #nim |
14:19:45 | * | sjums left #nim ("Leaving") |
14:22:41 | yglukhov | Araq: removed `$` from my pr, since it may be done in another pr. |
14:25:29 | Araq_ | cool, good idea. |
14:27:05 | yglukhov | Araq: what do you think of supporting slices (views) for passing arrays/strings/seqs to proc expecting openarray/var openarray. |
14:27:56 | * | vendethiel quit (Ping timeout: 272 seconds) |
14:28:10 | * | zepolen quit () |
14:29:12 | yglukhov | myFooThatMutatesPartOfArray(myArray[5 .. 10]) |
14:33:16 | yglukhov | Araq: sorry, still not used to this skipType thing. should i do the same in binaryUintExpr? |
14:33:34 | * | aziz_ joined #nim |
14:34:37 | * | aziz_ is now known as aziz |
14:40:44 | Araq_ | yglukhov: we do that for spawn in a parallel statement ... |
14:40:58 | Araq_ | somehow the non-parallel code should do the same |
14:41:58 | yglukhov | oh, interesting. |
14:42:18 | yglukhov | js would require some special care now that i think of it... |
14:42:22 | Araq_ | we prove array bounds correct though in parallel |
14:42:35 | Araq_ | so we avoid them at runtime. |
14:42:44 | Araq_ | and don't generate them. dangerous stuff. |
14:42:54 | Araq_ | the serial version needs to perform index checking |
14:44:25 | * | vendethiel joined #nim |
14:47:19 | * | zepolen joined #nim |
14:48:03 | bozaloshtsh | are there any known issues with nested async procs? I'm having one where my program just the GC just segfaults when the inner one's called. The line given in the stack trace is just the line of the declaration of the inner async proc |
14:48:23 | bozaloshtsh | I'm having one where the GC just segfaults* |
14:49:37 | yglukhov | bozaloshtsh: a gist would help ;) |
14:51:38 | * | arnetheduck quit (Ping timeout: 256 seconds) |
14:53:34 | * | derka quit (Ping timeout: 265 seconds) |
14:58:32 | * | derka joined #nim |
15:00:07 | bozaloshtsh | all right: line 44 is where the compiler complains: http://hastebin.com/uzavawefed |
15:01:19 | * | coffeepot joined #nim |
15:02:00 | * | coffeepot quit (Client Quit) |
15:03:44 | * | pregressive quit (Remote host closed the connection) |
15:04:15 | * | lompik quit (Ping timeout: 240 seconds) |
15:04:40 | * | vendethiel quit (Ping timeout: 272 seconds) |
15:05:00 | * | bozaloshtsh quit (Ping timeout: 250 seconds) |
15:32:13 | yglukhov | bozaloshtsh: sorry, its kinda hard to tell, as theres so much missing to compile the gist. my guess would be using async closures in async proc, but cant tell for sure. |
15:33:20 | * | bozaloshtsh joined #nim |
15:33:44 | Araq_ | bozaloshtsh: compile with -d:useSysAssert -d:useGcAssert and see what it reports |
15:41:07 | * | girvo joined #nim |
15:43:16 | * | pregressive joined #nim |
15:45:30 | * | girvo quit (Ping timeout: 245 seconds) |
15:46:30 | * | satbyy quit (Quit: Kumbhakarna mode . . . zzZZ) |
16:13:15 | * | derka_ joined #nim |
16:13:48 | * | derka quit (Ping timeout: 256 seconds) |
16:13:49 | * | derka_ is now known as derka |
16:15:49 | * | vendethiel joined #nim |
16:19:36 | * | bozaloshtsh quit (Ping timeout: 272 seconds) |
16:37:24 | * | vendethiel quit (Ping timeout: 264 seconds) |
16:42:11 | * | derka quit (Ping timeout: 264 seconds) |
16:43:54 | * | derka joined #nim |
16:45:30 | * | derka quit (Client Quit) |
16:46:06 | * | vikaton joined #nim |
16:48:32 | * | vendethiel joined #nim |
16:51:55 | * | bozaloshtsh joined #nim |
17:01:36 | * | aziz quit (Remote host closed the connection) |
17:10:18 | * | vendethiel quit (Ping timeout: 250 seconds) |
17:10:30 | * | bozaloshtsh quit (Ping timeout: 245 seconds) |
17:41:55 | * | girvo joined #nim |
17:46:59 | * | yglukhov quit (Ping timeout: 264 seconds) |
17:47:00 | * | girvo quit (Ping timeout: 272 seconds) |
17:49:05 | * | pregressive quit (Remote host closed the connection) |
17:49:51 | * | pregressive joined #nim |
18:05:12 | * | derka joined #nim |
18:16:43 | * | Jesin quit (Quit: Leaving) |
18:19:42 | * | juanfra quit (Quit: juanfra) |
18:26:50 | * | yglukhov joined #nim |
18:31:20 | * | yglukhov quit (Ping timeout: 272 seconds) |
18:36:05 | * | derka quit (Ping timeout: 260 seconds) |
18:36:34 | * | brson joined #nim |
18:36:40 | * | brson quit (Client Quit) |
18:37:00 | * | brson joined #nim |
18:39:05 | * | lompik joined #nim |
18:46:23 | * | derka joined #nim |
18:49:35 | * | askatasuna quit (Ping timeout: 240 seconds) |
18:51:39 | * | darkf quit (Quit: Leaving) |
18:54:44 | * | vendethiel joined #nim |
19:02:35 | * | lompik quit (Ping timeout: 245 seconds) |
19:04:43 | * | brson_ joined #nim |
19:06:52 | * | brson quit (Ping timeout: 250 seconds) |
19:11:30 | * | derka quit (Read error: Connection reset by peer) |
19:11:41 | * | kniteli joined #nim |
19:15:17 | * | yglukhov joined #nim |
19:20:44 | * | vqrs quit (Ping timeout: 272 seconds) |
19:20:45 | * | D3_4dl1N3 joined #nim |
19:21:31 | * | D3_4dl1N3 left #nim (#nim) |
19:22:18 | ldlework | Araq_: I hope you got my PM |
19:22:29 | * | yglukhov quit (Remote host closed the connection) |
19:24:07 | * | vqrs joined #nim |
19:27:35 | * | derka joined #nim |
19:28:48 | * | Matthias247 joined #nim |
19:33:40 | derka | Hello Guys |
19:33:50 | derka | are there unikernel works with Nim |
19:35:38 | ldlework | derka: that'd be cool |
19:35:43 | ldlework | derka: do you ask because of the Docker news? |
19:38:00 | derka | yeah |
19:38:15 | derka | a few month ago i wanted to do a startup on unikernel cause i knew it was the next thing |
19:38:22 | derka | looks like docker already gonna kill the market |
19:38:32 | derka | i started looking OCaml beacuse of unikernel |
19:38:35 | derka | but i dont like OCaml |
19:38:39 | derka | I love python too much |
19:38:44 | derka | hopefuly there is Nim |
19:39:07 | derka | which is like python little brother but with a bright future |
19:42:28 | ldlework | derka: I work at docker, am a professional Python programmer, and I think Nim deserves just about a bajillion more internet fame points than it currently has. |
19:42:36 | ldlework | so high-five. |
19:42:40 | * | girvo joined #nim |
19:42:48 | * | yglukhov joined #nim |
19:43:31 | derka | great |
19:43:44 | pigmej | hello after break :) |
19:43:51 | derka | i was disapointed about docker |
19:44:09 | derka | i have a telecom company making real time voip routing software |
19:44:25 | derka | docker network layer is not suited at all from my perspective |
19:44:45 | derka | i used to use lxc in the very begining and network layer was very nice to use with bridge |
19:45:20 | derka | lot of good ideas in docker |
19:45:25 | derka | but execution doesnt suit me |
19:45:32 | derka | it probably fits most of use cases but not mine |
19:47:06 | * | girvo quit (Ping timeout: 250 seconds) |
19:47:13 | ldlework | derka: gotcha |
19:47:43 | derka | idlework i have to go run an errand quickly will be right back to tease you about docker :) |
19:48:25 | * | yglukhov quit (Remote host closed the connection) |
19:49:25 | * | yglukhov joined #nim |
19:49:37 | * | yglukhov quit (Remote host closed the connection) |
19:51:27 | pigmej | derka: docker has many not "production" ready things |
19:51:38 | * | devn joined #nim |
19:51:42 | devn | hello |
19:51:51 | devn | noob here |
19:51:56 | * | brson_ quit (Ping timeout: 250 seconds) |
19:51:58 | devn | suggestions for up-to-date guides/docs/tutorials/etc. |
19:52:00 | devn | ? |
19:52:15 | * | yglukhov joined #nim |
19:52:32 | devn | also, is there something like "nim new myproject"? |
19:52:42 | * | dom96_mobile joined #nim |
19:52:55 | dom96_mobile | Cool. We're on HN again. |
19:52:58 | devn | :) |
19:53:27 | devn | I've seen y'all show up a couple times in the past few weeks. I've heard mixed feels on Nim, but I'd like to give it a shot. |
19:54:51 | pigmej | dom96_mobile: what's the state of async ? |
19:56:02 | * | dom96_mobile quit (Remote host closed the connection) |
19:56:08 | * | ryan2 quit (Quit: WeeChat 1.3) |
19:59:06 | yglukhov | Araq: so unfortunately i've broken js strings with my latest "unicode" fix. it works for valid unicode but is broken for arbitrary byte data strings generated in compile time, so heres a suggestion. when generating a string literal, check string for non-ascii-and-valid-utf8-chars, and if it has invalid chars, do the codegen with array-of-ints literal instead of cstrToNimstr("literal"). does it sound sane? |
20:00:39 | ldlework | pigmej: Containerization has opened the door to massive questions in orchestration technique and standards. Basically ever large company you can name has a hand in help trying to figure out what the best solutions to these new questions. The containerization engine was just a catalyst. And that was not much than three years ago. Your statement is correct but I like to give some context. If you wanted to discuss |
20:00:40 | ldlework | this more we have a #nim-offtopic |
20:01:27 | * | brson joined #nim |
20:02:08 | * | Jesin joined #nim |
20:05:44 | pigmej | ldlework: I know :) |
20:07:55 | * | brson quit (Ping timeout: 240 seconds) |
20:08:36 | Araq_ | yglukhov: no, just revert the patch instead please. |
20:08:42 | Araq_ | no heuristics for strings. |
20:09:00 | yglukhov | but that will not work. |
20:09:16 | yglukhov | the old implementation was broken even more. |
20:10:59 | yglukhov | it did not work for unicode. |
20:12:50 | Araq_ | maybe for JS the runtime needs to provide "writeBytes" and "writeUtf8" |
20:13:10 | Araq_ | or 'convertBytesToJS' vs 'convertUtf8ToJS' |
20:15:48 | yglukhov | well.. the thing is. we dont have any troubles converting bytes to js in runtime %). the only trouble we have with the latest impl, is that it tries to create nimstrings from js string literals. |
20:16:15 | yglukhov | the literals are generated by compiler. and it's tricky to put invalid utf data into a js literal. |
20:19:36 | yglukhov | here's what i mean: https://gist.github.com/yglukhov/33a79660d8d551aa12b9 |
20:19:47 | * | quark1 joined #nim |
20:22:25 | * | Arrrr quit (Quit: WeeChat 1.2) |
20:23:22 | yglukhov | oh, there is one more good solution you might like. use different functions for creating nim string literal and for converting cstringToNimstring |
20:24:34 | yglukhov | that would almost completely revert my change which is what you want =) |
20:24:53 | derka | dom96: where do u see HN stuff about nim |
20:24:55 | Araq_ | good, do it, but I don't follow and I'm busy |
20:28:55 | * | Jehan_ joined #nim |
20:32:05 | def- | derka: https://news.ycombinator.com/item?id=10947192 |
20:34:22 | Xe | Araq_: how does the nimscript compiler configuration work? |
20:35:57 | Araq_ | http://nim-lang.org/docs/nims.html |
20:36:13 | dom96 | pigmej: Araq_ is working on parallelizing it |
20:37:32 | pigmej | oh, cool, so multiple threads + async ? |
20:37:47 | pigmej | sounds cool :) |
20:43:50 | * | Jehan_ quit (Ping timeout: 245 seconds) |
20:46:01 | * | bamorim joined #nim |
20:50:18 | * | Demon_Fox joined #nim |
20:53:02 | * | derka quit (Read error: Connection reset by peer) |
20:54:18 | * | derka joined #nim |
20:56:27 | * | Jehan_ joined #nim |
20:59:45 | * | Jehan` joined #nim |
21:00:50 | * | Jehan_ quit (Ping timeout: 250 seconds) |
21:02:53 | * | brson joined #nim |
21:05:12 | * | derka quit (Read error: Connection reset by peer) |
21:06:13 | * | derka joined #nim |
21:17:11 | * | bozaloshtsh joined #nim |
21:21:34 | * | derka quit (Read error: Connection reset by peer) |
21:21:58 | * | derka joined #nim |
21:32:06 | * | Jehan` quit (Ping timeout: 240 seconds) |
21:35:37 | * | Jehan_ joined #nim |
21:37:59 | * | derka quit (Read error: Connection reset by peer) |
21:39:18 | * | derka joined #nim |
21:43:27 | * | girvo joined #nim |
21:43:50 | * | bjz_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
21:47:05 | * | derka_ joined #nim |
21:48:18 | * | girvo quit (Ping timeout: 272 seconds) |
21:48:56 | * | derka quit (Ping timeout: 250 seconds) |
21:48:57 | * | derka_ is now known as derka |
22:04:26 | * | quark1 quit (Ping timeout: 240 seconds) |
22:07:55 | * | Jehan_ quit (Ping timeout: 240 seconds) |
22:07:56 | * | xet7 quit (Quit: Leaving) |
22:10:58 | * | nchambers quit (Ping timeout: 250 seconds) |
22:16:46 | * | Jehan_ joined #nim |
22:17:17 | * | derka quit (Read error: Connection reset by peer) |
22:19:15 | * | derka joined #nim |
22:20:17 | * | girvo joined #nim |
22:22:24 | * | junw joined #nim |
22:28:10 | * | vikaton quit (Quit: Connection closed for inactivity) |
22:29:50 | * | xet7 joined #nim |
22:34:10 | * | junw_ joined #nim |
22:34:40 | * | derka quit (Ping timeout: 245 seconds) |
22:37:24 | * | junw quit (Ping timeout: 250 seconds) |
22:43:40 | * | pregressive quit () |
22:44:47 | * | kniteli quit (Ping timeout: 276 seconds) |
22:45:48 | * | Trustable quit (Remote host closed the connection) |
22:49:36 | * | Jehan_ quit (Read error: Connection reset by peer) |
22:49:54 | * | vendethiel quit (Ping timeout: 256 seconds) |
22:49:57 | * | Jehan_ joined #nim |
22:53:48 | * | Jesin quit (Quit: Leaving) |
22:55:28 | * | kniteli joined #nim |
23:08:57 | bozaloshtsh | Araq_: I used those options you mentioned, here's the only new thing I got: [GCASSERT] incRef: interiorPtr |
23:16:15 | Araq_ | well that's a codegen bug. can you create a snippet that I can compile? |
23:17:09 | * | Jehan` joined #nim |
23:17:10 | * | Jehan_ quit (Read error: Connection reset by peer) |
23:20:45 | bozaloshtsh | I'll try |
23:25:03 | Araq_ | in fact ... I fear that I have a fix for it that I forgot to merge into devel ... -.- |
23:28:33 | * | xtagon joined #nim |
23:31:42 | * | Jehan` quit (Ping timeout: 265 seconds) |
23:32:16 | * | desophos joined #nim |
23:34:21 | * | Jehan_ joined #nim |
23:38:31 | * | Matthias247 quit (Read error: Connection reset by peer) |
23:42:26 | * | ephja quit (Ping timeout: 240 seconds) |