<< 06-03-2015 >>

00:00:32dom96once suggest works i'll finally release a new version
00:00:49dom96so that you don't need to explicitly install head all the time
00:04:50Jehan_Nimble/Nim QoL issue: The Hint: added path spam does get annoying once you've got a number of nimble packages installed. I'm not sure if I've got a good solution for it (I don't want to turn off the hint entirely, either).
00:06:08Jehan_Also not crazy about how the top level module namespace starts to get polluted.
00:08:07reactormonkJehan_, got an idea how to fix that part?
00:09:03Jehan_reactormonk: What I'd really like is to specify not only a module but a library for the import. And default to local modules > stdlib, too.
00:09:11*fizzbooze quit (Ping timeout: 246 seconds)
00:10:43Jehan_E.g. import numerics:num
00:11:02Jehan_Would still allow me to use a local "num" module.
00:11:28Jehan_Without them fighting over which is which.
00:12:03Jehan_I'd also like to, say, have a local "net" module without that conflicting with stdlib:net
00:13:09Jehan_Right now I'm working around that by putting modules into a directory of their own (which works until the stdlib or a nimble package gets a directory that's named identically).
00:14:43Jehan_Module lookup in general is my single serious issue that I'm still having with Nim.
00:16:47mpthrappAlright, one more silly question. :P What's the best practice for folder structure within my workspace? Eg, /NimWorkspace/hello_world/src? Or right in /NimWorkspace/hello_world
00:17:55dom96Jehan_: Perhaps we need to enforce that modules in a nimble package must be put in a directory which name corresponds to the package's.
00:18:04dom96*whose
00:18:41Jehan_dom96: Still doesn't really fix the bigger issue.
00:19:14*BitPuffin joined #nim
00:19:34dom96Jehan_: It doesn't?
00:19:51dom96You will import the package's modules via import packageName/module
00:20:15Jehan_dom96: It avoids it (sort of) for Nimble packages, but not for, say, the stdlib.
00:20:32Jehan_Or anything that's not installed via Nimble.
00:20:38dom96Although conflicts could arise if you have a directory in your source code which matches a package's name.
00:21:43dom96I think you have a point.
00:21:56Jehan_For example, let's say I have a module foo.nim right now; at one point, the stdlib is reorganized so that a foo.nim submodule is created, at which point either my code or the stdlib breaks.
00:22:00dom96A simple introduction of a module into the stdlib could cause code breakage.
00:22:06Jehan_Yeah.
00:23:53flaviuplace the stdlib in a "stdlib" directory?
00:23:54Jehan_For starters, I think that local modules should get priority. I.e. an "import net" in my own program should prioritize my module over that of the stdlib, an "import net" in the stdlib should prioritize the stdlib's net module.
00:23:59flaviustdlib.foo
00:24:05dom96Do you have any ideas how we can fix this without breaking everybody's code?
00:24:48Jehan_dom96: As I said, I'd use smart priorities and allow users to specify where to get a module from via import syntax.
00:25:24Jehan_If you have a local module called foo in your program or nimble module, you will practically never want one from elsewhere.
00:25:32Araqthe compiler already does that to some extend
00:25:51dom96Jehan_: So you suggest we introduce new syntax to make the lookup explicit?
00:25:53Jehan_And if you do, having an import syntax to specify that resolves the problem.
00:26:17OderWat_@Araq I know have a docs related error with stacktrace from nim without -d:release .. https://gist.github.com/oderwat/9d9f1ff286036a4f03b8
00:26:26dom96I like the idea, but does Araq?
00:26:32Jehan_dom96: I'm not fixated on one approach. I'm happy with anything that works.
00:27:00Araqdom96: the compiler already does work this way in my dream
00:27:00Jehan_But a syntax like "import library:module" would be one way to do it (combined with smart prioritization).
00:28:20dom96Araq: So you want this syntax in the language?
00:28:24dom96Araq: Can I implement it?
00:28:49Araqdom96: no, we have lots of logic that deals with the search path order
00:29:03Araqmaybe it doesn't work yet
00:29:18Jehan_Well, there'd still be the problem of how you'd map the library name to a path.
00:29:33dom96we can use nimble files
00:29:44Jehan_True.
00:29:45Araqwe already look at nimble files
00:29:45dom96they are already used for .c file prefixes.
00:30:17*l04m33 joined #nim
00:30:26AraqOderWat_: how does this command differ from the command that works?
00:32:04*a5i joined #nim
00:33:13*l04m33_ quit (Ping timeout: 252 seconds)
00:33:24Jehan_Hmm, I keep getting double posts on the forum.
00:33:51Jehan_No big deal since I can delete them, but odd.
00:34:07Jehan_Is it something I'm doing wrong or are other people having the problem, too?
00:34:22AraqI never ever had this problem
00:34:54Jehan_I've only had it starting today.
00:34:59OderWat_hum... thats hard to see. the first (which works) was created just with koch boot without the -d:release from a compiler which made with an -d:release one. the second nim is compiled without -d:release but with the compiler which has no -d:release :) ... I am not totally sure what happens here :)
00:35:15a5iWhats with this heat between u peeps and Rust
00:36:12Jehan_a5i: Just some people who are a bit excitable, I think.
00:36:33flaviua5i: Some people are more vocal than others, but I think it's clear that they aren't really representative of the entire community. http://forum.nim-lang.org/t/970
00:37:28flaviuI personally feel that rust is great, and that nim is great too!
00:37:45a5iSame ! ^
00:37:57a5iYeah runvnc is a Dick
00:38:03Jehan_Not sure about others, but I generally think that competition is good and monocultures are a problem. Different languages allow for different ideas to develop, and the good ones tend to find broad adoption later.
00:38:10a5iHis name is Jason Livesay in Quora
00:38:42a5iI kinda think Rust and nim isnt really an apples to apples thing is most cases
00:39:07flaviuLet's not bash people, even if you feel they deserve it.
00:39:33a5iSorry but that guy makes me cringe
00:39:44Jehan_a5i: Yeah, they really target different niches (despite some overlap).
00:40:18a5iI hope to learn Nim after I learn some foundation languages
00:40:34*epichero joined #nim
00:40:49OderWat_@Araq I still have both versions of the compiler.. one which does not work and one which works. both show the same switches (both without -d:release)
00:41:18a5iwell and after Rust 1.0, I know bit too much of Rust to not learn it after foundation languages
00:42:39*epichero quit (Read error: Connection reset by peer)
00:43:08*epichero joined #nim
00:46:36AraqOderWat_: well in theory you could diff the C source code and see why one version is buggy
00:48:03*Jehan_ quit (Quit: Leaving)
00:51:21OderWat_@Araq: Its funny. With the current compiler I can "nim c -d:release compiler/nim.nim" and then "compiler/nim doc2 lib/system.nim" works
00:52:56OderWat_@Araq even ./koch boot -d:release now made a version of the compiler which works...
00:54:04OderWat_@Araq I guess that something is not doing what I think it does. I try to bring you something reproduceable tomorrow. I am to tired right now.
00:54:31Araqsure no problem. same here. good night
00:56:24randomwalkI'm trying to compile my own fork of Nim (so I can do pull requests); and using my own install of MinGW I get an error from as.exe saying it can't find the __printf__ entry point.... :(
00:56:46randomwalkIs there something special about the gcc in dist?
00:57:13*elbow_jason quit (Ping timeout: 256 seconds)
00:59:09*epichero quit ()
00:59:25*epichero joined #nim
01:04:42randomwalk:( I'll just learn how to build the repo later...ttyl
01:04:42*ruzu quit (Read error: Connection reset by peer)
01:05:21*ruzu joined #nim
01:06:04*kniteli quit (Ping timeout: 245 seconds)
01:07:43*flaviu quit (Read error: Connection reset by peer)
01:07:55*flaviu joined #nim
01:13:53*leonlee joined #nim
01:18:10def-randomwalk: nothing special about the mingw with the distro afaik
01:19:25*johnsoft quit (Ping timeout: 250 seconds)
01:20:14*johnsoft joined #nim
01:21:04randomwalkI will try again.
01:21:13def-i haven't seen that error before
01:21:23def-usually people have problem with 32/64 bit
01:21:27randomwalkI'll just use the mingw from the binary download.
01:25:19*reem quit (Remote host closed the connection)
01:25:30randomwalkbtw start.bat should be named differently since START is a command in windows
01:27:39mpthrappWhat module should I look at to be making POST calls to an API?
01:29:12mpthrappNevermind, figured it out.
01:29:23randomwalkmpthrapp: I use libcurl for GET calls...I haven't tried POSTs yet
01:29:46mpthrapprandomwalk: I'm checking out httpclient at the moment.
01:32:06randomwalkyay, build64.bat works... I just threw away my mingw install and put dist/mingw in my path
01:46:43*reem joined #nim
01:50:01*reem quit (Remote host closed the connection)
01:52:47*reem joined #nim
01:54:10*mpthrapp quit (Quit: Konversation terminated!)
01:55:32*kniteli_ joined #nim
02:01:07*darkf joined #nim
02:18:30*reem quit (Remote host closed the connection)
02:26:11*saml_ joined #nim
02:27:08*reem joined #nim
02:32:45*kniteli_ quit (Ping timeout: 252 seconds)
02:33:10*kniteli_ joined #nim
02:40:57*reem quit (Remote host closed the connection)
02:43:11*johnsoft quit (Ping timeout: 246 seconds)
02:43:31*johnsoft joined #nim
02:49:07*reem joined #nim
02:51:24*reem quit (Remote host closed the connection)
02:53:05*BitPuffin quit (Ping timeout: 244 seconds)
02:53:16*reem joined #nim
02:54:34*chemist69_ joined #nim
02:56:51*reem quit (Remote host closed the connection)
02:57:22*chemist69 quit (Ping timeout: 245 seconds)
03:06:52*reem joined #nim
03:08:56*brson quit (Quit: leaving)
03:17:51*reem quit (Remote host closed the connection)
03:18:57*a5i quit (Quit: Connection closed for inactivity)
03:21:45*reem joined #nim
03:24:54*reem quit (Remote host closed the connection)
03:26:08*reem joined #nim
03:28:25*reem quit (Remote host closed the connection)
03:33:49*Teef joined #nim
03:34:40*silven quit (Read error: Connection reset by peer)
03:35:07*reem joined #nim
03:35:25*silven joined #nim
03:36:42*reem quit (Remote host closed the connection)
03:40:16*reem joined #nim
03:42:45*Demos quit (Read error: Connection reset by peer)
03:43:32*reem quit (Remote host closed the connection)
03:57:40*reem joined #nim
04:04:10*reem quit (Remote host closed the connection)
04:09:46l04m33Anyone here? A question regarding the asyncfile module: http://forum.nim-lang.org/t/984
04:19:50*l04m33 left #nim (#nim)
04:19:53*l04m33 joined #nim
04:20:27*fizzbooze joined #nim
04:21:12*reem joined #nim
04:24:02*reem quit (Remote host closed the connection)
04:37:08*reem joined #nim
04:43:46*reem quit (Remote host closed the connection)
04:45:07*ChrisMAN quit (Ping timeout: 252 seconds)
05:00:53*reem joined #nim
05:03:02*reem quit (Remote host closed the connection)
05:08:55*gmpreussner|lapt joined #nim
05:08:57*gmpreussner|lapt quit (Read error: Connection reset by peer)
05:12:46*banister joined #nim
05:12:52*banister quit (Max SendQ exceeded)
05:19:06*reem joined #nim
05:25:33*darkf_ joined #nim
05:28:37*darkf quit (Ping timeout: 264 seconds)
05:28:42*darkf_ is now known as darkf
05:32:51*randomwalk_ joined #nim
05:33:28*randomwalk_ quit (Client Quit)
05:33:47*randomwalk quit (Quit: Leaving)
05:34:27*reem quit (Remote host closed the connection)
05:35:00*reem joined #nim
05:37:18*reem quit (Remote host closed the connection)
05:39:16*reem joined #nim
05:43:28reactormonkhttp://pastie.org/10004181
05:44:22reactormonkl04m33, wrong TZ, wait a few hours
05:46:18*zahary1 quit (Ping timeout: 246 seconds)
05:47:29*reem quit (Remote host closed the connection)
06:01:41*reem joined #nim
06:02:03*gsingh93 quit (Ping timeout: 246 seconds)
06:05:46*saml_ quit (Remote host closed the connection)
06:06:45*reem quit (Remote host closed the connection)
06:08:15*reem joined #nim
06:13:25*Teef quit (Ping timeout: 246 seconds)
06:16:24*reem quit (Remote host closed the connection)
06:19:11*reem joined #nim
06:20:08*reem quit (Remote host closed the connection)
06:32:09*kniteli_ quit (Ping timeout: 244 seconds)
06:39:45*Varriount|Mobile quit (Quit: AndroIRC - Android IRC Client ( http://www.androirc.com ))
06:42:26*gsingh93 joined #nim
06:43:47*gmpreussner|lapt joined #nim
06:44:30*fizzbooze quit (Quit: WeeChat 1.1.1)
06:45:22*kniteli_ joined #nim
06:47:47*gsingh93 quit (Ping timeout: 245 seconds)
06:49:46*reem joined #nim
06:51:51*reem quit (Remote host closed the connection)
06:53:09*reem joined #nim
06:57:19*reem quit (Remote host closed the connection)
07:06:04*reem joined #nim
07:06:13*gmpreussner|lapt quit (Quit: Leaving)
07:08:16*reem quit (Remote host closed the connection)
07:08:51*reem joined #nim
07:20:02*rkj-b joined #nim
07:21:03*reem quit (Remote host closed the connection)
07:21:46*rkj-b quit (Client Quit)
07:23:13*untitaker quit (Ping timeout: 264 seconds)
07:26:44*BlaXpirit joined #nim
07:27:43*bjz joined #nim
07:30:13*untitaker joined #nim
07:32:26*reem joined #nim
07:36:24*bjz quit (Ping timeout: 265 seconds)
07:38:24*reem quit (Remote host closed the connection)
07:43:10*reem joined #nim
07:46:19*reem quit (Remote host closed the connection)
07:50:45*reem joined #nim
08:00:14*bjz joined #nim
08:06:09*reem quit (Remote host closed the connection)
08:13:17*reem joined #nim
08:15:54*reem quit (Remote host closed the connection)
08:17:17*reem joined #nim
08:19:20*reem quit (Remote host closed the connection)
08:23:40*reem joined #nim
08:34:40*xificurC joined #nim
08:39:01*reem quit (Remote host closed the connection)
08:43:28*reem joined #nim
08:46:37novisti need to generate unique variable name at compile time (macro). is there any way to have some kind of global state during compile time? what i have in mind is using simple counter which is increased by one each time macro is called.
08:46:55novistalso Araq thank you for that fix, now i can mess w/ macros again :)
09:01:33novistactually turns out adding counter to static: block works. /win
09:05:14*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
09:06:18*ruzu quit (Ping timeout: 265 seconds)
09:07:34*tumult joined #nim
09:12:11*zahary joined #nim
09:20:13*davidhq joined #nim
09:25:25BlaXpiritnovist, there is a way to generate a unique name
09:25:47novistif you are speaking of oids module (if name is right) - cant use it at compile time
09:26:26BlaXpiritnovist, http://nim-lang.org/macros.html#genSym,TNimrodSymKind,string
09:27:18novistoh thats cool, thanks!
09:28:03BlaXpiriti have never used this, not sure if it's even the right thing
09:29:16novisthmm yeah noticed its.. odd. it has ident as parameter. so if im giving it identifier name its as good as generating identifier myself
09:29:25novistwell anyway having counter works so it will do
09:31:32novistanyway my latest macro version: http://forum.nim-lang.org/t/703/5#5926
09:35:47*aidanh quit (Ping timeout: 265 seconds)
09:36:39*aidanh joined #nim
09:44:58tumultnovist: I've been following this as you've developed it and I love this idea of uniformly generating calls to initialisation procs. I'm wondering though, why is there a second call to generate a Type2 here: var a = new_ref Type1(1, new_ref Type2(2))
09:47:24tumultah sorry I see, type1 has a less trivial 'constructor' that accepts type2! Clever stuff :)
09:58:23*reem quit (Remote host closed the connection)
10:11:40novisttumult: its just a test verifying that nesting calls works
10:11:56novistim glad at least one person finds it cool :D
10:12:34novisttoo bad Araq is anti-oop hehe. if there was standard way to do this it would be much better than optional macro hack
10:18:04*gokr quit (Ping timeout: 256 seconds)
10:20:53*leonlee quit (Quit: Leaving)
10:24:25*reem joined #nim
10:25:40tumultpersonally I like this idea as it encourages uniformity in the name of construction procs, but I can see it might split people who see it as adding hidden complexity and those who see it as reducing code complexity
10:26:06tumulthas Araq said that he doesn't like the idea?
10:27:15novisthe did not state that explicitly but i got a vibe of disapproval. you can read his posts here: http://forum.nim-lang.org/t/703/3
10:27:52novistthough without something like this im not sure how working with c++ stuff is going to happen. especially complex things like Qt or Urho3D
10:29:24*reem quit (Ping timeout: 256 seconds)
10:29:24tumultfor me, on the one hand I am used to calling obj = MyObj.Create and knowing I can write my own Create to init, on the other hand I like nim's resistance to 'dogma' of OOP (I guess I'm thinking of the UCS and not having an implied super class in methods here)
10:30:22tumultI don't see why it can't be a module that you can include depending on your coding preference though
10:30:45*reem joined #nim
10:31:21novistwith MyObj.Create i bet you have to allocate object yourself and return it?
10:32:08novisti wanted to avoid that kind of redundancy
10:33:35novistall in all that OOP macro seems to do pretty good job. with my macro calling constructor automatically its pretty much solved problem for me personally. but im still not sure how problem would be tackled for big lib wrappers
10:34:03novistnow i saw urhonimo using constructObject() convention. which is odd. then there is var a = cnew getContext().something()
10:34:10novistwhich is even more strange
10:34:21novisteasy to get lost in this maze
10:34:45*reem quit (Remote host closed the connection)
10:40:33tumult"i bet you have to allocate object yourself and return it" For Delphi, the Create call constructs the memory for you so you can just stuff your init code in there, as opposed to nim where you explicitly call new
10:40:50tumulthowever it's a different oop model in Delphi
10:41:33tumultthere's a default create in object base classes that does the allocate when create is called
10:48:18tumultyour macro does make me wonder something I've had trouble with in nim, though. Every bit of code that I've seen that populates a seq with objects uses ref objects, so it will do newobj = newMyObj() then myseq.add(newobj). This is fine but is it possible to do this with objects that are not refs? I've never seen it, and I wonder if your new_obj macro would allow this?
10:49:07tumultI am wondering if everyone uses refs in seq for a reason though and I just haven't understood why it's a bad idea to generate non-ref objects to stuff into seqs
10:49:45tumult(^ where newMyObj() would make a call to new(result) to create the ref)
11:06:30novisttumult: i did not try it myself but i think it would be possible, however adding stack object to seq if it worked it would make a copy of that object
11:06:58novisteveryone uses refs because its efficient, object is allocated on heap and only reference (like pointer) is passed around
11:07:26Araqer ... did you look at my patch?
11:07:38AraqI used seq[tuple[a, b]] just fine
11:09:47*aidanh quit (Ping timeout: 256 seconds)
11:15:16*chemist69_ quit (Quit: WeeChat 1.1.1)
11:15:26*chemist69 joined #nim
11:15:32tumultnovist: I keep forgetting that stack objects would copy. I do use refs anyway because they're easier to work with in the situations I use them. As a delphi developer I've often been bitten by using records instead of classes and not updating what I think it would due to updating the copy!
11:16:36def-tumult: if you want inheritance, you can't put put non-ref objects into their base class types or data gets cut off
11:16:43novisthehe i see. i hate delphi/pascal with passion so i dont know it's ins and outs. should you have c++ background it would be obvious because it works like that in c++
11:20:09Araqtumult: you cannot do anything else with a stack object. the nature of the stack is that things cannot escape from it
11:20:47Araqif they could, it would be a heap ;-)
11:21:03*aidanh joined #nim
11:22:17tumultAraq: I'm a simple man with a simple mind sometimes :) I think I've had trouble separating MyObj = object and instantiating it, and my weird idea that refs are somehow related to Delphi interfaces and the problems I've had with those, when they're not really related
11:23:03tumultI just use refs most of the time now except in rare circumstances
11:23:28Araqhe, that's slow :P
11:24:42tumultinterfaces in Delphi have caused me so many problems tbh, I really dislike them even though I like the idea of templating a collection of methods that something may use
11:27:14tumultactually whilst I'm asking questions on OOP in nim. When you have an object, say MyObj = ref object of RootObj, what happens when you inherit it? If I do: MyNewObj = ref object of MyObj is that a ref of a ref? What about MyNewObj = object of MyObj, is this a stack allocation of a ref object?
11:27:41*aidanh quit (Ping timeout: 244 seconds)
11:29:35tumultI should probably make these questions forum posts...
11:29:56Araqit's not a ref to a ref
11:30:05Araqwhen you do object of SomeRef
11:30:32Araqthat's just an allowed shortcut for 'object of UnderlyingObjectofSomeRef'
11:31:05Araqsince the underlying object can be anonymous
11:31:24Araqwhich is what happens when you do
11:31:32Araqtype SomeRef = ref object
11:33:06*aidanh joined #nim
11:35:00tumultso where SomeObject = ref object, "SomeRef = ref object of SomeObject" is the same as "SomeRef = object of SomeObject", where SomeRef is a ref in both cases? So the inherited 'ref' is redundant in the code here?
11:38:18novisti think he meant "SomeRef = ref object of SomeRefObject" == "SomeRef = ref object of SomeObject"
11:48:57fowlAraq, getType is returning float64 as float
11:49:30Araqfowl: that is correct, float64 is mapped to float since quite some time now
11:52:19fowlint and uint still exist with int8 through int64 though?
11:52:28Araqyes
11:52:36fowlint and uint still exist with int8 through int64 though?
11:52:39fowler
11:53:21Araqbut yeah, we need to look at this design again
11:53:34Araqfloat vs float64 proved hard to work with math.nim
11:53:58Araqbut effectively losing the "default fast float type" is not good either
11:54:24Araqthat said, I'd like to make float32 the default
11:54:52Araqboth Urho and Unreal Engine 4 use float32 for everything anyway
11:55:15Araqand float32 is much better for GPUs
11:56:59tumultdoes anyone know the url of an online nim evaluator?
11:57:08Araqask ekarlso
11:57:13tumultI'm sure I remember seeing one but can't find it now
12:00:35tumultbtw thanks everyone for helping me on my OOP questions :)
12:01:22def-tumult: http://185.56.186.94/
12:02:08tumultdef-, cheers :)
12:02:45tumultthere's also this one http://www.tutorialspoint.com/compile_nimrod_online.php
12:03:12*aidanh quit (Ping timeout: 245 seconds)
12:04:27tumultdef- the one you posted is far better tho
12:04:37def-that's the one by ekarlso
12:05:38*TEttinger quit (Ping timeout: 252 seconds)
12:06:36ekarlsomeh meh :p
12:13:11*gokr joined #nim
12:17:29Araqekarlso: can we get a proper URL for this?
12:17:32dom96ekarlso: Is your version ready to be accessible via play.nim-lang.org?
12:18:02ekarlsotake a look at the code and you decide ;)
12:18:32def-ekarlso: got the timeout issue solved?
12:19:20*aidanh joined #nim
12:19:26dom96ekarlso: Is there any sort of API for it?
12:19:43dom96I could add it to NimBot then :)
12:20:24ekarlsodom96: there is
12:20:25def-ekarlso: and you'll definitely need cpu% and mem% limits too
12:20:36ekarlsodef-: eh, how the crap you do that :p
12:20:38ekarlsowith playpen
12:20:50def-playpen -h
12:20:54def-should tell you all
12:24:51def-ekarlso: and it should be possible to select the backend compiler maybe. tcc is much faster, which is great for this, but if someone tries threading they'll be disappointed. setting compiler options would also be necessary then (--threads:on)
12:25:20def-and you can use highlight.js for syntax highlighting
12:25:59ekarlsodef-: on the roadmap :|
12:26:06ekarlsodef-: you can do that with ace too :)
12:26:20dom96also set indentation to two spaces
12:26:40def-ekarlso: great
12:27:01dom96ekarlso: do you want to run this on your own server?
12:27:25ekarlsodom96: i got more resources then u do I wonder ?^^
12:27:29ekarlsoso i think so :)
12:27:51dom96possibly
12:27:58dom96Araq needs to upgrade the VPS :P
12:28:10ekarlsodom96: heh, I got freebie account on a cloud :p
12:28:21def-you really shouldn't run the playpen thing on the website vps
12:28:47dom96That's true.
12:28:57dom96ekarlso: You can host it then.
12:36:11BlaXpiritekarlso, it went down
12:40:16ekarlsok
12:55:01*BlaXpirit quit (Quit: Quit Konversation)
12:57:54*BlaXpirit joined #nim
13:00:08*aidanh quit (Ping timeout: 256 seconds)
13:00:52*aidanh joined #nim
13:12:45*johnsoft quit (Ping timeout: 252 seconds)
13:12:57*johnsoft joined #nim
13:17:32*BitPuffin joined #nim
13:18:46*johnsoft quit (Ping timeout: 244 seconds)
13:19:11*aidanh quit (Ping timeout: 250 seconds)
13:19:42*johnsoft joined #nim
13:40:10*aidanh joined #nim
13:47:14ekarlsosuggestions def- ? ^
13:49:29def-ekarlso: suggestions for?
13:59:58ekarlsodef-: u had some examples no to import ?
14:00:47def-ekarlso: Many of those: https://github.com/def-/nim-unsorted
14:01:07def-they all print something and show a huge part of the standard library
14:09:43*mpthrapp joined #nim
14:11:21*aleron joined #nim
14:19:28*Trixar_za quit (Quit: ZNC - http://znc.in)
14:22:36aleronAre there any file reading procs that will return right away if there is no data available on the file handle?
14:23:06aleronI'm looking for a way to read from stdin without blocking
14:29:56Araqdunno, I'm sure you can wrap some name without vowels to get this feature on unix
14:32:35aleronI am debaiting exposing poll() to nim
14:33:12aleronalso having a way to set a file handle to non-blocking (fcntl()) would be a way too
14:33:33Araqposix.nim?
14:34:53aleronwoohoo
14:34:55aleronthanks!
14:36:16aleronSo if a proc's signature has a ptr argument, that means when I call the proc I need to do foo(addr myarg) right?
14:36:31def-right
14:37:00aleronty
14:45:39*sampwing joined #nim
14:45:57onionhammeraww ekarlso where'd it go? I wanted to see :(
14:51:53ekarlsoonionhammer: :P
14:52:19*sampwing quit (Ping timeout: 252 seconds)
14:52:25onionhammer:'(
15:01:19*Trustable joined #nim
15:05:21*johnsoft quit (Ping timeout: 250 seconds)
15:06:07*johnsoft joined #nim
15:12:58*mpthrapp quit (Remote host closed the connection)
15:14:49*mpthrapp joined #nim
15:16:07*a5i joined #nim
15:16:58*zahary quit (Read error: Connection reset by peer)
15:30:33*ChrisMAN joined #nim
15:40:13*aleron quit (Quit: leaving)
15:40:18*darkf quit (Quit: Leaving)
15:42:47BlaXpiritonionhammer, it's an ACE editor textbox with a "run" button and an output field
15:54:50*zahary joined #nim
16:00:15*irrequietus joined #nim
16:07:44*irrequietus_ joined #nim
16:07:51*irrequietus quit (Ping timeout: 252 seconds)
16:27:04Araqnovist: we can re-consider the construction problem, but please consider a few more things than just syntax
16:27:56Araq1. does the design allow painless switching to some form of pool allocation
16:28:21Araq2. how does the design deal with the 'not nil' initialization problems
16:32:16Araqand when we talk about syntax why is 'new T' so much better than 'newT'? If you argue about consistency, well the 'new T' syntax cannot prevent a simple construction proc, so the people who ignore the standard way of doing things can continue to do that just fine. So nothing is gained.
16:34:31Araqand again, even in C#/Java construction is not consistent. There can be factories.
16:34:50novisthmm i see, behind-the-scenes constructor obscures object allocation.. well that surely is not good. although if "new" in "new T()" did allocation then it could be customized with custom "new_pool T". im not sure what are 'not nil' problems though
16:35:38AraqT(field: "") # can prove x.field is not nil very easily.
16:36:05*irrequietus_ quit ()
16:36:28AraqinitT("") # harder to prove. well my example sucks
16:37:02Araqbut it's a big problem with init(x: var Obj)
16:37:13Araqsince 'var' doesn't mean 'out'
16:37:40reactormonkinit(x: var Obj not nil) ?
16:37:48Araqso for better 'not nil' support we need 'init(x: var Obj) {.constructor.}'
16:38:00Araqand then the compiler can *check* every field is assigned in 'init'
16:38:13Araqreactormonk: it's about the Obj's fields
16:38:33reactormonkso not nil is transitive?
16:38:41Araqno.
16:38:50novistalthough why every field has to be assigned in ctor? there surely are situations where it can be nil until its needed
16:38:55Araqbut object field: T not nil is possible
16:39:04Araqnot every field
16:39:09Araqbut every field that is not nil
16:40:13novistim not aware of such things. is it set somehow in declaration of field or what? or its based on field type?
16:40:26Araqbased on field type
16:41:11AraqConstruction in a mutable language is *complex*. ;-)
16:41:45novisti do not doubt hehe, but this thing is really nasty itch that needs scratching
16:41:59novistand i believe it would simplify some things for wrapping large c++ libs too
16:42:57AraqI don't think it solves anything for C++ interop.
16:43:03novistregarding constructor pragma - is it really necessary? can it not be implied that if method name is init and it has first param of a certain type its a constructor? after all its being called by compiler as a constructor if it fits the bill
16:43:59Araqyeah but we decided on "magic builtin procs" to use operator syntax
16:44:20Araqsince proc `[]=` already exists and is somewhat special
16:45:10reactormonkAraq, do I also need to realign WarningsToStr / HintsToStr?
16:45:25Araqiirc it would be proc `~init`(x: var T)
16:45:28novistim thinking with pragma it would be somewhat out of tune with destroy() destructor, hence again confusing
16:45:45Araqonionhammer argued we need to do 'destroy' differently
16:46:10novistdifferently how?
16:46:17Araqso ok, no pragma required, that's good
16:46:22reactormonk... nope
16:46:28Araqproc `~destroy`(x: var T)
16:48:52novistwell to me such syntax looks bit awkward but okay ^_^. i mean i get why operators are in backticks - special characters and all. ctor/dtor does not have to be like that
16:49:54Araqbbl
16:50:20novistan someone logs out on pidgin. i must be having Araq in my contacts :))
16:56:02onionhammerit'd be better to not need the backticks
16:56:14onionhammerjust proc ~destroy(self: var T)
16:58:30onionhammernext up owned pointers
16:58:55novisttbh i think its pretty good without ~. i get that it makes it obvious that its dtor if one comes from c++ background but maybe it should not be dragged into nim
16:59:06novistjust like __del__ in python
16:59:24onionhammeri would prefer ~TypeName() to ~destroy
16:59:40onionhammerproc ~MyObj(self: MyObj)
17:00:01novistlike people say in my country it looks like buttery butter
17:00:19emilspnovist, is that sviestains sviests ?
17:00:27novistsviestas sviestuotas :p
17:00:37emilspnovist, lithuanian ?
17:00:47novistare you from Latvia or something? yes i am lithuanian hehe
17:00:54emilspyes, indeed I am
17:01:10novistgood to meet neighbors in this vast internetz world haha
17:02:27ekarlsoplay site running again
17:04:04novistreason i personally would prefer init(or even construct)/destroy that it fits nicer into nim's functional approach, since they then are just ordinary procs that get called by compiler. and later in child object constructor user can call manually parent constructor, just like a simple proc. much like in python
17:04:38*brson joined #nim
17:06:07*gmpreussner|lapt joined #nim
17:08:06*Menche quit (Ping timeout: 246 seconds)
17:32:16*kniteli_ quit (Quit: Leaving)
17:32:29*kniteli joined #nim
17:41:34ekarlsowho managed to crash it again ? :p
17:41:58dom96ekarlso: You should set it up so that it restarts automatically :P
17:42:39ekarlsodom96: ...
17:42:42ekarlsotoo much todo atm :|
17:51:19*tumult quit (Ping timeout: 246 seconds)
17:54:33*Tennis quit (Quit: Leaving)
17:54:41*federico3 joined #nim
17:59:01*pregressive joined #nim
18:09:51ekarlsodoes http://185.56.186.94/#/
18:09:54ekarlsolook better ?
18:25:01*johnsoft quit (Ping timeout: 264 seconds)
18:28:00ekarlsodef-: dom96 ? :p
18:28:28*gmpreussner|lapt quit (Ping timeout: 255 seconds)
18:30:43Araqekarlso: did I break it?
18:33:45reactormonkAraq, any tests on import statements besides in modules/ ?
18:34:59Araqreactormonk: there is also 1 important test in manyloc/ iirc
18:35:34reactormonkwhat does manyloc stand for?
18:35:56Araq"many lines of code"
18:36:41reactormonkhttp://pastie.org/10004181 <- when running ./koch tests
18:36:43Araqaye manyloc/packages is the test
18:37:10Araqyeah I need to disable Nimble package testing
18:37:19Araqbut you can do it too
18:39:47*johnsoft joined #nim
18:43:19*kniteli quit (Ping timeout: 250 seconds)
18:43:53*tumult joined #nim
18:45:02reactormonkFound the bug, but the tests still fail in nimble
18:48:52Araqreactormonk: if you could get that to work, that would really be sweet
18:49:02reactormonkAraq, the nimble tests?
18:49:03ekarlsohaha, apparantly u did Araq ...
18:49:06ekarlsosilly while loop :p
18:49:13Araqekarlso: :P
18:49:19Araqreactormonk: yes
18:50:15reactormonkOh, I found the bug.
18:50:40reactormonkTask: chop off a newline (And a bit more). Solution: str[0.. -3]. Find the bug.
18:51:16ekarlsowonder how to avoid that Araq
18:51:17ekarlso:p
18:52:04Araqekarlso: use linux sandboxing
18:52:41Araqor simply have a watcher process that kills the Nim process after a timeout
18:52:57*Trixar_za joined #nim
18:56:15*vendethiel- quit (Remote host closed the connection)
18:56:25*vendethiel joined #nim
18:58:59reactormonkhow can I run all non-nimble tests?
18:59:26*kniteli joined #nim
19:00:29reactormonkfound it
19:02:03*epichero quit ()
19:18:14*milosn quit (Read error: Connection reset by peer)
19:21:19*UberLambda joined #nim
19:22:32*milosn joined #nim
19:23:07AraqMaxdamantus: what happened to your PR?
19:25:14*pregressive quit (Remote host closed the connection)
19:28:51*pregressive joined #nim
19:40:02onionhammerekarlso very cool, you want some help with the UI? :)
19:41:07Araqekarlso: yeah, pretty cool, we will link to it from the website when it's more stable :-)
19:41:22Araqso yes, people here do care about your work
19:43:07*Trustable quit (Remote host closed the connection)
19:43:07ekarlsoonionhammer: by all means :P
19:43:25ekarlsoAraq: i think pkgs are more importamt :p
19:43:29ekarlsobut ey ok ^^
19:43:53onionhammerekarlso you got a repo somewhere?
19:44:07onionhammeryou got the tcc back end working huh, nice :)
19:44:29ekarlsoonionhammer: yeah, it's 2 seperate repos atm :)
19:44:48onionhammerlinks?
19:44:56ekarlsothere's the old frontend which was jquery and the new using angular
19:45:01ekarlsohttps://github.com/ekarlso/nim-play-frontend
19:45:06onionhammergotcha
19:45:22ekarlsothe other part is a simple rest api with some utils to create a chroot etc
19:45:29def-ekarlso: only 1 program can be compiled and run at any time? that should be a much higher number
19:46:19ekarlsodef-: I suspect it's because the cmd is blocking :P
19:47:31ekarlsothat part is here: https://github.com/ekarlso/nim-playpen
19:47:59ekarlsoonionhammer: u good at gulp ?
19:48:28onionhammernot at all
19:48:41ekarlsodoh :D
19:48:44onionhammeri'm a web dev, but I dont do a lot of client-side fuckery :P
19:48:52ekarlso:P
19:48:57*a5i quit (Quit: Connection closed for inactivity)
19:49:22onionhammershouldnt be too hard to figure out though
19:49:27ekarlso:P
19:49:42ekarlsothere's a issue with the fonts not wokring when doing "gulp serve"
19:49:52ekarlsoyou'll see i've done a hacky thing :p
19:50:05onionhammerha ok
19:50:17onionhammeri'm at work right now, but i should have time to look at this tomorrow :)
19:50:26ekarlso:D
19:50:39onionhammermy girlfriend has to work tomorrow (party! :))
19:50:55ekarlso:P
19:50:57ekarlsohaha
19:51:07ekarlsoenjoy it while it's gf and not mom or wife :P
19:51:19onionhammerlol i hope she never becomes my mom
19:51:34fowlekarlso, will you add a sharing function to your repl
19:51:39ekarlsoyour childs mim hah :
19:51:47ekarlsofowl: sharing how ?
19:52:01ekarlsoi got a few ideas in mind :P
19:52:08ekarlsothough not all the time in the world :/
19:52:13fowllink to open the page with script loaded would be perfect
19:52:45ekarlsoshould'nt be hard though
19:52:52ekarlsoeach run / snip already has a ID
19:52:58ekarlsoso just store the file and share the id
19:53:00ekarlso:P
19:53:36fowlcool
19:58:09ekarlsodef-: any clue on the multiple requests stuff ? :p
19:58:35def-ekarlso: a thread for each request?
19:58:41def-if you want to keep it blocking
19:58:47def-or you do some async stuff
19:58:49ekarlsohow to make it nonblocking :P
19:58:52ekarlsodef-: patches welcome :D
19:59:01def-none coming soon, sorry
19:59:53ekarlso:(
20:00:00ekarlsoeveryone just has ideas :p
20:02:52*BlaXpirit quit (Remote host closed the connection)
20:03:16Maxdamantus08:22:50 < Araq> Maxdamantus: what happened to your PR?
20:03:46Araqyeah, your diff looked good
20:03:49MaxdamantusIt's still there. I added the `(int, int)` commit to it and rebased it again yesterday (because of conflicts)
20:04:10Araqhrm oh so you added it to the other PR?
20:04:17MaxdamantusYeah.
20:04:41*BlaXpirit joined #nim
20:04:56MaxdamantusMerging them separately would cause conflicts because of at least the type rendering.
20:05:17ekarlsoAraq: ever concidered using something like gerrithub?
20:14:05dom96ekarlso: I haven't looked at your code but perhaps this would be of use? https://github.com/nim-lang/nimbuild/blob/rewrite/src/builder/asyncproc.nim
20:14:25dom96If so then I can put it in a separate nimble package so that both projects can use a common code base
20:15:11ekarlsodom96: what projects ? :)
20:15:19OderWat_Yeah! I love my new echo x[->] and x[<-] as alternative to x[x.high] x[x.low] which I made as the next thing @Araq can reject to put into the language :-P
20:15:45dom96ekarlso: nim-playpen and nimbuild
20:15:57ekarlso:P
20:16:28dom96OderWat_: hah
20:16:47OderWat_I think it is beautiful: https://github.com/Araq/Nim/pull/2283
20:18:01OderWat_But I bet it is not good for some reason. I still like to fiddle with the compiler parser / ast :-P
20:18:26fowlOderWat_, hey, i just saw your comment today, the fix for repeat() is curry((proc(c:char,n:int):string)strutils.repeat, 'x')
20:18:57dom96OderWat_: Certainly a good way to get to know the way the compiler works.
20:18:58OderWat_@fowl ok thats cool!
20:20:08*pregressive quit (Remote host closed the connection)
20:30:35dom96ekarlso: From looking at your code you should be able to make use of asyncproc :)
20:30:57ekarlsodom96: hard to adopt ? :Ø
20:31:14dom96ekarlso: I don't think so.
20:31:18dom96Just need to make everything async :P
20:31:28dom96That said, I haven't actually properly tested asyncproc yet.
20:31:42dom96Because of the bug which prevented threads and async await being used together.
20:31:56dom96Basic usage of it seems to work though
20:31:58ekarlsoanyways, looking into sharing atm :P
20:38:03*Matthias247 joined #nim
20:38:23ekarlsodom96: what compiler flags should one allwo ?
20:38:27ekarlsolike threads or so
20:38:36dom96just --threads:on
20:38:42ekarlsono other flags ? :p
20:38:44ekarlsook
20:38:51def--d:release
20:38:56def-and checks on/off
20:42:18ekarlsostacktrace too or ?
20:43:42def-in my opinion yes
20:47:50*Jehan_ joined #nim
20:52:09VarriountPersonally, I compile all my 'release' code with '-d:release --stacktrace:on --linetrace:on'
20:52:56*mnemonikk quit (Ping timeout: 265 seconds)
20:55:15*mnemonikk joined #nim
20:55:15*mnemonikk quit (Changing host)
20:55:15*mnemonikk joined #nim
20:56:38MaxdamantusAraq: actually, there's some bug somewhere that has something to do with the anonymous tuples.
21:02:00*Menche joined #nim
21:10:44AraqMaxdamantus: well you have to be more concrete
21:14:00MaxdamantusI think .n is only set for tuple[..]-constructed PTypes.
21:14:05*Maxdamantus wonders where that happens.
21:16:31onionhammerekarlso syntax highlighting working yet?
21:17:59ekarlsoonionhammer: nope, that needs some ace stuff
21:18:38onionhammerhttp://ace.c9.io/#nav=higlighter
21:18:41onionhammerdoesnt look too bad
21:20:52Varriountonionhammer: Just added shell escaping to 'nimble search'
21:22:13VarriountSo users shouldn't be able to destroy their own computers via 'dummy;rm -rf /
21:22:16Varriount'
21:22:17onionhammeroo yeah :)
21:22:26onionhammer'accidentally' :P
21:22:45onionhammerwhen does this go into master?
21:22:56Varriountonionhammer: When it's finished and tested.
21:23:15Varriountonionhammer: I intend to post on the forum to request some beta testers when it's ready.
21:23:29onionhammermaster is for beta testing :p;
21:23:52onionhammerST package control is for stable releases :P
21:24:09VarriountHm, true
21:24:27VarriountOnly AutoComplete.py, Lookup.py, and Documentation.py remain for refactoring.
21:24:45VarriountAdding the new output settings has taken a lot of time to get right.
21:25:06MaxdamantusAh, in semTuple itself.
21:25:18Varriountonionhammer: Of course, if you want to merge it, be my guest. Just don't complain about anything being broken.
21:25:37onionhammerif u dont think it's ready to be merged then its not ready
21:26:05*tumult quit (Quit: Page closed)
21:26:13AraqOderWat_: you can implement var (foo, _, _) = p() instead
21:26:38Araqthat one will be accpted
21:27:00onionhammer_= discarded?
21:27:04Araqyes
21:27:09onionhammerwhy not discard :P
21:27:16Araqbecause sexy
21:27:20onionhammerheh ok
21:27:24Jehan_I think it's about selective discards?
21:27:38onionhammerJehan_ I meant var (foo, discard, discard) = p()
21:27:46Jehan_Oh, I see.
21:28:03Jehan_I'd favor _, because it's easier to read.
21:28:14onionhammersame, just devils advocate for consistency
21:28:32BlaXpiritcool stuff
21:28:43Jehan_Eh, it would be using discard differently (as a pseudo-variable rather than function), so it wouldn't be all that consistent.
21:28:53*Menche quit (Ping timeout: 264 seconds)
21:28:57onionhammerdiscard as a function?
21:29:08VarriountBut it would still serve the same purpose. :/
21:29:13Araqand if you want a challenge, go on and implement p(_, _, "abc") which we need for disambiguation for the fowl's 'curry' macro
21:29:14Jehan_Well, discard is essentially a pseudo-function.
21:29:19Jehan_You could implement it as one.
21:29:20onionhammerJehan_ there are already multiple purposes for it
21:29:41onionhammerdiscard meaning "I dont care about this result" or discard meaning "no statement"
21:29:47BlaXpirit`discard` will not look good
21:30:21Jehan_onionhammer: The latter is the same as the first without an argument.
21:30:24*Menche joined #nim
21:30:37VarriountPersonally, I favor 'var (foo, discard, discard) = p()', since it re-uses discard (and is a logical extension of it's purpose)
21:30:39onionhammerno, they're on different sides of calls
21:30:40MaxdamantusMm. I think they shouldn't have .n, though semtypes.nim at least assumes they do, dunno what else.
21:30:55onionhammerl value vs r value
21:31:15Jehan_Varriount: I'm mostly interested in code readability. If you have multiple values, it's easier to count "_" than discards.
21:31:18AraqMaxdamantus: there are few places left that assume an 'n', should be easy to fix
21:31:47Jehan_But, well, personal opinion and all that. :)
21:32:03onionhammerI think _ is easier to use, but im not sure if it should be used all that much :P
21:32:15Jehan_I mean, I am also using underscores in Nim identifiers for my code (heresy!)
21:32:21VarriountAraq: What would p(_, _, "abc") do?
21:32:43AraqVarriount: match against the proc that ends with a 'string' parameter
21:32:44Maxdamantuser, not semtypes, semtypeinst
21:34:23VarriountAraq: Is there any reasoning besides 'looking nice' to use '_' over 'discard'?
21:34:47Maxdamantusvar discard = 4
21:34:58AraqVarriount: no.
21:35:01Jehan_What would p(_, _, "abc") for? A moment ago we were talking about destructuring, I thought?
21:35:16Jehan_be for*
21:35:21VarriountAraq: I'm just trying to keep in mind that it will be yet another surprise for someone who is new to the language.
21:35:23BlaXpiritpartial?
21:35:26Araqwe talk about the new "solves everything feature" _
21:35:46*Jehan_ looks vaguely lost.
21:35:46BlaXpiritwell it could still be `discard` even in that case
21:35:54BlaXpiritbut it will blend in with the rest
21:35:57BlaXpiritit is not nice
21:36:03Araqfowl's curry macro needs partial overloading resolution
21:36:16Jehan_Oh, anonymous functions as in Sather or Scala?
21:36:32Araqso I am thinking of giving the placeholder _ more features
21:37:15*tinAndi joined #nim
21:37:20BlaXpiritare you sure "currying" is the right term here?
21:37:29BlaXpiritsome background would be nice anyway
21:37:30VarriountAraq: Hm. What would be the difference between '_ = proc()' and 'discard proc'?
21:37:45Araqthere is no '_ = proc'
21:37:55Araq_ is only in tuple destructuring
21:37:55MaxdamantusAraq: do you know what all those places are or how to find out?
21:38:23AraqMaxdamantus: the tests will tell you
21:38:51Araqbut you can also grep for tyTuple
21:38:59VarriountAraq: But every value can also be thought of as a tuple of length 1
21:39:51MaxdamantusThe current tests don't exhaustively use anonymous tuples (or even nominal ones, I suspect)
21:40:11AraqMaxdamantus: well I'm sure you will add tests ;-)
21:41:33MaxdamantusBut ensuring exhaustion is difficult and can't really itself be tested for.
21:41:49MaxdamantusI'll add this parser combinator thing as a test anyway.
21:42:09Araqgrepping for tyTuple is exhaustive
21:44:00Jehan_Next on the menu: ADT notation? :)
21:45:04Araqpattern matching macro seems to be more important after _
21:45:14def-Jehan_: maybe a nice macro would work
21:45:17AraqADT notation is only helpful when you write lots of ADTs
21:45:23Araqbut nobody does
21:45:50*UberLambda quit (Quit: Leaving the Matrix)
21:45:55Jehan_I wasn't serious, and I have a macro for when I do (albeit not a nice one). :)
21:46:13MaxdamantusWhy not GADT?
21:46:16Araqpeople write an ADT when they try Nim the first time
21:46:33Araqbut most code doesn't consist of ADTs
21:47:30Maxdamantustype Maybe where Just: proc[A](a: A): Maybe A; Nothing: Maybe A
21:49:22VarriountDoes this have anything to do with type classes?
21:49:27MaxdamantusNo.
21:49:39*fizzbooze joined #nim
21:50:01Jehan_Araq: Hmm, I tend to use them (or their equivalents) a fair bit.
21:51:12Jehan_tagged unions/ADTs/subtyping or something like them is pretty essential for polymorphic behavior.
21:51:14fizzboozeso heard that if you disable GC, you get memory leak. is this true?
21:51:21BlaXpiritpretty much
21:51:34Jehan_And often, ADTs are the most convenient way of doing them (especially for ad-hoc types).
21:51:46def-fizzbooze: try --gc:none and you will see the compiler warnings about GCed memory
21:52:22fizzboozedef-: is there a way to disable GC and free the memory yourself?
21:52:22AraqJehan_: dunno, my ad-hoc types are often just enums, I think
21:52:31fizzboozeor is GC required if you don't want leaks
21:52:42flaviufizzbooze: GC is requried for the stdlib.
21:52:57fizzboozei see. thanks
21:52:57Araqfizzbooze: something like that is in fact in the works
21:52:57def-fizzbooze: the idea is not to use the standard library then but write your own stuff, as you would do in a kernel, for example
21:53:13VarriountAraq: Well, I just want it to be noted that I oppose using '_' for tuple destructuring, and would rather re-use 'discard'.
21:53:20Varriount'discard' is already used to 'throw away' data, and it would make more sense when a beginner to the language sees it used in a tuple destructuring context.
21:54:23VarriountUsing '_' for two very different purposes is confusing, even if it does look nice.
21:54:41AraqVarriount: fair enough, but I think newbies don't understand the consistency
21:54:58Araqnewbies are usually more like "ok, like in Scala"
21:55:00fizzboozeAraq: is this planned for post-1.0?
21:55:36Araqfizzbooze: pretty much, yes as the design is not finished
21:55:42Maxdamantusproc dracsid[T](a: T) = return
21:56:37Jehan_Araq: Hmm, I often need more than enums, but that probably comes down to programming style.
21:57:13Araqand programming domain
21:57:13Jehan_I am not so keen on having ADTs as the one-stop-shopping solution for polymorphism, but I do find them handy often enough.
21:57:18Jehan_True.
21:57:57*Maxdamantus doesn't like the use of the term "polymorphism" there.
21:58:01Varriountfizzbooze: In the future, parts of the stdlib may become less dependant on run-time garbage collection (if they aren't already)
21:58:12MaxdamantusYou declare a bunch of things that are the same type.
21:58:23MaxdamantusPolymorphism is about handling things of varying types.
21:58:37AraqVarriount: that's not really my plan
21:59:07Jehan_And an ADT is basically a sum type over multiple tuple types.
21:59:10Araqinstead the threal local GC can be turned into region based allocator
21:59:20VarriountAraq: I mean, aren't there places where sequences could be safely deallocated when scope ends?
21:59:34Araqoh yeah but that's just escape analysis
21:59:41MaxdamantusJehan_: no, because of tags.
22:00:06VarriountAraq: Well yes, but then you aren't really using (run-time) garbage collection anymore.
22:00:20AraqVarriount: that depends on the *thread*
22:00:40Araqoh
22:00:52Araqyou're still talking about escape analysis
22:00:54Jehan_http://en.wikipedia.org/wiki/Algebraic_data_type#Theory
22:01:01VarriountAraq: Yep.
22:01:09Araqwell that's just an optimization, that cannot do wonders
22:01:18*Zuchto quit (Quit: --)
22:03:25MaxdamantusJehan_: it's describing it lazily, unfortunately.
22:05:39MaxdamantusJehan_: but the tag is quite important. You can't just say that `List Int` in Haskell is a union of `()` and `(Int, List Int)`
22:06:02Jehan_Sum types are tagged unions?
22:06:13Jehan_Just a different terminology?
22:06:14*l04m33 quit (Ping timeout: 252 seconds)
22:06:17MaxdamantusNot really.
22:06:28*l04m33 joined #nim
22:06:46Jehan_Hmm, reference?
22:08:00MaxdamantusMaybe sometimes.
22:08:34MaxdamantusWikipedia says tagged unions are also called "sum types" .. on the tagged union page.
22:11:28Jehan_Any specific example where a sum type expresses something that a tagged union cannot express or vice versa?
22:13:04Maxdamantusif you're not in a intuitionistic system, you can just have a sum without a tag, which is the same as a union operation on sets.
22:13:11*mpthrapp quit (Remote host closed the connection)
22:14:19Jehan_Hmm.
22:14:54Jehan_Still not seeing how they aren't isomorphic.
22:15:06Maxdamantusthink about Either Int Int
22:15:22Jehan_Though my background is primarily algebra, not type theory, so that may color my perception.
22:17:53Maxdamantus`Left 4` is distinguished from `Right 4`
22:19:17Maxdamantusif you just had: `Either a b = a ∪ b`, `Either Int Int` would be `{0, -1, 1, -2, 2, ..} ∪ {0, -1, 1, -2, 2, ..}`
22:19:25Maxdamantuswhich is again just `{0, -1, 1, -2, 2, ..}`
22:22:07Araqthat makes sense. :-)
22:22:35Maxdamantusbut that's not what happens.
22:22:52Maxdamantusif `Int` has 2^32 values, `Either Int Int` has 2^33 values.
22:23:15Araqso ... does your Either have a tag or not?
22:23:30MaxdamantusThe one with ∪ doesn't.
22:23:33MaxdamantusThe one in Haskell does.
22:23:58*fizzbooze quit (Ping timeout: 256 seconds)
22:24:23Maxdamantusin C you have something more like the one with ∪
22:24:43Maxdamantusbecause `union { int a, b; }` still has the same number of values as `int`
22:28:42Araqso your point is that a "sum type" doesn't have a tag?
22:28:51MaxdamantusActually, sum types should have tags.
22:29:04Maxdamantusotherwise they won't correspond to summation.
22:29:26Araqbut a union type doesn't?
22:29:36MaxdamantusNo.
22:30:19Araqbut a tagged union type does?
22:30:22MaxdamantusYes.
22:30:39Araqso Jehan_ used the terms correctly then
22:31:04Araqa sum type is a tagged union type then
22:31:16MaxdamantusYes.
22:31:22Araqlol
22:31:57MaxdamantusAlthough not about the polymorphism thing.
22:39:34*aidanh quit (Ping timeout: 272 seconds)
22:40:09*aidanh joined #nim
22:42:29xificurCwhat package(s) should I check out as a newcomer for creating a simple 2d toy game?
22:46:35Jehan_Class hierarchies are tagged unions also and ADTs are isomorphic to a very specific type of class hierarchy. I.e. how Scala represents ADTs as case classes with a sealed abstract superclass. I think this justifies calling them polymorphic.
22:47:04def-xificurC: csfml has some nice example games, there's also an sdl2 and urho3d wrapper
22:49:44xificurCdef-: csfml, I see that's a wrapper, will check out, thanks
22:57:01MaxdamantusJehan_: then every type with more than two values is polymorphic.
22:57:44Maxdamantusboolean is a hierarchy containing the types True and False.
22:57:55Maxdamantusint is a hierarchy containing the types 0, 1, 2, ..
22:58:14*Maxdamantus does know of languages that work like that.
22:58:46Maxdamantuser, two or more values*
22:59:04Jehan_Do 0, 1, 2 have operations with distinct semantics?
22:59:10MaxdamantusYes.
22:59:17Maxdamantus0 + 1 = 1
22:59:19Maxdamantus1 + 1 = 2
22:59:22Jehan_I'll note that polymorphism is a vague concept to begin with.
23:00:11Jehan_But if you've got a pretty clear isomorphism between two concepts (ADTs and specific kinds of class hierarchies), it's difficult to argue that they are fundamentally different.
23:00:30Jehan_You'll have to get really creative with Goedel numberings to say the same thing about integers.
23:00:44*Maxdamantus also implemented Int64, etc in some language once using an Int{n} → Int{2*n} combinator.
23:01:11Maxdamantusstarting with Int1 as being derived from Bool, which was an interface with True and False as instances.
23:01:35reactormonkSo how exactly do I diff between two version of tests?
23:01:46MaxdamantusBool, Int1, Int2, Int4, Int8, Int16, Int32, Int64
23:01:59Maxdamantusoperations were kind of slow.
23:02:16federico3how can I check if a string belongs to a set of strings?
23:03:22Jehan_Maxdamantus: Still isomorphic to integers, I presume.
23:03:36Jehan_I.e. different implementation, same semantics.
23:04:32MaxdamantusSo are the different types for different constructors exposed in Scala?
23:04:55MaxdamantusLeft 4 :: Either[Int].Left
23:06:15MaxdamantusHm. Scala doesn't seem to have ADTs.
23:06:25MaxdamantusThey just write the hierarchy themself.
23:06:32def-federico3: contains?
23:06:42Jehan_http://www.scala-lang.org/api/rc2/scala/Either.html
23:07:13federico3def-: if x in ["foo", "bar"] ?
23:07:34def-federico3: that looks like an array, not a set
23:08:07federico3yup, I gather that a set can only contain chars, not strings
23:08:26federico3(and afaict a set should support "in" as well)
23:09:10def-federico3: there are 2 types of sets, these work with strings too: http://nim-lang.org/sets.html#contains,HashSet[A],A
23:09:58VarriountHm, I could have sworn there was a special case in the built-in set type for strings.
23:10:41*xificurC quit (Ping timeout: 265 seconds)
23:12:34Jehan_Varriount: Not that I know of, but case works with strings (and uses hashing).
23:13:42Jehan_federico3: are you talking about the basic set[T] type or one of the set types provided as a library?
23:13:43VarriountJehan_: Ah, yeah, that's right.
23:14:01*tinAndi quit (Quit: ChatZilla 0.9.91.1 [Firefox 36.0/20150222232811])
23:14:48Jehan_And AFAIK both support `in`.
23:15:38VarriountJehan_: Though, you could use the builtin set type with strings of 8 or fewer characters, by casting the characters to an integer
23:16:09Jehan_Varriount: cardinality is capped at 65536.
23:16:22Jehan_Unless that changed recently.
23:17:10VarriountAw.
23:17:23*brson quit (Ping timeout: 256 seconds)
23:17:32Jehan_Well, they're basically bitmaps. You'd trash swap memory.
23:17:59*reem joined #nim
23:19:26VarriountSpeaking of swap memory, am I the only one here that cringes whenever someone describes swap memory as "memory the os uses when it runs out of real ram"?
23:20:18*randomwalk joined #nim
23:20:21*aurora joined #nim
23:20:32*aurora quit (Remote host closed the connection)
23:21:49randomwalkWhen I call values() on an OrderedTable, I get this Error: expression 'pairs' cannot be called
23:21:53*^aurora^ joined #nim
23:22:07randomwalkHow do I figure out why?
23:22:14^aurora^hi
23:22:53Varriountrandomwalk: What kind of types is the table holding? What does the stack traceback look like?
23:22:57VarriountHi ^aurora^
23:23:32*reem quit (Remote host closed the connection)
23:23:40randomwalkVarriount: I didn't see a traceback in the error message.
23:24:09randomwalkIt's holding (string, float32)
23:24:15flaviurandomwalk: It's a compile error, there's no traceback.
23:24:31VarriountUnless you compile the nim compiler with stacktrace:on
23:25:11Varriount'koch boot -d:release --stacktrace:on --linetrace:on' is what I always use.
23:25:28Jehan_randomwalk: values is an iterator. Are you using it as a procedure?
23:25:32flaviuYeah, but that's mostly useful for ICEs. This is a regular error from what I can tell.
23:25:50randomwalkJehan_: I'm trying to assign it to a var
23:26:18Jehan_Ah, you cannot do that; or at least not the way you're probably trying to.
23:26:24*BlaXpirit quit (Quit: Quit Konversation)
23:26:25Jehan_If you want just a seq of values, use:
23:26:28Jehan_import sequtils
23:26:34Jehan_let a = toSeq(b.values)
23:26:53randomwalkmaybe @[ot.values]
23:27:05Jehan_No, toSeq is something different.
23:27:27Jehan_it takes an iterator as its argument, runs through it, and produces a seq of all enumerated values.
23:28:00Jehan_values is something that's normally used in a for loop. It doesn't return a seq or other collection.
23:31:48*Menche quit (Remote host closed the connection)
23:33:44*Demon_Fox joined #nim
23:35:05*Menche joined #nim
23:44:58*Matthias247 quit (Read error: Connection reset by peer)
23:45:58*reem joined #nim
23:59:05*reem quit (Remote host closed the connection)