<< 05-05-2015 >>

00:00:32*solidsnack joined #nim
00:02:33asdfldlework: I like to think of myself as asdf 2.0
00:02:36asdfbetter than ever
00:10:54ldleworkbut 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:58awesomo4000how do i iterate over bytes in stdin
00:32:07*asdf quit (Ping timeout: 246 seconds)
00:34:52*JinShil joined #nim
00:39:38def-awesomo4000: i only see procs for that, no iterators. You can use readChar
00:40:10awesomo4000ok. how do i detect EOF
00:42:24def-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:55Jehan_You can use `for ch in stdin.readAll`, however, that will slurp in all of stdin at once.
01:07:15Jehan_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:22reactormonkAraq, 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:19reactormonkSo from what I see the the names are already resolved by the pass expr is called in ccgexprs
03:49:49reactormonkI 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:09gokrI 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:48Araqgokr: i don't like most of these proposals and I think we have enough complexity and bugs already
08:52:24gokrI think Jehan's view is also that we are "good" as is.
08:52:31Araqwhat I like cause it's easy enough is some .cripple pragma that prevents Foo() construction in a foreign module
08:52:50gokrBut 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:20gokrhttps://gist.github.com/PhilipWitte/2cba4544530f23631ad1
08:53:53gokrAraq: Yeah, that might be good.
08:54:31Araq"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:18Araqwe can easily have only newFoo, it's only a convention, but further conflating these things is stupid.
08:56:44gokrOh, didn't see that new RFC thread
08:56:49gokrTalk about timing.
08:57:33r-kustrange, during last discussion i think it seemed you Araq agreed some kind of solution might be viable
08:58:00r-kuespecially since what i propose is fully backwards-compatible and wrist-friendly
08:58:14r-kusure handheld saw is good as is, but chainsaw is better. same situation here
08:59:05*endragor_ joined #nim
08:59:34Araqr-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:21Araqr-ku: and thanks for taking the time and coming up with an RFC!
09:01:59r-kui actually wasnt sure it was enough for RFC but great if it is :)
09:02:22gokrThe autoderef at the end... don't we already have that?
09:02:42gokrIn {.experimental.}
09:02:53Araqgokr 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:35r-kuoh 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:15r-kuthe 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:24Araqr-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:46gokrWell, 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:29r-kuAraq: what does mean 'out
09:06:52r-kuif its ref types - everything can not be ref
09:07:01Araqthat's what Delphi and Ada use for it
09:07:14Araqproc p(x: var Foo) # read and write Foo
09:07:31Araqproc p(x: out Foo) # only write to Foo, set all its fields
09:08:17r-kuerr, but do we actually have out keyword?
09:08:25r-kui dont think i ever saw it anywhere
09:08:36Araqit's a keyword, but it's not used
09:09:26r-kuso guess my proposition depends on feature that does not exist yet
09:09:46Araqnot really, the problem exists independent from your proposal
09:09:51*xet7 quit (Ping timeout: 276 seconds)
09:10:23AraqI think/fear the proper solution is to allow:
09:11:09Araqvar subType: SubType = initSuperType() # modifies initSuperType() to return something big enough for SubType
09:11:10gokrOne 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:39Araqbut 'out' surely is simpler to implement than that, so I dunno
09:12:15*mal`` quit (Ping timeout: 248 seconds)
09:12:37Araqgokr: to be honest, once fowl's interfaces work well I like to remove 'method' from the language
09:12:50gokrouch
09:13:31gokrThat ... sounds very bad.
09:13:47r-kuthere certainly are applications where dynamic dispatch is very useful
09:13:51Araqreally? why?
09:14:11*endragor joined #nim
09:14:11gokrHow would interfaces solve all the things that methods do?
09:15:31gokrRon will go ballistic, I can tell you for sure.
09:15:58Araqhe he he well it would probably break too much code anyway
09:16:41synthmeatis breaking compatibility really a thing to consider?
09:16:55gokrWhen 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:18Araqgokr: interfaces do dynamic dispatch
09:17:57gokrWell, 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:27r-ku<Araq> proc p(x: out Foo) # only write to Foo, set all its fields
09:18:29synthmeatgokr: i recently wanted to do that in as3 and couldn't
09:18:33r-kuthat might not be optimal btw
09:18:45fowlAraq I don't know how to make it do multi dispatch like methods do
09:18:46r-kuthere surely gonna be people that want to read object on initialization
09:18:52r-kufor example after calling parent ctor
09:19:00*bluenote joined #nim
09:19:51fowlgokr: 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:03fowlThe issue is single vs multi dispatch
09:20:06Araqfowl: yeah it's not. it's only single dispatch but lots of languages manage to do with only that
09:20:25fowlWith single dispatch you have to use the visitor pattern to emulate multi dispatch
09:20:31gokrsure
09:21:04gokrSmalltalk is single, so I know how that works.
09:21:49gokrWell, I need much more explanations to have any kind of view on it.
09:21:53fowlI think wrapping it in an extra call to get multi dispatch is a good tradeoff
09:22:44gokrA classic obvious thing that comes to mind is how self and super calls plays together - with inheritance.
09:23:38Araqsynthmeat: yes, it is something to keep in mind, all the successful languages stopped breaking code at one point.
09:23:46fowlCan 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:46fowlProccall init(super(self), ...)
09:27:39r-kuthat looks awesome
09:28:44synthmeatwould 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:30fowlI think Perl has been compatible for a long time
09:30:47gokrHehe, which version? :)
09:31:13*allan0 joined #nim
09:31:15fowlIts been written in hieroglyphs for centuries
09:32:05*endragor quit (Remote host closed the connection)
09:32:24gokrfowl: You had some writeup about interfaces right?
09:32:41fowlSuper() is simpler in languages with single dispatch since only self needs to be considered
09:32:43synthmeathey, 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:04fowlgokr: yea on bitbucket.org/fowlsoft
09:33:10gokrfowl: Just calling super is one thing, its when the code in the super class calls code on self it gets interesting.
09:34:00fowlgokr: it can call a method that's defined for a sub type fine AFAIK
09:35:39fowlsynthmeat: networking, physics, audio
09:36:09gokrsynthmeat: Urhonimo
09:36:23gokrBut I doubt Nim was created with "games in mind".
09:36:23fowlEverything is available , there's a project called nimx that compiles to android,iOS,js etc
09:36:32synthmeatif urhonimo's a game title, then yes, that's what i was awkwardly asking for reference on
09:36:57gokrsynthmeat: No, its a Nim wrapper of Urho3D: github.com/3dicc/Urhonimo
09:37:34*endragor joined #nim
09:38:23fowldef- wrote a NES emu
09:38:55*endragor quit (Remote host closed the connection)
09:39:19synthmeatyeah, caught that. and js port, but dude ended up going through emscripten though
09:40:13gokrWith Urhonimo you have quite a solid base for game development.
09:41:10gokrof course, its a C++ wrapper, but still.
09:41:24synthmeatthank you, already spawned dozens of tabs
09:42:38coffeepotwhy 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:47r-kugokr: since you are here just to make sure.. you saw my yesterday's poke about urhonimo?
09:43:11gokrr-ku: No?
09:43:28synthmeatwhat was the poke about?
09:43:31r-kuall i was saying that wrapper repo wasnt synced in a month. so in case there is anything to share... :->
09:43:35fowlcoffeepot: can't assume you want to upclass every inheritable argument
09:43:51gokrr-ku: Oh, yeah. Well, we have some small stuff - but not much.
09:44:23r-kuah i see. wondered if its not much done or everyone forgot about github repo hehe
09:44:31*endragor joined #nim
09:44:33gokrsynthmeat: We use and develop Urhonimo in our private gitlab at 3DICC - then we push to github regularly.
09:44:58gokrWe are busy coding *with* it and not *on* it for the moment.
09:45:14gokrBut its being used in our product now, so we are quite committed.
09:45:40synthmeatgokr: should i google 3DICC or can you direct me to something relevant right off the bat?
09:45:51r-kuhttps://github.com/3dicc/Urhonimo
09:46:03fowlcoffeepot: the super() I proposed would upclass a single argument
09:46:09*endragor quit (Remote host closed the connection)
09:46:37gokrOur 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:47r-kufowl: what about super(super(self))? would it yield parent of the parent?
09:47:33gokrsynthmeat: What you see in that movie though is the old render engine, we are replacing it with Urhonimo now.
09:48:05fowlr-ku: that should work without extra work
09:48:23synthmeatgokr: i am personally related to many similar projects
09:48:24gokrAh, this one is also new: https://www.youtube.com/watch?v=yNFwF13yBIg
09:48:44synthmeatbut i won't level up the noise in here, sorry. it's offtopic
09:48:54*endragor joined #nim
09:48:55r-kuah then super() plays in tune with my constructors vision
09:48:56gokrYou can join #nim-offtopic
09:49:06coffeepotfowl 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:12fowlcoffeepot: you would have to explicitly type it, proccall is still required too
09:50:31coffeepotsounds good
09:52:03coffeepotis there an example of your proposal for super somewhere?
09:52:36fowlNah it will be only a few lines using macros.getType
09:53:05*mal`` joined #nim
09:53:15coffeepotit'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:22coffeepotcool :)
09:53:34fowlI'll write it up in a min
09:53:37coffeepot:D
09:56:04Araqbbl
09:57:18def-synthmeat: the SFML wrapper has some nice example games: https://github.com/blaxpirit/nim-csfml
09:59:01synthmeatdef-: oh, thanks for that too. lovely day fishing for nim and game related stuff today :)
10:01:46fowlI used to have a list of game related libraries but now we have nimble
10:01:54fowlI should find it and update it
10:03:15gokrcoffeepot: I dissected these things in my OO articles. And subsequently pushed Araq to add procCall.
10:03:29gokrOtherwise proper super calls couldn't be done.
10:03:59*mal`` quit (Ping timeout: 248 seconds)
10:04:07fowlgokr: thanks that was missing for a long time
10:04:13gokrsynthmeat: Urho3D has a bunch of examples, we ported a few to Nim in Urhonimo.
10:04:31fowlIf I needed super calls I used vtables
10:04:41*endragor quit (Remote host closed the connection)
10:05:23someplacehmm
10:05:42someplacelet's say I have a table, string->string, and I want to add elements to it from C code
10:05:46someplacewhat's the best way to do that?
10:06:39fowlUse strtabs? I think those funcs are exportc'd
10:08:50fowlFor a Table type you could maybe export them as var set_table_strstr{.exportc.}: proc... = tables.`[]=`[string,string]
10:09:25someplaceoh boy I'm in over my head :D
10:09:28someplacethanks for the pointers
10:09:49fowlSince table is generic it can't just be exported to c
10:10:44*endragor joined #nim
10:12:40fowlsomeplace: 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:25coffeepotgokr, 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:25coffeepott'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:43someplacefowl: to pass the StringTableRef to C I use void*, right? or am I missing something?
10:15:49someplace(it works anyway)
10:16:00someplacesorry, 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:24fowlsomeplace: yea looks like the type doesn't have exportc so it has some mangled name
10:21:49someplacelovely
10:21:51someplacethanks!
10:26:14someplace..and how do I turn cstrings into strings for nstPut?
10:26:20someplaceis there any good doc for this? :<
10:26:34r-kui think you can use $ on cstring
10:28:11someplacewithin C code
10:30:44fowlHmm you'd have to wrap it
10:31:19fowlproc cstr_to_nim (some:cstring): string {.exportc.} = $some
10:31:26someplacehmm right
10:31:35someplacewell, just in case..
10:31:57someplacemy use case is flex generating a table of id -> tile, both of which are strings
10:32:07someplaceif there's any easier way to do that
10:32:13fowlflex?
10:32:47fowlaraq wrote a lexer that works at compile time that might interest you :D
10:33:18someplaceooh?
10:33:20someplacehm
10:34:10fowlhttps://github.com/Araq/lexim
10:34:30*endragor quit (Read error: Connection reset by peer)
10:34:51*endragor joined #nim
10:35:12someplaceahh so much documentation :>
10:35:16someplacei'll give it a try
10:35:36fowlyea lol
10:36:07fowlex1.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:10someplacehmm
10:37:21someplaceseems to be more useful for lexing/tokenising than what I'm doing
10:37:27*endragor joined #nim
10:39:28fowlwhat are you trying to do exactly
10:39:49fowlget to the table of id->tile from nim? or in c?
10:40:05*filwit joined #nim
10:40:30filwitdom96: got the Aporia features done: https://github.com/nim-lang/Aporia/pull/84
10:40:56filwiti'll add some real prefs for these (and 'scrollPastBottom') later
10:41:05someplacenim. 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:14someplace..it might be easier to reimplement the loaderin nim entirely
10:41:15filwitfor now they just use rawPrefs
10:51:31dom96filwit: cool. I'll review it and pull it ASAP.
10:52:16gokrcoffeepot: 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:50coffeepotcall the class' super class (if it has one) without knowing what this might be at compile time
10:56:17gokrBut... but... :)
10:56:38coffeepotyeah I don't know if it's actually something that's needed as you should always know the heirachy
10:58:56gokrI 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:30filwitdom96: 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:15filwitlet me know
11:00:21*gokr lunch...
11:00:35*gokr_ quit (Quit: IRC for Sailfish 0.9)
11:01:12fowlhttps://gist.github.com/fowlmouth/dbb43f560cdc67cc3601
11:01:53dom96filwit: off by default please
11:04:14filwitdom96: k, np.
11:04:47*mal`` quit (Ping timeout: 248 seconds)
11:05:03filwitdom96: any idea what all those GTK failure message are about when Aporia closes?
11:05:16dom96nope
11:06:56filwitk, changed the defaults in the PR
11:20:51*mal`` joined #nim
11:25:21fowlsuper turned out to be the simplest example of gettype yet
11:26:27fowlgn all
11:29:10someplacenight
11:36:15*mal`` quit (Ping timeout: 248 seconds)
11:37:03*mal`` joined #nim
11:37:18thotypousneeded 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:35thotypoushttps://github.com/zah/nimrod.vim <- this seems to be abandoned
11:47:46thotypouswhich fork is most up to date?
11:47:54thotypoushttps://github.com/miyakogi/nimrod.vim
11:48:03thotypousseems like that is, but it doesn't have nimsuggest yet
11:48:28thotypousi can update it and send a pull request, but need to know if it is the most up to date
11:48:34thotypousdoes anyone here uses vim?
11:50:03XeI do
11:50:32thotypousXe: are you using nimrod.vim? do you use zah's or a fork?
11:50:45Xelet me check
11:51:09Xeyeah 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:15Xenim*
11:51:20thotypoushmm thanks
11:52:23thotypousXe: 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:26thotypoushmm, i was wrong, it is still working
12:01:38thotypouseven though it doesn't use the new nimsuggest executable
12:03:26def-Oh, I see Nim on HN: https://news.ycombinator.com/item?id=9491397
12:03:35*synthmeat joined #nim
12:03:54coffeepotgokr 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:55coffeepotaving 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:55coffeepotly 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:02coffeepotas 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:37dom96ooh yay
12:15:40dom96my project this time
12:16:07def-dom96: you can upload new screenshot: http://hookrace.net/nimkernel.png
12:16:45dom96what do you mean?
12:16:57*QWERTYPASSWORD joined #nim
12:17:06def-Your screenshot at http://picheta.me/private/images/nimkernel2.png (linked in the repo) still shows "Nimrod"
12:17:09def-instead of "Nim"
12:17:59dom96oh
12:18:22dom96Sure, i'll update it
12:20:40dom96github seems to be caching it
12:21:59def-fixed
12:22:25def-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:57def-Googling for Nim docs is totally impossible now that the old docs are 404 and the new ones not indexed
12:29:09BlaXpirityup, that's completely stupid
12:29:20def-and all old links to docs are dead
12:29:41BlaXpiritnobody listened to my nagging
12:30:06BlaXpirit"master" branch is also completely meaningless
12:30:47thotypousBlaXpirit: what do you mean? we shouldn't get the latest nim release from the master branch of the repository?
12:31:00BlaXpiritwell apparently you shouldn't
12:31:04BlaXpiritbecause master is currently 0.11.0
12:31:33BlaXpiritlet me ping dom96 about this again
12:31:42thotypousBlaXpirit: so, should get using git checkout v0.11.2 ?
12:34:00dom96BlaXpirit: I need to go to a lecture now, but i'll do it there.
12:34:04dom96Keep reminding me.
12:41:02*mal`` quit (Ping timeout: 272 seconds)
12:41:57*arnetheduck joined #nim
12:44:11QWERTYPASSWORDIm pretty sure the default branch is devel not master
12:44:36*mal`` joined #nim
12:56:00QWERTYPASSWORDlol i love how 'steveklabnik1' is bashing Nim every time he can on reddit
12:57:20QWERTYPASSWORDI guess he::doesnt::want::to::his::users.unwrap()
12:57:25QWERTYPASSWORDlose*
12:57:31*EXetoC joined #nim
12:59:39HakanD_nim vs rust <==> python vs ruby <==> java vs c# and goes and on and on
12:59:55def-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:12HakanD_I've been following him since his ruby days, cool guy
13:07:30coffeepotyeah I thought what he said was quite reasonable too
13:07:49coffeepotit's so tempting to compare languages but it often just ends up with tribalism
13:08:32repaxIt'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:45dom96_BlaXpirit: done
13:16:48*Pisuke joined #nim
13:18:39*JinShil quit (Quit: Konversation terminated!)
13:20:09BlaXpiritnice
13:24:41HakanD_we really need to set up proper redirects for old doc stuff
13:25:39coffeepotwhen 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:25coffeepotjust noticed what everyone was say, the nim manual doesn't work from google now?
13:31:24coffeepotah google's link is missing the /docs/
13:33:19*dom96_ quit (Ping timeout: 246 seconds)
13:40:17coffeepotanyone know where newStringOfCap is defined?
13:40:50def-system/sysstr.nim
13:40:57coffeepotcheers :)
13:40:57def-as rawNewString()
13:41:04coffeepotah, nice one thanks
13:41:15coffeepoti was looking in that unit but didn't see it :)
13:41:27def-It says what compiler magic is used in the definition of newStringOfCap in system.nim
13:41:49def-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:58coffeepotthanks def- :)
13:55:16*BitPuffin joined #nim
13:56:01UUUUUUUUUaddting a 'm. prefix
13:56:06UUUUUUUUUadding*
13:56:12UUUUUUUUU'm'
13:56:40*syncn quit (Quit: Lost terminal)
13:56:41someplaceis there any equivalent to python's subprocessing module in nim?
13:57:35*mal`` quit (Ping timeout: 248 seconds)
13:59:37def-someplace: http://nim-lang.org/docs/osproc.html
14:01:06someplacecheers
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:30coffeepotdoes anyone know why I get this since upgrading to 0.11.2?
14:46:47coffeepotIn file included from c:\nimproj\odbc\nimcache\stdlib_system.c:8:0:
14:46:47coffeepotC:\Nim\lib/nimbase.h:393:13: error: size of array 'assert_numbits' is negative
14:46:47coffeepot typedef int assert_numbits[sizeof(NI) == sizeof(void*) && NIM_INTBITS == sizeof(NI)*8 ? 1 : -1];
14:46:47coffeepot ^
14:48:30coffeepotseems to happen on any program, even just echo "hello" :-/
14:48:44BlaXpiritthat is something so familiar
14:48:56BlaXpiritcoffeepot, probably is 32-64 bit mismatch
14:49:09*gsingh93 joined #nim
14:49:21BlaXpiritbetween C compiler and Nim
14:49:36coffeepoti thought someone might say that for some reason. I'm using nim-0.11.2_x64 told it to install the mingw
14:50:16BlaXpiritmaybe there is some other mingw
14:50:24coffeepotcould be, just checking
14:58:15*HakanD__ quit (Read error: Connection reset by peer)
15:00:54coffeepotyay! Cheers BlaXpirit, was an old mingw floatng baout
15:01:07coffeepot*floating about
15:02:15EXetoCthere are two build scripts for windows
15:04:45XeIs there a way to listen on a unix socket in nim?
15:10:00coffeepotdoes this help Xe? Don't know if it works on unix https://github.com/Araq/Nim/wiki/Tutorial:-Sockets
15:10:13Xecoffeepot: I mean domain sockets
15:10:19Xesockets in the filesystem
15:10:27coffeepotooh ok :)
15:11:20XeI'm assuming no
15:11:22Xelol
15:11:38r-kuXe: whatever you can do with c api you can do in nim
15:12:01r-kuits just a matter of importing those functions. its not most optimal way if wrapper is not present but it is certainly possible
15:12:26mischanixXe: Looks like the rawsockets module has what you want
15:13:53keypusherhttp://nim-lang.org/docs/rawsockets.html#Domain
15:14:43Xethanks
15:16:46coffeepothaving 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:47coffeepotfor the buffer for the C func :/
15:17:28Araqvar buffer = newString(size)
15:17:33Araqc_call(buffer)
15:17:34coffeepotif 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:38Xeis the nim "$" operator for turning something that is not a string into a string?
15:17:41AraqsetLen(buffer, strlen(buffer))
15:17:42coffeepotah cheers Araq
15:18:02AraqXe yes
15:18:16*HakanD__ joined #nim
15:18:17Xeah
15:18:42*yglukhov_ quit (Quit: Lingo: www.lingoirc.com)
15:19:00*yglukhov joined #nim
15:19:42*Jehan_ joined #nim
15:19:50Xewhat is the suggested build system to use for nontrivial nim projects?
15:20:37Jehan_Xe: There's really not a specific build system required. I've used a number of different systems myself.
15:20:44Jehan_Make works fine, for example.
15:21:50XeJehan_: what would you suggest for someone who wants a low maintenance build system?
15:22:16Jehan_Xe: Umm. Depends on your definition of low maintenance.
15:22:31Xe`go build` low maintenance
15:22:51*TEttinger quit (Ping timeout: 250 seconds)
15:23:08Jehan_I'm personally partial to scons, but I don't really know what others need.
15:23:28AraqXe 'nim c -d:release myproject'
15:23:32yglukhovHello. How can i get typedesc of a local var?
15:23:48Araqtype(localvar)
15:23:54yglukhovthank you!
15:24:14Jehan_Araq: Well, he said "nontrivial".
15:24:42Jehan_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:47Xeshe*
15:24:54Jehan_Oops! Sorry.
15:24:58yglukhovXe: nake?
15:26:46Xeis nimble just a package manager or is it also a build system?
15:28:33coffeepotthis 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:34coffeepotlength until it reaches zero) or I'm referencing dodgy memory
15:29:28coffeepotit 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:16coffeepotvar buf: string = newString(1024)
15:31:17coffeepot# call c func
15:31:17coffeepotbuf.setLen(indicator)
15:31:17coffeepotecho buf.len # displays "1"
15:31:17coffeepotecho buf.len # displays "20266198323167233"
15:35:00coffeepoto_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:22gokrXe: Since nim pulls in dependencies etc, it often works to build simple stuff as a oneliner.
15:36:10Jehan_Xe: It's a package manager, the "nimble build" is basically a predefined call to "nim c" with certain arguments.
15:36:53Jehan_I don't like it because it uses -d:release by default, which throws out all safety checks and debugging info.
15:37:10Jehan_Well, I don't like the "nimble build" command, that wasn't about "nimble" in its entirety.
15:40:13Araqcoffeepot: that sounds like a bad corruption indeed
15:40:41Araqdoes the C func take ownership of this memory?
15:40:47yglukhovAbother 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:46coffeepotAraq 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:36coffeepotit should just populate the buffer, I told it the buffer size was 512, but I'm reserving 1024 anyway
15:42:54Araqomg, don't pass addr mystring!
15:42:58*OnO joined #nim
15:43:07coffeepot... sounds like you found my problem! :D
15:43:07Araqpass cstring(buffer) instead
15:43:14coffeepotroger wilco
15:43:21Xeare all nim values implicitly passed as pointers?
15:43:23coffeepotfor reference, what is happening here?
15:43:28yglukhovok, answer to my question is when declared(result)
15:43:36Jehan_Xe
15:43:39Jehan_Xe: Sort of.
15:44:14Jehan_Unless you specify {.byCopy.} or have sufficiently small non-var arguments.
15:44:32Jehan_E.g., an int is obviously passed as a value, as is a pair (int, int).
15:45:00*HakanD___ joined #nim
15:45:27coffeepot:) I get a length of 1 both times now :D
15:45:44*gokr_ joined #nim
15:45:56coffeepotcurious as to what was going on behind the scenes there
15:46:36bluenoteme 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:51Araqbluenote: that's horrible
15:47:04onionhammermaybe I'll make a sublime snippet for it.. hmm
15:47:05EXetoCyou mean str[0].addr?
15:47:07bluenoteI just didn't know and it worked...
15:47:22coffeepotseems like I made the same assumption
15:47:53Araqaddr str --> address of string, but the string starts with the length field, then capacity, then the char data
15:48:07coffeepotoh that really makes sense now :3
15:48:08Araqso you tell C to write to the string's length field
15:48:10bluenoteoh :)
15:48:32gokr_hehe
15:48:38*HakanD__ quit (Ping timeout: 272 seconds)
15:49:16coffeepotmaybe I should write a list of "dun goofed" things wot I did in nim so others can avoid them ;)
15:49:51bluenotelooks like you are not alone ;)
15:50:31Jehan_Doesn't addr(str) point to the string pointer rather than the contents?
15:50:57Araqoh yeah
15:51:54Jehan_Which, of course, is even worse.
15:53:10coffeepotI 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:36coffeepotin this case though, the wrapper func took a pointer because it has to accept different types of data
15:55:55Jehan_coffeepot: Basically, the pointer (= void *) type can contain pretty much anything.
15:56:45Jehan_But string auto-converts properly to cstring, so you shouldn't have to take an address.
15:57:01coffeepot... unless the parameter is a pointer :)
15:57:11coffeepot... but takes a string, because C
15:57:29Jehan_Then use str.cstring instead.
15:57:59coffeepotthat 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:32coffeepotI must say I kinda assumed cstring(str) would be a cast rather than a type conversion
15:58:42coffeepotvery 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:49gokr_afaik type conversion is what you should use
16:08:36coffeepotwell, 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:03OnOAraq: 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:52OnOI'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:14bluenoteOnO: I guess it doesn't really matter if you do that within a macro or not
16:36:47bluenoteif you do e.g.: var s = @[1,2,3]; echo s.items()
16:36:59bluenoteyou also get Error: undeclared identifier: 'items'
16:37:36bluenoteI was told that this is just because "calling" it makes the assumption that there is a proc with that name
16:37:51bluenotesince there is no proc, you get the undeclared identifier
16:38:03OnOno I want to do: for s in macro(ex: untyped): echo s <- where macro replaces ex with call to existing iterator
16:38:11bluenotei.e., it does not really matter that there is an iterator with that name
16:38:59OnOI've dumped AST for: ```for s in it(ex: untyped): echo s``` and there IS A CALL there
16:39:35OnOso I just believe there is a special NimSym node that distinguishes proc symbol from iterator symbol
16:39:47*solidsnack joined #nim
16:40:23OnOoops... I meant AST for: ```for s in it(1, 2, 3): echo s```
16:40:24bluenoteyes, 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:37OnOparsed AST for an iterator call has also Call -> Sym "it", Arg1, Arg2
16:41:48OnOso it is identical on the dump as call to proc
16:42:10OnOI just presume that the Sym binding has some special type
16:42:24OnOand newCall tries to bind "it" only to proc symbols, not "it" symbols
16:42:33leruSo 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:00OnOleru: did you add runForever() at the end of your script?
16:43:34leruOnO: No I didn't. Okay... :<
16:45:20leruIs there an explanation for "runForever()" ?
16:46:04OnOwell, it is part of AsyncHTTPServer which is a system core module
16:46:23OnOJester is just above it as an HTTP callback
16:46:43OnOso actually you need runForever() to start listening for incoming connections
16:47:51OnOoh well, wrong - it is part of asyncdispatch module :)
16:47:56OnOwhich is even lower
16:48:13OnOhttp://nim-lang.org/0.11.0/asyncdispatch.html#runForever,
16:49:51leruI 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:52OnOexactly
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:08drewsremIs 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:56Siecjeonionhammer: 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:16dalarmmstHow do I flush output with echo?
18:20:35def-stdout.flushFile()
18:20:56def-but echo should be flushing already
18:21:13*UberLambda quit (Quit: Leaving)
18:22:37dalarmmstOh, 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:20gyeateshow can you use nimble to install deps listed in a .nimble file?
18:31:35dalarmmstGiven 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:52def-gyeates: nimble build should do that
18:31:58def-or nimble install
18:32:12gyeatesah i think build was what I was looking for
18:33:01def-dalarmmst: cast it to a cstring
18:33:11flyxI 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:23def-flyx: name is a runtime variable, how can the macro use that at compile time?
18:34:58def-dalarmmst: then you should be able to echo the cstring and do a type conversion to string with myCString.string
18:35:11dalarmmstThanks def-
18:35:28flyxdef-: well, the context is at compile time
18:35:33flyxbut I see your point
18:35:50*HakanD___ joined #nim
18:36:17fowlMorning #nim
18:36:39def-Good morning fowl
18:36:45BlaXpiritflyx, var -> const, string -> static[string] and it works
18:37:57flyxoh, static[string] works with macros? didn't know that
18:38:14BlaXpiritit's top secret stuff
18:38:20BlaXpirityou can only find out by accident -_-
18:39:44flyx^^
18:42:43flyxcan I, somehow, transform a piece of code into its AST representation in place?
18:43:25def-flyx: dumpTree:
18:43:36BlaXpirittreeRepr(
18:43:37flyxdef-: well, that outputs it
18:43:50def-var foo = quote do:
18:44:02BlaXpiritparseStmt("
18:44:08def-many choices
18:45:27flyxquote do looks interesting
18:45:37flyxthe manual says the future of do: is unclear
18:45:55*Demon_Fox joined #nim
18:46:33flyxis that correct?
18:47:17BlaXpiritdoes it maybe work without do?
18:48:28BlaXpiritthat's strange, Siecje. that should be correct
18:49:26BlaXpiritthis works tho https://bpaste.net/show/b59568184633
18:49:50BlaXpiriti should complete and document that lib some day
18:50:02BlaXpiritapparently 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:44SiecjeBlaXpirit: I would use it if I could just write the template in a file :)
19:01:54BlaXpiritSiecje, you can
19:02:00BlaXpirittempl slurp "file"
19:02:10*leru joined #nim
19:02:40SiecjeBlaXpirit: I'm trying to use it like Jinja2
19:02:47BlaXpirituse what like jinja
19:03:22*solidsnack quit (Quit: My Mac has gone to sleep. ZZZzzz…)
19:03:25SiecjeI think you linked to Jinja2 before.
19:03:27BlaXpirityes
19:03:34BlaXpiriti don't know what you mean though
19:03:43BlaXpiriti used jinja even today :p
19:03:44SiecjeI'm trying to create a layout file and have other templates inherit that file
19:03:54renesacmy .nimble/bin/ directory is empty
19:03:58BlaXpiritwell nobody has done that , Siecje
19:03:59SiecjeAnd not have to wrap my templates in nim code
19:04:09renesaceven though I have plenty of things on .nimble/pkgs
19:04:11renesacis that normal?
19:04:16flyxSiecje: I'm currently working on template inheritance in my templating language
19:04:20flyxbut it's not ready yet
19:04:24*solidsnack joined #nim
19:04:28Siecjeflyx: link?
19:04:37BlaXpiritflyx's project is certainly very interesting
19:04:41BlaXpiritbut i don't think i'd use it
19:04:42flyxhttps://github.com/flyx/emerald
19:04:51BlaXpiritHTML as DSL is a hack :|
19:04:52*ELFrederich joined #nim
19:04:55*solidsnack quit (Client Quit)
19:05:14flyxwell, it's certainly not for everyone
19:05:23dom96flyx: very nice
19:05:26SiecjeI don't mind writing HTML
19:06:01renesacdom96: saw what I wrote just above?
19:06:21BlaXpiritSiecje, you know what? i think i can make template inheritance.
19:06:22ELFrederichDeveloper of this nimkernel in here?
19:06:31dom96renesac: Just read it. It's normal if you haven't installed any binary packages.
19:06:32BlaXpiritit's as simple as defining functions
19:06:39BlaXpiriti just wish i had time
19:06:43dom96ELFrederich: that's me
19:06:58renesachum, but I would hope nimble binary itself would be there
19:07:12ELFrederichdom96, cool... Curious why you chose 32bit instead of 64
19:07:17dom96renesac: yeah, it should be.
19:07:31renesacit isn't
19:07:33SiecjeBlaXpirit: It sounds like you really want people to use your library. Add some examples
19:07:44dom96ELFrederich: I simply followed the OS barebones C tutorial and converted it to Nim.
19:07:55BlaXpiriti want people to like the library because it's written in 30 lines :D
19:07:55dom96*OSDev
19:08:14dom96renesac: did you install it via nimble?
19:08:16ldleworkflyx: very cool!
19:08:19renesacI 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:22ldleworkflyx: hacker news, my man!
19:08:22SiecjeBlaXpirit: usefulness > size
19:08:47ELFrederichdom96, this? http://wiki.osdev.org/Bare_Bones
19:08:54BlaXpiritELFrederich, 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:55renesacI don't remember
19:09:09dom96ELFrederich: yep
19:09:19dom96Well, I did extend it a bit.
19:09:53*Beluki joined #nim
19:10:25flaviuIRC is a little more active right now, its great time for some bikeshedding!
19:10:25flaviuhttps://docs.google.com/forms/d/1Hh_Ap6Z8D6F1y0OfsXVbQEG0SlRckHjTluiuU88Rves/viewform
19:10:29flyxldlework: what about hacker news?
19:11:07Siecjeflaviu: What is it supposed to do?
19:11:08ldleworkflyx: you should submit your project to it
19:11:34flaviuSiecje: I can't make up my mind, so I'm making you all decide for me. :P
19:11:48renesacok, 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:48Siecjeflaviu: What is the desired operation
19:12:06renesacbut I can't run nimble install nimble anymore
19:12:07flyxldlework: I don't really know anything about hacker news, apart from having heard the name
19:12:09renesacnimblepkg/version.nim(141, 22) Error: use '^' instead of '-'; negative indexing is obsolete
19:12:14flaviuSiecje: Constructing a Regex from a pattern and options..
19:12:18flyxbut I will consider it once I finished v0.2
19:12:18dom96flaviu: yay, a google form. We need more of these.
19:12:27ELFrederichwhat are Nim's primary inspirations? Python? Are there any other languages that use indentation like this?
19:12:35ldleworkI submitted my meta programming article just now, https://news.ycombinator.com/newest
19:12:36renesacELFrederich: Pascal
19:12:38mischanixBlaXpirit: I find x86_64 assembly easier to write, honestly. calling conventions being register-first are nice
19:12:55dom96renesac: git pull nimble and update your compiler?
19:13:00renesacwell, the indentation thing is probably from python
19:13:06BlaXpiritok, so i should not talk about what i don't know
19:13:11ELFrederichrenesac, before my time. I think my high school had a Pascal class and my father wouldn't let me enroll
19:13:12Siecjeflaviu: What is ix? An 'i' followed by an 'x'? and <anycrlf> is ?
19:13:15renesacdom96: I'm at the latest nim compiler
19:13:49renesacand shouldn't nimble install nimble already be doing the git pull thing?
19:13:54BlaXpirit"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:07Siecjeflaviu: I'm a fan of raw strings so you don't have to have \\d etc
19:14:16dom96renesac: oh yes.
19:14:16renesacI'm using a nimble binary from the .nimble/pkgs/nimble*/ dir by the way
19:14:23dom96renesac: which nim
19:14:28bougymanBlaXpirit: I use it more often than you think.
19:14:32bougymanmultiline parsing, that is.
19:14:44dom96ldlework: upvoted
19:14:46bougyman /m in onigurama (and pcre, too, iirc)
19:14:50Siecjeflaviu: If you had the result it would be a lot easier to see what each line is trying to do
19:15:01renesacdom96: nim 11.2
19:15:05renesac*0.11.2
19:15:19dom96ldlework: your blog could really use some syntax highlighting
19:15:29ldleworkdom96: probably
19:15:36Siecjerenesac: I think he wants to know the output of "$ which nim"
19:15:37flaviuSiecje: It's just syntax for initializng a regex. let x = re"123"; "abc".match(x).
19:15:53dom96renesac: I mean executed the command 'which nim'
19:16:02Siecjeflaviu: So it won't match anything in your example
19:16:03dom96renesac: to make sure you don't have another one in your PATH
19:16:07bougymanBlaXpirit: does nim have its own regex engine?
19:16:12BlaXpiritno
19:16:18flaviuSort of.
19:16:21bougymanwhich does it use?
19:16:23BlaXpiritso like i said yesterday
19:16:26BlaXpiritthe problem with this poll is people don't see any merit at all in a few of the options
19:16:27BlaXpiritbut there is a reason for them to be like this. the "anycrlf" part is rare
19:16:28Siecjeflaviu: You want x to be captured?
19:16:29BlaXpiritand some of the options are just consistent with PCRE's syntax
19:16:30BlaXpirit(*ANYCRLF) and (?i) are syntaxes that are already supported by PCRE
19:16:32BlaXpirit(?i) can appear in the middle of the string
19:16:33bougymanhopefully spencer's or onigurama
19:16:45bougymanugh, pcre.
19:17:00flaviubougyman: https://github.com/Araq/lexim, but what I'm working on uses PCRE.
19:17:35renesacdom96: I only have one nim on path, the which output is the expected one
19:17:36renesachttps://github.com/nim-lang/nimble/issues/119
19:17:47renesac<-- that is my problem
19:17:53dom96oooh
19:18:00dom96Run nimble install nimble@#head
19:18:16bougymanhttp://sljit.sourceforge.net/regex_perf.html oniguruma outperforms even pcre with a jit.
19:18:37BlaXpiritk
19:18:45*nimbie joined #nim
19:19:11renesacok, now it created a symlink to the bin dir
19:19:25dom96good
19:19:44renesacthanks, now I should be good
19:19:56flaviubougyman: Performance isn't everything.
19:21:43bougymanno, it isn't.
19:21:52bougymani prefer the flexibility of oniguruma, too.
19:22:20bougyman(?<named_thing>thing) is one of the nicer named-capture syntaxes, imo.
19:23:02ldleworkguys, upvote this! https://news.ycombinator.com/item?id=9494310
19:23:04flaviubougyman: https://regex101.com/r/kR4hT9/1
19:23:13bougymannot to mention the protections you get against infinite backreferences.
19:23:22bougymanthe things that can make pcre grab 100% of your cpu.
19:23:47dom96ldlework: If people vote by going to that page then the votes may not count
19:23:58ldleworkdom96: why is that
19:24:18ldleworkdon't up vote that pls!
19:24:20ldleworklol
19:24:31flaviuldlework: Don't tell people to vote. It's highly frowned upon by all these sorts of communities.
19:24:38dom96Also what flaviu said
19:24:39ldleworksorry...
19:24:54ldleworks/vote for this/check out this article!
19:25:01BelukiPeople will upvote anyway if the content is good.
19:25:06*ldlework goes back to work.
19:25:10dom96ldlework: 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:30renesacELFrederich: http://hackernewsmobile.com/story/9488585
19:30:29*gsingh93 quit (Ping timeout: 246 seconds)
19:31:45gyeatescan you import from the directory above ala `import ...module` in python
19:32:29*nimbie quit (Quit: Page closed)
19:33:47gyeatesor rather `from ..module import A, B` (for unit tests in a sub directory)
19:34:20dom96gyeates: You can do: import "../module" (I might be wrong)
19:34:46dom96gyeates: You should also be able to pass --path:".." when compiling and then: import module.
19:34:51renesacyep
19:35:06renesacyou can do import "../src/module"
19:35:10renesacfor example
19:35:21renesacI use that
19:35:44gyeatessweetness thanks
19:35:59def-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:51gyeateshttp://nim-lang.org/unittest.html 404s
20:00:25dom96nim-lang.org/docs/unittest.html
20:03:21gyeatesah ^ was the one indexed by google
20:04:02BlaXpiritjust make the damn redirect
20:04:09BlaXpirityou 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:42ELFrederichNim 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:37def-ELFrederich: yes, see async* in the stdlib
20:16:59dom96BlaXpirit: 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:17def-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:45dom96or just serve all of nim-lang.org off it
20:20:45mischanixyou can just make it a rewrite rule in nginx if that's the idea
20:20:57dom96if a html file does not exist, check if it exists in /docs/
20:22:14def-I don't like that solution and nginx can already do that easily
20:22:53dom96how?
20:22:57mischanixsee 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:01ELFrederichwhat 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:56mischanixI think try_files $uri /docs/$uri =404; is what you want?
20:24:20*OnO joined #nim
20:24:25dom96oh cool. I'll try that.
20:24:54mischanixand you can put that under a location{} block matching things ending in html, too, to just apply to those doc pages
20:26:02mischanixI think that'd be location ~ \.html$ { try_files ...; }
20:26:19dom96yeah... that doesn't work well
20:26:21dom96Main site 404's
20:26:46mischanixwhat does the nginx.conf look like atm?
20:27:16dom96Restricting it to .html files works
20:27:20dom96but it doesn't redirect
20:27:27dom96it just responds with the docs
20:28:03BlaXpiritit's something
20:28:24def-it should redirect
20:28:59ldlework#3 on hn :D
20:29:23mischanixoh, in that html location block then `rewrite ^(.*)$ /doc/$1 permanent;`
20:29:33mischanixinstead of try_files
20:29:51*solidsnack quit (Quit: My Mac has gone to sleep. ZZZzzz…)
20:29:57mischanixs/doc/docs/
20:30:06BlaXpiritmischanix, doesn't it redirect everything
20:30:16dom96lol yep
20:30:42mischanixif it's in the location block matching ^/([^\/]).html$
20:30:43dom96that doesn't work
20:30:50mischanixso just change the regex to that i guess?
20:31:17mischanixerr with a + between the ] and )
20:32:12mischanix... i suppose i should set up a local nginx if there are any more issues
20:32:22dom96there we go
20:32:28dom96mischanix: Thank you for the help
20:32:36mischanixGlad to help!
20:32:39dom96argh
20:32:59mischanixoh index broke
20:33:09Araqdom96: epic failure. ;-)
20:33:17BlaXpiriteverything broke
20:33:21BlaXpiritcommunity.html
20:33:22Araqindex.html is still index.html, not docs/index.html
20:34:31mischanixcould put the intentional .htmls in a location block above the redirect block
20:35:00mischanixlike location ~ ^\/(index|community|...).html ?
20:35:02fowl+1 all around good work team
20:35:02dom96redirects main page to /docs/index.html
20:35:02fowld:
20:35:02dom96right, that's enough of that.
20:35:02dom96I need to get back to work.
20:35:05BlaXpiritthis looks promising https://gist.github.com/casivaagustin/9261586
20:35:33AraqI 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:45BlaXpiritwe are not talking about goole
20:35:57BlaXpiritand if we are, setting up redicrects is better for SEO
20:36:04BlaXpiritbut the real problems is all the other existing links
20:36:07*Trustable quit (Ping timeout: 256 seconds)
20:36:08fowlIrclogs is down :(
20:36:21BlaXpiritno
20:36:44dom96I think BlaXpirit's link is most promising.
20:36:46*Trustable joined #nim
20:36:57fowlOh maybe its my connection
20:37:13dom96Damn. Firefox thinks that nim-lang.org redirects to nim-lang.org/docs/index.html now :\
20:37:30BlaXpirityes, i had to try another browser, it's not actually redirected
20:37:49BlaXpiritgotta be careful with permanent
20:37:56BlaXpiritmaybe best to try without permanent first
20:38:00Araqand so does chrome
20:38:27fowlI get err conn refused :p
20:38:41mischanixapparently the only way to uncache that is another 301 back to / from some other url on the domain
20:39:11dom96There we go.
20:39:16dom96I think it's working now.
20:39:40BlaXpiritgreat work, dom96
20:40:08mischanixi'm sorry about the issues, hard to edit configs by proxy
20:40:21mischanixand yay
20:40:41dalarmmstIf 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:44dom96mischanix: You still helped me massively :)
20:41:01dom96This is what I used for anyone curious: https://gist.github.com/dom96/14a7ffa773e19b52e1c8
20:41:53def-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:00fowldalarmmst: mark the enum pure
20:42:05def-oh, or that
20:42:22fowlThen it requires X.Z
20:42:56BlaXpirithttp://nim-lang.org/lolhtml
20:43:27*grncdr joined #nim
20:43:37mischanixThat's a non-issue in my mind :P
20:43:41dom96indeed.
20:43:56filwitdom96: 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:24ELFrederichwhen 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:14BlaXpiritfilwit, i wonder if git rebase --ignore-whitespace can help
20:45:30dom96ELFrederich: 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:43filwitELFrederich: try it. you get an ambiguity error. If you *really* need that, just use 'from Foo import nil'
20:46:10BlaXpiritsure, non-problem
20:46:14filwitBlaXpirit: didn't know git had that, thanks
20:46:30BlaXpiritfilwit, i'm not sure it does what we think it does
20:46:34BlaXpiritnever used it
20:46:36BlaXpiritjust found
20:46:54BlaXpiritanyhow, on the problem of importing everything to one namespace
20:46:56ELFrederichfilwit, 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:57filwitwell i don't it's really needed in this scenario
20:47:00BlaXpiritnow adding functions to modules is a breaking change
20:47:09BlaXpiritELFrederich, and that sucks too, yeah
20:47:22filwitnot 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:01ELFrederichdom96, 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:03BlaXpiritwhy did nobody ever think that adding functions to modules non-backwards-compatible change
20:48:31filwitELFrederich: ah i see. Yes this is certainly annoying without proper IDE support sometimes.
20:49:41ELFrederichdamn kids with their fancy IDEs ruining everything
20:49:54ldleworkELFrederich: agreed. 1000 million times.
20:49:55filwitlol
20:50:50Araqnot worth replying. too stupid.
20:50:57ldleworkyou just did.
20:51:02Araqdamn
20:51:06ldleworkhehe
20:51:15Jehan_ELFrederich: You can use `from module import nil`.
20:51:28BlaXpiritno u can't in most cases
20:51:48BlaXpiriti don't want to repeat this every time someone mentions it
20:52:01ldleworkBlaXpirit: just put a link to the IDE that solves this problem for Nim in the topic
20:52:12BlaXpiritwut
20:52:22ldleworkBlaXpirit: that IDE we keep referring to
20:52:25ldleworkthat helps with this import issue
20:52:34ldleworkjust link to it in the channel topic so we don't have to keep going over it
20:52:36BlaXpiritwhy are you saying this to me
20:52:37Araqisn't that every editor by now with nimsuggest support?
20:52:46BlaXpiritno IDE can help with this glaring problem
20:52:53filwityes it can
20:52:53BlaXpiriti never say anything about IDEs
20:53:06BlaXpirit[:48:00] <BlaXpirit> why did nobody ever think that adding functions to modules is a non-backwards-compatible change
20:53:14ldleworkBlaXpirit: sorry I thought you were responding to someone else
20:53:26filwiti agree it's annoying without an IDE, but why design things like they don't exist and aren't incredibly useful?
20:53:49ldleworkNim, a programming language who's design is coupled to the existence of IDEs that support it.
20:53:53*solidsnack joined #nim
20:54:02BlaXpiritforget about IDEs
20:54:03filwitnimsuggest, and it's integration into popular editors, should be the answer to this
20:54:03BlaXpirit[:48:00] <BlaXpirit> why did nobody ever think that adding functions to modules non-backwards-compatible change
20:54:06ldleworkIf that's cool with you, then that's cool. You guys are doing the work.
20:54:16*Siecje left #nim (#nim)
20:54:20mischanixldlework: Go harp on C# if that's your beef :D
20:54:21gokrI think BlaXpirit is referring to some issue with importing ... but I forgot exactly what it was, something with objects?
20:54:29Araqyeah, as opposed to Java which is only the most common programming language on earth.
20:54:49filwitldlework: 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:50ldleworkYou can write both of those languages without requiring an IDE, if you have the documentation of the libraries you're working with.
20:55:01mischanixThe same is true for nim
20:55:01ldleworkThis is an entirely different problem.
20:55:29BlaXpiriti'm tired
20:55:30ldleworkmischanix: 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:46filwituh.. yes you can
20:55:46BlaXpiriti 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:01BlaXpiriti guess i just like fiddling with it..
20:56:02filwitif Y is the solution to problem X, it solves it.. i don't get what you're saying
20:56:15Araqif you prefer to work without decent tooling in 2015 that's your personal problem.
20:56:31loz1hi guys, i'm trying to do some parallel code, but i get
20:56:31loz1life.nim(110, 21) Error: (col)..(col) not disjoint from (col)..(col)
20:56:57filwita compile is comprised of many tools, not just the actual compiler and but also things like docgen, c2nim, etc
20:57:07loz1the thing is col is just an index, and i pass it to spawned function, which cant change it
20:57:16loz1can i prove this to compiler somehow?
20:57:22Jehan_Which reminds me that I need to polish my `ntags` implementation and put it up somewhere.
20:57:28Araqloz1: report it properly please
20:57:36def-Jehan_: looking forward to that!
20:57:43*ldlework fails to find nimsuggest integration for emacs.
20:57:54BlaXpiritoh somebody was working on it for sure
20:58:04loz1Araq: do you mean like a bug report or something?
20:58:06ldleworkI hope they maintain it forever once they are done.
20:58:25Jehan_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:27filwitldlework: it's a WIP, this is a newer language with a very small dev community.
20:58:33BlaXpiritwho cares about IDEs though, nobody still replied to
20:58:35ldleworkfilwit: again, I hope they maintain it forever
20:58:36BlaXpirit[:48:00] <BlaXpirit> why did nobody ever think that adding functions to modules non-backwards-compatible change
20:59:09Jehan_BlaXpirit: That's a tradeoff. You get the same issue in OO languages with inheritance.
20:59:11def-Jehan_: that would solve the problem ELFrederich described for me. I'm not a big fan of IDEs
20:59:18Jehan_def-: Ditto.
20:59:39Jehan_I'll put it on my todo list.
21:00:10filwitldlework: 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:13Araqloz1: bug report
21:00:25BlaXpiritguy is looking for help, not bug report
21:00:33loz1Araq: ok, i got it
21:01:14loz1BlaXpirit: well, if Araq thinks this could be a bug i will report it
21:01:17AraqC's #include does the same thing.
21:01:32AraqI have never heard that C is unusable without an IDE
21:01:52BlaXpiritbut have you heard that C's functions have stupid prefixes?
21:02:00Jehan_Well, that's why ctags are pretty essential for any work with C.
21:02:01BlaXpiritSDL_ GL_ anyone
21:02:04ldleworkfilwit: 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:13Araqin fact, Python is *unusable* with an IDE thanks to its dynamisms everywhere IMHO
21:02:15ldleworkBut we don't have to argue, about it.
21:02:26BlaXpiritAraq, and why are you saying that?
21:02:29BlaXpiritit's not true, anyway
21:02:41ldleworkAraq: at least I know where something was imported from.
21:02:51Araqldlework: no you don't.
21:02:54ldleworkI really do.
21:03:01ldleworkYou can't get names into a module without importing it.
21:03:05ldleworkOtherwise its an attribute.
21:03:07Araqmuhaha
21:03:08ldleworkAnd you have documentation for that.
21:03:11ldleworksorry.
21:03:37*OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…)
21:03:44Araqattributes are like 90% of all identifiers in a Python source file.
21:03:44ldleworkIts 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:55ldleworkthe change would be small, backwards compatible and would make the language better
21:04:21ldleworkAraq: except the ones you import. amazing.
21:06:23Araqldlework: what do you propose that's backward compatible?
21:06:40BlaXpirityeah i don't get it
21:06:40ldleworkYou're right it wouldn't be, sorry.
21:06:45filwitin 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:58ldleworkfilwit: its better, because of how it works currently
21:07:02ldleworknot Better.
21:07:21*OnO joined #nim
21:07:23ldleworkfilwit: no one does import *, in the professional python community
21:07:32ldleworkin fact its against the style guide at all three companies I've worked for
21:08:10filwitthis 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:22ldleworkfilwit: by simply not typing it
21:08:33ldleworknot by requiring they use some software to overcome the existence of import *
21:08:39AraqPython has rather absymal IDE support
21:09:06BlaXpiritwho the heck cares!!!!!
21:09:13filwitldlework: my python knowledge is limited.. 'import *' is almost identical to Nim's 'import' default right?
21:09:19ldleworkfilwit: yes
21:09:31ldleworkimport foo, you just get 'foo', and you have to use . operator to get things in the module
21:09:36ldleworkor explicitly import the names
21:09:41ldleworkwhy *wouldn't you want this*
21:09:47ldleworkIts the virtue we hold everywhere else in computing
21:09:55filwitbut in Nim, not procs are tied to a type like they are in Python
21:09:58Araqbecause it's retarded to program like it's 1970?
21:10:19ldleworkAraq: yes, the virtues of explicit interfaces is so antiquated
21:10:19filwitso how exactly are you suggesting changing import anyways?
21:10:41ldleworkWith the advent of IDE's and all.
21:10:52ldleworkAnyway I don't want to be a source of vitriol here
21:11:30filwitthere'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:37ldleworkBut don't 'hurr hurr, just use an ide' to what is arguably a really bad engineering decision.
21:11:46ldleworkIt isn't obvious that your choice is ideal, so don't act like it.
21:11:57BlaXpiritAraq will be Araq
21:12:08filwitwe aren't 'hurr hurr'ing anything.. it's a perfectly valid argument for the situation
21:12:26Araqit'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:41BlaXpirituh C++?
21:12:56Araqjust look at C, C++, c#, Java ...
21:13:06ldleworkyou 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:08BlaXpiritlook at what exactly
21:13:12ldleworkrather than the counterargument itself
21:13:16BlaXpiritC, C++, c#, Java pretty much all have namespaces
21:13:21dom96I 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:27BlaXpiritof course, this is completely untrue that C has namespaces
21:13:38BlaXpiritthat's why all "real" libraries prefix every function to emulate it
21:13:46Araqagain, so just say it:
21:13:52AraqC cannot be used without an IDE.
21:14:10BlaXpiritmmmm i definitely disagree
21:14:18Araqbe somewhat consequent in your line of argumentation.
21:14:33ldleworkC isn't reaching 1.0
21:14:41filwitldlework: "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:42BlaXpiritif you say anything about IDEs again i'm gonna kill a kitten
21:15:15*elbow_jason joined #nim
21:15:30QWERTYPASSWORDUFCS wouldnt work since functions arent tied to objects like in python
21:15:40filwit^ exactly
21:15:49gokrSorry 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:57filwitso you cannot do "import Foo" and get all it's "functions (well.. i guess you could)
21:16:01Belukigokr: automatically importing stuff into the current namespace?
21:16:05ldleworkfilwit: that was the conclusion last time
21:16:09ldlework"Well I guess you could"
21:16:18BelukiOr at least that's what I got from the current conversation going on.
21:16:18BlaXpiriti already suggested that it's a good solution to pull procs that have the mentioned class as first argument
21:16:27ldleworkBut it would require work, would be backwards incompatible, though I don't think it would break UFCS
21:16:48BlaXpiritldlework, not necessary to remove or replace old syntax
21:17:05ldleworkBlaXpirit: import foo shouldn't import everything from foo
21:17:10ldleworkoh you said syntax
21:17:12ldleworknot semantics
21:17:13renesacBlaXpirit: the mentioned class, like "int"?
21:17:15filwitldelwork: exactly. and since this problem basically disappears with IDE support, it's the most logical way forward to fixing it.
21:17:21dom96what?
21:17:25*flaviu quit (Read error: Connection reset by peer)
21:17:27*dom96 is lost
21:17:29BlaXpiritfilwit, please drop the goddamn IDEs
21:17:32ldleworkfilwit: No its merely the easiest.
21:17:32gokrBeluki: Its a reoccurring subject ;)
21:17:39filwitldlework: yes.
21:17:41*flaviu joined #nim
21:17:42ldleworkfilwit: merely.
21:17:49ldleworkIE, "therefore most logical"
21:17:52BlaXpiritI don't suggest to change import module
21:17:58filwit"most logical right now"
21:17:58BlaXpiritjust condemn it
21:18:00dom96If it shouldn't import everything then what should it do?
21:18:05Jehan_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:09BlaXpiritfrom x import nil, however, has potential
21:18:16Jehan_gokr: At least that's my understanding.
21:18:19renesacI do like python explicitness on what function is from what module when I'm reading code on github, for example
21:18:20gokrJehan_: So... its exactly like in Java, right?
21:18:22*OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…)
21:18:24Belukigokr: 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:24ldleworkfilwit: no
21:18:31ldleworkfilwit: after 1.0, it definitely will be and I will agree
21:18:35BlaXpiritgokr, what do you mean like in java
21:18:39BlaXpiritclasses almost replace modules
21:18:49BlaXpiritin nim it's just a soup of short-named functions
21:18:54renesacbut it don't work well with nim's UFCS and custom operators
21:18:55dom96In Java you have static classes, so it's not the same as Nim really.
21:19:09gokrBlaXpirit: In Java you can do import blabla.* - right?
21:19:29filwitldlework: manhours are real things, and on short supply. don't drop them from your equation.
21:19:32ldleworkfilwit: that said, it will be tragic and I will always see this unpolished corner on Nim's otherwise pretty plastic.
21:19:34loz1you can even import static parts of classes
21:19:36BlaXpiritgokr, who cares what you can
21:19:59ldleworkfilwit: and in the end, its a smallish thing that wont stop me from using Nim
21:20:03BlaXpiritjust don't do it and be happy
21:20:12ldleworkI still feel the same way, though.
21:20:14BlaXpiritin nim, however, you can't not do the bad thing because there is no alternative
21:20:28flaviugokr: static imports are almost never used in Java.
21:20:56renesacBlaXpirit: you can do "from module import x, y, z"
21:21:00BlaXpiritno
21:21:02BlaXpiritit is useless
21:21:02Belukistatic imports are basically never used anywhere if it can be avoided.
21:21:09QWERTYPASSWORDok what would you do if u have functions that works on the same object type in 2 modules?
21:21:13gokrflaviu: And isn't that because almost everyone uses an IDE for Java? That fixes up the imports.
21:21:14renesacthis is pretty nice most of the time
21:21:16QWERTYPASSWORDif you dont import them automatically
21:21:22*RegisterOn joined #nim
21:21:26gokrflaviu: IIRC its alt-shift-something in Eclipse.
21:21:29RegisterOnso dom96 is in the news :D
21:21:30loz1when you should consider adding symbols renaming, shadowing rules, etc, etc
21:21:43flaviugokr: Yep. When doing Java, I didn't even pay attention to imports. Autocomplete handled all that for me.
21:21:47dom96RegisterOn: I am?
21:21:48renesacBlaXpirit: I guess we would need a keyword to import all operators from it too
21:21:51renesacis that the problem?
21:21:51BlaXpirityes
21:21:56RegisterOndom96: yes
21:22:00RegisterOndom96: http://www.osnews.com
21:22:00BlaXpirit[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:01filwitRegisterOn: what news?
21:22:04filwitnevermind
21:22:16mischanixnim doesn't have classes right?
21:22:16ldleworkBlaXpirit: I missed it
21:22:25renesacthe mentioned type?
21:22:32BlaXpiritwell the imported type
21:22:36dom96cool!
21:22:39loz1dom96: hey, above the apple news :D
21:22:46dom96Does that finally make us notable in the eyes of Wikipedia?
21:22:46ldleworkBlaXpirit: a sigil or something?
21:22:52BlaXpiritfrom module import Point and whatnot, so `+`(Point,Point) would be pulled because it's first argument
21:22:52ldleworkdom96: lol
21:22:53filwitmischanix: not exactly, no.. depending how what you mean by a "class"
21:22:54QWERTYPASSWORDclass?
21:22:55RegisterOndom96: it should help :)
21:22:57mischanixthen why compare it to languages that do?
21:23:03RegisterOndom96: well done by the way
21:23:03QWERTYPASSWORDwhat is a class
21:23:15ldleworkBlaXpirit: ah so you have to atleast import the type explicit
21:23:16dom96RegisterOn: thank you :)
21:23:17ldleworknot bad...
21:23:35*dom96 has no idea how big OSNews is.
21:23:44QWERTYPASSWORDyou woul still have no clue where your function came from
21:23:52gokrOh, OSNews is actually an Inc.
21:23:52QWERTYPASSWORDso it doesnt fix your complaint
21:23:56ldleworkBlaXpirit: but its bad because someone will ask "Why didn't I get `+`(Point,Point) when I 'import module' ?
21:24:08BlaXpiritwait what
21:24:10RegisterOndom96: OSNews has been around and has tons of readers
21:24:22ldleworkBlaXpirit: not bad from my perspective, just that it conflicts with the default 'import module'
21:24:23gokrRegisterOn: Yeah, me included ;)
21:24:28BlaXpirithow so
21:24:40RegisterOnit 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:43ldleworkBlaXpirit: hm
21:24:43RegisterOnso this was refreshing
21:24:48BlaXpiritnobody in their right mind would use `import module`
21:24:55renesacdom96: that seems like the slashdot article, I don't think it will have much more weight than that
21:24:56ldleworkBlaXpirit: okay fair enough
21:25:02ldleworkWait
21:25:05ldleworkWhat if there was a
21:25:09ldleworkfrom global import module
21:25:11ldleworkor something
21:25:20ldlework(global is a terrible keyword, I know)
21:25:22renesacit is not written by their editorial staff, and does not cover the language in depth
21:25:27dom96renesac: Yeah. It quotes what I wrote directly.
21:25:33gokrrenesac: Quite true.
21:25:41ldleworkOr an alternative import keyword
21:25:47dom96Still. My project is on the front page of OSNews woooh
21:25:48ldlework"givemejust module"
21:25:51RegisterOnwho will present Nim at OSCON?
21:25:58BlaXpiritif 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:59def-RegisterOn: Araq will
21:26:08BlaXpiritok i'm done
21:26:09RegisterOncool, i plan to attend
21:26:14ldleworkBlaXpirit: ah
21:26:34filwitBlaXpirit: 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:44gokrdom96: Yeah! Get on there and write some nice comments
21:26:48BlaXpiritfilwit, no, it's only the beginners that do it
21:27:05dom96gokr: will do!
21:27:10BlaXpiritand people who also program in PHP in addition to C++
21:27:26flaviuBlaXpirit: The way that D does it?
21:27:32BlaXpiriti dont know
21:27:56QWERTYPASSWORDimo the import is fine as is
21:27:56filwitdude, i have seen too many C# project to know 'using namespace' is used everywhere in production
21:28:00BlaXpiritlol impossible to google info on D
21:28:17QWERTYPASSWORDyou can already do 'from x import y'
21:28:26BlaXpiritbut it's useless
21:28:37BlaXpiritgoddammit i need to have prerecorded replies
21:28:48QWERTYPASSWORDit does something
21:28:52QWERTYPASSWORDso its not useless
21:28:53filwitnevermind, lets just drop it now
21:28:54Belukifilwit: 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:08BlaXpiritthat too..
21:29:13gokrBlaXpirit: So... the uselessness of that is because you can't import a whole "class", right?
21:29:14Beluki(other than static functions ofc)
21:29:17filwitthat doesn't make sense, BlaXpirit
21:29:20gokrBlaXpirit: Just trying to understand.
21:29:25BlaXpiritgokr, pretty much
21:29:29filwitclass come with functions, and if you get them all, ti's the same
21:29:32BlaXpiritlike i keep saying,
21:29:45BlaXpiritI want to be able to access related procs if i import a type
21:30:05QWERTYPASSWORD... what if you define a function on that type in another function
21:30:08QWERTYPASSWORDmodule*
21:30:21Araqif 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:33mischanixhey you could just return a table of function pointers from a single exported function in your package named after the package
21:30:38BlaXpiritAraq, sure you do. type(foo)
21:30:38mischanixthat'd fix your problem right
21:31:19Jehan_BlaXpirit: Umm, that doesn't work in an editor?
21:31:41BlaXpiritright..
21:32:02QWERTYPASSWORDfunction 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:03ldleworkAraq: 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:13ldleworkYes, python has certain implicit limitations - that nim does not.
21:32:26gokrI am thinking of writing a blog article about "long standing reoccurring design battles in the Nim community" :)
21:32:46ldleworkgokr: Just wait until 1.0 and all these discussions cease.
21:32:53QWERTYPASSWORDits either you import every symbol 1 by 1 or you import everything, there is no middle ground imo
21:33:03loz1gokr: it would be nice to read something like this :)
21:33:43AraqQWERTYPASSWORD: and yet Nim even provides some middle ground: import foo except bar.
21:33:46mischanixi 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:54QWERTYPASSWORDyes araq thats what im saying
21:33:59QWERTYPASSWORD1 symbol at a time
21:34:02gokrI know a few of these: constructors, indexing and slices, and this one (feel free to tell me about more)
21:34:07QWERTYPASSWORDo
21:34:07QWERTYPASSWORDyes
21:34:08filwitBlaXpirit: 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:09filwita waist of time.
21:34:09QWERTYPASSWORDlol
21:34:22filwitwouldn't** be a....
21:35:07gokr"a waist of time"... trying to visualize a really slender goddess of Time...
21:35:14ldleworkfilwit: 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:27ldleworkhow will that ever work as an argument that aims to satisfy?
21:35:41ldleworkwe know what Nim has already.
21:35:49filwitno i said "I'm not saying it wouldn't be a useful feature"
21:35:54QWERTYPASSWORDso the only argument for a new import system is 'durr i dont know where this come from' right?
21:35:57ldleworkI know followed by "but nim already provides"
21:36:02filwitthen i made the argument "it wouldn't save a bunch of time"
21:36:15ldleworkQWERTYPASSWORD: and "durr I'd like to import a type and be able to use it"
21:36:21ldleworkits _so_ durr of us.
21:36:46QWERTYPASSWORDit cant work
21:36:56filwitthen 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:14ldleworkfilwit: see: everything BlaXpirit has said about IDE's to-date.
21:37:30QWERTYPASSWORDwhat 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:33Jehan_filwit: Plenty of developers prefer to work without IDEs.
21:37:46Jehan_Or, in some cases, have to.
21:37:46ldleworkQWERTYPASSWORD: that's an entirely unrelated problem
21:37:52QWERTYPASSWORDhow so?
21:37:58ldleworkseriously?
21:38:14ldleworkQWERTYPASSWORD: name one other language that does what you just said
21:38:15QWERTYPASSWORDyou would have to repeat the import type per module
21:38:41QWERTYPASSWORDpython works per function
21:38:45QWERTYPASSWORDor class
21:38:47filwitJehan_: 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:05QWERTYPASSWORDdoesnt magically import function on that type,
21:39:07ldleworkQWERTYPASSWORD: in python if I import Foo from bar I don't magically get stuff in utils
21:39:11Jehan_filwit: I'm not actually suggesting changing much, if anything, about import.
21:39:18ldleworkQWERTYPASSWORD: right, no one is asking for that, or has any language even attempted it
21:39:21ldleworkits a non-sequitur
21:39:27Jehan_I'm just saying that "people will have IDEs" does not work as an argument.
21:39:30ldleworkyou're taking our desire to the illogical extreme that no one is interested in
21:39:33QWERTYPASSWORDidlework
21:39:37QWERTYPASSWORDyou can already do what you ask for
21:39:40QWERTYPASSWORDfrom x import y
21:39:47QWERTYPASSWORD...
21:39:49Xeldlework: I can name one language that matches it
21:39:52ldleworkThat doesn't import the functions for y that exist in x
21:39:52XeGo technically
21:40:01QWERTYPASSWORD...
21:40:02ldleworkXe: only in terms of interfaces
21:40:07QWERTYPASSWORDthats what im saying
21:40:12QWERTYPASSWORDpython doesnt either
21:40:17ldleworkQWERTYPASSWORD: yes it does
21:40:18QWERTYPASSWORDit export the CLASS
21:40:28QWERTYPASSWORDif u declare a normal function working on a type
21:40:30ldleworkRight, which Nim has decided to divorce into state and procs
21:40:31QWERTYPASSWORDit doesnt import it
21:40:32ldleworkwe *get it*
21:40:35ldleworkwe *know how nim works*
21:40:42ldleworkwe're making a *UI argument*
21:40:46QWERTYPASSWORDthats why nim cant do it
21:40:46ldleworkplease.
21:41:06ldleworkQWERTYPASSWORD: nothing about its current implementation would prevent it from importing the functions that work upon that type
21:41:08ldleworknothing
21:41:22ldleworkthere isn't some core design to the implementation where this feature is just logically imposible
21:41:26ldleworkplease.
21:41:36filwitanyways, gotta do other things now
21:41:40ldlework"it doesn't work that way right now" is exactly the conversation
21:41:41QWERTYPASSWORDwhat im saying is
21:41:51ldlework"it doesn't work that way" isn't a justification for it not working that way.
21:41:51QWERTYPASSWORDif you break your functions on that type between modules
21:41:58ldleworkyes and just like in Python
21:42:03ldleworkno one is asking for it to work across modules
21:42:05ldleworkno one
21:42:09ldleworkits a nonsequitur
21:42:14QWERTYPASSWORDyou would then neeed to do: from y import x, from z import x from aaa import x
21:42:23ldleworkyes just like in every other language
21:42:30ldleworkwe would have achieved the state of the art
21:42:31*ingsoc1 quit (Quit: Leaving.)
21:42:38ldleworkwithout going beyond it to illogical extremes that no one cares about
21:42:41ldlework\o/
21:42:44QWERTYPASSWORDthats retarded imo
21:42:49QWERTYPASSWORDseparate your modules better
21:42:52ldleworkyay now I'm retarded
21:42:56QWERTYPASSWORDnot you
21:43:04QWERTYPASSWORDwhat your asking is retarded
21:43:12ldleworkhuge distinction, thanks
21:43:28ldleworkSorry languages that already work the way we just covered
21:43:32ldleworkYou're also retarded!
21:43:38BlaXpiritdude
21:43:51renesacldlework: BlaXpirit make a feature request to improve the from module import blah
21:43:52gokrehm. Stop.
21:43:53QWERTYPASSWORDC works like nim
21:43:58renesacon the bugtracker
21:44:05BlaXpiritrenesac, honestly pretty soon i'm just gonna stop caring
21:44:14BlaXpiritat least i wish i could
21:44:18ldleworkrenesac: its been proven that the decision has been made politically.
21:44:32fowlPolitically?
21:44:38k1ihow does UFCS work with a fully-qualified import
21:44:38QWERTYPASSWORDwhat decision?
21:44:41*jsseb left #nim (#nim)
21:44:42ldleworkSure, those who will ever have any say are settled on the issue.
21:44:55fowlThis discussion sucks
21:44:59QWERTYPASSWORDyes it does
21:45:02QWERTYPASSWORDmodules are fine thx
21:45:04renesacI think an improvement that don't breaks the current "import module" behaviour will be welcomed
21:45:06dom96Guys. Stop using offensive language i.e. "retarded".
21:45:10ldleworkdom96: thanks
21:45:21Xehow do I load nim code at runtime?
21:45:23ldleworkk1i: why does where a name comes from have anything to do with how it is involved in UFCS
21:45:34k1ildlework: specifically the 'method call syntax'
21:45:41k1iwas just curious how it looked
21:45:44flaviuXe: There isn't a simple solution there.
21:45:50renesacXe: you will need the compiler as a dependency
21:45:53ldleworkyeah. how does "the mechanism responsible for bringing a name into a module" affect UFCS?
21:45:54renesacyeah
21:45:55fowlk1i: well, it can't, fully qualified means the module is in the receiver position
21:46:01k1ifoo.(myPackage.Bar)?
21:46:12renesacXe: search the nim logs for the last days, there has been discussions about this
21:46:19k1ifowl: that's what i thought.
21:46:24XeI will
21:46:30gokrXe: I presume you mean "compile" when you say load?
21:46:41gokrOtherwise dlls etc work fine
21:47:16XeI 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:54QWERTYPASSWORDXe: use the nim compiler to compile a shared library at runtime lol
21:48:06fowlk1i: 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:08ldleworkBlaXpirit: Maybe we should write an article and post it to HN and see what the larger audience thinks?
21:48:13XeI'm not sure how to use the nim compiler to compile a shared library
21:48:20*OnO joined #nim
21:48:31BlaXpiritldlework, i say i don't have time
21:48:33renesacldlework: why not write a bug report or at least a forum post first?
21:48:35BlaXpiritaaand waste hours arguing here
21:48:36Xemuch less load and run it
21:48:48QWERTYPASSWORDim not exactly sure either but the compiler has a --lib or something
21:49:03renesacwell articulated and that clearly shows the problem points and your proposals
21:49:12k1ifowl: 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:15ldleworkrenesac: if the wider community agrees, then perhaps that's the right thing to do
21:49:46renesacldlework: the problem is if the wider comunity haven't even tried to write in nim
21:49:53fowlk1i: why is that an issue
21:49:59renesacand will argue out of ignorance and familiarity with other languages
21:50:01gokrXe: Its quite easy to make a dll, so ... try http://nim-lang.org/docs/nimc.html
21:50:02QWERTYPASSWORDim pretty sure if someone implement something backward compatible it wouldnt be a problem.
21:50:11k1ifowl: fully-qualified imports, the function exists in different modules
21:50:21ldleworkrenesac: I don't think anything about writing Nim specifically is a blocker to understanding namespaces.
21:50:39renesacldlework: nim UFCS, operators, and the unique nim import system
21:50:47QWERTYPASSWORDexactly
21:50:50ldleworkI don't see how UFCS is involved at all
21:50:56BlaXpiritnext 2 days i'm seriously not gonna have time, especially because i wasted this day :D
21:50:58renesacpeople need to understand that before they can cast a vote
21:51:03renesac"vote"
21:51:16ldleworkAnd the import system is exactly what would be explained in detail
21:51:28ldleworkOperators seem like a thing you could mention and it would break the minds of hn readers.
21:51:29fowlk1i: I don't get what you're saying, if you want to qualify them you can't use UFC
21:51:35renesacldlework: only reading about something isn't the same thing as experiencing it
21:51:37ldleworkwouldn't*
21:51:47renesacplease make a forum post or a bug report first
21:52:02ldleworkrenesac: there have been forum posts and plenty of feedback from the core community already
21:52:02renesacI think it is more organized than discussing that on irc
21:52:08Araqwell 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:19k1ifowl: 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:22renesac^
21:52:23Araqor perhaps C#.
21:52:28ldleworkCompared to "Find araq on a day he's feeling amicable" style of language design
21:52:46ldlework"And those who already agree with him are not paying attention at the moment"
21:52:46BlaXpirit:D
21:52:49BlaXpiritso true
21:53:10renesacAraq: what you feel about the ability of "from module import type" import all procs for that type?
21:53:15fowlConsidering that he will implementing it what can you do other than ask nicely
21:53:23renesacor some way to say "from module import all the operators"
21:53:23renesac?
21:53:37ldleworkfowl: I'm just observing the characteristics that in addition to the one you mention.
21:53:38BlaXpiritit's not just operators ......
21:53:41Xegokr: I would first make a shared object of the nim runtime and then link things against that?
21:54:00Araqldlework: what's the alternative? letting people decide who won't program in Nim anyway?
21:54:07QWERTYPASSWORDdemocracy isnt a good thing for technical things, its a meritocracy for a reason
21:54:08renesacBlaXpirit: that is why I want what you guys want written clearly in some place
21:54:09*BlaXpirit quit (Quit: Quit Konversation)
21:54:22flaviuvoting on this is ridiculous.
21:54:26ldleworkAraq: implement my will?
21:54:28ldlework:)
21:55:08flaviuXe: What are you *really* trying to do? Compiling code at runtime will be very difficult.
21:55:13RegisterOnAraq: extremely impressed by Nim so far. Huge kudos.
21:55:20*solidsnack joined #nim
21:55:21QWERTYPASSWORDx2
21:55:33gokrXe: 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:33Araqrenesac: I wouldn't mind "import type Foo" or something like that too much, but we already have lots of "import" related features
21:56:23renesachum, indeed
21:56:25Araqldlework: actually I thought about making import macro-able
21:56:36Araqso you can write a macro that does the import filterings
21:56:56Araqand yes, we can have a "good" one in system.nim that everybody loves
21:56:58Xeflaviu: dynamic loading of program code at runtime so things can be reloaded without restarting the binary
21:57:00renesacstill, 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:25gokrXe: There are some experiments on this being made... wasn't there someone on the forum?
21:57:31fowlXe: there is a project for this, called plugins iirc
21:57:34*solidsnack quit (Client Quit)
21:57:34fowlIts on babel
21:57:38gokrXe: We are also going to go that route eventually
21:57:49renesacfowl: do you mean nimble?
21:57:54fowlYes :p
21:58:04Xegokr: ah I see
21:58:07fowlI still say Nimrod
21:58:57renesacI started liking "nim" better than nimrod latelly
21:59:29ldleworkAraq: 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:29renesacprobably it ws Arrrrr fault
21:59:31ldleworkhave solved certaion PL design problems that have been solved in quality-of-life sustaining or even enhancing way.
21:59:37renesac*was
21:59:47filwitAraq: 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:48Xegokr, 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:57filwitpetitioning**
22:00:12gokrXe: Should be doable, Araq can fill in more
22:00:37ldleworkWhatever 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:51fowlXe: 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:26flaviuHas anyone had actual concrete problems with imports?
22:01:28ldleworkheh wow I butchered the grammar there, sorry.
22:01:28Xefowl: i can't find it in nimble, can you link me to the github repo?
22:01:36ldleworkflaviu: yes, emotional frustration
22:01:44flaviuldlework: Doesn't coult ;)
22:01:46flaviu*count
22:01:56ldleworkwhere 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:05ldleworkThat violates my basic presmise for why Nim should succeed.
22:02:06QWERTYPASSWORDwhat crap?
22:02:14QWERTYPASSWORDgrepping?
22:02:20ldleworkQWERTYPASSWORD: manually import every function related to my type, grep my source, and so on.
22:02:27QWERTYPASSWORDimport module
22:02:29QWERTYPASSWORDits fixed
22:02:35ldleworkQWERTYPASSWORD: I understand that you don't agree.
22:02:36QWERTYPASSWORDno need to import 1 by 1 import everything
22:02:38ldleworkWe have two choices
22:02:40renesaclet's not start it again...
22:02:47ldleworkJust repeat your thesis with more and more abrasion and shortness
22:02:56ldleworkOr just move on and understand that we're not debating directly anymore.
22:02:56*loz1 quit (Ping timeout: 272 seconds)
22:03:02filwitwhy would you not just 'import M expect A, B, C'? this is obviously better for avoiding conflicts with now Nim works
22:03:04QWERTYPASSWORDlearn to separate your modules better if its a problem
22:03:11filwithow*
22:03:32ldleworkNone 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:35filwitrenesac: yeah sorry.. lol.. i'm trying to work on other things too.. i need to close this IRC window
22:03:37ldleworkI don't want your cookies, please.
22:03:46renesacfilwit: you can't "except" future functions you don't know
22:03:58renesacand it don't helps with knowing from where something came W/O an ide
22:04:06renesacby the way, before you go, are you still using kate?
22:04:13renesacany plans for nimsuggest support?
22:04:20filwitrenesac: the compiler will give you ambiguity errors when they're added
22:04:31*gsingh93 quit (Ping timeout: 256 seconds)
22:04:42fowlXe: looking for it too
22:04:44renesacfilwit: exactly, adding any new function on the stdlib is a breaking change
22:04:58renesacor any library you are working with
22:05:01*bluenote quit (Ping timeout: 246 seconds)
22:05:03renesac*a potential breaking change
22:05:08filwitso 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:12renesacI don't care about this much
22:05:19renesacby the way
22:05:46Xefowl: I assume the process is going to be something like
22:05:46renesacbut it is the opposite of the procvar thing
22:05:52Xe1. open so for the binary
22:05:55*solidsnack quit (Client Quit)
22:06:02Xe2. run its "main" procedure
22:06:14Xeand have the main detect if it need to reload its state, etc
22:06:31filwiti see, that's a valid point though
22:07:08renesacby the way, before you go, are you still using kate?
22:07:28Araqrenesac: yep, indeed very valid. however, chances are small that this bites you thanks to overloading disambiguation
22:07:36renesacyes
22:07:45Xefowl: basically I'm looking to rewrite an ircd in nim
22:07:47mischanixXe: 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:19Araqrenesac: 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:33mischanixXe: 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:39gokrXe: In tests/dll there is some... not sure how to run it though
22:08:40Xehmm
22:08:50XeI'll do some research
22:09:11renesacwell, 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:40renesacbut I'm not that much into the full qualified function calls
22:09:43mischanixXe: 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:00fowlXe: got it https://github.com/transfuturist/outlet
22:10:02renesacthough it is nicer for the reader w/o an IDE as I said
22:10:02def-Xe: sounds like a cool idea. Maybe this helps: http://rosettacode.org/wiki/Call_a_function_in_a_shared_library#Nim
22:10:21Xemischanix: 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:42Xeso all you have to worry about is the json being able to be parsed
22:10:52mischanixXe: yeah, something like that works
22:11:07Xehow would i parse json?
22:11:09gokrXe: marshal module uses JSON btw
22:11:15Xeah
22:11:18Xemarshal module
22:11:20def-Xe: with the json module: http://nim-lang.org/docs/json.html
22:11:34gokror marshal :)
22:11:45def-the marshal module may be problematic if your objects change and you want to refill them with the data
22:12:06Xewhat about dumping a json object to a data structure?
22:12:49fowlIt'll work fine until the type changes
22:13:11Xedef-: let's argue that for now there's no reason for the type to change
22:13:25mischanixi 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:42mischanixso i don't think there should be many hard problems implementing that
22:14:05Xesomething like that
22:14:15Xeexcept I was thinking about using the filesystem as a buffer for that
22:14:56mischanixyeah, where the string data goes is a minor detail
22:15:34QWERTYPASSWORDrenesac: 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:56QWERTYPASSWORDif it were to break before
22:16:02renesacQWERTYPASSWORD: yes, but that would be even more rare
22:16:18QWERTYPASSWORDi guess
22:16:34renesacthe most likely chance for conflicts is when working with the default types
22:16:49renesaclike string, int, etc
22:17:22Xemischanix: 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:27gokrXe: Why do you have to be able to dynamically reload the actual socket stuff?
22:21:09Xegokr: I basically want to be able to restart things and get the same state as I began with
22:22:41gokrXe: Sure, but I mean... it would be simpler to be a bit selective.
22:23:46XeI'm probably thinking too deep into it
22:28:22*antranigv1 joined #nim
22:29:11QWERTYPASSWORDwhats the status on typeclasses?
22:29:25QWERTYPASSWORDwill 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:02gokrAFAIK they are called concepts now
22:30:15QWERTYPASSWORDyeh i tried them a bit like 2 weeks ago
22:30:30QWERTYPASSWORDbut i had a couple of bugs
22:30:50QWERTYPASSWORDand didnt really know how they were suposed to be used exactly
22:32:27EXetoCpossibly after 1.0
22:34:24*vendethiel quit (Ping timeout: 256 seconds)
22:34:26QWERTYPASSWORDok
22:34:54QWERTYPASSWORDthey would help a lot with game programming imo
22:35:13*clone1018 joined #nim
22:36:43*vendethiel joined #nim
22:36:44QWERTYPASSWORDused 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:03fowlQWERTYPASSWORD, heres some example https://bitbucket.org/fowlsoft/interfaces/wiki/Home
22:40:37QWERTYPASSWORDfowl: thx
22:45:02*Siecje joined #nim
22:50:09gokrSo... 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:57Araqdunno about "easy" but it's not certainly not hard
22:51:09Araqit requires some .pragma trickery to get going
22:51:10*banister joined #nim
22:52:03gokrI 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:48SiecjeDoes nim have methods?
23:07:33gokrhttp://nim-lang.org/docs/manual.html#multi-methods
23:07:58gokrYou 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:31filwitgokr, did you see fowl's 'super' implementation using the new getType()?
23:09:42*OnwardEuler joined #nim
23:09:59gokrfilwit: 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:31Araqgokr: 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:59gokrAnd the principle at work is... because its a wrapper or?
23:14:06*yglukhov joined #nim
23:14:29Araqbecause there is no dispatcher involved that requires updating
23:14:44*Matthias247 quit (Quit: Matthias247)
23:15:00Araqit's ultimately just a bunch of function pointers they are exchanged
23:15:05Araq*that are
23:16:17gokrI read the stuff fowl wrote - but I am not sure I followed it all.
23:17:27*Jesin quit (Quit: Leaving)
23:17:38Araqyou 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:19gokrIt 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:33fowlOnce 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:37fowlOr a dll
23:37:42filwitgokr, Araq: wait interfaces stuff? I was talking about his simple 'super' example: https://gist.github.com/fowlmouth/dbb43f560cdc67cc3601
23:44:37QWERTYPASSWORDfilwit: probably https://bitbucket.org/fowlsoft/interfaces/wiki/Home i think
23:45:05filwitthanks
23:52:58*vendethiel quit (Ping timeout: 264 seconds)