00:00:32 | * | solidsnack joined #nim |
00:02:33 | asdf | ldlework: I like to think of myself as asdf 2.0 |
00:02:36 | asdf | better than ever |
00:10:54 | ldlework | but you're clearly the original |
00:18:45 | * | awesomo4000 joined #nim |
00:24:46 | * | solidsnack quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
00:29:21 | * | solidsnack joined #nim |
00:29:25 | * | Jehan_ joined #nim |
00:31:58 | awesomo4000 | how do i iterate over bytes in stdin |
00:32:07 | * | asdf quit (Ping timeout: 246 seconds) |
00:34:52 | * | JinShil joined #nim |
00:39:38 | def- | awesomo4000: i only see procs for that, no iterators. You can use readChar |
00:40:10 | awesomo4000 | ok. how do i detect EOF |
00:42:24 | def- | with the endOfFile proc |
00:42:25 | * | gsingh93 quit (Ping timeout: 255 seconds) |
00:47:37 | * | brson joined #nim |
00:58:15 | * | dashed joined #nim |
01:03:55 | Jehan_ | You can use `for ch in stdin.readAll`, however, that will slurp in all of stdin at once. |
01:07:15 | Jehan_ | readChar + endOfFile is comparatively slow (not Nim's fault, that's the fault of how POSIX requires locking for each call and ANSI C tells you that you can't check for EOF without first reading a character). |
01:07:44 | * | saml_ joined #nim |
01:08:45 | * | Demon_Fox joined #nim |
01:09:35 | * | solidsnack quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
01:10:45 | * | gsingh93 joined #nim |
01:13:30 | * | havenwood quit (Remote host closed the connection) |
01:17:45 | * | aboisvert quit (Quit: aboisvert) |
01:28:59 | * | stefantalpalaru quit (Quit: Leaving) |
01:33:52 | * | darkf joined #nim |
01:37:06 | * | Jehan_ quit (Quit: Leaving) |
01:43:01 | * | aboisvert joined #nim |
01:55:15 | * | brson quit (Quit: leaving) |
02:00:07 | * | aboisvert_ joined #nim |
02:01:53 | * | aboisvert quit (Ping timeout: 246 seconds) |
02:01:54 | * | aboisvert_ is now known as aboisvert |
02:02:02 | * | brson joined #nim |
02:05:09 | * | milosn joined #nim |
02:07:22 | reactormonk | Araq, concerning the global stuff - is there something where exported symbols for each module is stored? And are global variables initialized as soon as parsed or in a lazy manner? (I believe lazy from what I've seen) Also, is there an index for global variable names, such that two modules use the same variable? |
02:09:56 | * | gsingh93 quit (Ping timeout: 276 seconds) |
02:12:44 | * | Jesin quit (Quit: Leaving) |
02:13:25 | * | yglukhov_ joined #nim |
02:18:23 | * | yglukhov_ quit (Ping timeout: 276 seconds) |
02:19:23 | * | zzach quit (Ping timeout: 246 seconds) |
02:20:30 | * | zzach joined #nim |
02:20:40 | * | iamd3vil joined #nim |
02:22:53 | * | aboisvert quit (Ping timeout: 246 seconds) |
02:23:02 | * | aboisvert joined #nim |
02:26:04 | * | EXetoC quit (Ping timeout: 245 seconds) |
02:29:41 | * | endragor joined #nim |
02:30:04 | * | aboisvert quit (Quit: aboisvert) |
02:32:22 | * | aboisvert joined #nim |
02:38:46 | * | aboisvert quit (Quit: aboisvert) |
02:47:43 | * | mal`` quit (Ping timeout: 248 seconds) |
02:50:38 | * | Jesin joined #nim |
02:52:17 | * | BitPuffin|osx quit (Ping timeout: 246 seconds) |
02:58:49 | * | syncn joined #nim |
02:58:56 | * | solidsnack joined #nim |
03:03:13 | * | mal`` joined #nim |
03:15:34 | * | saml_ quit (Ping timeout: 256 seconds) |
03:23:26 | * | fowl joined #nim |
03:26:20 | * | solidsnack quit (Ping timeout: 256 seconds) |
03:36:38 | * | aboisvert joined #nim |
03:42:49 | * | aboisvert quit (Quit: aboisvert) |
03:44:40 | * | aboisvert joined #nim |
03:49:19 | reactormonk | So from what I see the the names are already resolved by the pass expr is called in ccgexprs |
03:49:49 | reactormonk | I haven't found the location where the syms are resolved yet |
03:52:35 | * | gsingh93 joined #nim |
03:54:21 | * | aboisvert quit (Quit: aboisvert) |
03:55:40 | * | aboisvert joined #nim |
04:00:12 | * | Senketsu joined #nim |
04:01:44 | * | ddl_smurf quit (Quit: ddl_smurf) |
04:13:35 | * | iamd3vil quit (Remote host closed the connection) |
04:28:31 | * | Xe joined #nim |
04:32:17 | * | brson quit (Ping timeout: 276 seconds) |
04:33:11 | * | kulelu88 left #nim ("Leaving") |
04:40:56 | * | gsingh93 quit (Ping timeout: 240 seconds) |
04:43:15 | * | aboisvert quit (Quit: aboisvert) |
04:56:03 | * | filwit quit (Read error: Connection reset by peer) |
05:13:23 | * | vikaton quit (Quit: Connection closed for inactivity) |
05:45:30 | * | superfunc joined #nim |
05:47:51 | * | yglukhov_ joined #nim |
06:01:24 | * | gokr_ joined #nim |
06:09:50 | * | yglukhov_ quit (Quit: Be back later ...) |
06:24:29 | * | dashed quit (Quit: Connection closed for inactivity) |
06:27:39 | * | mischanix quit (Quit: leaving) |
06:28:19 | * | mischanix joined #nim |
06:30:59 | * | Jesin quit (Quit: Leaving) |
06:34:01 | * | FDGFGFGDFD quit (Ping timeout: 246 seconds) |
06:48:09 | * | xet7 quit (Ping timeout: 245 seconds) |
07:01:06 | * | xet7 joined #nim |
07:05:28 | * | endragor_ joined #nim |
07:08:03 | * | endragor quit (Ping timeout: 256 seconds) |
07:08:12 | * | Jesin joined #nim |
07:13:24 | * | HakanD_ joined #nim |
07:25:01 | * | endragor_ quit (Remote host closed the connection) |
07:26:07 | * | OnO joined #nim |
07:26:25 | * | Ven_ joined #nim |
07:27:30 | * | HakanD_ quit (Quit: Be back later ...) |
07:28:19 | * | Ven_ quit (Read error: No route to host) |
07:33:33 | * | zahary quit (Read error: Connection reset by peer) |
07:36:55 | * | HakanD_ joined #nim |
07:42:25 | * | yglukhov_ joined #nim |
07:54:07 | * | superfunc quit (Quit: leaving) |
08:02:43 | * | wtw joined #nim |
08:02:59 | * | Pisuke joined #nim |
08:03:34 | * | MyMind quit (Ping timeout: 245 seconds) |
08:06:22 | * | OnwardEuler joined #nim |
08:12:19 | * | BlaXpirit joined #nim |
08:12:24 | * | bjz joined #nim |
08:12:43 | * | coffeepot joined #nim |
08:13:08 | * | coffeepot quit (Client Quit) |
08:13:20 | * | coffeepot joined #nim |
08:15:00 | * | OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…) |
08:16:52 | * | bjz quit (Client Quit) |
08:17:39 | * | endragor joined #nim |
08:21:08 | * | bjz joined #nim |
08:22:23 | * | mischanix quit (Quit: leaving) |
08:26:15 | * | bjz quit (Ping timeout: 256 seconds) |
08:27:14 | * | mischanix joined #nim |
08:27:57 | * | Ven_ joined #nim |
08:38:59 | * | repax_ is now known as repax |
08:39:09 | gokr | I just ... skimmed the constructors thread (once again) on the forum... was there ever some ... conclusion to it? |
08:40:08 | * | jsseb joined #nim |
08:42:58 | * | HakanD_ quit (Quit: Be back later ...) |
08:47:22 | * | someplace joined #nim |
08:50:28 | * | bjz joined #nim |
08:51:48 | Araq | gokr: i don't like most of these proposals and I think we have enough complexity and bugs already |
08:52:24 | gokr | I think Jehan's view is also that we are "good" as is. |
08:52:31 | Araq | what I like cause it's easy enough is some .cripple pragma that prevents Foo() construction in a foreign module |
08:52:50 | gokr | But filwit has a gist in which he creates a class macro also, and that... may of course be nice to have in the stdlib. |
08:53:20 | gokr | https://gist.github.com/PhilipWitte/2cba4544530f23631ad1 |
08:53:53 | gokr | Araq: Yeah, that might be good. |
08:54:31 | Araq | "No more awkward and confusing newFoo and initBar." ugh, seriously? these names are a reflection of the value vs ref semantics that is the core point of systems programming language |
08:56:18 | Araq | we can easily have only newFoo, it's only a convention, but further conflating these things is stupid. |
08:56:44 | gokr | Oh, didn't see that new RFC thread |
08:56:49 | gokr | Talk about timing. |
08:57:33 | r-ku | strange, during last discussion i think it seemed you Araq agreed some kind of solution might be viable |
08:58:00 | r-ku | especially since what i propose is fully backwards-compatible and wrist-friendly |
08:58:14 | r-ku | sure handheld saw is good as is, but chainsaw is better. same situation here |
08:59:05 | * | endragor_ joined #nim |
08:59:34 | Araq | r-ku: as I said, yet another pragma to prevent Foo() construction is fine with me |
08:59:47 | * | ddl_smurf joined #nim |
09:00:37 | * | endragor_ quit (Remote host closed the connection) |
09:01:21 | Araq | r-ku: and thanks for taking the time and coming up with an RFC! |
09:01:59 | r-ku | i actually wasnt sure it was enough for RFC but great if it is :) |
09:02:22 | gokr | The autoderef at the end... don't we already have that? |
09:02:42 | gokr | In {.experimental.} |
09:02:53 | Araq | gokr yeah I think so, I think r-ku is not up to date on this point :-) |
09:02:56 | * | Demon_Fox quit (Quit: Leaving) |
09:03:18 | * | endragor quit (Ping timeout: 272 seconds) |
09:03:35 | r-ku | oh i dont use experimental features cause i most of the time forgot to type that into every single small test file i make, but if it already works its awesome ^_^ |
09:04:15 | r-ku | the other day i was actually scouting source for some list of experimental features, but as quick search did not yield much result i figured its not important enough hehe |
09:05:24 | Araq | r-ku: well one problem that we already have in the language and that you touch is that 'var' doesn't mean 'out', so this 'init' idiom doesn't work with 'not-nil' annotations |
09:05:46 | gokr | Well, I am not that interested in introducing "constructors" - but I do think it would be good for the community if this RFC gets a proper "handling", since r-ku took the time to write it. |
09:06:10 | * | endragor joined #nim |
09:06:29 | r-ku | Araq: what does mean 'out |
09:06:52 | r-ku | if its ref types - everything can not be ref |
09:07:01 | Araq | that's what Delphi and Ada use for it |
09:07:14 | Araq | proc p(x: var Foo) # read and write Foo |
09:07:31 | Araq | proc p(x: out Foo) # only write to Foo, set all its fields |
09:08:17 | r-ku | err, but do we actually have out keyword? |
09:08:25 | r-ku | i dont think i ever saw it anywhere |
09:08:36 | Araq | it's a keyword, but it's not used |
09:09:26 | r-ku | so guess my proposition depends on feature that does not exist yet |
09:09:46 | Araq | not really, the problem exists independent from your proposal |
09:09:51 | * | xet7 quit (Ping timeout: 276 seconds) |
09:10:23 | Araq | I think/fear the proper solution is to allow: |
09:11:09 | Araq | var subType: SubType = initSuperType() # modifies initSuperType() to return something big enough for SubType |
09:11:10 | gokr | One issue I can immediately see is that this only talks about procs - not methods. And... that's my feeling in general, complexity is increased here. |
09:11:31 | * | endragor quit (Remote host closed the connection) |
09:11:39 | Araq | but 'out' surely is simpler to implement than that, so I dunno |
09:12:15 | * | mal`` quit (Ping timeout: 248 seconds) |
09:12:37 | Araq | gokr: to be honest, once fowl's interfaces work well I like to remove 'method' from the language |
09:12:50 | gokr | ouch |
09:13:31 | gokr | That ... sounds very bad. |
09:13:47 | r-ku | there certainly are applications where dynamic dispatch is very useful |
09:13:51 | Araq | really? why? |
09:14:11 | * | endragor joined #nim |
09:14:11 | gokr | How would interfaces solve all the things that methods do? |
09:15:31 | gokr | Ron will go ballistic, I can tell you for sure. |
09:15:58 | Araq | he he he well it would probably break too much code anyway |
09:16:41 | synthmeat | is breaking compatibility really a thing to consider? |
09:16:55 | gokr | When you use OO for larger domain models - I have a true hard time understanding how you would manage without any dynamic dispatch. |
09:17:14 | * | endragor quit (Remote host closed the connection) |
09:17:18 | Araq | gokr: interfaces do dynamic dispatch |
09:17:57 | gokr | Well, perhaps I need someone to explain how fowl's interfaces work then. Because that's not what I would expect an interface to ... do. |
09:18:27 | r-ku | <Araq> proc p(x: out Foo) # only write to Foo, set all its fields |
09:18:29 | synthmeat | gokr: i recently wanted to do that in as3 and couldn't |
09:18:33 | r-ku | that might not be optimal btw |
09:18:45 | fowl | Araq I don't know how to make it do multi dispatch like methods do |
09:18:46 | r-ku | there surely gonna be people that want to read object on initialization |
09:18:52 | r-ku | for example after calling parent ctor |
09:19:00 | * | bluenote joined #nim |
09:19:51 | fowl | gokr: my interface only do single dispatch but I can catch methods and wrap them in a proc so that nims methods are called and multi dispatch is kept |
09:20:03 | fowl | The issue is single vs multi dispatch |
09:20:06 | Araq | fowl: yeah it's not. it's only single dispatch but lots of languages manage to do with only that |
09:20:25 | fowl | With single dispatch you have to use the visitor pattern to emulate multi dispatch |
09:20:31 | gokr | sure |
09:21:04 | gokr | Smalltalk is single, so I know how that works. |
09:21:49 | gokr | Well, I need much more explanations to have any kind of view on it. |
09:21:53 | fowl | I think wrapping it in an extra call to get multi dispatch is a good tradeoff |
09:22:44 | gokr | A classic obvious thing that comes to mind is how self and super calls plays together - with inheritance. |
09:23:38 | Araq | synthmeat: yes, it is something to keep in mind, all the successful languages stopped breaking code at one point. |
09:23:46 | fowl | Can make a supertype() macro easily now, super() would be easy to implement |
09:24:48 | * | xet7 joined #nim |
09:25:26 | * | endragor joined #nim |
09:26:46 | fowl | Proccall init(super(self), ...) |
09:27:39 | r-ku | that looks awesome |
09:28:44 | synthmeat | would be interesting, over different languages, to correlate at what (publicly available) codebase size did successful languages first stopped breaking compatibility as some sort of long(er)-term (un)official contract |
09:30:30 | fowl | I think Perl has been compatible for a long time |
09:30:47 | gokr | Hehe, which version? :) |
09:31:13 | * | allan0 joined #nim |
09:31:15 | fowl | Its been written in hieroglyphs for centuries |
09:32:05 | * | endragor quit (Remote host closed the connection) |
09:32:24 | gokr | fowl: You had some writeup about interfaces right? |
09:32:41 | fowl | Super() is simpler in languages with single dispatch since only self needs to be considered |
09:32:43 | synthmeat | hey, they say nim was made with games in mind. besides sdl & glfw wrappers, i didn't see much on that note. anyone care to direct me to something related, if something comes to mind? |
09:33:04 | fowl | gokr: yea on bitbucket.org/fowlsoft |
09:33:10 | gokr | fowl: Just calling super is one thing, its when the code in the super class calls code on self it gets interesting. |
09:34:00 | fowl | gokr: it can call a method that's defined for a sub type fine AFAIK |
09:35:39 | fowl | synthmeat: networking, physics, audio |
09:36:09 | gokr | synthmeat: Urhonimo |
09:36:23 | gokr | But I doubt Nim was created with "games in mind". |
09:36:23 | fowl | Everything is available , there's a project called nimx that compiles to android,iOS,js etc |
09:36:32 | synthmeat | if urhonimo's a game title, then yes, that's what i was awkwardly asking for reference on |
09:36:57 | gokr | synthmeat: No, its a Nim wrapper of Urho3D: github.com/3dicc/Urhonimo |
09:37:34 | * | endragor joined #nim |
09:38:23 | fowl | def- wrote a NES emu |
09:38:55 | * | endragor quit (Remote host closed the connection) |
09:39:19 | synthmeat | yeah, caught that. and js port, but dude ended up going through emscripten though |
09:40:13 | gokr | With Urhonimo you have quite a solid base for game development. |
09:41:10 | gokr | of course, its a C++ wrapper, but still. |
09:41:24 | synthmeat | thank you, already spawned dozens of tabs |
09:42:38 | coffeepot | why can't we have multiple dispatch with OO by having a multi method call super on more than one of it's arguments? |
09:42:47 | r-ku | gokr: since you are here just to make sure.. you saw my yesterday's poke about urhonimo? |
09:43:11 | gokr | r-ku: No? |
09:43:28 | synthmeat | what was the poke about? |
09:43:31 | r-ku | all i was saying that wrapper repo wasnt synced in a month. so in case there is anything to share... :-> |
09:43:35 | fowl | coffeepot: can't assume you want to upclass every inheritable argument |
09:43:51 | gokr | r-ku: Oh, yeah. Well, we have some small stuff - but not much. |
09:44:23 | r-ku | ah i see. wondered if its not much done or everyone forgot about github repo hehe |
09:44:31 | * | endragor joined #nim |
09:44:33 | gokr | synthmeat: We use and develop Urhonimo in our private gitlab at 3DICC - then we push to github regularly. |
09:44:58 | gokr | We are busy coding *with* it and not *on* it for the moment. |
09:45:14 | gokr | But its being used in our product now, so we are quite committed. |
09:45:40 | synthmeat | gokr: should i google 3DICC or can you direct me to something relevant right off the bat? |
09:45:51 | r-ku | https://github.com/3dicc/Urhonimo |
09:46:03 | fowl | coffeepot: the super() I proposed would upclass a single argument |
09:46:09 | * | endragor quit (Remote host closed the connection) |
09:46:37 | gokr | Our website kinda sucks IMHO but ... here is a movie, it gets interesting about 45 seconds into it: https://www.youtube.com/watch?v=oK3xjPaKuSg |
09:46:47 | r-ku | fowl: what about super(super(self))? would it yield parent of the parent? |
09:47:33 | gokr | synthmeat: What you see in that movie though is the old render engine, we are replacing it with Urhonimo now. |
09:48:05 | fowl | r-ku: that should work without extra work |
09:48:23 | synthmeat | gokr: i am personally related to many similar projects |
09:48:24 | gokr | Ah, this one is also new: https://www.youtube.com/watch?v=yNFwF13yBIg |
09:48:44 | synthmeat | but i won't level up the noise in here, sorry. it's offtopic |
09:48:54 | * | endragor joined #nim |
09:48:55 | r-ku | ah then super() plays in tune with my constructors vision |
09:48:56 | gokr | You can join #nim-offtopic |
09:49:06 | coffeepot | fowl without assuming, can't the method choose to call super as it needs to. If your super() upclasses a single argument, don't you have to call this for each argument? I wouldn't want super called automatically, personally. |
09:50:12 | fowl | coffeepot: you would have to explicitly type it, proccall is still required too |
09:50:31 | coffeepot | sounds good |
09:52:03 | coffeepot | is there an example of your proposal for super somewhere? |
09:52:36 | fowl | Nah it will be only a few lines using macros.getType |
09:53:05 | * | mal`` joined #nim |
09:53:15 | coffeepot | it's just it was something that I stumbled on when initially starting nim - trying to make an object hierarchy then not knowing how to call the parent constructor |
09:53:22 | coffeepot | cool :) |
09:53:34 | fowl | I'll write it up in a min |
09:53:37 | coffeepot | :D |
09:56:04 | Araq | bbl |
09:57:18 | def- | synthmeat: the SFML wrapper has some nice example games: https://github.com/blaxpirit/nim-csfml |
09:59:01 | synthmeat | def-: oh, thanks for that too. lovely day fishing for nim and game related stuff today :) |
10:01:46 | fowl | I used to have a list of game related libraries but now we have nimble |
10:01:54 | fowl | I should find it and update it |
10:03:15 | gokr | coffeepot: I dissected these things in my OO articles. And subsequently pushed Araq to add procCall. |
10:03:29 | gokr | Otherwise proper super calls couldn't be done. |
10:03:59 | * | mal`` quit (Ping timeout: 248 seconds) |
10:04:07 | fowl | gokr: thanks that was missing for a long time |
10:04:13 | gokr | synthmeat: Urho3D has a bunch of examples, we ported a few to Nim in Urhonimo. |
10:04:31 | fowl | If I needed super calls I used vtables |
10:04:41 | * | endragor quit (Remote host closed the connection) |
10:05:23 | someplace | hmm |
10:05:42 | someplace | let's say I have a table, string->string, and I want to add elements to it from C code |
10:05:46 | someplace | what's the best way to do that? |
10:06:39 | fowl | Use strtabs? I think those funcs are exportc'd |
10:08:50 | fowl | For a Table type you could maybe export them as var set_table_strstr{.exportc.}: proc... = tables.`[]=`[string,string] |
10:09:25 | someplace | oh boy I'm in over my head :D |
10:09:28 | someplace | thanks for the pointers |
10:09:49 | fowl | Since table is generic it can't just be exported to c |
10:10:44 | * | endragor joined #nim |
10:12:40 | fowl | someplace: for string to string you can use strtabs from c http://nim-lang.org/docs/strtabs.html |
10:13:04 | * | endragor quit (Remote host closed the connection) |
10:14:25 | coffeepot | gokr, your articles are very enlightening and I just went back to read http://goran.krampe.se/2014/11/30/nim-and-oo-part-iv/ again. So, we can use procCall to call a particular typed method. Is it possible to dynamically call the super class (I assume this is what you're doing fowl) based on runtime type, or is this not possible atm? (not sure if i |
10:14:25 | * | mal`` joined #nim |
10:14:25 | coffeepot | t's quite necessary as most of the time you'll know the heirachy) |
10:14:48 | * | Ven_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
10:14:57 | * | Ven_ joined #nim |
10:15:00 | * | endragor joined #nim |
10:15:34 | * | Ven_ quit (Client Quit) |
10:15:43 | someplace | fowl: to pass the StringTableRef to C I use void*, right? or am I missing something? |
10:15:49 | someplace | (it works anyway) |
10:16:00 | someplace | sorry, can't find a good guide to FFI beyond the small bit in the manual :p |
10:17:39 | * | endragor quit (Remote host closed the connection) |
10:17:51 | * | endragor joined #nim |
10:21:24 | fowl | someplace: yea looks like the type doesn't have exportc so it has some mangled name |
10:21:49 | someplace | lovely |
10:21:51 | someplace | thanks! |
10:26:14 | someplace | ..and how do I turn cstrings into strings for nstPut? |
10:26:20 | someplace | is there any good doc for this? :< |
10:26:34 | r-ku | i think you can use $ on cstring |
10:28:11 | someplace | within C code |
10:30:44 | fowl | Hmm you'd have to wrap it |
10:31:19 | fowl | proc cstr_to_nim (some:cstring): string {.exportc.} = $some |
10:31:26 | someplace | hmm right |
10:31:35 | someplace | well, just in case.. |
10:31:57 | someplace | my use case is flex generating a table of id -> tile, both of which are strings |
10:32:07 | someplace | if there's any easier way to do that |
10:32:13 | fowl | flex? |
10:32:47 | fowl | araq wrote a lexer that works at compile time that might interest you :D |
10:33:18 | someplace | ooh? |
10:33:20 | someplace | hm |
10:34:10 | fowl | https://github.com/Araq/lexim |
10:34:30 | * | endragor quit (Read error: Connection reset by peer) |
10:34:51 | * | endragor joined #nim |
10:35:12 | someplace | ahh so much documentation :> |
10:35:16 | someplace | i'll give it a try |
10:35:36 | fowl | yea lol |
10:36:07 | fowl | ex1.lex looks like an example, dunno how you run it though |
10:36:14 | * | ingsoc joined #nim |
10:36:37 | * | vikaton joined #nim |
10:37:00 | * | endragor quit (Remote host closed the connection) |
10:37:10 | someplace | hmm |
10:37:21 | someplace | seems to be more useful for lexing/tokenising than what I'm doing |
10:37:27 | * | endragor joined #nim |
10:39:28 | fowl | what are you trying to do exactly |
10:39:49 | fowl | get to the table of id->tile from nim? or in c? |
10:40:05 | * | filwit joined #nim |
10:40:30 | filwit | dom96: got the Aporia features done: https://github.com/nim-lang/Aporia/pull/84 |
10:40:56 | filwit | i'll add some real prefs for these (and 'scrollPastBottom') later |
10:41:05 | someplace | nim. I have flex/C code to load this file into a certain format but I'm looking to do it differently and use the stuff in nim |
10:41:14 | someplace | ..it might be easier to reimplement the loaderin nim entirely |
10:41:15 | filwit | for now they just use rawPrefs |
10:51:31 | dom96 | filwit: cool. I'll review it and pull it ASAP. |
10:52:16 | gokr | coffeepot: What do you mean with "dynamically call the super class"? |
10:53:18 | * | Kingsquee quit (Quit: Konversation terminated!) |
10:54:29 | * | Ven_ joined #nim |
10:55:50 | coffeepot | call the class' super class (if it has one) without knowing what this might be at compile time |
10:56:17 | gokr | But... but... :) |
10:56:38 | coffeepot | yeah I don't know if it's actually something that's needed as you should always know the heirachy |
10:58:56 | gokr | I am trying to visualize code, but I come up blank. Not knowing the super class would imply not knowing the class either. Some kind of generics or? |
10:59:30 | filwit | dom96: cool :) I forgot to ask before I made the PR.. I made both those settings default to true, don't know if you want that or not |
11:00:15 | filwit | let me know |
11:00:21 | * | gokr lunch... |
11:00:35 | * | gokr_ quit (Quit: IRC for Sailfish 0.9) |
11:01:12 | fowl | https://gist.github.com/fowlmouth/dbb43f560cdc67cc3601 |
11:01:53 | dom96 | filwit: off by default please |
11:04:14 | filwit | dom96: k, np. |
11:04:47 | * | mal`` quit (Ping timeout: 248 seconds) |
11:05:03 | filwit | dom96: any idea what all those GTK failure message are about when Aporia closes? |
11:05:16 | dom96 | nope |
11:06:56 | filwit | k, changed the defaults in the PR |
11:20:51 | * | mal`` joined #nim |
11:25:21 | fowl | super turned out to be the simplest example of gettype yet |
11:26:27 | fowl | gn all |
11:29:10 | someplace | night |
11:36:15 | * | mal`` quit (Ping timeout: 248 seconds) |
11:37:03 | * | mal`` joined #nim |
11:37:18 | thotypous | needed to do a "ln -s ../../doc ." in order to compile nimsuggest |
11:38:33 | * | HakanD_ joined #nim |
11:42:00 | * | milosn quit (Quit: leaving) |
11:47:35 | thotypous | https://github.com/zah/nimrod.vim <- this seems to be abandoned |
11:47:46 | thotypous | which fork is most up to date? |
11:47:54 | thotypous | https://github.com/miyakogi/nimrod.vim |
11:48:03 | thotypous | seems like that is, but it doesn't have nimsuggest yet |
11:48:28 | thotypous | i can update it and send a pull request, but need to know if it is the most up to date |
11:48:34 | thotypous | does anyone here uses vim? |
11:50:03 | Xe | I do |
11:50:32 | thotypous | Xe: are you using nimrod.vim? do you use zah's or a fork? |
11:50:45 | Xe | let me check |
11:51:09 | Xe | yeah I'm using zah's as it was the one the nim wiki suggested |
11:51:13 | * | Xe is very new to him |
11:51:15 | Xe | nim* |
11:51:20 | thotypous | hmm thanks |
11:52:23 | thotypous | Xe: the last release (from the last week i believe) changed nim --suggest to a separate nimsuggest executable, so the completion is not working anymore.. i was going to try updating zah's version, but it looks abandoned (no updates for 6 months and lots of open pull requests) |
12:00:25 | * | synthmeat quit (Quit: WeeChat 1.2-dev) |
12:00:40 | * | darkf quit (Read error: Connection reset by peer) |
12:01:05 | * | darkf joined #nim |
12:01:26 | thotypous | hmm, i was wrong, it is still working |
12:01:38 | thotypous | even though it doesn't use the new nimsuggest executable |
12:03:26 | def- | Oh, I see Nim on HN: https://news.ycombinator.com/item?id=9491397 |
12:03:35 | * | synthmeat joined #nim |
12:03:54 | coffeepot | gokr to be fair I can't think of any compelling cases of a dynamic super call either. Is it possible for a single class to inherit from different roots?! Again, not sure why you might want to do that. I guess the lazy part of me is thinking in terms of not having to specify the parent type and change the code if you change the super-class's name. H |
12:03:55 | coffeepot | aving said *that*, the compiler presumably has the knowledge to select the correct super class to call anyway when set at compile time (assuming craziness with multiple roots isn't possible). I think I'm just a bit leery of having to type the parent class in when writing inheritable code... and after writing all this I realise how complex this real |
12:03:55 | coffeepot | ly is. I mean, you would still have to know the name of the initialiser proc anyway wouldn't you, so perhaps this is all one big moot point :) |
12:08:02 | coffeepot | as you say in your article, perhaps it is more nim-like to have the concrete types listed there in the code so you can really see what's happening, rather than it being a somewhat ambiguous call to inherited X |
12:09:21 | * | synthmeat quit (Quit: WeeChat 1.2-rc2) |
12:09:52 | * | synthmeat joined #nim |
12:11:14 | * | synthmeat quit (Client Quit) |
12:12:30 | * | synthmeat joined #nim |
12:15:37 | dom96 | ooh yay |
12:15:40 | dom96 | my project this time |
12:16:07 | def- | dom96: you can upload new screenshot: http://hookrace.net/nimkernel.png |
12:16:45 | dom96 | what do you mean? |
12:16:57 | * | QWERTYPASSWORD joined #nim |
12:17:06 | def- | Your screenshot at http://picheta.me/private/images/nimkernel2.png (linked in the repo) still shows "Nimrod" |
12:17:09 | def- | instead of "Nim" |
12:17:59 | dom96 | oh |
12:18:22 | dom96 | Sure, i'll update it |
12:20:40 | dom96 | github seems to be caching it |
12:21:59 | def- | fixed |
12:22:25 | def- | dom96: you can force a cache purge by doing "curl -X PURGE https://camo.githubusercontent.com/c2837587036b5d5c71fc584d3e03a2b796bb8be6/687474703a2f2f706963686574612e6d652f707269766174652f696d616765732f6e696d6b65726e656c322e706e67" |
12:23:25 | * | coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
12:27:17 | * | coffeepot joined #nim |
12:28:57 | def- | Googling for Nim docs is totally impossible now that the old docs are 404 and the new ones not indexed |
12:29:09 | BlaXpirit | yup, that's completely stupid |
12:29:20 | def- | and all old links to docs are dead |
12:29:41 | BlaXpirit | nobody listened to my nagging |
12:30:06 | BlaXpirit | "master" branch is also completely meaningless |
12:30:47 | thotypous | BlaXpirit: what do you mean? we shouldn't get the latest nim release from the master branch of the repository? |
12:31:00 | BlaXpirit | well apparently you shouldn't |
12:31:04 | BlaXpirit | because master is currently 0.11.0 |
12:31:33 | BlaXpirit | let me ping dom96 about this again |
12:31:42 | thotypous | BlaXpirit: so, should get using git checkout v0.11.2 ? |
12:34:00 | dom96 | BlaXpirit: I need to go to a lecture now, but i'll do it there. |
12:34:04 | dom96 | Keep reminding me. |
12:41:02 | * | mal`` quit (Ping timeout: 272 seconds) |
12:41:57 | * | arnetheduck joined #nim |
12:44:11 | QWERTYPASSWORD | Im pretty sure the default branch is devel not master |
12:44:36 | * | mal`` joined #nim |
12:56:00 | QWERTYPASSWORD | lol i love how 'steveklabnik1' is bashing Nim every time he can on reddit |
12:57:20 | QWERTYPASSWORD | I guess he::doesnt::want::to::his::users.unwrap() |
12:57:25 | QWERTYPASSWORD | lose* |
12:57:31 | * | EXetoC joined #nim |
12:59:39 | HakanD_ | nim vs rust <==> python vs ruby <==> java vs c# and goes and on and on |
12:59:55 | def- | QWERTYPASSWORD: I don't think he is and bashing Rust won't help. See for example https://pay.reddit.com/r/programming/comments/34tb7r/nim_binary_size_from_160_kb_to_150_bytes/cqy1dlh |
13:05:12 | HakanD_ | I've been following him since his ruby days, cool guy |
13:07:30 | coffeepot | yeah I thought what he said was quite reasonable too |
13:07:49 | coffeepot | it's so tempting to compare languages but it often just ends up with tribalism |
13:08:32 | repax | It's just sad that some people get defensive/aggressive towards programming languages. Just try to stay out of it and continue to do what you think is worth your time |
13:14:54 | * | dom96_ joined #nim |
13:15:41 | * | Pisuke quit (Read error: Connection reset by peer) |
13:15:45 | dom96_ | BlaXpirit: done |
13:16:48 | * | Pisuke joined #nim |
13:18:39 | * | JinShil quit (Quit: Konversation terminated!) |
13:20:09 | BlaXpirit | nice |
13:24:41 | HakanD_ | we really need to set up proper redirects for old doc stuff |
13:25:39 | coffeepot | when I do var s: string = newStringOfCap(size), do I need to do s = "" afterwards? Seems to not work properly without it |
13:28:49 | * | UUUUUUUUU joined #nim |
13:30:25 | coffeepot | just noticed what everyone was say, the nim manual doesn't work from google now? |
13:31:24 | coffeepot | ah google's link is missing the /docs/ |
13:33:19 | * | dom96_ quit (Ping timeout: 246 seconds) |
13:40:17 | coffeepot | anyone know where newStringOfCap is defined? |
13:40:50 | def- | system/sysstr.nim |
13:40:57 | coffeepot | cheers :) |
13:40:57 | def- | as rawNewString() |
13:41:04 | coffeepot | ah, nice one thanks |
13:41:15 | coffeepot | i was looking in that unit but didn't see it :) |
13:41:27 | def- | It says what compiler magic is used in the definition of newStringOfCap in system.nim |
13:41:49 | def- | then you can just grep for it |
13:42:43 | * | Ven_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:42:50 | * | havenwood joined #nim |
13:42:58 | coffeepot | thanks def- :) |
13:55:16 | * | BitPuffin joined #nim |
13:56:01 | UUUUUUUUU | addting a 'm. prefix |
13:56:06 | UUUUUUUUU | adding* |
13:56:12 | UUUUUUUUU | 'm' |
13:56:40 | * | syncn quit (Quit: Lost terminal) |
13:56:41 | someplace | is there any equivalent to python's subprocessing module in nim? |
13:57:35 | * | mal`` quit (Ping timeout: 248 seconds) |
13:59:37 | def- | someplace: http://nim-lang.org/docs/osproc.html |
14:01:06 | someplace | cheers |
14:03:57 | * | mal`` joined #nim |
14:07:19 | * | mpthrapp joined #nim |
14:10:32 | * | syncn joined #nim |
14:13:44 | * | mythfish joined #nim |
14:15:33 | * | mythfish quit (Client Quit) |
14:16:36 | * | HakanD__ joined #nim |
14:19:42 | * | HakanD_ quit (Ping timeout: 256 seconds) |
14:22:17 | * | darkf quit (Quit: Leaving) |
14:26:05 | * | milosn joined #nim |
14:26:17 | * | Ven_ joined #nim |
14:38:18 | * | vikaton quit () |
14:46:30 | coffeepot | does anyone know why I get this since upgrading to 0.11.2? |
14:46:47 | coffeepot | In file included from c:\nimproj\odbc\nimcache\stdlib_system.c:8:0: |
14:46:47 | coffeepot | C:\Nim\lib/nimbase.h:393:13: error: size of array 'assert_numbits' is negative |
14:46:47 | coffeepot | typedef int assert_numbits[sizeof(NI) == sizeof(void*) && NIM_INTBITS == sizeof(NI)*8 ? 1 : -1]; |
14:46:47 | coffeepot | ^ |
14:48:30 | coffeepot | seems to happen on any program, even just echo "hello" :-/ |
14:48:44 | BlaXpirit | that is something so familiar |
14:48:56 | BlaXpirit | coffeepot, probably is 32-64 bit mismatch |
14:49:09 | * | gsingh93 joined #nim |
14:49:21 | BlaXpirit | between C compiler and Nim |
14:49:36 | coffeepot | i thought someone might say that for some reason. I'm using nim-0.11.2_x64 told it to install the mingw |
14:50:16 | BlaXpirit | maybe there is some other mingw |
14:50:24 | coffeepot | could be, just checking |
14:58:15 | * | HakanD__ quit (Read error: Connection reset by peer) |
15:00:54 | coffeepot | yay! Cheers BlaXpirit, was an old mingw floatng baout |
15:01:07 | coffeepot | *floating about |
15:02:15 | EXetoC | there are two build scripts for windows |
15:04:45 | Xe | Is there a way to listen on a unix socket in nim? |
15:10:00 | coffeepot | does this help Xe? Don't know if it works on unix https://github.com/Araq/Nim/wiki/Tutorial:-Sockets |
15:10:13 | Xe | coffeepot: I mean domain sockets |
15:10:19 | Xe | sockets in the filesystem |
15:10:27 | coffeepot | ooh ok :) |
15:11:20 | Xe | I'm assuming no |
15:11:22 | Xe | lol |
15:11:38 | r-ku | Xe: whatever you can do with c api you can do in nim |
15:12:01 | r-ku | its just a matter of importing those functions. its not most optimal way if wrapper is not present but it is certainly possible |
15:12:26 | mischanix | Xe: Looks like the rawsockets module has what you want |
15:13:53 | keypusher | http://nim-lang.org/docs/rawsockets.html#Domain |
15:14:43 | Xe | thanks |
15:16:46 | coffeepot | having a bit of trouble interfacing with C and strings. If I set up a buffer as var s: string, setting the length either via s.setLen(size) or if I declare it as var s: string = newStringOfCap(size) it ends up with a crazy length when I look at it (some 64 bit number, looks like junk). Setting s = "" fixes this, but now I'm not reserving the space |
15:16:47 | coffeepot | for the buffer for the C func :/ |
15:17:28 | Araq | var buffer = newString(size) |
15:17:33 | Araq | c_call(buffer) |
15:17:34 | coffeepot | if I do var s: string = "" then call s.setLen it has the correct length first time I echo it, but subsequent times it's full of junk! |
15:17:38 | Xe | is the nim "$" operator for turning something that is not a string into a string? |
15:17:41 | Araq | setLen(buffer, strlen(buffer)) |
15:17:42 | coffeepot | ah cheers Araq |
15:18:02 | Araq | Xe yes |
15:18:16 | * | HakanD__ joined #nim |
15:18:17 | Xe | ah |
15:18:42 | * | yglukhov_ quit (Quit: Lingo: www.lingoirc.com) |
15:19:00 | * | yglukhov joined #nim |
15:19:42 | * | Jehan_ joined #nim |
15:19:50 | Xe | what is the suggested build system to use for nontrivial nim projects? |
15:20:37 | Jehan_ | Xe: There's really not a specific build system required. I've used a number of different systems myself. |
15:20:44 | Jehan_ | Make works fine, for example. |
15:21:50 | Xe | Jehan_: what would you suggest for someone who wants a low maintenance build system? |
15:22:16 | Jehan_ | Xe: Umm. Depends on your definition of low maintenance. |
15:22:31 | Xe | `go build` low maintenance |
15:22:51 | * | TEttinger quit (Ping timeout: 250 seconds) |
15:23:08 | Jehan_ | I'm personally partial to scons, but I don't really know what others need. |
15:23:28 | Araq | Xe 'nim c -d:release myproject' |
15:23:32 | yglukhov | Hello. How can i get typedesc of a local var? |
15:23:48 | Araq | type(localvar) |
15:23:54 | yglukhov | thank you! |
15:24:14 | Jehan_ | Araq: Well, he said "nontrivial". |
15:24:42 | Jehan_ | I assumed that was something that included a mix of Nim code, external libraries that may need to be built separately, and/or code generated from data. |
15:24:47 | Xe | she* |
15:24:54 | Jehan_ | Oops! Sorry. |
15:24:58 | yglukhov | Xe: nake? |
15:26:46 | Xe | is nimble just a package manager or is it also a build system? |
15:28:33 | coffeepot | this is really strange. Ok so get my buff back from c func and call setLen(returned_size). In this case the size is 1. I literally just do echo buf.len then on the next line again echo buf.len. Gives me "1" (as expected) then next line len says "20266198323167233". So... Either I need to zero the buffer beforehand (and it's running on counting the |
15:28:34 | coffeepot | length until it reaches zero) or I'm referencing dodgy memory |
15:29:28 | coffeepot | it appears as if echo is corrupting my buffer, as it is fine first time but then second time it's fubar, but I doubt that's actually what's happening |
15:31:16 | coffeepot | var buf: string = newString(1024) |
15:31:17 | coffeepot | # call c func |
15:31:17 | coffeepot | buf.setLen(indicator) |
15:31:17 | coffeepot | echo buf.len # displays "1" |
15:31:17 | coffeepot | echo buf.len # displays "20266198323167233" |
15:35:00 | coffeepot | o_O ok... so if I add repr(buf) to the echo statements it correctly shows the right length of 1 both times! wat |
15:35:22 | gokr | Xe: Since nim pulls in dependencies etc, it often works to build simple stuff as a oneliner. |
15:36:10 | Jehan_ | Xe: It's a package manager, the "nimble build" is basically a predefined call to "nim c" with certain arguments. |
15:36:53 | Jehan_ | I don't like it because it uses -d:release by default, which throws out all safety checks and debugging info. |
15:37:10 | Jehan_ | Well, I don't like the "nimble build" command, that wasn't about "nimble" in its entirety. |
15:40:13 | Araq | coffeepot: that sounds like a bad corruption indeed |
15:40:41 | Araq | does the C func take ownership of this memory? |
15:40:47 | yglukhov | Abother silly question. How can i check if "result" var i available in scope of a function? What i need is type(result) to be void if result is not defined. |
15:41:46 | coffeepot | Araq I'm not sure. I don't think so as it's just the func to get data back from a query. The cfunc is SQLGetData and I'm passing it a nim string but as it only takes a pointer I'm passing it addr mystring |
15:42:36 | coffeepot | it should just populate the buffer, I told it the buffer size was 512, but I'm reserving 1024 anyway |
15:42:54 | Araq | omg, don't pass addr mystring! |
15:42:58 | * | OnO joined #nim |
15:43:07 | coffeepot | ... sounds like you found my problem! :D |
15:43:07 | Araq | pass cstring(buffer) instead |
15:43:14 | coffeepot | roger wilco |
15:43:21 | Xe | are all nim values implicitly passed as pointers? |
15:43:23 | coffeepot | for reference, what is happening here? |
15:43:28 | yglukhov | ok, answer to my question is when declared(result) |
15:43:36 | Jehan_ | Xe |
15:43:39 | Jehan_ | Xe: Sort of. |
15:44:14 | Jehan_ | Unless you specify {.byCopy.} or have sufficiently small non-var arguments. |
15:44:32 | Jehan_ | E.g., an int is obviously passed as a value, as is a pair (int, int). |
15:45:00 | * | HakanD___ joined #nim |
15:45:27 | coffeepot | :) I get a length of 1 both times now :D |
15:45:44 | * | gokr_ joined #nim |
15:45:56 | coffeepot | curious as to what was going on behind the scenes there |
15:46:36 | bluenote | me too, I always pass mystring.addr instead of mystring.cstring -- is there a difference? (in my cases mystring.addr worked well so far) |
15:46:51 | Araq | bluenote: that's horrible |
15:47:04 | onionhammer | maybe I'll make a sublime snippet for it.. hmm |
15:47:05 | EXetoC | you mean str[0].addr? |
15:47:07 | bluenote | I just didn't know and it worked... |
15:47:22 | coffeepot | seems like I made the same assumption |
15:47:53 | Araq | addr str --> address of string, but the string starts with the length field, then capacity, then the char data |
15:48:07 | coffeepot | oh that really makes sense now :3 |
15:48:08 | Araq | so you tell C to write to the string's length field |
15:48:10 | bluenote | oh :) |
15:48:32 | gokr_ | hehe |
15:48:38 | * | HakanD__ quit (Ping timeout: 272 seconds) |
15:49:16 | coffeepot | maybe I should write a list of "dun goofed" things wot I did in nim so others can avoid them ;) |
15:49:51 | bluenote | looks like you are not alone ;) |
15:50:31 | Jehan_ | Doesn't addr(str) point to the string pointer rather than the contents? |
15:50:57 | Araq | oh yeah |
15:51:54 | Jehan_ | Which, of course, is even worse. |
15:53:10 | coffeepot | I think because I've heard that nim strings are compatible with C I just assumed passing the address was okay. AIUI, wrappers can declare a parameter as string and it's magically passed over to C correctly? |
15:53:36 | coffeepot | in this case though, the wrapper func took a pointer because it has to accept different types of data |
15:55:55 | Jehan_ | coffeepot: Basically, the pointer (= void *) type can contain pretty much anything. |
15:56:45 | Jehan_ | But string auto-converts properly to cstring, so you shouldn't have to take an address. |
15:57:01 | coffeepot | ... unless the parameter is a pointer :) |
15:57:11 | coffeepot | ... but takes a string, because C |
15:57:29 | Jehan_ | Then use str.cstring instead. |
15:57:59 | coffeepot | that was the solution. Now it doesn't suddenly have a length of several bazillion! :) |
15:58:25 | * | Ven_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:58:32 | coffeepot | I must say I kinda assumed cstring(str) would be a cast rather than a type conversion |
15:58:42 | coffeepot | very handy to be able to do that tho |
16:00:47 | * | ingsoc1 joined #nim |
16:00:55 | * | ddl_smurf quit (Quit: ddl_smurf) |
16:02:43 | * | ingsoc quit (Ping timeout: 250 seconds) |
16:04:49 | gokr_ | afaik type conversion is what you should use |
16:08:36 | coffeepot | well, managed to get a simple query returning in sql server! catch u guys tomorrow :) |
16:09:05 | * | BitPuffin quit (Ping timeout: 276 seconds) |
16:10:06 | * | coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
16:16:13 | * | saml quit (Quit: Leaving) |
16:16:57 | * | gsingh93 quit (Ping timeout: 264 seconds) |
16:19:07 | * | saml joined #nim |
16:21:31 | * | Matthias247 joined #nim |
16:28:03 | OnO | Araq: I need a info from the Nim's creator :) does macro can issue call to iterator, I am trying to do some result = newCall("it", ...), where "it" is a name of existing iterator, but I get: identifier "it" not found |
16:28:52 | OnO | I've spent whole evening yesterday trying to figure out why it thinks "it" is not found, trying to put some NimSym with nsIterator type, but no luck |
16:30:37 | * | leru joined #nim |
16:32:47 | * | brson joined #nim |
16:34:19 | * | UberLambda joined #nim |
16:36:14 | bluenote | OnO: I guess it doesn't really matter if you do that within a macro or not |
16:36:47 | bluenote | if you do e.g.: var s = @[1,2,3]; echo s.items() |
16:36:59 | bluenote | you also get Error: undeclared identifier: 'items' |
16:37:36 | bluenote | I was told that this is just because "calling" it makes the assumption that there is a proc with that name |
16:37:51 | bluenote | since there is no proc, you get the undeclared identifier |
16:38:03 | OnO | no I want to do: for s in macro(ex: untyped): echo s <- where macro replaces ex with call to existing iterator |
16:38:11 | bluenote | i.e., it does not really matter that there is an iterator with that name |
16:38:59 | OnO | I've dumped AST for: ```for s in it(ex: untyped): echo s``` and there IS A CALL there |
16:39:35 | OnO | so I just believe there is a special NimSym node that distinguishes proc symbol from iterator symbol |
16:39:47 | * | solidsnack joined #nim |
16:40:23 | OnO | oops... I meant AST for: ```for s in it(1, 2, 3): echo s``` |
16:40:24 | bluenote | yes, I assume that newCall("it", ...) is just restricted to that special place |
16:40:58 | * | solidsnack quit (Client Quit) |
16:41:14 | * | vendethiel joined #nim |
16:41:20 | * | gsingh93 joined #nim |
16:41:37 | OnO | parsed AST for an iterator call has also Call -> Sym "it", Arg1, Arg2 |
16:41:48 | OnO | so it is identical on the dump as call to proc |
16:42:10 | OnO | I just presume that the Sym binding has some special type |
16:42:24 | OnO | and newCall tries to bind "it" only to proc symbols, not "it" symbols |
16:42:33 | leru | So I just tried jester. It starts and quits immediately after "Jester is making jokes at http://localhost:5000". No error messages. What is wrong? |
16:42:46 | * | solidsnack joined #nim |
16:43:00 | OnO | leru: did you add runForever() at the end of your script? |
16:43:34 | leru | OnO: No I didn't. Okay... :< |
16:45:20 | leru | Is there an explanation for "runForever()" ? |
16:46:04 | OnO | well, it is part of AsyncHTTPServer which is a system core module |
16:46:23 | OnO | Jester is just above it as an HTTP callback |
16:46:43 | OnO | so actually you need runForever() to start listening for incoming connections |
16:47:51 | OnO | oh well, wrong - it is part of asyncdispatch module :) |
16:47:56 | OnO | which is even lower |
16:48:13 | OnO | http://nim-lang.org/0.11.0/asyncdispatch.html#runForever, |
16:49:51 | leru | I guess I understand. So it is an event loop, right? |
16:51:24 | * | yglukhov quit (Quit: Be back later ...) |
16:53:18 | * | n0x0ff joined #nim |
17:05:52 | OnO | exactly |
17:11:16 | * | vendethiel quit (Ping timeout: 240 seconds) |
17:14:15 | * | vendethiel joined #nim |
17:15:51 | * | seymour joined #nim |
17:16:21 | * | endragor quit (Ping timeout: 264 seconds) |
17:19:04 | * | seymour_ quit (Ping timeout: 272 seconds) |
17:19:07 | * | seymour__ joined #nim |
17:22:18 | * | seymour quit (Ping timeout: 252 seconds) |
17:23:36 | * | drewsrem joined #nim |
17:25:08 | drewsrem | Is there any easy way to import cpp classes into Nim objects? |
17:25:53 | * | mal`` quit (Ping timeout: 246 seconds) |
17:26:22 | * | mal`` joined #nim |
17:29:10 | * | banisterfiend quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
17:36:56 | * | Siecje joined #nim |
17:37:56 | Siecje | onionhammer: A few days ago you helpped me get template composition working. You said to use '${' instead of '$ {' but now I get an error https://dpaste.de/sn0C |
17:39:26 | * | yglukhov joined #nim |
17:42:39 | * | HakanD___ quit (Quit: Be back later ...) |
17:47:18 | * | solidsnack quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
17:51:15 | * | BitPuffin|osx joined #nim |
17:51:58 | * | bluenote quit (Ping timeout: 246 seconds) |
17:57:48 | * | fizzbooze joined #nim |
18:07:57 | * | seymour joined #nim |
18:09:44 | * | seymour__ quit (Ping timeout: 272 seconds) |
18:10:58 | * | OnwardEuler quit (Ping timeout: 244 seconds) |
18:15:05 | * | solidsnack joined #nim |
18:15:29 | * | gyeates joined #nim |
18:16:29 | * | solidsnack quit (Client Quit) |
18:17:07 | * | gyeates quit (Client Quit) |
18:18:50 | * | gyeates joined #nim |
18:20:00 | * | solidsnack joined #nim |
18:20:16 | dalarmmst | How do I flush output with echo? |
18:20:35 | def- | stdout.flushFile() |
18:20:56 | def- | but echo should be flushing already |
18:21:13 | * | UberLambda quit (Quit: Leaving) |
18:22:37 | dalarmmst | Oh, looks like it did already yes. Thanks. Sorry for the noise |
18:23:52 | * | jefus quit (Read error: Connection reset by peer) |
18:24:49 | * | jefus joined #nim |
18:27:55 | * | seymour_ joined #nim |
18:28:28 | * | fizzbooze quit (Ping timeout: 256 seconds) |
18:30:46 | * | seymour quit (Ping timeout: 272 seconds) |
18:31:08 | * | OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…) |
18:31:20 | gyeates | how can you use nimble to install deps listed in a .nimble file? |
18:31:35 | dalarmmst | Given a char ptr which points to a '\0'-ended string, is it possible to easily print it with echo, and/or create a string from it? |
18:31:52 | def- | gyeates: nimble build should do that |
18:31:58 | def- | or nimble install |
18:32:12 | gyeates | ah i think build was what I was looking for |
18:33:01 | def- | dalarmmst: cast it to a cstring |
18:33:11 | flyx | I have a problem with macros: https://gist.github.com/flyx/46976d02e128cca49261 I know why it doesn't work: "name" in the macro isn't a string, but a NimNode. but I can't figure out how to implement the macro properly. is that even possible? |
18:34:23 | def- | flyx: name is a runtime variable, how can the macro use that at compile time? |
18:34:58 | def- | dalarmmst: then you should be able to echo the cstring and do a type conversion to string with myCString.string |
18:35:11 | dalarmmst | Thanks def- |
18:35:28 | flyx | def-: well, the context is at compile time |
18:35:33 | flyx | but I see your point |
18:35:50 | * | HakanD___ joined #nim |
18:36:17 | fowl | Morning #nim |
18:36:39 | def- | Good morning fowl |
18:36:45 | BlaXpirit | flyx, var -> const, string -> static[string] and it works |
18:37:57 | flyx | oh, static[string] works with macros? didn't know that |
18:38:14 | BlaXpirit | it's top secret stuff |
18:38:20 | BlaXpirit | you can only find out by accident -_- |
18:39:44 | flyx | ^^ |
18:42:43 | flyx | can I, somehow, transform a piece of code into its AST representation in place? |
18:43:25 | def- | flyx: dumpTree: |
18:43:36 | BlaXpirit | treeRepr( |
18:43:37 | flyx | def-: well, that outputs it |
18:43:50 | def- | var foo = quote do: |
18:44:02 | BlaXpirit | parseStmt(" |
18:44:08 | def- | many choices |
18:45:27 | flyx | quote do looks interesting |
18:45:37 | flyx | the manual says the future of do: is unclear |
18:45:55 | * | Demon_Fox joined #nim |
18:46:33 | flyx | is that correct? |
18:47:17 | BlaXpirit | does it maybe work without do? |
18:48:28 | BlaXpirit | that's strange, Siecje. that should be correct |
18:49:26 | BlaXpirit | this works tho https://bpaste.net/show/b59568184633 |
18:49:50 | BlaXpirit | i should complete and document that lib some day |
18:50:02 | BlaXpirit | apparently it is competent |
18:51:06 | * | fizzbooze joined #nim |
18:51:37 | * | flyx is currently also working on html templating |
18:54:04 | * | Siecje quit (Quit: Leaving.) |
18:54:16 | * | Siecje joined #nim |
18:57:24 | * | leru quit (Quit: Page closed) |
18:57:50 | * | leru joined #nim |
19:01:02 | * | leru quit (Client Quit) |
19:01:44 | Siecje | BlaXpirit: I would use it if I could just write the template in a file :) |
19:01:54 | BlaXpirit | Siecje, you can |
19:02:00 | BlaXpirit | templ slurp "file" |
19:02:10 | * | leru joined #nim |
19:02:40 | Siecje | BlaXpirit: I'm trying to use it like Jinja2 |
19:02:47 | BlaXpirit | use what like jinja |
19:03:22 | * | solidsnack quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
19:03:25 | Siecje | I think you linked to Jinja2 before. |
19:03:27 | BlaXpirit | yes |
19:03:34 | BlaXpirit | i don't know what you mean though |
19:03:43 | BlaXpirit | i used jinja even today :p |
19:03:44 | Siecje | I'm trying to create a layout file and have other templates inherit that file |
19:03:54 | renesac | my .nimble/bin/ directory is empty |
19:03:58 | BlaXpirit | well nobody has done that , Siecje |
19:03:59 | Siecje | And not have to wrap my templates in nim code |
19:04:09 | renesac | even though I have plenty of things on .nimble/pkgs |
19:04:11 | renesac | is that normal? |
19:04:16 | flyx | Siecje: I'm currently working on template inheritance in my templating language |
19:04:20 | flyx | but it's not ready yet |
19:04:24 | * | solidsnack joined #nim |
19:04:28 | Siecje | flyx: link? |
19:04:37 | BlaXpirit | flyx's project is certainly very interesting |
19:04:41 | BlaXpirit | but i don't think i'd use it |
19:04:42 | flyx | https://github.com/flyx/emerald |
19:04:51 | BlaXpirit | HTML as DSL is a hack :| |
19:04:52 | * | ELFrederich joined #nim |
19:04:55 | * | solidsnack quit (Client Quit) |
19:05:14 | flyx | well, it's certainly not for everyone |
19:05:23 | dom96 | flyx: very nice |
19:05:26 | Siecje | I don't mind writing HTML |
19:06:01 | renesac | dom96: saw what I wrote just above? |
19:06:21 | BlaXpirit | Siecje, you know what? i think i can make template inheritance. |
19:06:22 | ELFrederich | Developer of this nimkernel in here? |
19:06:31 | dom96 | renesac: Just read it. It's normal if you haven't installed any binary packages. |
19:06:32 | BlaXpirit | it's as simple as defining functions |
19:06:39 | BlaXpirit | i just wish i had time |
19:06:43 | dom96 | ELFrederich: that's me |
19:06:58 | renesac | hum, but I would hope nimble binary itself would be there |
19:07:12 | ELFrederich | dom96, cool... Curious why you chose 32bit instead of 64 |
19:07:17 | dom96 | renesac: yeah, it should be. |
19:07:31 | renesac | it isn't |
19:07:33 | Siecje | BlaXpirit: It sounds like you really want people to use your library. Add some examples |
19:07:44 | dom96 | ELFrederich: I simply followed the OS barebones C tutorial and converted it to Nim. |
19:07:55 | BlaXpirit | i want people to like the library because it's written in 30 lines :D |
19:07:55 | dom96 | *OSDev |
19:08:14 | dom96 | renesac: did you install it via nimble? |
19:08:16 | ldlework | flyx: very cool! |
19:08:19 | renesac | I tried: ./nimble update Downloading package list from https://github.com/nim-lang/packages/raw/master/packages.json Error: unhandled exception: 404 Not Found [HttpRequestError] |
19:08:22 | ldlework | flyx: hacker news, my man! |
19:08:22 | Siecje | BlaXpirit: usefulness > size |
19:08:47 | ELFrederich | dom96, this? http://wiki.osdev.org/Bare_Bones |
19:08:54 | BlaXpirit | ELFrederich, x86_64 is just a big hack on top of x86, i'm sure it is much more difficult to work with it |
19:08:55 | renesac | I don't remember |
19:09:09 | dom96 | ELFrederich: yep |
19:09:19 | dom96 | Well, I did extend it a bit. |
19:09:53 | * | Beluki joined #nim |
19:10:25 | flaviu | IRC is a little more active right now, its great time for some bikeshedding! |
19:10:25 | flaviu | https://docs.google.com/forms/d/1Hh_Ap6Z8D6F1y0OfsXVbQEG0SlRckHjTluiuU88Rves/viewform |
19:10:29 | flyx | ldlework: what about hacker news? |
19:11:07 | Siecje | flaviu: What is it supposed to do? |
19:11:08 | ldlework | flyx: you should submit your project to it |
19:11:34 | flaviu | Siecje: I can't make up my mind, so I'm making you all decide for me. :P |
19:11:48 | renesac | ok, updated the packages.json by hand (I dunno why it failed, but then there is the bug that zeroes it and I have to manually download) |
19:11:48 | Siecje | flaviu: What is the desired operation |
19:12:06 | renesac | but I can't run nimble install nimble anymore |
19:12:07 | flyx | ldlework: I don't really know anything about hacker news, apart from having heard the name |
19:12:09 | renesac | nimblepkg/version.nim(141, 22) Error: use '^' instead of '-'; negative indexing is obsolete |
19:12:14 | flaviu | Siecje: Constructing a Regex from a pattern and options.. |
19:12:18 | flyx | but I will consider it once I finished v0.2 |
19:12:18 | dom96 | flaviu: yay, a google form. We need more of these. |
19:12:27 | ELFrederich | what are Nim's primary inspirations? Python? Are there any other languages that use indentation like this? |
19:12:35 | ldlework | I submitted my meta programming article just now, https://news.ycombinator.com/newest |
19:12:36 | renesac | ELFrederich: Pascal |
19:12:38 | mischanix | BlaXpirit: I find x86_64 assembly easier to write, honestly. calling conventions being register-first are nice |
19:12:55 | dom96 | renesac: git pull nimble and update your compiler? |
19:13:00 | renesac | well, the indentation thing is probably from python |
19:13:06 | BlaXpirit | ok, so i should not talk about what i don't know |
19:13:11 | ELFrederich | renesac, before my time. I think my high school had a Pascal class and my father wouldn't let me enroll |
19:13:12 | Siecje | flaviu: What is ix? An 'i' followed by an 'x'? and <anycrlf> is ? |
19:13:15 | renesac | dom96: I'm at the latest nim compiler |
19:13:49 | renesac | and shouldn't nimble install nimble already be doing the git pull thing? |
19:13:54 | BlaXpirit | "i" is an option for a regex, "x" is an option for a regex, ANYCRLF is a rarely used flag for a regex |
19:14:07 | Siecje | flaviu: I'm a fan of raw strings so you don't have to have \\d etc |
19:14:16 | dom96 | renesac: oh yes. |
19:14:16 | renesac | I'm using a nimble binary from the .nimble/pkgs/nimble*/ dir by the way |
19:14:23 | dom96 | renesac: which nim |
19:14:28 | bougyman | BlaXpirit: I use it more often than you think. |
19:14:32 | bougyman | multiline parsing, that is. |
19:14:44 | dom96 | ldlework: upvoted |
19:14:46 | bougyman | /m in onigurama (and pcre, too, iirc) |
19:14:50 | Siecje | flaviu: If you had the result it would be a lot easier to see what each line is trying to do |
19:15:01 | renesac | dom96: nim 11.2 |
19:15:05 | renesac | *0.11.2 |
19:15:19 | dom96 | ldlework: your blog could really use some syntax highlighting |
19:15:29 | ldlework | dom96: probably |
19:15:36 | Siecje | renesac: I think he wants to know the output of "$ which nim" |
19:15:37 | flaviu | Siecje: It's just syntax for initializng a regex. let x = re"123"; "abc".match(x). |
19:15:53 | dom96 | renesac: I mean executed the command 'which nim' |
19:16:02 | Siecje | flaviu: So it won't match anything in your example |
19:16:03 | dom96 | renesac: to make sure you don't have another one in your PATH |
19:16:07 | bougyman | BlaXpirit: does nim have its own regex engine? |
19:16:12 | BlaXpirit | no |
19:16:18 | flaviu | Sort of. |
19:16:21 | bougyman | which does it use? |
19:16:23 | BlaXpirit | so like i said yesterday |
19:16:26 | BlaXpirit | the problem with this poll is people don't see any merit at all in a few of the options |
19:16:27 | BlaXpirit | but there is a reason for them to be like this. the "anycrlf" part is rare |
19:16:28 | Siecje | flaviu: You want x to be captured? |
19:16:29 | BlaXpirit | and some of the options are just consistent with PCRE's syntax |
19:16:30 | BlaXpirit | (*ANYCRLF) and (?i) are syntaxes that are already supported by PCRE |
19:16:32 | BlaXpirit | (?i) can appear in the middle of the string |
19:16:33 | bougyman | hopefully spencer's or onigurama |
19:16:45 | bougyman | ugh, pcre. |
19:17:00 | flaviu | bougyman: https://github.com/Araq/lexim, but what I'm working on uses PCRE. |
19:17:35 | renesac | dom96: I only have one nim on path, the which output is the expected one |
19:17:36 | renesac | https://github.com/nim-lang/nimble/issues/119 |
19:17:47 | renesac | <-- that is my problem |
19:17:53 | dom96 | oooh |
19:18:00 | dom96 | Run nimble install nimble@#head |
19:18:16 | bougyman | http://sljit.sourceforge.net/regex_perf.html oniguruma outperforms even pcre with a jit. |
19:18:37 | BlaXpirit | k |
19:18:45 | * | nimbie joined #nim |
19:19:11 | renesac | ok, now it created a symlink to the bin dir |
19:19:25 | dom96 | good |
19:19:44 | renesac | thanks, now I should be good |
19:19:56 | flaviu | bougyman: Performance isn't everything. |
19:21:43 | bougyman | no, it isn't. |
19:21:52 | bougyman | i prefer the flexibility of oniguruma, too. |
19:22:20 | bougyman | (?<named_thing>thing) is one of the nicer named-capture syntaxes, imo. |
19:23:02 | ldlework | guys, upvote this! https://news.ycombinator.com/item?id=9494310 |
19:23:04 | flaviu | bougyman: https://regex101.com/r/kR4hT9/1 |
19:23:13 | bougyman | not to mention the protections you get against infinite backreferences. |
19:23:22 | bougyman | the things that can make pcre grab 100% of your cpu. |
19:23:47 | dom96 | ldlework: If people vote by going to that page then the votes may not count |
19:23:58 | ldlework | dom96: why is that |
19:24:18 | ldlework | don't up vote that pls! |
19:24:20 | ldlework | lol |
19:24:31 | flaviu | ldlework: Don't tell people to vote. It's highly frowned upon by all these sorts of communities. |
19:24:38 | dom96 | Also what flaviu said |
19:24:39 | ldlework | sorry... |
19:24:54 | ldlework | s/vote for this/check out this article! |
19:25:01 | Beluki | People will upvote anyway if the content is good. |
19:25:06 | * | ldlework goes back to work. |
19:25:10 | dom96 | ldlework: You're already on the front page, once you get there it's unlikely you will fall off it quickly. |
19:27:14 | * | solidsnack joined #nim |
19:27:30 | renesac | ELFrederich: http://hackernewsmobile.com/story/9488585 |
19:30:29 | * | gsingh93 quit (Ping timeout: 246 seconds) |
19:31:45 | gyeates | can you import from the directory above ala `import ...module` in python |
19:32:29 | * | nimbie quit (Quit: Page closed) |
19:33:47 | gyeates | or rather `from ..module import A, B` (for unit tests in a sub directory) |
19:34:20 | dom96 | gyeates: You can do: import "../module" (I might be wrong) |
19:34:46 | dom96 | gyeates: You should also be able to pass --path:".." when compiling and then: import module. |
19:34:51 | renesac | yep |
19:35:06 | renesac | you can do import "../src/module" |
19:35:10 | renesac | for example |
19:35:21 | renesac | I use that |
19:35:44 | gyeates | sweetness thanks |
19:35:59 | def- | or add 'path: "../src"' to your nim.cfg |
19:37:51 | * | Kingsquee joined #nim |
19:42:02 | * | grncdr joined #nim |
19:44:11 | * | solidsnack quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
19:46:24 | * | grncdr quit (Ping timeout: 252 seconds) |
19:46:27 | * | solidsnack joined #nim |
19:49:33 | * | Trustable joined #nim |
19:53:14 | * | RegisterOn left #nim (#nim) |
19:53:55 | * | HakanD___ quit (Quit: Be back later ...) |
19:54:51 | * | bluenote joined #nim |
19:59:51 | gyeates | http://nim-lang.org/unittest.html 404s |
20:00:25 | dom96 | nim-lang.org/docs/unittest.html |
20:03:21 | gyeates | ah ^ was the one indexed by google |
20:04:02 | BlaXpirit | just make the damn redirect |
20:04:09 | BlaXpirit | you can't not make it, there are too many links |
20:04:48 | * | gokr_ quit (Quit: IRC for Sailfish 0.9) |
20:07:39 | * | gsingh93 joined #nim |
20:08:42 | ELFrederich | Nim have any cool async features which seem to be all the rage these days (goroutines, Python's asyncio, node.js, etc)? |
20:10:18 | * | shodan45 joined #nim |
20:14:37 | def- | ELFrederich: yes, see async* in the stdlib |
20:16:59 | dom96 | BlaXpirit: I don't have time, if somebody is willing to write a Jester app to perform the redirects then I will gladly run it on the VPS. |
20:18:56 | * | fizzbooze quit (Ping timeout: 272 seconds) |
20:20:17 | def- | dom96: so if a site is 404, nginx should call the app instead or what? |
20:20:44 | * | gyeates quit (Ping timeout: 265 seconds) |
20:20:45 | dom96 | or just serve all of nim-lang.org off it |
20:20:45 | mischanix | you can just make it a rewrite rule in nginx if that's the idea |
20:20:57 | dom96 | if a html file does not exist, check if it exists in /docs/ |
20:22:14 | def- | I don't like that solution and nginx can already do that easily |
20:22:53 | dom96 | how? |
20:22:57 | mischanix | see http://nginx.org/en/docs/http/ngx_http_core_module.html#try_files |
20:22:59 | * | leru quit (Quit: Nettalk6 - www.ntalk.de) |
20:23:01 | ELFrederich | what is possible with this python package? The example doesn't do anything really interesting. It seems to expose the CPython C-API to Nim |
20:23:56 | mischanix | I think try_files $uri /docs/$uri =404; is what you want? |
20:24:20 | * | OnO joined #nim |
20:24:25 | dom96 | oh cool. I'll try that. |
20:24:54 | mischanix | and you can put that under a location{} block matching things ending in html, too, to just apply to those doc pages |
20:26:02 | mischanix | I think that'd be location ~ \.html$ { try_files ...; } |
20:26:19 | dom96 | yeah... that doesn't work well |
20:26:21 | dom96 | Main site 404's |
20:26:46 | mischanix | what does the nginx.conf look like atm? |
20:27:16 | dom96 | Restricting it to .html files works |
20:27:20 | dom96 | but it doesn't redirect |
20:27:27 | dom96 | it just responds with the docs |
20:28:03 | BlaXpirit | it's something |
20:28:24 | def- | it should redirect |
20:28:59 | ldlework | #3 on hn :D |
20:29:23 | mischanix | oh, in that html location block then `rewrite ^(.*)$ /doc/$1 permanent;` |
20:29:33 | mischanix | instead of try_files |
20:29:51 | * | solidsnack quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
20:29:57 | mischanix | s/doc/docs/ |
20:30:06 | BlaXpirit | mischanix, doesn't it redirect everything |
20:30:16 | dom96 | lol yep |
20:30:42 | mischanix | if it's in the location block matching ^/([^\/]).html$ |
20:30:43 | dom96 | that doesn't work |
20:30:50 | mischanix | so just change the regex to that i guess? |
20:31:17 | mischanix | err with a + between the ] and ) |
20:32:12 | mischanix | ... i suppose i should set up a local nginx if there are any more issues |
20:32:22 | dom96 | there we go |
20:32:28 | dom96 | mischanix: Thank you for the help |
20:32:36 | mischanix | Glad to help! |
20:32:39 | dom96 | argh |
20:32:59 | mischanix | oh index broke |
20:33:09 | Araq | dom96: epic failure. ;-) |
20:33:17 | BlaXpirit | everything broke |
20:33:21 | BlaXpirit | community.html |
20:33:22 | Araq | index.html is still index.html, not docs/index.html |
20:34:31 | mischanix | could put the intentional .htmls in a location block above the redirect block |
20:35:00 | mischanix | like location ~ ^\/(index|community|...).html ? |
20:35:02 | fowl | +1 all around good work team |
20:35:02 | dom96 | redirects main page to /docs/index.html |
20:35:02 | fowl | d: |
20:35:02 | dom96 | right, that's enough of that. |
20:35:02 | dom96 | I need to get back to work. |
20:35:05 | BlaXpirit | this looks promising https://gist.github.com/casivaagustin/9261586 |
20:35:33 | Araq | I still don't see the need for these redirects. Google should be able to follow links from index.html to the other stuff. |
20:35:45 | BlaXpirit | we are not talking about goole |
20:35:57 | BlaXpirit | and if we are, setting up redicrects is better for SEO |
20:36:04 | BlaXpirit | but the real problems is all the other existing links |
20:36:07 | * | Trustable quit (Ping timeout: 256 seconds) |
20:36:08 | fowl | Irclogs is down :( |
20:36:21 | BlaXpirit | no |
20:36:44 | dom96 | I think BlaXpirit's link is most promising. |
20:36:46 | * | Trustable joined #nim |
20:36:57 | fowl | Oh maybe its my connection |
20:37:13 | dom96 | Damn. Firefox thinks that nim-lang.org redirects to nim-lang.org/docs/index.html now :\ |
20:37:30 | BlaXpirit | yes, i had to try another browser, it's not actually redirected |
20:37:49 | BlaXpirit | gotta be careful with permanent |
20:37:56 | BlaXpirit | maybe best to try without permanent first |
20:38:00 | Araq | and so does chrome |
20:38:27 | fowl | I get err conn refused :p |
20:38:41 | mischanix | apparently the only way to uncache that is another 301 back to / from some other url on the domain |
20:39:11 | dom96 | There we go. |
20:39:16 | dom96 | I think it's working now. |
20:39:40 | BlaXpirit | great work, dom96 |
20:40:08 | mischanix | i'm sorry about the issues, hard to edit configs by proxy |
20:40:21 | mischanix | and yay |
20:40:41 | dalarmmst | If I do type X = enum Z and then type Z, I get Error: redefinition of 'Z'. Isn't the Z in X.Z protected by X? Can I make it protected somehow? |
20:40:44 | dom96 | mischanix: You still helped me massively :) |
20:41:01 | dom96 | This is what I used for anyone curious: https://gist.github.com/dom96/14a7ffa773e19b52e1c8 |
20:41:53 | def- | dalarmmst: no, you use it as Z, not X.Z. if you really want X.Z you can put the enum into a module X |
20:42:00 | fowl | dalarmmst: mark the enum pure |
20:42:05 | def- | oh, or that |
20:42:22 | fowl | Then it requires X.Z |
20:42:56 | BlaXpirit | http://nim-lang.org/lolhtml |
20:43:27 | * | grncdr joined #nim |
20:43:37 | mischanix | That's a non-issue in my mind :P |
20:43:41 | dom96 | indeed. |
20:43:56 | filwit | dom96: sorry about all the mess in the Aporia PR.. was using Aporia to edit Aporia's whitespace handling and accidentally changed a few random lines throughout the files :\ |
20:44:24 | ELFrederich | when you import a package you don't have to prefix any of the functions with the package name? How if you import foo and import bar and call spam(), how do you know where to find spam? |
20:45:14 | BlaXpirit | filwit, i wonder if git rebase --ignore-whitespace can help |
20:45:30 | dom96 | ELFrederich: That's one of the major differences between Nim and Python. It's largely a non-problem though, this is something that IDEs can tell you. |
20:45:43 | filwit | ELFrederich: try it. you get an ambiguity error. If you *really* need that, just use 'from Foo import nil' |
20:46:10 | BlaXpirit | sure, non-problem |
20:46:14 | filwit | BlaXpirit: didn't know git had that, thanks |
20:46:30 | BlaXpirit | filwit, i'm not sure it does what we think it does |
20:46:34 | BlaXpirit | never used it |
20:46:36 | BlaXpirit | just found |
20:46:54 | BlaXpirit | anyhow, on the problem of importing everything to one namespace |
20:46:56 | ELFrederich | filwit, I'm not saying that it exists in both packages, I'm asking how a reader of the code knows where it comes from |
20:46:57 | filwit | well i don't it's really needed in this scenario |
20:47:00 | BlaXpirit | now adding functions to modules is a breaking change |
20:47:09 | BlaXpirit | ELFrederich, and that sucks too, yeah |
20:47:22 | filwit | not enough commits to really be a problem, but it makes finding what i did change a bit more challenging |
20:47:51 | * | grncdr quit (Ping timeout: 250 seconds) |
20:47:58 | * | grncdr joined #nim |
20:48:01 | ELFrederich | dom96, I like python where you have to explicitly import *. Typically the only times I ever import * from a package is PyQt where nearly everything starts with a capital Q and its easy to tell where it came from anywya |
20:48:03 | BlaXpirit | why did nobody ever think that adding functions to modules non-backwards-compatible change |
20:48:31 | filwit | ELFrederich: ah i see. Yes this is certainly annoying without proper IDE support sometimes. |
20:49:41 | ELFrederich | damn kids with their fancy IDEs ruining everything |
20:49:54 | ldlework | ELFrederich: agreed. 1000 million times. |
20:49:55 | filwit | lol |
20:50:50 | Araq | not worth replying. too stupid. |
20:50:57 | ldlework | you just did. |
20:51:02 | Araq | damn |
20:51:06 | ldlework | hehe |
20:51:15 | Jehan_ | ELFrederich: You can use `from module import nil`. |
20:51:28 | BlaXpirit | no u can't in most cases |
20:51:48 | BlaXpirit | i don't want to repeat this every time someone mentions it |
20:52:01 | ldlework | BlaXpirit: just put a link to the IDE that solves this problem for Nim in the topic |
20:52:12 | BlaXpirit | wut |
20:52:22 | ldlework | BlaXpirit: that IDE we keep referring to |
20:52:25 | ldlework | that helps with this import issue |
20:52:34 | ldlework | just link to it in the channel topic so we don't have to keep going over it |
20:52:36 | BlaXpirit | why are you saying this to me |
20:52:37 | Araq | isn't that every editor by now with nimsuggest support? |
20:52:46 | BlaXpirit | no IDE can help with this glaring problem |
20:52:53 | filwit | yes it can |
20:52:53 | BlaXpirit | i never say anything about IDEs |
20:53:06 | BlaXpirit | [:48:00] <BlaXpirit> why did nobody ever think that adding functions to modules is a non-backwards-compatible change |
20:53:14 | ldlework | BlaXpirit: sorry I thought you were responding to someone else |
20:53:26 | filwit | i agree it's annoying without an IDE, but why design things like they don't exist and aren't incredibly useful? |
20:53:49 | ldlework | Nim, a programming language who's design is coupled to the existence of IDEs that support it. |
20:53:53 | * | solidsnack joined #nim |
20:54:02 | BlaXpirit | forget about IDEs |
20:54:03 | filwit | nimsuggest, and it's integration into popular editors, should be the answer to this |
20:54:03 | BlaXpirit | [:48:00] <BlaXpirit> why did nobody ever think that adding functions to modules non-backwards-compatible change |
20:54:06 | ldlework | If that's cool with you, then that's cool. You guys are doing the work. |
20:54:16 | * | Siecje left #nim (#nim) |
20:54:20 | mischanix | ldlework: Go harp on C# if that's your beef :D |
20:54:21 | gokr | I think BlaXpirit is referring to some issue with importing ... but I forgot exactly what it was, something with objects? |
20:54:29 | Araq | yeah, as opposed to Java which is only the most common programming language on earth. |
20:54:49 | filwit | ldlework: was is your argument there? Nimsuggest is not an IDE itself, and at the end of the day it solve the practical problem just the same. |
20:54:50 | ldlework | You can write both of those languages without requiring an IDE, if you have the documentation of the libraries you're working with. |
20:55:01 | mischanix | The same is true for nim |
20:55:01 | ldlework | This is an entirely different problem. |
20:55:29 | BlaXpirit | i'm tired |
20:55:30 | ldlework | mischanix: they don't share the same problem. You can't say problem X is not a problem because problem Y is solved elsewhere. |
20:55:46 | filwit | uh.. yes you can |
20:55:46 | BlaXpirit | i don't think i'm gonna use nim at all in the nearest months, why am i still here |
20:55:53 | * | loz1 joined #nim |
20:56:01 | BlaXpirit | i guess i just like fiddling with it.. |
20:56:02 | filwit | if Y is the solution to problem X, it solves it.. i don't get what you're saying |
20:56:15 | Araq | if you prefer to work without decent tooling in 2015 that's your personal problem. |
20:56:31 | loz1 | hi guys, i'm trying to do some parallel code, but i get |
20:56:31 | loz1 | life.nim(110, 21) Error: (col)..(col) not disjoint from (col)..(col) |
20:56:57 | filwit | a compile is comprised of many tools, not just the actual compiler and but also things like docgen, c2nim, etc |
20:57:07 | loz1 | the thing is col is just an index, and i pass it to spawned function, which cant change it |
20:57:16 | loz1 | can i prove this to compiler somehow? |
20:57:22 | Jehan_ | Which reminds me that I need to polish my `ntags` implementation and put it up somewhere. |
20:57:28 | Araq | loz1: report it properly please |
20:57:36 | def- | Jehan_: looking forward to that! |
20:57:43 | * | ldlework fails to find nimsuggest integration for emacs. |
20:57:54 | BlaXpirit | oh somebody was working on it for sure |
20:58:04 | loz1 | Araq: do you mean like a bug report or something? |
20:58:06 | ldlework | I hope they maintain it forever once they are done. |
20:58:25 | Jehan_ | def-: Me, too, I just need to fix a number of bugs. The parser is an extreme hack right now and barfs on some normal code. |
20:58:27 | filwit | ldlework: it's a WIP, this is a newer language with a very small dev community. |
20:58:33 | BlaXpirit | who cares about IDEs though, nobody still replied to |
20:58:35 | ldlework | filwit: again, I hope they maintain it forever |
20:58:36 | BlaXpirit | [:48:00] <BlaXpirit> why did nobody ever think that adding functions to modules non-backwards-compatible change |
20:59:09 | Jehan_ | BlaXpirit: That's a tradeoff. You get the same issue in OO languages with inheritance. |
20:59:11 | def- | Jehan_: that would solve the problem ELFrederich described for me. I'm not a big fan of IDEs |
20:59:18 | Jehan_ | def-: Ditto. |
20:59:39 | Jehan_ | I'll put it on my todo list. |
21:00:10 | filwit | ldlework: well I can't argue that this design comes with a different set of pros and cons.. but Nim's not "unusable" without 'jumpToDefinition' either.. that's just the most direct way of doing this sort of thing, so Nim is design to work around that concept. |
21:00:13 | Araq | loz1: bug report |
21:00:25 | BlaXpirit | guy is looking for help, not bug report |
21:00:33 | loz1 | Araq: ok, i got it |
21:01:14 | loz1 | BlaXpirit: well, if Araq thinks this could be a bug i will report it |
21:01:17 | Araq | C's #include does the same thing. |
21:01:32 | Araq | I have never heard that C is unusable without an IDE |
21:01:52 | BlaXpirit | but have you heard that C's functions have stupid prefixes? |
21:02:00 | Jehan_ | Well, that's why ctags are pretty essential for any work with C. |
21:02:01 | BlaXpirit | SDL_ GL_ anyone |
21:02:04 | ldlework | filwit: I think deep down you know that making a language that literally depends on external tooling is wrong. But that since it works for you, you want to establish this as generalized virtue. I just don't agree. I think its really realllllllly bad. |
21:02:13 | Araq | in fact, Python is *unusable* with an IDE thanks to its dynamisms everywhere IMHO |
21:02:15 | ldlework | But we don't have to argue, about it. |
21:02:26 | BlaXpirit | Araq, and why are you saying that? |
21:02:29 | BlaXpirit | it's not true, anyway |
21:02:41 | ldlework | Araq: at least I know where something was imported from. |
21:02:51 | Araq | ldlework: no you don't. |
21:02:54 | ldlework | I really do. |
21:03:01 | ldlework | You can't get names into a module without importing it. |
21:03:05 | ldlework | Otherwise its an attribute. |
21:03:07 | Araq | muhaha |
21:03:08 | ldlework | And you have documentation for that. |
21:03:11 | ldlework | sorry. |
21:03:37 | * | OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…) |
21:03:44 | Araq | attributes are like 90% of all identifiers in a Python source file. |
21:03:44 | ldlework | Its amazing that such a small obvious enhancement is guarded behind so much paper thin pseudo-virtue |
21:03:47 | * | mpthrapp quit (Remote host closed the connection) |
21:03:55 | ldlework | the change would be small, backwards compatible and would make the language better |
21:04:21 | ldlework | Araq: except the ones you import. amazing. |
21:06:23 | Araq | ldlework: what do you propose that's backward compatible? |
21:06:40 | BlaXpirit | yeah i don't get it |
21:06:40 | ldlework | You're right it wouldn't be, sorry. |
21:06:45 | filwit | in Nim it's better to do 'import Foo except bar' whenever you have conflicts. It's not like you're going to know the source module for every Type that get's imported when you do 'import *' in Python either |
21:06:58 | * | solidsnack quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
21:06:58 | ldlework | filwit: its better, because of how it works currently |
21:07:02 | ldlework | not Better. |
21:07:21 | * | OnO joined #nim |
21:07:23 | ldlework | filwit: no one does import *, in the professional python community |
21:07:32 | ldlework | in fact its against the style guide at all three companies I've worked for |
21:08:10 | filwit | this isn't an argument for the language feature.. you're just saying the community has worked around the issues there, like what will happen with Nim |
21:08:22 | ldlework | filwit: by simply not typing it |
21:08:33 | ldlework | not by requiring they use some software to overcome the existence of import * |
21:08:39 | Araq | Python has rather absymal IDE support |
21:09:06 | BlaXpirit | who the heck cares!!!!! |
21:09:13 | filwit | ldlework: my python knowledge is limited.. 'import *' is almost identical to Nim's 'import' default right? |
21:09:19 | ldlework | filwit: yes |
21:09:31 | ldlework | import foo, you just get 'foo', and you have to use . operator to get things in the module |
21:09:36 | ldlework | or explicitly import the names |
21:09:41 | ldlework | why *wouldn't you want this* |
21:09:47 | ldlework | Its the virtue we hold everywhere else in computing |
21:09:55 | filwit | but in Nim, not procs are tied to a type like they are in Python |
21:09:58 | Araq | because it's retarded to program like it's 1970? |
21:10:19 | ldlework | Araq: yes, the virtues of explicit interfaces is so antiquated |
21:10:19 | filwit | so how exactly are you suggesting changing import anyways? |
21:10:41 | ldlework | With the advent of IDE's and all. |
21:10:52 | ldlework | Anyway I don't want to be a source of vitriol here |
21:11:30 | filwit | there's no concept of a 'class' in Nim (eg, a type with associated functions).. not directly anyways.. so you want 'import' to import all associated procs for each type-name you provide? |
21:11:37 | ldlework | But don't 'hurr hurr, just use an ide' to what is arguably a really bad engineering decision. |
21:11:46 | ldlework | It isn't obvious that your choice is ideal, so don't act like it. |
21:11:57 | BlaXpirit | Araq will be Araq |
21:12:08 | filwit | we aren't 'hurr hurr'ing anything.. it's a perfectly valid argument for the situation |
21:12:26 | Araq | it's obvious to me that the choice is ideal since nothing that's statically typed and widely used works like what you're proposing |
21:12:41 | BlaXpirit | uh C++? |
21:12:56 | Araq | just look at C, C++, c#, Java ... |
21:13:06 | ldlework | you are hurr hurr'ing when you boil down the counter argument to being a programmer stuck in the past, or that you must use shitty tools, or that the problem is on the person who disagrees with you |
21:13:08 | BlaXpirit | look at what exactly |
21:13:12 | ldlework | rather than the counterargument itself |
21:13:16 | BlaXpirit | C, C++, c#, Java pretty much all have namespaces |
21:13:21 | dom96 | I agree that the lack of module names qualifying function calls is not ideal but I don't see how requiring these qualifiers can work with operators. |
21:13:27 | BlaXpirit | of course, this is completely untrue that C has namespaces |
21:13:38 | BlaXpirit | that's why all "real" libraries prefix every function to emulate it |
21:13:46 | Araq | again, so just say it: |
21:13:52 | Araq | C cannot be used without an IDE. |
21:14:10 | BlaXpirit | mmmm i definitely disagree |
21:14:18 | Araq | be somewhat consequent in your line of argumentation. |
21:14:33 | ldlework | C isn't reaching 1.0 |
21:14:41 | filwit | ldlework: "or that you must use shitty tools" this is a oversimplification of my argument. And I still don't even know how you're proposing to 'fix' the problem here? |
21:14:42 | BlaXpirit | if you say anything about IDEs again i'm gonna kill a kitten |
21:15:15 | * | elbow_jason joined #nim |
21:15:30 | QWERTYPASSWORD | UFCS wouldnt work since functions arent tied to objects like in python |
21:15:40 | filwit | ^ exactly |
21:15:49 | gokr | Sorry for... breaking up the really cozy atmosphere by asking - can someone in 1-2 paragraphs tell me what the issue is? I am ... daft. |
21:15:51 | * | gyeates joined #nim |
21:15:57 | filwit | so you cannot do "import Foo" and get all it's "functions (well.. i guess you could) |
21:16:01 | Beluki | gokr: automatically importing stuff into the current namespace? |
21:16:05 | ldlework | filwit: that was the conclusion last time |
21:16:09 | ldlework | "Well I guess you could" |
21:16:18 | Beluki | Or at least that's what I got from the current conversation going on. |
21:16:18 | BlaXpirit | i already suggested that it's a good solution to pull procs that have the mentioned class as first argument |
21:16:27 | ldlework | But it would require work, would be backwards incompatible, though I don't think it would break UFCS |
21:16:48 | BlaXpirit | ldlework, not necessary to remove or replace old syntax |
21:17:05 | ldlework | BlaXpirit: import foo shouldn't import everything from foo |
21:17:10 | ldlework | oh you said syntax |
21:17:12 | ldlework | not semantics |
21:17:13 | renesac | BlaXpirit: the mentioned class, like "int"? |
21:17:15 | filwit | ldelwork: exactly. and since this problem basically disappears with IDE support, it's the most logical way forward to fixing it. |
21:17:21 | dom96 | what? |
21:17:25 | * | flaviu quit (Read error: Connection reset by peer) |
21:17:27 | * | dom96 is lost |
21:17:29 | BlaXpirit | filwit, please drop the goddamn IDEs |
21:17:32 | ldlework | filwit: No its merely the easiest. |
21:17:32 | gokr | Beluki: Its a reoccurring subject ;) |
21:17:39 | filwit | ldlework: yes. |
21:17:41 | * | flaviu joined #nim |
21:17:42 | ldlework | filwit: merely. |
21:17:49 | ldlework | IE, "therefore most logical" |
21:17:52 | BlaXpirit | I don't suggest to change import module |
21:17:58 | filwit | "most logical right now" |
21:17:58 | BlaXpirit | just condemn it |
21:18:00 | dom96 | If it shouldn't import everything then what should it do? |
21:18:05 | Jehan_ | gokr: The problem is that when you import multiple modules, you may not be able to tell which module an identifier was imported from. |
21:18:09 | BlaXpirit | from x import nil, however, has potential |
21:18:16 | Jehan_ | gokr: At least that's my understanding. |
21:18:19 | renesac | I do like python explicitness on what function is from what module when I'm reading code on github, for example |
21:18:20 | gokr | Jehan_: So... its exactly like in Java, right? |
21:18:22 | * | OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…) |
21:18:24 | Beluki | gokr: dunno, to me it was scary when I first tried nim. I usually prefix the identifiers with the namespace anyway. Then again I also use 4 character idents... so I may not be a great example. :D |
21:18:24 | ldlework | filwit: no |
21:18:31 | ldlework | filwit: after 1.0, it definitely will be and I will agree |
21:18:35 | BlaXpirit | gokr, what do you mean like in java |
21:18:39 | BlaXpirit | classes almost replace modules |
21:18:49 | BlaXpirit | in nim it's just a soup of short-named functions |
21:18:54 | renesac | but it don't work well with nim's UFCS and custom operators |
21:18:55 | dom96 | In Java you have static classes, so it's not the same as Nim really. |
21:19:09 | gokr | BlaXpirit: In Java you can do import blabla.* - right? |
21:19:29 | filwit | ldlework: manhours are real things, and on short supply. don't drop them from your equation. |
21:19:32 | ldlework | filwit: that said, it will be tragic and I will always see this unpolished corner on Nim's otherwise pretty plastic. |
21:19:34 | loz1 | you can even import static parts of classes |
21:19:36 | BlaXpirit | gokr, who cares what you can |
21:19:59 | ldlework | filwit: and in the end, its a smallish thing that wont stop me from using Nim |
21:20:03 | BlaXpirit | just don't do it and be happy |
21:20:12 | ldlework | I still feel the same way, though. |
21:20:14 | BlaXpirit | in nim, however, you can't not do the bad thing because there is no alternative |
21:20:28 | flaviu | gokr: static imports are almost never used in Java. |
21:20:56 | renesac | BlaXpirit: you can do "from module import x, y, z" |
21:21:00 | BlaXpirit | no |
21:21:02 | BlaXpirit | it is useless |
21:21:02 | Beluki | static imports are basically never used anywhere if it can be avoided. |
21:21:09 | QWERTYPASSWORD | ok what would you do if u have functions that works on the same object type in 2 modules? |
21:21:13 | gokr | flaviu: And isn't that because almost everyone uses an IDE for Java? That fixes up the imports. |
21:21:14 | renesac | this is pretty nice most of the time |
21:21:16 | QWERTYPASSWORD | if you dont import them automatically |
21:21:22 | * | RegisterOn joined #nim |
21:21:26 | gokr | flaviu: IIRC its alt-shift-something in Eclipse. |
21:21:29 | RegisterOn | so dom96 is in the news :D |
21:21:30 | loz1 | when you should consider adding symbols renaming, shadowing rules, etc, etc |
21:21:43 | flaviu | gokr: Yep. When doing Java, I didn't even pay attention to imports. Autocomplete handled all that for me. |
21:21:47 | dom96 | RegisterOn: I am? |
21:21:48 | renesac | BlaXpirit: I guess we would need a keyword to import all operators from it too |
21:21:51 | renesac | is that the problem? |
21:21:51 | BlaXpirit | yes |
21:21:56 | RegisterOn | dom96: yes |
21:22:00 | RegisterOn | dom96: http://www.osnews.com |
21:22:00 | BlaXpirit | [00][:16:15] <BlaXpirit> i already suggested that it's a good solution to pull procs that have the mentioned class as first argument |
21:22:01 | filwit | RegisterOn: what news? |
21:22:04 | filwit | nevermind |
21:22:16 | mischanix | nim doesn't have classes right? |
21:22:16 | ldlework | BlaXpirit: I missed it |
21:22:25 | renesac | the mentioned type? |
21:22:32 | BlaXpirit | well the imported type |
21:22:36 | dom96 | cool! |
21:22:39 | loz1 | dom96: hey, above the apple news :D |
21:22:46 | dom96 | Does that finally make us notable in the eyes of Wikipedia? |
21:22:46 | ldlework | BlaXpirit: a sigil or something? |
21:22:52 | BlaXpirit | from module import Point and whatnot, so `+`(Point,Point) would be pulled because it's first argument |
21:22:52 | ldlework | dom96: lol |
21:22:53 | filwit | mischanix: not exactly, no.. depending how what you mean by a "class" |
21:22:54 | QWERTYPASSWORD | class? |
21:22:55 | RegisterOn | dom96: it should help :) |
21:22:57 | mischanix | then why compare it to languages that do? |
21:23:03 | RegisterOn | dom96: well done by the way |
21:23:03 | QWERTYPASSWORD | what is a class |
21:23:15 | ldlework | BlaXpirit: ah so you have to atleast import the type explicit |
21:23:16 | dom96 | RegisterOn: thank you :) |
21:23:17 | ldlework | not bad... |
21:23:35 | * | dom96 has no idea how big OSNews is. |
21:23:44 | QWERTYPASSWORD | you woul still have no clue where your function came from |
21:23:52 | gokr | Oh, OSNews is actually an Inc. |
21:23:52 | QWERTYPASSWORD | so it doesnt fix your complaint |
21:23:56 | ldlework | BlaXpirit: but its bad because someone will ask "Why didn't I get `+`(Point,Point) when I 'import module' ? |
21:24:08 | BlaXpirit | wait what |
21:24:10 | RegisterOn | dom96: OSNews has been around and has tons of readers |
21:24:22 | ldlework | BlaXpirit: not bad from my perspective, just that it conflicts with the default 'import module' |
21:24:23 | gokr | RegisterOn: Yeah, me included ;) |
21:24:28 | BlaXpirit | how so |
21:24:40 | RegisterOn | it used to be an hobby-os centric site in the 90s, but now it's far and long between actual OS news, mostly generic IT stuff |
21:24:43 | ldlework | BlaXpirit: hm |
21:24:43 | RegisterOn | so this was refreshing |
21:24:48 | BlaXpirit | nobody in their right mind would use `import module` |
21:24:55 | renesac | dom96: that seems like the slashdot article, I don't think it will have much more weight than that |
21:24:56 | ldlework | BlaXpirit: okay fair enough |
21:25:02 | ldlework | Wait |
21:25:05 | ldlework | What if there was a |
21:25:09 | ldlework | from global import module |
21:25:11 | ldlework | or something |
21:25:20 | ldlework | (global is a terrible keyword, I know) |
21:25:22 | renesac | it is not written by their editorial staff, and does not cover the language in depth |
21:25:27 | dom96 | renesac: Yeah. It quotes what I wrote directly. |
21:25:33 | gokr | renesac: Quite true. |
21:25:41 | ldlework | Or an alternative import keyword |
21:25:47 | dom96 | Still. My project is on the front page of OSNews woooh |
21:25:48 | ldlework | "givemejust module" |
21:25:51 | RegisterOn | who will present Nim at OSCON? |
21:25:58 | BlaXpirit | if there was a syntax that is like from m import nil BUT knows that when you do m.thing+m.thing you also want to pull the `+` from m |
21:25:59 | def- | RegisterOn: Araq will |
21:26:08 | BlaXpirit | ok i'm done |
21:26:09 | RegisterOn | cool, i plan to attend |
21:26:14 | ldlework | BlaXpirit: ah |
21:26:34 | filwit | BlaXpirit: what are you talking about? pretty much every C/C++/C# program uses 'using namespace X' which is pretty much the same is 'import module' |
21:26:44 | gokr | dom96: Yeah! Get on there and write some nice comments |
21:26:48 | BlaXpirit | filwit, no, it's only the beginners that do it |
21:27:05 | dom96 | gokr: will do! |
21:27:10 | BlaXpirit | and people who also program in PHP in addition to C++ |
21:27:26 | flaviu | BlaXpirit: The way that D does it? |
21:27:32 | BlaXpirit | i dont know |
21:27:56 | QWERTYPASSWORD | imo the import is fine as is |
21:27:56 | filwit | dude, i have seen too many C# project to know 'using namespace' is used everywhere in production |
21:28:00 | BlaXpirit | lol impossible to google info on D |
21:28:17 | QWERTYPASSWORD | you can already do 'from x import y' |
21:28:26 | BlaXpirit | but it's useless |
21:28:37 | BlaXpirit | goddammit i need to have prerecorded replies |
21:28:48 | QWERTYPASSWORD | it does something |
21:28:52 | QWERTYPASSWORD | so its not useless |
21:28:53 | filwit | nevermind, lets just drop it now |
21:28:54 | Beluki | filwit: in C#, using won't make harm because everything is encapsulated into classes. So you get HashTable, but you don't get every function in your current namespace, since there aren't standalone functions. |
21:29:08 | BlaXpirit | that too.. |
21:29:13 | gokr | BlaXpirit: So... the uselessness of that is because you can't import a whole "class", right? |
21:29:14 | Beluki | (other than static functions ofc) |
21:29:17 | filwit | that doesn't make sense, BlaXpirit |
21:29:20 | gokr | BlaXpirit: Just trying to understand. |
21:29:25 | BlaXpirit | gokr, pretty much |
21:29:29 | filwit | class come with functions, and if you get them all, ti's the same |
21:29:32 | BlaXpirit | like i keep saying, |
21:29:45 | BlaXpirit | I want to be able to access related procs if i import a type |
21:30:05 | QWERTYPASSWORD | ... what if you define a function on that type in another function |
21:30:08 | QWERTYPASSWORD | module* |
21:30:21 | Araq | if 90% of all things use foo.bar as opposed to module.bar(foo) you cannot reasonably argue for "explicit is better". Sorry you simply cannot. And in Python's case you don't even know foo's type. |
21:30:33 | mischanix | hey you could just return a table of function pointers from a single exported function in your package named after the package |
21:30:38 | BlaXpirit | Araq, sure you do. type(foo) |
21:30:38 | mischanix | that'd fix your problem right |
21:31:19 | Jehan_ | BlaXpirit: Umm, that doesn't work in an editor? |
21:31:41 | BlaXpirit | right.. |
21:32:02 | QWERTYPASSWORD | function for a type dont need to be in the same module as the type, so you would have to import the same 'type' from different module if you want to be consistant with your 'explicit' imports |
21:32:03 | ldlework | Araq: its like Python *can't* do this, we *could* but we're aiming for the middle ground between 'best that can be done for the langauge' and 'the best that can be done by other completely unrelated languages' |
21:32:13 | ldlework | Yes, python has certain implicit limitations - that nim does not. |
21:32:26 | gokr | I am thinking of writing a blog article about "long standing reoccurring design battles in the Nim community" :) |
21:32:46 | ldlework | gokr: Just wait until 1.0 and all these discussions cease. |
21:32:53 | QWERTYPASSWORD | its either you import every symbol 1 by 1 or you import everything, there is no middle ground imo |
21:33:03 | loz1 | gokr: it would be nice to read something like this :) |
21:33:43 | Araq | QWERTYPASSWORD: and yet Nim even provides some middle ground: import foo except bar. |
21:33:46 | mischanix | i actually wonder if gcc could optimize through such a thing, or if you could do compile time execution to achieve such a thing simply, as i said above |
21:33:54 | QWERTYPASSWORD | yes araq thats what im saying |
21:33:59 | QWERTYPASSWORD | 1 symbol at a time |
21:34:02 | gokr | I know a few of these: constructors, indexing and slices, and this one (feel free to tell me about more) |
21:34:07 | QWERTYPASSWORD | o |
21:34:07 | QWERTYPASSWORD | yes |
21:34:08 | filwit | BlaXpirit: i'm not saying that would be a useful feature.. i'm just saying it's not really worth a ton of time.. you have two issue: Finding symbols, and avoiding symbol collisions. Avoiding symbol collisions is easy with 'except' and finding symbols is barely better with "import Module.Type".. at the end of the day, you want "jumpToDefinition()".. you don't want to scroll to the top of your file and look at what you're importing, that's |
21:34:09 | filwit | a waist of time. |
21:34:09 | QWERTYPASSWORD | lol |
21:34:22 | filwit | wouldn't** be a.... |
21:35:07 | gokr | "a waist of time"... trying to visualize a really slender goddess of Time... |
21:35:14 | ldlework | filwit: all you're doing is justfiying the design you like, by pointing out the stuff we don't like about how to work around it. |
21:35:27 | ldlework | how will that ever work as an argument that aims to satisfy? |
21:35:41 | ldlework | we know what Nim has already. |
21:35:49 | filwit | no i said "I'm not saying it wouldn't be a useful feature" |
21:35:54 | QWERTYPASSWORD | so the only argument for a new import system is 'durr i dont know where this come from' right? |
21:35:57 | ldlework | I know followed by "but nim already provides" |
21:36:02 | filwit | then i made the argument "it wouldn't save a bunch of time" |
21:36:15 | ldlework | QWERTYPASSWORD: and "durr I'd like to import a type and be able to use it" |
21:36:21 | ldlework | its _so_ durr of us. |
21:36:46 | QWERTYPASSWORD | it cant work |
21:36:56 | filwit | then i gave future argument, and concluded that at the end of the day you'll want IDE support anyways.. so lets just work towards that. |
21:37:14 | ldlework | filwit: see: everything BlaXpirit has said about IDE's to-date. |
21:37:30 | QWERTYPASSWORD | what would you do if you have your type in 1 module, and 3 other modules with functions on that type, how would you import that? |
21:37:33 | Jehan_ | filwit: Plenty of developers prefer to work without IDEs. |
21:37:46 | Jehan_ | Or, in some cases, have to. |
21:37:46 | ldlework | QWERTYPASSWORD: that's an entirely unrelated problem |
21:37:52 | QWERTYPASSWORD | how so? |
21:37:58 | ldlework | seriously? |
21:38:14 | ldlework | QWERTYPASSWORD: name one other language that does what you just said |
21:38:15 | QWERTYPASSWORD | you would have to repeat the import type per module |
21:38:41 | QWERTYPASSWORD | python works per function |
21:38:45 | QWERTYPASSWORD | or class |
21:38:47 | filwit | Jehan_: and they live with the slight disadvantages that comes with. I'm not saying we couldn't do more in the future to improve 'import' (like make it import all procs of a type), but as an argument for what we should cater too and focus on now? |
21:39:05 | QWERTYPASSWORD | doesnt magically import function on that type, |
21:39:07 | ldlework | QWERTYPASSWORD: in python if I import Foo from bar I don't magically get stuff in utils |
21:39:11 | Jehan_ | filwit: I'm not actually suggesting changing much, if anything, about import. |
21:39:18 | ldlework | QWERTYPASSWORD: right, no one is asking for that, or has any language even attempted it |
21:39:21 | ldlework | its a non-sequitur |
21:39:27 | Jehan_ | I'm just saying that "people will have IDEs" does not work as an argument. |
21:39:30 | ldlework | you're taking our desire to the illogical extreme that no one is interested in |
21:39:33 | QWERTYPASSWORD | idlework |
21:39:37 | QWERTYPASSWORD | you can already do what you ask for |
21:39:40 | QWERTYPASSWORD | from x import y |
21:39:47 | QWERTYPASSWORD | ... |
21:39:49 | Xe | ldlework: I can name one language that matches it |
21:39:52 | ldlework | That doesn't import the functions for y that exist in x |
21:39:52 | Xe | Go technically |
21:40:01 | QWERTYPASSWORD | ... |
21:40:02 | ldlework | Xe: only in terms of interfaces |
21:40:07 | QWERTYPASSWORD | thats what im saying |
21:40:12 | QWERTYPASSWORD | python doesnt either |
21:40:17 | ldlework | QWERTYPASSWORD: yes it does |
21:40:18 | QWERTYPASSWORD | it export the CLASS |
21:40:28 | QWERTYPASSWORD | if u declare a normal function working on a type |
21:40:30 | ldlework | Right, which Nim has decided to divorce into state and procs |
21:40:31 | QWERTYPASSWORD | it doesnt import it |
21:40:32 | ldlework | we *get it* |
21:40:35 | ldlework | we *know how nim works* |
21:40:42 | ldlework | we're making a *UI argument* |
21:40:46 | QWERTYPASSWORD | thats why nim cant do it |
21:40:46 | ldlework | please. |
21:41:06 | ldlework | QWERTYPASSWORD: nothing about its current implementation would prevent it from importing the functions that work upon that type |
21:41:08 | ldlework | nothing |
21:41:22 | ldlework | there isn't some core design to the implementation where this feature is just logically imposible |
21:41:26 | ldlework | please. |
21:41:36 | filwit | anyways, gotta do other things now |
21:41:40 | ldlework | "it doesn't work that way right now" is exactly the conversation |
21:41:41 | QWERTYPASSWORD | what im saying is |
21:41:51 | ldlework | "it doesn't work that way" isn't a justification for it not working that way. |
21:41:51 | QWERTYPASSWORD | if you break your functions on that type between modules |
21:41:58 | ldlework | yes and just like in Python |
21:42:03 | ldlework | no one is asking for it to work across modules |
21:42:05 | ldlework | no one |
21:42:09 | ldlework | its a nonsequitur |
21:42:14 | QWERTYPASSWORD | you would then neeed to do: from y import x, from z import x from aaa import x |
21:42:23 | ldlework | yes just like in every other language |
21:42:30 | ldlework | we would have achieved the state of the art |
21:42:31 | * | ingsoc1 quit (Quit: Leaving.) |
21:42:38 | ldlework | without going beyond it to illogical extremes that no one cares about |
21:42:41 | ldlework | \o/ |
21:42:44 | QWERTYPASSWORD | thats retarded imo |
21:42:49 | QWERTYPASSWORD | separate your modules better |
21:42:52 | ldlework | yay now I'm retarded |
21:42:56 | QWERTYPASSWORD | not you |
21:43:04 | QWERTYPASSWORD | what your asking is retarded |
21:43:12 | ldlework | huge distinction, thanks |
21:43:28 | ldlework | Sorry languages that already work the way we just covered |
21:43:32 | ldlework | You're also retarded! |
21:43:38 | BlaXpirit | dude |
21:43:51 | renesac | ldlework: BlaXpirit make a feature request to improve the from module import blah |
21:43:52 | gokr | ehm. Stop. |
21:43:53 | QWERTYPASSWORD | C works like nim |
21:43:58 | renesac | on the bugtracker |
21:44:05 | BlaXpirit | renesac, honestly pretty soon i'm just gonna stop caring |
21:44:14 | BlaXpirit | at least i wish i could |
21:44:18 | ldlework | renesac: its been proven that the decision has been made politically. |
21:44:32 | fowl | Politically? |
21:44:38 | k1i | how does UFCS work with a fully-qualified import |
21:44:38 | QWERTYPASSWORD | what decision? |
21:44:41 | * | jsseb left #nim (#nim) |
21:44:42 | ldlework | Sure, those who will ever have any say are settled on the issue. |
21:44:55 | fowl | This discussion sucks |
21:44:59 | QWERTYPASSWORD | yes it does |
21:45:02 | QWERTYPASSWORD | modules are fine thx |
21:45:04 | renesac | I think an improvement that don't breaks the current "import module" behaviour will be welcomed |
21:45:06 | dom96 | Guys. Stop using offensive language i.e. "retarded". |
21:45:10 | ldlework | dom96: thanks |
21:45:21 | Xe | how do I load nim code at runtime? |
21:45:23 | ldlework | k1i: why does where a name comes from have anything to do with how it is involved in UFCS |
21:45:34 | k1i | ldlework: specifically the 'method call syntax' |
21:45:41 | k1i | was just curious how it looked |
21:45:44 | flaviu | Xe: There isn't a simple solution there. |
21:45:50 | renesac | Xe: you will need the compiler as a dependency |
21:45:53 | ldlework | yeah. how does "the mechanism responsible for bringing a name into a module" affect UFCS? |
21:45:54 | renesac | yeah |
21:45:55 | fowl | k1i: well, it can't, fully qualified means the module is in the receiver position |
21:46:01 | k1i | foo.(myPackage.Bar)? |
21:46:12 | renesac | Xe: search the nim logs for the last days, there has been discussions about this |
21:46:19 | k1i | fowl: that's what i thought. |
21:46:24 | Xe | I will |
21:46:30 | gokr | Xe: I presume you mean "compile" when you say load? |
21:46:41 | gokr | Otherwise dlls etc work fine |
21:47:16 | Xe | I mean some kind of loading a file into memory and executing it by either compiling and running or just loading a shard object |
21:47:26 | * | Trustable quit (Remote host closed the connection) |
21:47:54 | QWERTYPASSWORD | Xe: use the nim compiler to compile a shared library at runtime lol |
21:48:06 | fowl | k1i: it might work if we were rust like, obj.pkg::f() but that looks weird imo and the syntax you suggested is yikes :p |
21:48:08 | ldlework | BlaXpirit: Maybe we should write an article and post it to HN and see what the larger audience thinks? |
21:48:13 | Xe | I'm not sure how to use the nim compiler to compile a shared library |
21:48:20 | * | OnO joined #nim |
21:48:31 | BlaXpirit | ldlework, i say i don't have time |
21:48:33 | renesac | ldlework: why not write a bug report or at least a forum post first? |
21:48:35 | BlaXpirit | aaand waste hours arguing here |
21:48:36 | Xe | much less load and run it |
21:48:48 | QWERTYPASSWORD | im not exactly sure either but the compiler has a --lib or something |
21:49:03 | renesac | well articulated and that clearly shows the problem points and your proposals |
21:49:12 | k1i | fowl: the other issue i'd think would appear with would be function name/type overloading (.bar on type Foo vs. .bar on type Qux) |
21:49:15 | ldlework | renesac: if the wider community agrees, then perhaps that's the right thing to do |
21:49:46 | renesac | ldlework: the problem is if the wider comunity haven't even tried to write in nim |
21:49:53 | fowl | k1i: why is that an issue |
21:49:59 | renesac | and will argue out of ignorance and familiarity with other languages |
21:50:01 | gokr | Xe: Its quite easy to make a dll, so ... try http://nim-lang.org/docs/nimc.html |
21:50:02 | QWERTYPASSWORD | im pretty sure if someone implement something backward compatible it wouldnt be a problem. |
21:50:11 | k1i | fowl: fully-qualified imports, the function exists in different modules |
21:50:21 | ldlework | renesac: I don't think anything about writing Nim specifically is a blocker to understanding namespaces. |
21:50:39 | renesac | ldlework: nim UFCS, operators, and the unique nim import system |
21:50:47 | QWERTYPASSWORD | exactly |
21:50:50 | ldlework | I don't see how UFCS is involved at all |
21:50:56 | BlaXpirit | next 2 days i'm seriously not gonna have time, especially because i wasted this day :D |
21:50:58 | renesac | people need to understand that before they can cast a vote |
21:51:03 | renesac | "vote" |
21:51:16 | ldlework | And the import system is exactly what would be explained in detail |
21:51:28 | ldlework | Operators seem like a thing you could mention and it would break the minds of hn readers. |
21:51:29 | fowl | k1i: I don't get what you're saying, if you want to qualify them you can't use UFC |
21:51:35 | renesac | ldlework: only reading about something isn't the same thing as experiencing it |
21:51:37 | ldlework | wouldn't* |
21:51:47 | renesac | please make a forum post or a bug report first |
21:52:02 | ldlework | renesac: there have been forum posts and plenty of feedback from the core community already |
21:52:02 | renesac | I think it is more organized than discussing that on irc |
21:52:08 | Araq | well I can see how that 'voting' would work. But the problem with language design by "voting" is that we already know where to find Java. |
21:52:19 | k1i | fowl: that's what I am saying - a 100% fully-qualified system would have fairly-considerable codestyle impact - you could no longer bar(Foo) and bar(Qux) |
21:52:22 | renesac | ^ |
21:52:23 | Araq | or perhaps C#. |
21:52:28 | ldlework | Compared to "Find araq on a day he's feeling amicable" style of language design |
21:52:46 | ldlework | "And those who already agree with him are not paying attention at the moment" |
21:52:46 | BlaXpirit | :D |
21:52:49 | BlaXpirit | so true |
21:53:10 | renesac | Araq: what you feel about the ability of "from module import type" import all procs for that type? |
21:53:15 | fowl | Considering that he will implementing it what can you do other than ask nicely |
21:53:23 | renesac | or some way to say "from module import all the operators" |
21:53:23 | renesac | ? |
21:53:37 | ldlework | fowl: I'm just observing the characteristics that in addition to the one you mention. |
21:53:38 | BlaXpirit | it's not just operators ...... |
21:53:41 | Xe | gokr: I would first make a shared object of the nim runtime and then link things against that? |
21:54:00 | Araq | ldlework: what's the alternative? letting people decide who won't program in Nim anyway? |
21:54:07 | QWERTYPASSWORD | democracy isnt a good thing for technical things, its a meritocracy for a reason |
21:54:08 | renesac | BlaXpirit: that is why I want what you guys want written clearly in some place |
21:54:09 | * | BlaXpirit quit (Quit: Quit Konversation) |
21:54:22 | flaviu | voting on this is ridiculous. |
21:54:26 | ldlework | Araq: implement my will? |
21:54:28 | ldlework | :) |
21:55:08 | flaviu | Xe: What are you *really* trying to do? Compiling code at runtime will be very difficult. |
21:55:13 | RegisterOn | Araq: extremely impressed by Nim so far. Huge kudos. |
21:55:20 | * | solidsnack joined #nim |
21:55:21 | QWERTYPASSWORD | x2 |
21:55:33 | gokr | Xe: I made a dll easily with -app:lib ... wrote an article about it but calling it from Smalltalk: http://goran.krampe.se/2014/11/03/squeak-to-nim/ |
21:55:33 | Araq | renesac: I wouldn't mind "import type Foo" or something like that too much, but we already have lots of "import" related features |
21:56:23 | renesac | hum, indeed |
21:56:25 | Araq | ldlework: actually I thought about making import macro-able |
21:56:36 | Araq | so you can write a macro that does the import filterings |
21:56:56 | Araq | and yes, we can have a "good" one in system.nim that everybody loves |
21:56:58 | Xe | flaviu: dynamic loading of program code at runtime so things can be reloaded without restarting the binary |
21:57:00 | renesac | still, if it blends naturally on the language it wouldn't be so bad of an addition |
21:57:06 | * | grncdr quit (Quit: Leaving.) |
21:57:25 | gokr | Xe: There are some experiments on this being made... wasn't there someone on the forum? |
21:57:31 | fowl | Xe: there is a project for this, called plugins iirc |
21:57:34 | * | solidsnack quit (Client Quit) |
21:57:34 | fowl | Its on babel |
21:57:38 | gokr | Xe: We are also going to go that route eventually |
21:57:49 | renesac | fowl: do you mean nimble? |
21:57:54 | fowl | Yes :p |
21:58:04 | Xe | gokr: ah I see |
21:58:07 | fowl | I still say Nimrod |
21:58:57 | renesac | I started liking "nim" better than nimrod latelly |
21:59:29 | ldlework | Araq: you know that I love Nim on the whole. I think it is making incredible strides and you know my chips are square on its number. I just don't want to have to appologize for Nim. "Well your editor might have a plugin." is an appology is all. I'm willing to admit it might be too late for some of the things, but I'll argue a position if the argument is underway. It shouldn't -not- supply features or UI that |
21:59:29 | renesac | probably it ws Arrrrr fault |
21:59:31 | ldlework | have solved certaion PL design problems that have been solved in quality-of-life sustaining or even enhancing way. |
21:59:37 | renesac | *was |
21:59:47 | filwit | Araq: I'm not really petition for it, but a macro import sound very interesting. We could tie it to 'class' macros or make things like 'importOperators()' |
21:59:48 | Xe | gokr, fowl: but I'm looking to implement the main application logic in nim and have it be able to reload its state and the implementation shared object without losing socket connections |
21:59:57 | filwit | petitioning** |
22:00:12 | gokr | Xe: Should be doable, Araq can fill in more |
22:00:37 | ldlework | Whatever that means for the import system I'm okay with. I'm just here to try to defend's Nim position in that ideal when I think its settling on non-hyper-alien-polished-plastic ideals. |
22:00:51 | fowl | Xe: the project I mentioned is a good place to start then he wants to do something similar |
22:01:18 | * | solidsnack joined #nim |
22:01:26 | flaviu | Has anyone had actual concrete problems with imports? |
22:01:28 | ldlework | heh wow I butchered the grammar there, sorry. |
22:01:28 | Xe | fowl: i can't find it in nimble, can you link me to the github repo? |
22:01:36 | ldlework | flaviu: yes, emotional frustration |
22:01:44 | flaviu | ldlework: Doesn't coult ;) |
22:01:46 | flaviu | *count |
22:01:56 | ldlework | where I have to think "Why do I have to do this crap when I've used languages where this was never in my way" |
22:02:05 | ldlework | That violates my basic presmise for why Nim should succeed. |
22:02:06 | QWERTYPASSWORD | what crap? |
22:02:14 | QWERTYPASSWORD | grepping? |
22:02:20 | ldlework | QWERTYPASSWORD: manually import every function related to my type, grep my source, and so on. |
22:02:27 | QWERTYPASSWORD | import module |
22:02:29 | QWERTYPASSWORD | its fixed |
22:02:35 | ldlework | QWERTYPASSWORD: I understand that you don't agree. |
22:02:36 | QWERTYPASSWORD | no need to import 1 by 1 import everything |
22:02:38 | ldlework | We have two choices |
22:02:40 | renesac | let's not start it again... |
22:02:47 | ldlework | Just repeat your thesis with more and more abrasion and shortness |
22:02:56 | ldlework | Or just move on and understand that we're not debating directly anymore. |
22:02:56 | * | loz1 quit (Ping timeout: 272 seconds) |
22:03:02 | filwit | why would you not just 'import M expect A, B, C'? this is obviously better for avoiding conflicts with now Nim works |
22:03:04 | QWERTYPASSWORD | learn to separate your modules better if its a problem |
22:03:11 | filwit | how* |
22:03:32 | ldlework | None of your adivce is useful. Maybe you think it is, I'm telling you at the person you're giving it to, its useless. |
22:03:35 | filwit | renesac: yeah sorry.. lol.. i'm trying to work on other things too.. i need to close this IRC window |
22:03:37 | ldlework | I don't want your cookies, please. |
22:03:46 | renesac | filwit: you can't "except" future functions you don't know |
22:03:58 | renesac | and it don't helps with knowing from where something came W/O an ide |
22:04:06 | renesac | by the way, before you go, are you still using kate? |
22:04:13 | renesac | any plans for nimsuggest support? |
22:04:20 | filwit | renesac: the compiler will give you ambiguity errors when they're added |
22:04:31 | * | gsingh93 quit (Ping timeout: 256 seconds) |
22:04:42 | fowl | Xe: looking for it too |
22:04:44 | renesac | filwit: exactly, adding any new function on the stdlib is a breaking change |
22:04:58 | renesac | or any library you are working with |
22:05:01 | * | bluenote quit (Ping timeout: 246 seconds) |
22:05:03 | renesac | *a potential breaking change |
22:05:08 | filwit | so that doesn't matter.. Nim does dead-code elimination, so you just say "import everything" unless there a conflict and you either resolve is explicitly or exclude it. |
22:05:12 | renesac | I don't care about this much |
22:05:19 | renesac | by the way |
22:05:46 | Xe | fowl: I assume the process is going to be something like |
22:05:46 | renesac | but it is the opposite of the procvar thing |
22:05:52 | Xe | 1. open so for the binary |
22:05:55 | * | solidsnack quit (Client Quit) |
22:06:02 | Xe | 2. run its "main" procedure |
22:06:14 | Xe | and have the main detect if it need to reload its state, etc |
22:06:31 | filwit | i see, that's a valid point though |
22:07:08 | renesac | by the way, before you go, are you still using kate? |
22:07:28 | Araq | renesac: yep, indeed very valid. however, chances are small that this bites you thanks to overloading disambiguation |
22:07:36 | renesac | yes |
22:07:45 | Xe | fowl: basically I'm looking to rewrite an ircd in nim |
22:07:47 | mischanix | Xe: if you're a server, i think the so should have a proc that handles an individual session, and a main loop that accepts incoming connections and calls that session proc |
22:08:19 | Araq | renesac: but yes, if your point is "procvar affects the same niche situations only", I think I have to agree |
22:08:28 | * | solidsnack joined #nim |
22:08:33 | mischanix | Xe: alternatively you can have the individual procs that are passed a session pointer be in the so, and the main holds the session pointers and above |
22:08:39 | gokr | Xe: In tests/dll there is some... not sure how to run it though |
22:08:40 | Xe | hmm |
22:08:50 | Xe | I'll do some research |
22:09:11 | renesac | well, if "from module import x, y, z" is improved to import types and/or operators I will probably will use it together with the plain "import module" thing |
22:09:40 | renesac | but I'm not that much into the full qualified function calls |
22:09:43 | mischanix | Xe: the tricky bit is when the definition of a struct changes between the so's view of the data and the main's view of the data |
22:10:00 | fowl | Xe: got it https://github.com/transfuturist/outlet |
22:10:02 | renesac | though it is nicer for the reader w/o an IDE as I said |
22:10:02 | def- | Xe: sounds like a cool idea. Maybe this helps: http://rosettacode.org/wiki/Call_a_function_in_a_shared_library#Nim |
22:10:21 | Xe | mischanix: that is why I'd like the implemented main to hold the state in memory and then dump it to a json file on reload being requested |
22:10:42 | Xe | so all you have to worry about is the json being able to be parsed |
22:10:52 | mischanix | Xe: yeah, something like that works |
22:11:07 | Xe | how would i parse json? |
22:11:09 | gokr | Xe: marshal module uses JSON btw |
22:11:15 | Xe | ah |
22:11:18 | Xe | marshal module |
22:11:20 | def- | Xe: with the json module: http://nim-lang.org/docs/json.html |
22:11:34 | gokr | or marshal :) |
22:11:45 | def- | the marshal module may be problematic if your objects change and you want to refill them with the data |
22:12:06 | Xe | what about dumping a json object to a data structure? |
22:12:49 | fowl | It'll work fine until the type changes |
22:13:11 | Xe | def-: let's argue that for now there's no reason for the type to change |
22:13:25 | mischanix | i think the idea is that the .so gets passed a json string and recreates the data structure from that, and when it reloads it gives its current state back to the main module as that same json string format |
22:13:42 | mischanix | so i don't think there should be many hard problems implementing that |
22:14:05 | Xe | something like that |
22:14:15 | Xe | except I was thinking about using the filesystem as a buffer for that |
22:14:56 | mischanix | yeah, where the string data goes is a minor detail |
22:15:34 | QWERTYPASSWORD | renesac: if it imports everything for the type it would still break on that type doing something like-> from module1 import type1, type2, type3 from module2 import typ2 |
22:15:56 | QWERTYPASSWORD | if it were to break before |
22:16:02 | renesac | QWERTYPASSWORD: yes, but that would be even more rare |
22:16:18 | QWERTYPASSWORD | i guess |
22:16:34 | renesac | the most likely chance for conflicts is when working with the default types |
22:16:49 | renesac | like string, int, etc |
22:17:22 | Xe | mischanix: the thing I'm kinda "worried" about atm is being able to rebuild a socket from just a file descriptor number |
22:18:08 | * | Jehan_ quit (Quit: Leaving) |
22:18:52 | * | OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…) |
22:19:27 | gokr | Xe: Why do you have to be able to dynamically reload the actual socket stuff? |
22:21:09 | Xe | gokr: I basically want to be able to restart things and get the same state as I began with |
22:22:41 | gokr | Xe: Sure, but I mean... it would be simpler to be a bit selective. |
22:23:46 | Xe | I'm probably thinking too deep into it |
22:28:22 | * | antranigv1 joined #nim |
22:29:11 | QWERTYPASSWORD | whats the status on typeclasses? |
22:29:25 | QWERTYPASSWORD | will it be included in 1.0? |
22:29:59 | * | antranigv quit (Ping timeout: 252 seconds) |
22:30:00 | * | clone1018 quit (Ping timeout: 252 seconds) |
22:30:02 | gokr | AFAIK they are called concepts now |
22:30:15 | QWERTYPASSWORD | yeh i tried them a bit like 2 weeks ago |
22:30:30 | QWERTYPASSWORD | but i had a couple of bugs |
22:30:50 | QWERTYPASSWORD | and didnt really know how they were suposed to be used exactly |
22:32:27 | EXetoC | possibly after 1.0 |
22:34:24 | * | vendethiel quit (Ping timeout: 256 seconds) |
22:34:26 | QWERTYPASSWORD | ok |
22:34:54 | QWERTYPASSWORD | they would help a lot with game programming imo |
22:35:13 | * | clone1018 joined #nim |
22:36:43 | * | vendethiel joined #nim |
22:36:44 | QWERTYPASSWORD | used as structural typing |
22:39:27 | * | gyeates quit (Ping timeout: 265 seconds) |
22:39:38 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
22:40:03 | fowl | QWERTYPASSWORD, heres some example https://bitbucket.org/fowlsoft/interfaces/wiki/Home |
22:40:37 | QWERTYPASSWORD | fowl: thx |
22:45:02 | * | Siecje joined #nim |
22:50:09 | gokr | So... about that dynlib stuff - I can make one by exportc etc, and I can selectively use importc etc to call something in a dynlib - but... is there no easy way to build/load a Nim module as a dll? |
22:50:57 | Araq | dunno about "easy" but it's not certainly not hard |
22:51:09 | Araq | it requires some .pragma trickery to get going |
22:51:10 | * | banister joined #nim |
22:52:03 | gokr | I mean, making an .so and calling a single proc in it - I do that easily. But... let's pretend a Nim module is a bit bigger, it would be nice if I could just "load it" with a oneliner. |
22:59:49 | * | vendethiel quit (Ping timeout: 245 seconds) |
23:01:58 | * | vendethiel joined #nim |
23:02:58 | * | tmku quit (Ping timeout: 272 seconds) |
23:06:35 | * | flaviu quit (Remote host closed the connection) |
23:06:48 | Siecje | Does nim have methods? |
23:07:33 | gokr | http://nim-lang.org/docs/manual.html#multi-methods |
23:07:58 | gokr | You might want to read my OO articles here: http://goran.krampe.se/category/nim/ |
23:09:11 | * | solidsnack quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
23:09:24 | * | TEttinger joined #nim |
23:09:31 | filwit | gokr, did you see fowl's 'super' implementation using the new getType()? |
23:09:42 | * | OnwardEuler joined #nim |
23:09:59 | gokr | filwit: No I haven't played with it yet, the interfaces stuff. |
23:10:12 | * | tmku joined #nim |
23:11:00 | * | solidsnack joined #nim |
23:13:07 | * | yglukhov quit (Quit: Be back later ...) |
23:13:31 | Araq | gokr: that's one reason why I want to replace methods with interfaces btw. Interfaces work out of the box across DLL boundaries. At least I think they do. |
23:13:59 | gokr | And the principle at work is... because its a wrapper or? |
23:14:06 | * | yglukhov joined #nim |
23:14:29 | Araq | because there is no dispatcher involved that requires updating |
23:14:44 | * | Matthias247 quit (Quit: Matthias247) |
23:15:00 | Araq | it's ultimately just a bunch of function pointers they are exchanged |
23:15:05 | Araq | *that are |
23:16:17 | gokr | I read the stuff fowl wrote - but I am not sure I followed it all. |
23:17:27 | * | Jesin quit (Quit: Leaving) |
23:17:38 | Araq | you don't read fowl's code. you make a picture of it, put a frame around it and put it on the wall. |
23:18:39 | * | yglukhov quit (Ping timeout: 250 seconds) |
23:19:19 | gokr | It did look like a wrapper - but... I didn't understand if one could combine more than one. |
23:20:59 | * | Jesin joined #nim |
23:21:29 | * | solidsnack quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
23:25:14 | * | vendethiel quit (Ping timeout: 276 seconds) |
23:31:26 | * | vendethiel joined #nim |
23:35:11 | * | jholland quit (Quit: Connection closed for inactivity) |
23:36:17 | * | brson quit (Quit: leaving) |
23:37:33 | fowl | Once you've determine that a type is Drawable and it has a vtable generated, you can take that vtable and modify it for ex with functions from some future compilation |
23:37:37 | fowl | Or a dll |
23:37:42 | filwit | gokr, Araq: wait interfaces stuff? I was talking about his simple 'super' example: https://gist.github.com/fowlmouth/dbb43f560cdc67cc3601 |
23:44:37 | QWERTYPASSWORD | filwit: probably https://bitbucket.org/fowlsoft/interfaces/wiki/Home i think |
23:45:05 | filwit | thanks |
23:52:58 | * | vendethiel quit (Ping timeout: 264 seconds) |