<< 07-02-2016 >>

00:11:04*Trustable quit (Remote host closed the connection)
00:13:17*shodan45 quit (Quit: Konversation terminated!)
00:13:55*Sornaenst is now known as THE_LORD
00:14:06*THE_LORD is now known as Sornaensis
00:20:44*M-max1 joined #nim
00:21:15*M-max quit (Ping timeout: 240 seconds)
00:22:32*Demon_Fox quit (Ping timeout: 240 seconds)
00:22:32*ephja quit (Ping timeout: 240 seconds)
00:25:17*vendethiel- joined #nim
00:25:39*Demon_Fox joined #nim
00:28:50*vendethiel quit (Ping timeout: 240 seconds)
00:29:40*ephja joined #nim
00:38:17*Matthias247 quit (Read error: Connection reset by peer)
00:46:06*apotheon quit (Ping timeout: 240 seconds)
00:47:03*apotheon joined #nim
00:52:55Araqldlework: sounds it should work yeah
00:53:06ldleworkAraq: I was using the proc keyword :(
00:54:07Araqhappens to the best of us
00:54:19*derka joined #nim
00:54:43*filwit quit (Read error: Connection reset by peer)
00:56:50*derka quit (Client Quit)
01:09:35*jaco60 quit (Ping timeout: 240 seconds)
01:12:02*yglukhov joined #nim
01:16:09*yglukhov quit (Ping timeout: 240 seconds)
01:40:01*arnetheduck joined #nim
01:48:50*zaimatzoain joined #nim
01:48:58*zaimatzoain left #nim ("ERC Version 5.3 (IRC client for Emacs)")
01:49:31*pregressive joined #nim
01:49:34*Sornaensis quit (Max SendQ exceeded)
01:49:40*Sornaensis joined #nim
01:51:05*derka joined #nim
01:53:40*pregressive quit (Ping timeout: 248 seconds)
02:04:29*ljgu joined #nim
02:04:40ljguhow do i compile a program to a windows executable? Im on linux atm
02:15:17*ljgu quit (Quit: Page closed)
02:15:36Xewait, nim can codegen php?
02:18:13ldleworkwat
02:18:53Xehttps://github.com/nim-lang/Nim/pull/3835#discussion_r52110412
02:19:40ldleworkhuh
02:28:19*derka quit (Quit: derka)
02:41:18*skyfex joined #nim
02:53:14*yuta joined #nim
02:55:35*filwit joined #nim
02:59:32yutahello
02:59:42ldleworkhi
03:00:18yutaDoes anyone can get documentation comment information from nimsuggest?
03:00:46*ephja quit (Ping timeout: 245 seconds)
03:01:04yutaI'm afraid to ask in forum/github issue if it's only my environment
03:01:44ldleworkyuta: the community is still small enough the forum is the best place to ask anyway
03:03:28yutathanks idlework. I'll ask nim forum
03:13:20*yglukhov joined #nim
03:17:45*yglukhov quit (Ping timeout: 240 seconds)
03:21:05*skyfex quit (Quit: My Mac has gone to sleep. ZZZzzz…)
03:34:48*yuta quit (Remote host closed the connection)
03:40:30*yglukhov joined #nim
03:43:33*pregressive joined #nim
03:44:56*yglukhov quit (Ping timeout: 240 seconds)
03:48:47*lompik joined #nim
03:50:06*sanctus joined #nim
03:50:10*sanctus is now known as francisl
03:50:18*francisl quit (Client Quit)
03:50:35*francisl joined #nim
03:57:56*filwit quit (Ping timeout: 250 seconds)
04:00:29*francisl quit (Quit: francisl)
04:03:21*francisl joined #nim
04:03:43*francisl quit (Client Quit)
04:04:07*francisl joined #nim
04:12:40*filwit joined #nim
04:24:38*brson quit (Quit: leaving)
04:28:45Varriount_arnetheduck: You there? I've been gone most of the day.
04:29:10arnetheduckVarriount_, yep
04:29:51Varriount_arnetheduck: First off, your SDL procedure wasn't exported properly, which lead to nothing ever happening.
04:30:00Varriount_The rendersound one.
04:30:29arnetheducksdl? rendersound?
04:31:02Varriount_arnetheduck: I was helping you with the dll-reload-on-change stuff, right? Or am I confusing you with someone else?
04:31:36arnetheduckVarriount_, think you're confused ;) I'm the nlvm guy
04:31:59Varriount_arnetheduck: Oh, sorry. My mistake
04:32:19filwitohh! nlvm looks very cool, btw.
04:33:36Varriount_arnetheduck: Well, on windows, the easiest way to make things work is to simply have clang compile the bytecode directly. There's a nasty bug (that's really old) that makes assembly output garbled.
04:34:26*lompik quit (Ping timeout: 252 seconds)
04:34:41Varriount_arnetheduck: Aside from that, the problem is resolving identifiers in C libraries and headers. Even if the correct object files are used, nlvm outputs symbols for things like defined identifiers.
04:34:54arnetheduckVarriount_, yeah, that's what I'm using too now (think I wrote it down in the readme as well)
04:35:39Varriount_arnetheduck: Might want to put it as the preferred way. I kept having to mangle arguments to the various llvm tools to get things working otherwise.
04:36:11*junw_ quit (Ping timeout: 245 seconds)
04:36:48arnetheduckVarriount_, I think I did, check out the latest readme.. also started on a support lib to work around the symbols problem.. though it's really a workaround, longer term it would probably be better to mod stdlib
04:37:07Varriount_arnetheduck: Regarding the llvm dynlib, on windows the makefile has to be modified to run objdump correctly.
04:37:39arnetheduckhm, ok.. I
04:37:42Varriount_The llvm source doesn't export symbols using the declspec mechanism on windows, so the code has to be patched.
04:37:58Varriount_Or rather, the dll does.
04:38:24arnetheduckok.. it's possible to use the static libs as well, except that the link times are annoying when recompiling nlvm
04:39:16arnetheduckthat's probably the longer term solution, but not something I want to use right now.. I think it should be possible to switch between the two using some when magic
04:39:24Varriount_arnetheduck: Also, it's a tad faster to compile in release mode. My laptop took ~10 minutes and 4GB of memory during the compilation process otherwise.
04:39:36Varriount_Er, release mode for the llvm dynlib.
04:40:22arnetheduckVarriount_, yeah, but since llvm error checking is based on asserts, any problems with your generated bytecode and it crashes.. in debug mode, at least it gives an assert with some info as to what might be wrong
04:41:15Varriount_arnetheduck: Oh. Wonderful.
04:41:45Varriount_arnetheduck: Well, I can generate some DLL's for others who want to try nlvm on Windows.
04:42:09Varriount_On the plus side, I got to learn about makefiles and cmake
04:43:00arnetheduckVarriount_, could do that.. I guess there are no official debug dll's to be had?
04:43:20arnetheduckyou compiling with msvc or mingw btw?
04:43:33Varriount_arnetheduck: For libllvm? I think there are a few scattered about, but they're 32-bit.
04:43:38Varriount_mingw
04:44:28arnetheduckVarriount_, ah, that's why.. on linux only the autoconf make files support shared libs.. they've fixed it for 3.8 though, so maybe it'll be easier on win also
04:45:03Varriount_arnetheduck: 3.8 is released?
04:45:04arnetheduckfor windows, maybe cygwin would work with the current llvm ver, using autoconf
04:45:28arnetheduckVarriount_, almost, I think.. I think there was an RC last I checked
04:45:35Varriount_I could have sworn I was using whatever was given on llvm's downloads section.
04:45:53*Varriount_ is now known as Varriount
04:46:43arnetheduckVarriount, ah, feb18.. release candidate avail now.
04:47:28arnetheduckfilwit, thanks. it'll be a lot more cool if it actually starts working ;)
05:18:03*chadsy joined #nim
05:19:14*chadsy quit (Client Quit)
05:19:25*chadsy joined #nim
05:20:39Varriountarnetheduck: Have you built llvm 3.7.1?
05:20:44*chadsy quit (Client Quit)
05:21:05*xawdy joined #nim
05:22:17*xawdy quit (Client Quit)
05:22:35*xawdy joined #nim
05:23:45*nullsector joined #nim
05:31:27*xawdy quit (Quit: Leaving)
05:35:33arnetheduckVarriount, yeah
05:41:56*yglukhov joined #nim
05:42:37Varriountarnetheduck: Did you use cmake at all?
05:42:52arnetheduckVarriount, no, autoconf + make
05:42:59arnetheducklike the instructions in the readme
05:43:06Varriountarnetheduck: Ah.
05:43:55Varriountarnetheduck: Windows people get to use cmake. And apparently whoever wrote the invokation for the python script forgot to put a flag to actually run the script properly.
05:44:23*nullsector quit (Read error: Connection reset by peer)
05:45:18arnetheduckVarriount, well, with 3.8, I think automake is gone, and they made an effort to ensure all features were ported to cmake
05:46:08Varriountarnetheduck: What's frustrating is that I could have sworn the configuration process worked properly a wekk ago.
05:46:13Varriount*week
05:46:20*yglukhov quit (Ping timeout: 245 seconds)
05:47:11arnetheduckVarriount, heh, unix has the history command for that situation ;)
05:47:38Varriountarnetheduck: True, but last time I used the default configuration provided by cmake-gui
05:48:21VarriountWith the exception of modifying one of the cmake files so that the llvm dynlib would build. But I know I didn't do anything with python.
05:54:41*Varriount_ joined #nim
05:54:41*Varriount quit (Disconnected by services)
05:57:07Varriount_arnetheduck: Ah, found the problem. It was due to some symlinks.
06:12:20*FreezerburnV quit (Ping timeout: 252 seconds)
06:18:55*pregressive quit ()
06:19:59*pregressive joined #nim
06:23:31*francisl quit (Quit: francisl)
06:48:33*gour joined #nim
07:07:43*endragor joined #nim
07:09:43*pregressive quit (Remote host closed the connection)
07:10:17*pregressive joined #nim
07:14:42*pregressive quit (Ping timeout: 250 seconds)
07:41:53ldleworkDo you really ever need to make a "ref Table[..]" type?
07:42:01ldleworkBecause a Table is already a ref type?
07:42:42ldleworkOh I see there is TableRef
07:43:27*yglukhov joined #nim
07:47:33ldleworkIf you make a type as `ref object` does that mean there is no way to make a value of that type?
07:47:38ldleworkOther than a reference to it on the heap?
07:47:48*yglukhov quit (Ping timeout: 248 seconds)
07:48:00ldleworkI mean, there is no way to pass it by value, other than passing around a reference to it on the heap?
07:50:42ldleworkI guess all the little Nimians are asleep right now
07:51:01*gour quit (Quit: WeeChat 1.4)
07:51:27filwitldlework: the only other way to "pass it around" would be to copy it..
07:51:53ldleworkfilwit: right, which is what you get with normal structure types created with "type foo = object .."
07:52:20ldleworkfilwit: so I'm asking, if you create a "type bar = ref object", does this mean when you create the object it is created on the heap and the only thing you can pass around is a ref to it on the heap?
07:52:29ldleworkIE it can never really be copied just by passing it?
07:52:53filwityou can always manually copy it via shallow/deepCopy
07:53:20ldleworkSure, but I'm asking specifically does creating a type of "ref object" prevent copying via passing semantics?
07:53:22filwitor you can do: var x: type(bar[]) = someBar[] # I think
07:53:36ldleworkIf I never purposefully copy it like you're describing, it'll never be copied right?
07:53:54filwitnot unless you're passing it to another thread, no
07:54:01ldleworkthat's pretty useful
07:54:58ldleworkI like that you have the option to create a base "FooObj = object" and then create a RefType with "Foo = ref FooObj"
07:55:17ldleworkOr you can just do "Foo = ref object" and prevent it from naturally being passed by vale
07:55:19ldleworkvalue
07:55:38ldleworkthere's a lot of flexibility available
07:57:02ldleworkLike, I never ever want my huge map type passed by value
07:57:13filwitthe parallel/spawn macros will auto-deepCopy ref-types that you pass to procedures (since it has to for safety) but beyond that, yeah you can limit and object to always be ref semantics... also, what's cool is in {.experimental.} code you can pass an ref-object to a proc that takes a non-ref version and it auto-derefs (which prevents you from mutating it's fields)
07:57:18ldleworkSo I'm going to define it as "ref object" so that you can't naturally do that by accident
07:58:03ldleworkde-ref's it and so passes it by value, and hence copying it
07:58:06ldleworkright?
07:58:25ldleworkI mean, in Nim, everything is passed by value
07:58:32filwiti would assume so... but I'm not sure actually
07:58:37ldleworkyou're jsut sometimes passing a structure or sometimes passing a reference
07:59:11ldleworkfilwit: I would imagine that's why you can't mutate it, because you actually have a copy
07:59:13filwitwell.. isn't that the way all languages work? I mean.. a reference is just and int address..
07:59:34ldleworkWell, not all languages, take python for example.
07:59:54ldleworkEverything is "passed by value" per-se, but the only thing you can pass is references.
08:00:16ldleworkBut yeah you're right
08:00:23ldleworkfundamentally, all passing is done 'by value'
08:01:31filwitldlework: about the auto-deref, Nim could actually just specialize procedures that auto-deref and assume value semantics to avoid the copy... but I doubt it does that
08:02:22filwitthat's probably why the feature is {.experimental.} cause it might not really be a good idea.. i mean it kinda breaks your "I can prevent unwittingly copying a large heap object" scenerio
08:02:35ldleworkoh yeah
08:03:09ldleworkI mean if the compiler has already recognized this kind of thing, it can probably just complain if any operations that mutate it exist.
08:03:22ldleworkrather than copying the data
08:03:24ldleworkmm yeah
08:04:33filwitoh btw, there's also a {.byRef.} and {.byVal.} pragmas I think, which you can apply to regular objects... so you can get a hybrid object where any "var x = y" is a copy, but passing 'y' will do so by reference (or vise versa)
08:05:19ldleworkthat just seems confusing
08:05:26ldleworkheh but flexible!
08:07:09filwityeah it's probably not a good idea in regular code.. In fact, a long time ago I was originally the person who suggested adding in 'ref object'.. Araq liked the idea, but now I'm not sure I really do.. it hides the details from call-site (originally I just suggested it cause there was the T/P Hungarian notation everywhere to avoid typing 'ref')
08:09:21filwitand btw, you could always enforce the use a ref version of a specific type even before 'ref object' by simply not exposing the FooObj version
08:10:03ldleworkyeah but with `ref object` yo udon't have to define two types at all
08:10:37ldleworkand the fact that nim kinda treats references transparently, it all adds up to a nice package
08:10:38filwithe's going to laugh at me for complaining so much about removing the T/P thing a long time ago, and now suggesting that it's good to have that info (value/ref) at callsite...
08:11:00ldleworkI think the thing I just mentioned is why its okay to not care
08:11:21ldleworkAlso the T/P thing still lives on
08:11:31ldleworkSome people do FooObj/Foo and some people do Foo/FooRef
08:12:11ldleworkI have been doing the former, but I think I want to switch to the latter.
08:13:15filwiti think you should do both, just depending on which you want promoted... eg, always assume 'Foo' is what your API users will pick, and if that's supposed to be a reference do the former, if not, the latter
08:14:08filwitor, like you said.. just have 'Foo' with a default and let people who really want the underlining object type jump through a bit of syntax hoops to get it
08:15:22ldleworkI used to actually use 'ref' throughout my code
08:15:30ldleworkdunno, didn't like it after a while
08:16:24ldleworkBut I think I like Foo/FooRef because then I can just go on knowing that, I'm passing things by value and sometimes, and it'll be obvious when, I'll be passing a ref by value (because Ref will be in the type name)
08:16:39ldleworkJust seems like the most straightforward cognitive model to work with.
08:16:53filwityeah, TBH it's much better not to have 'ref' everywhere.. I take it back... with proper IDE inspection tools you just hover over the type real-quick to find out what it is..
08:17:09ldleworkIts kind of like if you always used object types and used 'ref' keyword where you wanted references
08:17:30ldleworkexcept that you get to save a bunch of 'ref' keywords, but you're still treating 'ref' types the same way
08:18:13ldleworkMy IDE doesn't know Nim that well
08:18:21filwitwell the thing is a lot of my code right now I'm using objects (in continuous arrays) and passing around 'ptr T'
08:18:43ldleworkI think 'ptr' is loud enough that you should use the keyword for it
08:18:47filwitwell... i use both, just different parts of my application stuff
08:19:10filwitwhat IDE do you use?
08:19:14ldleworkemacs
08:19:26filwitah.. never used emacs.
08:19:48filwitthe Atom Nim support is pretty nice now (jump to def is nice)
08:20:35filwitbut honestly I still use Aporia for most of my Nim code... mostly cause I wrote all the color styles and I like to be able to control what the syntax is displayed like
08:20:37ldleworkfilwit: what do you use Nim for mostly?
08:21:38filwitheh, well I've done a lot of playing around with Nim for various things, I was building a HTML/CSS/server DSL a year or so ago.. but mostly game-engine related stuff
08:22:25ldleworkI'm writing a data-driven game engine :)
08:22:39ldleworkI wrote a json-driven entity-component system
08:22:42filwiti think Nim fits such a wide range of domains (because of it's meta-programming) that I always have these crazy ideas and want to work on them, but don't have the time
08:22:50ldleworkcurrently working on a chunked streaming tilemap system
08:23:02ldleworkI love the metaprogramming
08:23:02filwitoh, very cool
08:23:32filwiti thought you where a web-developer? I kinda remember having an argument with you about Nim's web HTML/CSS a long time ago :P
08:24:21ldleworkI'm a professional programmer so I'm expected to be proficient in the latest web-technologies regardless if it has anything to do with my direct profession.
08:24:49ldleworkI just ran the gauntlet getting up to speed on React and Redux
08:25:19ldleworkI built a realtime websocket-streaming Docker logs dashboard a couple weeks ago for work.
08:25:32ldleworkBut I am a distributed systems architect.
08:26:04ldleworkI just do games for fun!
08:26:11filwitoh i see, that makes sense then why you need to keep up with fullstack tech
08:26:44ldleworkcomponent-based web programming is pretty crazy
08:27:23filwitcomponent-based web programming? are you talking about games or distributed server apps?
08:27:32ldleworkLike with React
08:27:44filwitah, i don't know anything about React or Redux
08:27:49ldleworkWhere your front-end consists of a top-level react component, which has child components, and its just react components all the way down
08:27:53ldleworkah
08:28:20ldleworkFRP is the future of the the front-end
08:28:26ldleworkat least for the next 9 months or so ;)
08:28:30*Demon_Fox quit (Quit: Leaving)
08:28:36filwithmm... that just sounds like a fancy way of saying MVC or MVVC? or is this design something different?
08:28:53ldleworkYeah it has a lot in common with MVC conceptually
08:29:01filwit"at least for the next 9 months or so ;)" LOL
08:29:09ldleworkand propoents of FRP would probably find themselves trying too hard to distinguish them
08:29:47ldleworkfilwit: MVC is sort of "two-way binding"
08:29:56ldleworkFRP is more, "one-way binding"
08:30:03filwitokay i see, I've done some MVC/MVVC WPF/Silverlight work in the past, but mostly the front-end view-controller stuff
08:32:06ldleworkFRP is sort of, there is a core model and when it changes all the data will flow uni-directionally from root to leaf to render the document and nothing will cross talk and everything is immutable
08:32:27ldleworkits like a refinement in discipline over mvc... kinda
08:33:06ldleworkWith React, there is a virtual dom
08:33:15ldleworkyour javascript manipulates and controls a virtual dom
08:33:36ldleworkand then react has a ReactDOM backend which effectuates the virtual dom onto the real DOM
08:33:52ldleworkbut what's neat is there's nothing saying that the virtual dom has to render out to the browser DOM api
08:34:07ldleworkso you can make a node app that renders to the browser, or say a curses interface
08:35:01filwitso in FRP there is not defined mechanism for user-actions to mutate data? if a list is re-ordered for example, the control just arbitrarily submits those data changes, or is there a model it it like MVVC?
08:35:18filwitto be honest, I kinda like that idea more... half the time MVVC is complete overkill...
08:35:44filwit(list re-ordered by user)
08:35:54ldleworkWell, you attach code to those handlers, which mutate the data, which causes the entire virtual dom to be reconstructed
08:36:03ldleworkthe difference between the old virtual dom and the new virtual dom is computed
08:36:11ldleworkthe specific difference is applied to the live dom
08:36:21ldleworkso specifically only the elements needing to change are re-rendered
08:36:37ldleworkvirtual dom: cheap
08:36:40ldleworkreal dom: expensive
08:38:04filwitokay i see.. thought rebuilding/comparing the entire DOM doesn't actually sound as efficient as updating data per-control
08:38:09filwitthough*
08:38:43filwitbut maybe they have some clever way to do it fast (eg, it only rebuilds the entire DOM in theory)
08:41:55filwiti might take a look at it later, but honestly I'm trying to move away from that kind of work in general.. I really want to get a job as a game-developer for some company and move more towards that career path.
08:42:18ldleworkit rebuilds the virtual dom
08:42:27ldleworkthe virtual dom is just abstract objects representing the real dom
08:42:40ldleworkfilwit: work on dadren with me
08:43:37ldleworkI'm building a huge data-driven open-world rougelike game in which I hope to have lots of emergent interactions from all of the stuff in the game.
08:43:42filwithaha, paid work? cause I'm between gigs and looking for real work, not just hobby project.
08:43:56ldleworkWell how do you expect to convince anyone to pay you?
08:44:04ldleworkHave you worked on any games before?
08:44:39filwityes, two small games (Unity3D and our own internal C# SDK)
08:45:03ldleworkfilwit: then let's go to steam
08:45:11ldleworklike everyone else
08:45:14ldleworkdo you have a job?
08:45:22filwitand I've been doing game-dev stuff since I was very young (eg, writing OpenGL/DirectX shader stuff, etc)
08:45:25*yglukhov joined #nim
08:45:27ldleworkSame.
08:46:06filwitbut I was mostly just joking, I didn't actually think you where looking to hire anyone, if you are, I would be very interested in applying (especially if it's Nim code)
08:46:18filwitand no, I don't currently have a job
08:46:35filwit(handing out resumes this week)
08:46:50ldleworkI'm not hiring anyone. I work a fulltime job at Docker. But I have written a number of games and am a capable programmer. If I met another programmer such as myself, I could see myself collaborating seriously to get a game onto steam.
08:46:59ldleworkBut if you're looking for a real gig, that's something else.
08:47:14filwitokay I see
08:47:41filwiti would still be interested in the future maybe, but right now I have to focus on getting more income
08:48:04Varriount_Hi guys!
08:48:05ldleworkyes, it is nice to have a livelyhood
08:48:10*Varriount_ is now known as Varriount
08:48:19ldleworkfilwit: I wish you the bestestest of luck in that regard
08:48:48filwitldlework: thanks!
08:48:54filwithi Varriount
08:48:58ldleworkhi V
08:49:20filwitbtw, I noticed there's a #nim-gamedev.. what do y'all do in there?
08:49:30VarriountIf I made a game (at least, as a learning experience) it would probably be something based off of the Megaman Battle Network games.
08:49:35*yglukhov quit (Ping timeout: 240 seconds)
08:49:47VarriountI loved those games...
08:49:52filwitjust a place to discuss gamedev stuff without bottlenecking #nim?
08:50:16ldleworkfilwit: #nim-gamedev
08:50:23ldleworkoh
08:50:27filwitnever played Megaman games.. but I was always more interested in 3D stuff
08:50:27ldleworktalk about gamedev in nim
08:50:32ldleworkmostly me talking about dadren development
08:50:50filwitldlework: where are you on that project? it sound really cool
08:51:21ldleworkI have the json-driven ECS complete. I have tileset support. Basic scene management. I'm working on a streaming chunked tilemap and camera system now.
08:52:22ldleworkWould love any kind of collaboration
08:52:33ldleworkI have no deadline and am just tinkering when I find myself motivated
08:52:40ldleworkAnyone like that is welcome
08:52:54filwithmm.. cool. Does your ECS use continuous memory, btw? I'm not sure if you mean "json driven" as in "stores json objects per component" or "loads jsons files and builds components"
08:53:14ldleworkthe json defines entity models or 'templates'
08:53:29ldleworkIE, a definition of some group of components and their default values, with a name
08:53:32ldleworkso I can say
08:53:42ldleworkhey entity manager make me a "death ship, over here"
08:53:54ldleworkwell the quotes are strange there but you get the point
08:53:56ldlework:)
08:54:21ldleworkbut no the ECS is not optimized at all
08:54:30*desophos quit (Read error: Connection reset by peer)
08:54:37ldleworkI use Tables right now because there's no reason to preoptimize
08:54:41Varriountfilwit: What do you mean by 'continuous memory'?
08:55:00ldleworkI assume they mean "arrays of homogenous component instances"
08:55:09filwitokay i see, that's similar to what I'm doing, but I don't have much of the JSON loading/storing done (i have a basic version working, but it doesn't support everything I need and my component model recently changed, so I have a lot to do here)
08:55:15filwit^ ldlework
08:55:18ldleworkan array of all the Position components, an array of all the Velocity components, etc
08:55:35ldleworkfilwit: why should we compete?
08:55:37ldleworkjust join me
08:55:42ldleworkwe'll get much much futher
08:56:29ldleworkthere's so much to do, to think of duplicating efforts it makes me a bit nauseous
08:56:42filwitVarriount: 'continuous memory' = array of object not ref-object.., eg, all memory for the components are inline which prevents cache-misses when preforming some task over a bunch of them and increases performance (compared to reading an address and doing a lookup per ref for each component)
08:57:10Varriountfilwit: Ah
08:57:12filwitldlework: well I didn't know you where making and ECS until just now :P
08:57:20ldleworkIt assumes that you can process all of the components sequentially anyway
08:57:26ldleworkwhich is only useful for some kinds of components
08:58:02ldleworkand when you start implementing your game, your update loop is not going to be this straight list of clean systems that nicely and orderly iterate over continguous arrays of components updating them
08:58:19filwitldlework: but I'd love to collaborate on work like this in the near future, I have a project that I'm cleaning up right now that I'll put on github soon.. after that maybe we can compare and talk about joining forces..
08:58:32ldleworkfilwit: okay
08:58:34VarriountI can't help thinking that this is where Java and Python really takes the hit for game development - Since everything is a ref, you can't optimize for cache hits/misses.
08:59:09ldleworkPython takes a hit because every attribute access is a massive function call
08:59:22ldleworkand every function call is a massiver function call
09:00:08filwitin Python all objects are basically tables.. so not only would your component objects be non-continuous, but every field inside them would be as well...
09:00:26Varriountarnetheduck: By the way, the LLVM dynlib on windows is 'LLVM.dll'
09:00:45Varriountfilwit: Pretty much.
09:01:11ldleworkfilwit: well I guess hit me up sometime then
09:01:13filwitsame for Javascript, although with these languages you can "hack" them and basically make your own memory management using a bit array of bytes or something and storing object in it
09:01:31federico3Any epub available with the docs from the new release?
09:04:01filwitldlework: will do, gotta get a job first, then fix up my game-engine project a bit more (i have a couple goals to meet before i put it on github), then I'll make a forum post about it or something and we can compare/collaborate then.
09:22:01*yglukhov joined #nim
09:26:19*yglukhov quit (Remote host closed the connection)
09:32:30*yglukhov joined #nim
09:40:56*gour joined #nim
09:43:32*endragor quit ()
09:45:14*endragor joined #nim
09:47:31*yglukhov quit (Remote host closed the connection)
09:49:17*yglukhov joined #nim
10:09:37*yglukhov quit (Remote host closed the connection)
10:10:12*yglukhov joined #nim
10:13:01*yglukhov quit (Remote host closed the connection)
10:13:35*yglukhov joined #nim
10:15:01*sheerun joined #nim
10:22:52*darkf joined #nim
10:29:07Araqer ... def- do you have repo access?
10:29:16Araqhow come I don't know?
10:29:22*yglukhov quit (Remote host closed the connection)
10:29:26*sheerun quit ()
10:29:30Araq(it's fine, I'm just wondering)
10:29:48*sheerun joined #nim
10:34:59*yglukhov joined #nim
10:38:18filcucis it more idiomatic create or init as a name for initializing the field of an object. Basically when using inheritance where the subclass class the parent initialization proc
10:38:33filcuc*call*
10:40:52filwitfilcuc: i believe it's 'init' for regular value objects, and 'new' for ref-objects. There is a 'create' proc in system which allocates unsafe ptr types on the heap, so I wouldn't call it 'create'
10:42:21filwiteg: `let x = initFoo(..) # returns value object` ... and: `let y = newFoo(..) # returns ref object`
10:45:41filcucfilwit: but the proc i want doesn't return anything :| . It's just the call to the base object type initializing proc.
10:46:32filcucfilwit: in other words. type A = ref object of RootObj | type B = ref object of B | newA(): A | newB(): B
10:47:04filcucinside newB() i would like to call the proc of A that initialize its fields
10:48:05filcucmy question it's if there's a proper name for this proc, given that as you explained init is used for objects and new for ref objects
10:48:56*Matthias247 joined #nim
10:49:50filwitfilcuc: I'm not sure if there's a idiomatic naming convention for that exact scenario (there might be).. personally I always call that sort of thing 'setup', but 'init' makes just as much sense
10:52:44filcucfilwit: setup is a good one
10:52:44*dashed joined #nim
10:52:50filcucfilwit: thank you ;)
10:54:49*yglukhov_ joined #nim
10:54:49*yglukhov quit (Read error: Connection reset by peer)
11:01:57Araqfilwit: I think your macro skills exceed mine :-)
11:02:18Araqnot sure I would have come up with http://forum.nim-lang.org/t/2006/2
11:02:25filwithaha, i doubt that very much
11:03:16filwitand i was just looking at thinking... damn I should have used `macros.newTree(...)` instead of `newNimNode(...).add(...)`
11:04:39*TheManiac is now known as Max
11:05:08*Max is now known as Guest33022
11:06:00*M-max1 is now known as TheManiac
11:06:14*Guest33022 quit (Quit: leaving)
11:07:19AraqnewTree is pretty new though
11:07:51filwitis it? i just saw someone on the forums use it and I was think "how have I not know about this?"
11:08:10Araqsince 0.11 or 0.12 maybe
11:09:06*derka joined #nim
11:09:20filwitvery good addition... i should really contribute some PRs to the macros lib.. i use it a ton and there are some missing construction functions i use a lot, plus some missing features of the exist ones (eg, `newProc` doesn't take pragmas)
11:18:28*derka quit (Ping timeout: 248 seconds)
11:19:52*gokr joined #nim
11:20:54gokrAraq: I am using c2nim and wondering how to do the mangles for uint32_t etc...
11:21:29gokrIf I am running c2nim on many header files, what's the smart way here?
11:22:02filwitvery good addition... i should really contribute some PRs to the macros lib.. i use it a ton and there are some missing construction functions i use a lot, plus some missing features of the exist ones (eg, `newProc` doesn't take pragmas)
11:22:15filwitwhoops, shit..
11:22:33filwitalt-tabbed into this instead of the terminal..
11:23:07*jaco60 joined #nim
11:24:23gokrFor the insatiably curious, I am testing to get Nim going on a MediaTek Linkit ONE.
11:24:42gokrSo I want to wrap Arduino libs, and also specific libs from MediaTek.
11:36:15def-Araq: yes, I do. no idea, was never announced to me, I just noticed one day.
11:37:36*yglukhov_ quit (Read error: Connection reset by peer)
11:37:36*yglukhov joined #nim
11:54:32*yglukhov_ joined #nim
11:54:32*yglukhov quit (Read error: Connection reset by peer)
11:54:34*gokr quit (Quit: Leaving.)
11:57:11*yglukhov_ quit (Read error: Connection reset by peer)
11:58:59*arnetheduck quit (Ping timeout: 264 seconds)
12:00:36*arnetheduck joined #nim
12:01:58*yglukhov joined #nim
12:05:43*endragor quit (Remote host closed the connection)
12:11:22*gokr joined #nim
12:13:16*gokr quit (Client Quit)
12:13:16*yglukhov quit (Read error: Connection reset by peer)
12:13:19*yglukhov_ joined #nim
12:15:47*yglukhov_ quit (Read error: Connection reset by peer)
12:22:13*junw joined #nim
12:25:26*yglukhov joined #nim
12:34:13Araqgokr: use a config.c2nim file and pass that to every c2nim invocation
12:34:39Araqthat config.c2nim can #mangle uint32_t or #def it
12:41:51*endragor joined #nim
12:46:57*FreezerburnV joined #nim
12:58:23*lompik joined #nim
13:22:49filwitAraq: how expensive is getType() on the VM?
13:23:03flyxin the system.html documentation, all links to „exception hierarchy“ seem to be broken
13:23:46flyxand in manual.html, in the exception hierarchy, OutOfMemoryError is listed, but it's actually named OutOfMemError
13:25:03flyxshould I open an issue for that?
13:25:25filwitAraq: for instance, which would be faster: a macro which uses getType() to determine if a type is ref, or just outputs a `when T is ref: ...` ?
13:26:17filwitActually, Nim always outputs compile-times so I guess I should just benchmark this myself.. nevermind
13:27:39*endragor quit (Remote host closed the connection)
13:29:18*Egon_ joined #nim
13:30:00*endragor joined #nim
13:32:38*Egon_ quit (Client Quit)
13:33:25*gokr joined #nim
13:35:10*endragor quit (Ping timeout: 276 seconds)
13:41:27*Egon_ joined #nim
13:41:48*yglukhov quit (Remote host closed the connection)
13:42:50*Egon_ quit (Client Quit)
13:43:40*yglukhov joined #nim
13:43:59*petercommand joined #nim
13:44:04*petercommand left #nim (#nim)
13:44:13*junw_ joined #nim
13:47:50*junw quit (Ping timeout: 272 seconds)
13:51:01AraqgetType should be slower
13:52:21*sheerun quit ()
13:54:29*Mgeorge joined #nim
13:54:53*Mgeorge is now known as Guest47588
13:55:27filwitAraq: k, thanks
13:56:08*Guest47588 quit (Client Quit)
13:57:34*toaoMgeorge joined #nim
14:12:27gokrAraq: So, yeah, I was just wondering if I could pass some "pre file" using a specific option to c2nim but yes, of course, I can pass more than one file. Duh.
14:13:19Araqa .c2nim file is a "pre file"
14:13:51*skyfex joined #nim
14:14:17gokrEhm, "config.c2nim" ok, so... is this a specific file format or... is it described in the manual?
14:14:48gokrOr do I just fill it with the same stuff I would put in the #ifdef C2NIM sections?
14:14:59*gokr checking c2nim manual again...
14:16:00*yglukhov quit (Remote host closed the connection)
14:18:13gokrAraq: Ok, nevermind. I found you explaining this in the IRC log back in july.
14:18:23gokrSo the name is just a convention.
14:18:35gokrCool.
14:19:32*Dildosan joined #nim
14:25:13*yglukhov joined #nim
14:25:37AraqI guess I need to update the docs lol
14:25:54Araqit's the same stuff you would put into #ifdef sections
14:33:28gokrright
14:43:03*darian joined #nim
14:43:50*junw_ quit (Ping timeout: 245 seconds)
14:44:25*filcuc quit (Quit: Konversation terminated!)
14:48:07filwithmm... i just realized I could easily make a macro which in an objects generic fields from the constructor parameters... that's interesting..
14:48:23filwit*infers*
14:50:05*skyfex quit (Read error: Connection reset by peer)
14:55:44*darian quit (Quit: Page closed)
15:01:24*StarBrilliant joined #nim
15:01:48*FreezerburnV quit (Ping timeout: 252 seconds)
15:03:19*yglukhov_ joined #nim
15:03:19*yglukhov quit (Read error: Connection reset by peer)
15:18:12*emery joined #nim
15:19:26*antoniomo joined #nim
15:31:56*arnetheduck quit (Ping timeout: 240 seconds)
15:33:03gokrAraq: Idiotic question. So... dynlib, that's for so/dlls, but what about static libs?
15:34:05Araqyou can either use #header or do nothing.
15:34:29Xeis it normal for nim's file handling stuff to eat tab characters?
15:35:01Araqif you do nothing, it frees you from being source compatible with the C headers which is usually more of an advantage than a disadvantage
15:35:36Araqthe codegen then generates the proc headers and you need some --passL logic to pass the static libs to the linker
15:35:40AraqXe: no.
15:35:59Xeokay, because I think I am seeing that
15:37:12Xeit might be jester though
15:37:25*Matthias247 quit (Read error: Connection reset by peer)
15:39:00Xehttps://git.xeserv.us/xena/twtxtlist/src/master/src/twtxt.nim#L12-L13
15:39:10Xeis this the correct way to insert a tab character into a string?
15:40:51Araqsure but you can also do x & "\t" & y
15:42:02Xeit ate the tab in printing and file io
15:42:16Xehttps://twtxtlist.cf/twtxt.txt should have a tab there
15:43:25AraqI doubt it's Nim's or Jester's fault.
15:43:51Araqnimuggest uses the tab as separator too and it works
15:45:05Xehuh
15:49:15*yglukhov joined #nim
15:49:16*yglukhov_ quit (Read error: Connection reset by peer)
15:51:22*yglukhov quit (Read error: Connection reset by peer)
15:54:31*yglukhov joined #nim
16:01:59*yglukhov quit (Read error: Connection reset by peer)
16:04:41*yglukhov joined #nim
16:10:04*Dildosan quit (Remote host closed the connection)
16:11:55*cnu- quit (Ping timeout: 240 seconds)
16:14:33*cnu- joined #nim
16:20:01*Dildosan joined #nim
16:27:07*Dildosan quit (Quit: Leaving)
16:30:31*yglukhov_ joined #nim
16:30:32*yglukhov quit (Read error: Connection reset by peer)
16:34:09*sheerun joined #nim
16:34:10*Ven joined #nim
16:40:34*yglukhov_ quit (Read error: Connection reset by peer)
16:44:53*yglukhov joined #nim
16:46:46emerywhat is a good example in nim to test OS support? (something graphical would be nice)
17:01:59*yglukhov quit (Read error: Connection reset by peer)
17:02:22*junw_ joined #nim
17:04:42*yglukhov joined #nim
17:07:10*Trustable joined #nim
17:17:46*yglukhov quit (Read error: Connection reset by peer)
17:21:59*yglukhov joined #nim
17:26:14*derka joined #nim
17:27:49Araqemery: hey welcome. what do you mean?
17:28:43emeryI have hallo.nim running on a new OS but I need a better example
17:30:02emeryc++ system interface to most everything but compilecpp worked -> http://genode.org/
17:30:51*Ven quit (Read error: Connection reset by peer)
17:31:42emeryI would try aporia but we don't have GTK
17:32:27*Ven joined #nim
17:32:36Araqah that's what you mean. hmm, well we have IUP examples, GTK examples, OpenGL examples
17:32:44Araqsomething using Qt
17:32:56Araqstuff that uses SDL2
17:32:56emeryqt would be nice
17:33:11emerysdl would probably be eaiser
17:33:40emeryI would do nimes but it doesn't seem to be working on my gentoo machine
17:33:48Araqnimble search qt
17:34:15Araqlists git://github.com/filcuc/nimqml
17:34:24Araqand usually nimble packages come with examples
17:34:38*yglukhov quit (Read error: Connection reset by peer)
17:34:53Araqnot sure what we've left in the "Nim core" as UI app examples
17:34:53*yglukhov joined #nim
17:36:34emeryI'll just play around with nimble then
17:36:49*yglukhov quit (Read error: Connection reset by peer)
17:40:09*yglukhov joined #nim
17:41:41toaoMgeorgeMay I ask... when do you guys think Nim will reach 1.0 (just curious)?
17:42:55*sheerun quit ()
17:56:43*ephja joined #nim
18:01:17*antoniomo quit (Quit: WeeChat 1.4)
18:03:47*yglukhov quit (Read error: Connection reset by peer)
18:03:54*yglukhov joined #nim
18:11:45*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:15:55*junw_ quit (Read error: Connection reset by peer)
18:16:00*quark1 joined #nim
18:19:52*yglukhov_ joined #nim
18:19:52*yglukhov quit (Read error: Connection reset by peer)
18:22:23*yglukhov_ quit (Read error: Connection reset by peer)
18:27:19*Matthias247 joined #nim
18:28:20*yglukhov joined #nim
18:29:56*Varriount quit (Disconnected by services)
18:29:56*Varriount_ joined #nim
18:37:20*yglukhov_ joined #nim
18:37:20*yglukhov quit (Read error: Connection reset by peer)
18:40:23*yglukhov_ quit (Read error: Connection reset by peer)
18:50:12*yglukhov joined #nim
18:54:47*yglukhov quit (Ping timeout: 264 seconds)
18:55:02*matkuki joined #nim
19:04:42*sheerun joined #nim
19:09:24matkukiAnyone familiar with Chipmunk2D?
19:10:08ldleworkmatkuki: heh still struggling with that?
19:11:01matkukiIdlework: Almost done updating it. I'm getting some very small angles with the 'getAngle' procedure and I don't know why?
19:13:00matkukiHere is the working version: https://github.com/matkuki/nimrod-chipmunk
19:13:02matkukiEverything except the sdl_playground.nim example is working.
19:19:14ldleworkSorry I'm in no condition to help atm
19:21:17ldleworkgot my own mysteries
19:21:24ldleworkLike, wtf does: hatchet.nim(44, 18) Error: invalid type: 'GeneratorType' in this context: 'proc (app: App): GameScene'
19:21:26ldleworkeven mean
19:22:57matkukino idea
19:23:45ldleworkI feel like I should just ignore concepts all together
19:26:10ldleworkAraq: am I using concepts wrongly? https://gist.github.com/dustinlacewell/078ced7f6edd6be0a9f7
19:26:29*mat4 joined #nim
19:26:31mat4hi all
19:26:35ldleworkhi mat
19:26:49matkukiHey BlaXpirit, thanks for telling me about the 'csfmlNoDestructors' switch, that fixed everything!
19:26:56matkukihi mat4
19:28:01BlaXpiritmatkuki, yeah but now watch the process eat more and more memory without end
19:29:11mat4Araq: How does Nim support contract programming (if at all) ?
19:30:20mat4(I mean beside assertions)
19:30:27Araqmat4: there is only 'assert' plus what you can come up with via Nim's meta programming facilities
19:30:52matkukiBlaXpirit: Nope, holding steady. https://github.com/matkuki/nimrod-chipmunk planets.nim example.
19:31:49Araqldlework: yes but how come
19:31:52Araq TreeGenerator* = object
19:31:52Araq entities: var EntityManager
19:32:01Araqdoes compile? cause it shouldn't
19:32:06ldleworkheh
19:32:08ldleworkit does
19:32:18ldleworkI can update my compiler but its only a few weeks old
19:32:56ldleworkAraq: I can commit all the code to a branch if you want
19:33:54Araq GeneratorType[TileType] = concept cg
19:33:54Araq newChunk(cg, int, int) is Chunk[TileType]
19:34:01Araqyou need to use
19:34:07Araq var x: int
19:34:14Araq newchunk(cg, x, x) is ...
19:34:33Araqbecause 'int' would be newChunk gets 2 typedescs which is clearly not what you want
19:35:41ldleworkAs a special rule providing further convenience when writing concepts, any type value appearing in a callable expression will be treated as a variable of the designated type for overload resolution purposes, unless the type value was passed in its explicit typedesc[T] form:
19:35:47ldleworktype
19:35:50ldlework OutputStream = concept s
19:35:51ldlework write(var s, string)
19:35:54ldleworkI was just mimicing this example
19:36:19ldleworknewChunk's signature is (GeneratorType[TileType], int, int) so that's why I wrote that.
19:37:16ldleworkSo you have to pass actual values when calling a proc inside of a Concept?
19:38:58ldleworkbtw, when I remove the "var" from the structure type declaration, I get:
19:39:01ldleworkhatchet.nim(42, 32) Error: type mismatch: got (EntityManager, string)
19:39:03ldleworkbut expected one of:
19:39:05ldleworksystem.create(T: typedesc, size: Positive)
19:39:07ldleworkentities.create(em: var EntityManager, tmpl: string)
19:39:51ldleworkBecause I'm calling it with "gen.entities.create(...)"
19:40:31ldleworkwhere entities is a field on gen
19:43:50Araqis that still in the manual?
19:44:03Araqneed to remove it, that's not how it works anymore
19:44:05ldleworkyeah
19:44:08ldleworkoh?
19:44:22ldleworkIt doesn't say how to express proc constratints otherwise
19:44:33AraqI just told you.
19:44:37ldleworkI had no inkling that you have to create a useless variable just to pass it to the proc
19:44:51ldleworkSure I'll try it
19:44:54Araq"further convenience" my ass when the feature is hardly usable in the first place
19:45:14ldleworkwell that is a far nicer way to express it
19:45:30Araqthat's just a template away anyway
19:46:06Araqtemplate oftype(t: typedesc): untyped = (var x: t; x)
19:46:15Araq write(oftype(string))
19:46:35ldleworkSo you're saying it would be trivial to maintain as syntax.
19:46:51Araqno, quite the opposite
19:47:06ldleworkthat its trivial for everyone to have this template in their codebase
19:47:58Araqno, I am saying that we could eventually introduce such a helper
19:48:19ldleworkoh gotcha.
19:48:31Araqbut it would always be explicit because further conflation of typedesc[T] with T is misguided
19:48:43Araqand typedesc is already a clusterfuck to support in the compiler
19:49:36ldleworkSorry to hear its so complicated. It does allow for nice expressions of things.
19:49:50Araqand it took years until we read about it in the literature and to learn how its type theory works
19:50:06ldleworkYou mean treating types as values?
19:50:49AraqI mean what typedesc[typedesc[T]] should mean
19:51:16ldleworkah
19:51:50ldleworkSo i guess I'm just hung up on this line: GameTile(entity: gen.entities.create("tree").id)
19:52:05ldleworkwhere its complaining that I'm passing a non-var 'entities' to create()
19:52:18ldleworkthat's why I put 'var' in the field declaration for the generator
19:52:39ldleworkdo I have to do `var x = gen.entities; x.create(...)`
19:53:09ldleworkhmm doing that just gets me, hatchet.nim(45, 18) Error: invalid type: 'GeneratorType' in this context: 'proc (app: App): GameScene'
19:53:11ldleworkagain
19:54:02Araqoh yeah that also cannot work :P
19:54:08Araqa concept is not an interface
19:54:16Araqyou cannot store it in an object
19:54:20ldleworkit sure seems like one
19:54:23Araqit has no runtime representation
19:54:28ldleworkoh I don't want to store it..
19:54:34Araqit's just a fancy generic constraint
19:54:43ldleworkIsn't that how I'm using it?
19:54:49Araq Tilemap*[TileType] = ref object
19:54:49Araq chunk_width, chunk_height: int
19:54:49Araq chunks: Table[Point, Chunk[TileType]]
19:54:51Araq generator: GeneratorType[TileType]
19:55:12Araqthat surely stores it in the Tilemap
19:55:12ldleworkYes, I only want to store T's on a generator field
19:55:24ldleworkwhere T is T: GeneratorType[TileType]
19:56:39*yglukhov joined #nim
19:58:46Araqspeaking of which ... can we replace 'method' with Go-like interfaces in the language and call it a day? anybody who wants to implement that?
19:59:06ldleworkoh my god
19:59:18toaoMgeorgeYes
19:59:39ldleworkthe death of nim :(
19:59:43AraqI'm tired of explaining 'concept' to people. Or 'method'.
20:00:17ldleworkAraq: it wasn't that my field type was specified as GeneratorType
20:00:25*dashed quit (Quit: Connection closed for inactivity)
20:00:26ldleworkit was that I did not add GeneratorType to the brackexpr of Tilemap
20:00:41ldleworkonce I added a second generic param to Tilemap[TileType, GeneratorType] it worked
20:01:08ldleworkI'll be super sad if methods go away.
20:01:18Araqinteresting.
20:01:30*yglukhov quit (Ping timeout: 272 seconds)
20:01:44ldleworkYou can't express crap with go interfaces.
20:01:52ldleworkEverything interesting ends up as interface{}
20:02:00ldleworkwhich is truely useless.
20:02:07ldleworkmight as well use python
20:02:19AraqI think since we have generics they would be much more useful for us
20:02:19*yglukhov joined #nim
20:02:39ldleworkI seems strange to me that method are the hard thing to maintain.
20:02:39Araqas well as easier to understand for people.
20:02:48ephjaand then silly casts
20:02:54ldleworkexactly
20:02:57ldleworkits so nasty
20:03:10Araqwell don't get hung on "Go-like" too much
20:03:13ephjaI don't remember many details, but it seemed ridiculous
20:03:20ldleworkI'm also suspect that methods are these things that people don't understand
20:03:25ldleworkThat have to be continuously explained.
20:03:27AraqI just meant structural typing
20:04:10Araqwell I guess it's easy to say "it will be easier" when I don't even have any kind of spec in my head
20:05:30ldleworkMethods are super nice, if I can't express my relationship at compile-time methods are always a runtime solution that seems connect up the gap I cross at compile time.
20:05:53ldleworkThat they are supported by the language and I don't have to do anything special when I cross that bridge is like having running water.
20:07:36ldleworkheh doh
20:07:37ldleworkhatchet.nim(50, 30) Error: type mismatch: got (int literal(10), int literal(10), TreeGenerator)
20:07:39ldleworkbut expected one of:
20:07:42ldleworktilemap.newTilemap(chunk_width: int, chunk_height: int, gen: GeneratorType)
20:09:12*brson joined #nim
20:13:19ephjacan the usual construction pattern be used, when the type in question is expected to have descendents? "proc newBaseClass(): BaseClass"?
20:14:04ephjaor must this pattern be used: "proc init(o: BaseClass) = o.foo = ..."?
20:15:51Araqinit for obvious reasons (BaseClass has a different size)
20:15:59ephjaright
20:16:14ephjawe did talk about a potential constructor pragma before. I wonder if it's doable with a macro
20:17:08ephja"let x = initFoo()" calling initFoo(foo: var Foo), but the 'let' would have to be dealt with, though the call site can be modified
20:19:31*sheerun quit ()
20:20:15toaoMgeorgehttp://blog.rust-lang.org/2015/05/11/traits.html
20:21:07toaoMgeorgeWhat do you think of those?
20:21:29filwit+1 for keeping methods around.. i use them sparingly, but i *do* use them.. if anything, 'interfaces' should just be built with Nim's meta-programming and added as part of the standard lib (though to do it properly you might want some kind of 'concept' reflections/getType equivalent)
20:21:51gokrI use methods a lot.
20:22:55ldleworktoaoMgeorge: If I remember correctly Rust never got like default implementations or something was missing forever and then they decided to never implement it.
20:23:10ldleworkWhich made traits not a full solution for me. But I forget what it was at this point.
20:23:19ldleworkDefault method implementations? Something like that.
20:24:22gokrWhat came of fowl's stuff?
20:24:27ldleworkI think it was the eventual reason why I left Rust and eventually found Nim. It simply implemented methods (which allowed me to get what I was trying to do, done) and then I was eventually sucked in by the meta programming.
20:25:09ephjaI dunno if that would get us closer to a more general allocation scheme (new(Foo, arg...) and init(Foo, arg...) allocating on the heap and stack respectively, and then invoking the same initialization proc)
20:25:23ephjainheritance might complicate such an interface
20:26:18gokrIMHO methods is a very important "bridge" for us Smalltalk/Python/Ruby people. Otherwise the dynamic OO story is incomplete for us.
20:26:20filwitpretty sure in Rust traits double as both an ad-hoc generic specialer and 'interface' (fat pointer to vtable & instance) when used a struct field... but that was awhile ago I heard that and can't remember where from now..
20:27:54toaoMgeorgeMmh
20:27:55AraqtoaoMgeorge: ah yeah that design ... doesn't really fit Nim. but it's nice.
20:28:10gokrAlthough I would be interested to hear how "Go like interfaces" would work.
20:28:11ephjafilwit: that's correct IIRC
20:28:47ldleworkI think the general pattern of why I need this stuff is because I want to implement some type L that accepts some type U. Then the way I want to use L is by importing it, passing it something that's *like* a U, a U' and then getting that U' back later as a U'.
20:28:57ldleworkBut I don't have control of L at all.
20:29:21ldleworkWith methods, this pattern just works everytime.
20:29:38ldleworkGenerally, I want U to provide me most of the implementation.
20:29:47ldleworkAnd I want to customize that implementation with U'
20:29:56Araqldlework: if I ever design a new PL, it will likely be "dynamically typed" and use a specializer to get efficiency back and a theorem prover to get the type safety back
20:30:07gokrAraq: Wow.
20:30:20ldleworkI just want to write reusable code.
20:30:20Xehow do I depointer a pointer in nim?
20:30:39Araqit sucks that every aspect ends up in the type system
20:30:41ephjaAraq: and the performance?
20:31:12mat4ldlework: What is your opinion about functional programming ?
20:31:39ldleworkmat4: I'm all for it. I try to use it wherever I can identify places to do so.
20:31:47*sheerun joined #nim
20:31:52ldleworkI love building up a vocabulary tiny atomic partials.
20:32:03gokrephja: Performance is fairly orthogonal to dynamic/static typing - contrary to most people's belief. Dynamic typing needs smarter runtime support though.
20:32:07ldleworkBut functional programming isn't a magic wand that makes the usecase I just described go away.
20:32:19Araqcurrently type systems have to deal with too many conflicting goals
20:33:06filwithonestly I think the best theoretical "concept" design for Nim would be to have two types, much like it has two meta-programming procedure types... eg, a 'trait' which is a structurally iteratable type which can be used as both ad-hoc generic & interfaces (just like Rust), and our current 'concept' which gives you the full power to specialize ask questions (but can't be iterated over easily)
20:33:47Araqfowl worked on a macro that turns a concept into an interface
20:33:56Araqthat's the right thing for Nim right now
20:34:07ephjaldlework: have you tried to define concepts with procs containing var parameters yet?
20:34:16gokrAraq: That was the thing I was asking status about.
20:35:01Araqwell fowl is not exactly active these days
20:35:11filwitAraq: well that would be perfect of course, but I don't see how it's possible.. i mean a concept can pretty much ask any question, so how can you figure out which procs are available?
20:35:32Araqyou inspect the concept in the macro and bail out if you cannot handle the construction
20:35:43Araqpretty easy.
20:37:16Araqgokr: I disagree. The data type layouts that static typing produces are just more or less impossible to produce with a dynamic language.
20:37:16filwityeah but that seems bug-prone.. ie, the concept could behave differently for an interface than for a generic-specalizer.. though I suppose since the interface version would always be "sub set" of the concept's features it might not actually cause problems..
20:37:41Araqcase in point: JavaScript has superb JITs
20:37:47Araqand yet got typed arrays anyway.
20:38:19gokrI did say "fairly" :)
20:38:27ephjalet's get cracking with nim 2 then :p
20:38:37filwitLOL
20:38:58ephjaI'll be in charge of delegation
20:39:15gokrOf course its an advantage to know everything at compile time. But there are things that you still can do better with adaptive optimization.
20:40:14filwitgokr: yeah but those optimizations can be applied to static, JIT compiled languages much easier
20:40:32*filwit hates dynamic languages
20:40:37gokrfilwit: Is that really a truth, or just something you "think"?
20:40:49filwitsomething I think
20:41:18gokrStrongtalk for example, which had static typing - didn't use it at all to get its superior performance at the time. It was all PICs and adaptive optimizations.
20:41:42gokrThe stuff that was later commercialized as Hotspot tech - and bought by Sun and stuffed into the JVM.
20:41:55gokrSelf was first though.
20:42:21gokrAraq: Are there statically typed langs that do similar stuff at runtime?
20:42:29gokrI am not aware of any I think.
20:42:46filwitI don't know anything about the tech you just brought up, but I don't see how a dynamic language could gain any extra performance over a static language just by adding JIT (which can be applied to both)
20:43:12gokrfilwit: The difference is not purely JITing - the difference is adapting to runtime circumstances.
20:43:17filwitof course, I would be very interested to be proven wrong on that point
20:43:29gokrA pure JIT doesn't really do that.
20:44:03gokrIts a given that a "smart enough" adaptive runtime can beat a static compiler - it simply has more info.
20:44:37mat4that's right
20:44:54filwitokay sure, if your code made heavy use of tables, having a mechanism which built those into inline memory structures and treated them as structures on-the-fly could be very useful... but even then you could, theoretically, do the same thing in a static language with a specific library
20:44:58gokrIts just damn hard to write such adaptive runtimes.
20:45:19filwitbut yeah, that might need compiler support to be "easy"
20:45:29ldleworkWe don't need a new language
20:45:32gokrfilwit: The difference is that in runtime you can see the data - like say a loop - and decide that, hey, I can optimize for this specific case.
20:45:34ldleworkWe just need to not throw away methods
20:45:38ldleworka feature we already have
20:46:25ldleworkmethods + meta-programming + macros == everything I've ever needed to express anything I've ever wanted to express
20:46:46gokrI think for example that the JVM is beating C++ these days on certain benchmarks. I suspect that is due to the adaptive optimizations.
20:47:16filwitgokr: but what you said is somewhat reverse of what you're suggesting since the runtime (in a dynamic language) has to first proof the type structure at runtime before it can optimize that loop
20:47:47gokr(duh, Java is of course a case I didn't even consider. Statically typed with heavy adaptive opts.)
20:48:22filwitand since 90% of the time your types don't randomly change structure, it doesn't make sense not to help the compiler out in the optimization step
20:49:11gokrfilwit: Not sure what you are saying. And I am no expert - but I do *know* adaptive optimizations at runtime can beat statically compiled code. Its not surprising either.
20:50:40filwitI'm not saying they can't, but "adaptive optimizations" imply a lot.. I was specifically talking about data structures in a statically typed vs dynamically typed language..
20:53:30mat4a JIT compiler has the advantage of accessible runtime state(s) for optimization. A Side effect of this is the possibility to tag storage locations with specific data formats. A static compiler can't use the dynamic program state for optimisation beside runtime interpretation
20:55:00mat4which transform the static compiler in fact to a special case of inefficient JIT compiler
20:56:22filwityeah, I've always thought JIT was theoretically better than AOT compilation... I wasn't trying to imply anything different by saying "static language" (i guess that term is far too broad)
20:57:50*Trustable quit (Remote host closed the connection)
20:58:52filwitanyways, gotta do other stuff for a bit, bbl
20:58:56mat4I think the real difference lays in the possibility of a language environment supporting dynamic code transformation (programs which extend or modifcate there own code for example)
20:59:09mat4^modificate
20:59:38Araqmat4: the problem with "adaptive" optimizations that e.g. infer "this is an array of plain old ints" is that they use the program's history
20:59:58Araqand so need to shield against a future where everything is possible anyway
21:00:00filwitmat4: even if the compiler can do that for optimization, you would still only want to do it once and cache the result (unless your hardware is dynamic of course)
21:00:15Araqwith static information you know the *future* in addition to that
21:00:41Araqso you know it'll always stay an int array and need no guard checks whatsoever
21:01:05toaoMgeorgeAraq: where can I find that fowl's work you were talking about?
21:01:34Araqand the last time I checked even LuaJIT doesn't produce vector instructions though there was some talk that it's possible
21:02:37Araqknowing the future is far superior than recording the history.
21:02:41Araq*to
21:02:42mat4Araq: That's language dependent. For a 'pure' dynamic language there is no static state because all definations can change at runtime, which is intended so no demand for protection
21:03:47mat4for this such languages often use external code specification modelling
21:04:40gokrThis article explains some of how Hotspot and similar VMs work: https://clementbera.wordpress.com/2014/01/09/the-sista-chronicles-i-an-introduction-to-adaptive-recompilation/
21:04:55gokrClement writes in an easy to understand way.
21:05:01filwitAraq: to play devils advocate, there is the possibility where a code-base was making heavy use of Tables (objects who's future couldn't be known) and, for efficiency, would compile these into "real" binary objects for specific life-cycles (or something like that... much like Google's V8 Javascript compiler works)... in that scenerio it would be a benefit to have "compiler support" for those data structures over a simple library
21:05:02filwit(because the compiler to could indicate life-spans, etc)
21:05:49Araqruntime adaptive optimizations are very useful no doubt, but they can all be applied to static languages too
21:06:10Araqbut staticness buys you something no "adaptive" technology can buy.
21:06:22Araqwhich is: knowing the future.
21:07:24Araqthe only reason C++ environments have no JIT by now seems to be that there is not much to be gained from it
21:07:50Araqotherwise somebody would start to do it and the others have to follow
21:08:05filwitwell.... there is LLVM which has a JIT
21:08:06Araqsince lots of people are very interested their C++ code runs as fast as possible
21:08:35AraqLLVM started with a JIT to get its funding.
21:09:00gokrtoaoMgeorge: I can't find it, but he is "fowlmouth" on github
21:09:00Araqthat's my impression at least, don't quote me on that.
21:09:36filwityeah, anyways bbl
21:09:43Araqbut that just hardens my point: JIT for C++ is possible but nobody is interested in it
21:10:01Araqclang is a traditional static compiler toolchain
21:10:24gokrAraq: Couldn't in theory statically typed languages end up being written in a "too static" style thus actually *preventing* good adaptive optimization?
21:10:40gokrI mean "programs in statically typed languages".
21:10:46*tstm quit (*.net *.split)
21:10:55mat4in my opinion it makes no sense to write a JIT compiler for languages like C++ because of there static design
21:11:03*tstm joined #nim
21:11:22filwitmat4: both C# and Java disagree with you there
21:11:23gokrIts just a nagging feeling I get often when I read statically typed code... code that basically manually performs the various lookups and matches.
21:12:35Araqgokr: well no, in theory knowing more about a program can't hurt. In practice too many specializations can blow up your instruction cache and your C++ can be slower than your Smalltalk code
21:12:39mat4filwit: Bith languages use AOT compilers, even Google switched to this compilation technique for tehre Java environment
21:12:41filwit"manually performs the lookups and matches" is exactly what a dynamic language does, not a static one
21:12:51gokrfilwit: You missed my point.
21:12:58gokrI think.
21:13:20Araqgokr: so it's the opposite I think. In theory you can't lose. In practice you can. ;-)
21:13:39*matkuki quit (Quit: ChatZilla 0.9.92 [Firefox 44.0/20160123151951])
21:13:47ldleworkgokr: I had the same response as filwit
21:13:49filwitgokr: perhaps.. but I think the phrasing was a bit unclear. "performing" a lookup implies doing more work, which is what a dynamic language has to do
21:13:52gokrSo, take for example this: http://nim-lang.org/docs/manual.html#types-object-variants
21:13:58Araqbut then in practice even Smalltalk systems don't stay small, right? ;-)
21:13:59ldleworkIt seems like when I look at dynamic code, its the one doing all the checking.
21:14:06ldleworkisinstance, hasattr and so on
21:14:21ldleworkgokr: that to me expands out to different functions though
21:14:24ldleworkthat contain no type checking
21:14:27ldleworkwhen I see cased code
21:14:33ldleworksame with generics
21:14:34filwitmat4: sure, AOT with JIT options.. I'm just saying they're not like C/C++ AOT and are statically typed
21:14:51gokrldlework: But it basically is doing polymorphic dispatch - but manually.
21:14:59ldleworkno not manually
21:15:02ldleworkits not doing dispatch
21:15:07ldleworkits expanding it out to different implementations
21:15:12ldleworkwhich contain no dispatch at all
21:15:30ldleworkas if I had written individual distinct implemenations, except I didn't have to do that manually.
21:15:35ldleworkIts the best of both worlds.
21:15:42ldleworkI get to express a generic relationship, but pay no cost for it.
21:15:55ldleworkthat's clearly the superlative case, imo.
21:17:27Araqthere seems to be a misunderstanding here
21:17:29gokrldlework: Ok, you are probably right. I think I misunderstood that part.
21:17:33ldleworkno doubt :D
21:17:47gokrSo that was a bad example indeed.
21:18:05*cyraxjoe quit (K-Lined)
21:18:36mat4filwit: my point is that I can't see any advantage for static compilation in case of dynamic languages or dynamic programming techniques. That's at current a weak point of static compilation. In all other cases interpretation is easier to implement and efficient enough (both in therms of ressource usage and performance)
21:19:11gokrBut... I do get the feeling that a lot of code (in more complex systems) written in statically typed languages tend to end up ... doing workarounds that hurt more than they help. For example, in Java they started misusing XML for EVERYTHING just to avoid recompilation.
21:19:52ldleworkgokr: In Nim you have a great type system, with generics, typeclasses, user-type-classes (not really, do they work?)
21:20:04mat4It's natural to add JIT compilation to an interpreter so the usage of static against dynamic compilation is really a consequence of language design
21:20:10ldleworkAnd then you also have the ability to /directly/ expand parameterized implementations with templates and macros.
21:20:15Araqgokr: which ends up being slower than a solution that stays in JIT'ed Smalltalk all the way, yes
21:20:24gokrAraq: Exact.
21:20:42gokrThat was just what I was trying to say.
21:20:57filwitmat4: yeah I agree with that. You said something about no need for a JIT with statically typed languages above which is what I was responding too.
21:21:04Araqbut that's just a psychological thing, IMO.
21:21:13gokrThere were a number of large systems rewritten in C++ (from Smalltalk) in order to *gain* performance but ended up being DOG SLOWER instead.
21:21:24gokrAnd still - in a micro benchmark C++ will beat Smalltalk.
21:21:35ldleworkWell sure, anyone can implement mud.
21:21:38*yglukhov quit (Read error: Connection reset by peer)
21:21:41gokrSo in larger systems the simple truths dont work.
21:22:01ldleworkGiven infinite resources, you'd be able to build a more efficient system in C++.
21:22:01mat4filwit: ah, ok
21:22:25*yglukhov joined #nim
21:22:32ldleworkSince you could just reimplement smalltalk if you wanted. If it turns out that smalltalk is literally the most efficient solution in this universe.
21:22:59ldleworkI just doubt that, "implement smalltalk in C++" is how you get to the efficiency of smalltalk implementations if you have to use C++.
21:23:05Araqldlework: that cuts both ways, you could implement a C++ compiler in Smalltalk
21:23:28ldleworkSure, but you wouldn't be running the C++ compiler as the solution for your problem.
21:23:35gokrldlework: I am not following.
21:23:39ldleworkYou'd still have to then write the C++ solution to your problem and compile it with your C++ program.
21:23:47mat4one could write a Smalltalk implementation without much effort in assembler
21:24:08ldleworkgokr: I'm saying, given two teams, one using C++ and one using Smalltalk, and given the same task - given infinite resources, the C++ team could always implement the smalltalk team's answer.
21:24:15gokrmat4: There have been several.
21:24:16ldleworkThe implication of that is:
21:24:56gokrldlework: Its a fairly uninteresting statement.
21:25:00ldleworkUnless the most efficeint solution to the problem available in our universe is always modeled by a smalltalk runtime - then C++ seems like it has an inherent advantage.
21:25:06ldleworkNot really.
21:25:29gokrldlework: Its like saying "Well, given enough resources I can do it all better in assembler".
21:25:51ldleworkThe reality where "smalltalk can always produce a more efficient solution" is one in where, anytime you're using C++, you must implement smalltalk in order to produce an equivalent solution.
21:26:01ldleworkThat's clearly not true.
21:26:12ldleworkEven for large programs.
21:26:25ldleworkThat Java people started writing their programs in XML says nothing at all really.
21:26:40Araqanother problem is that the hardware itself is already quite "adaptive". it predicts branches and memory access patterns etc. The moment JITs do better for C++ than C++ would do otherwise the hardware should change and do the same thing the JIT does :P
21:27:16ldleworkThe reason it says nothing at all, is because I'm not inclined to write my Nim program in XML.
21:27:23mat4of course it says that Jave programmers favorite XML against there Java (which I can understand)
21:27:25ldleworkThere is a reason why Nim didn't simply replicate Java's type system.
21:27:33ldleworkhaha
21:27:36gokrldlework: If we are now in the "I refuse to try to even argue reasonably" I am out.
21:27:59ldleworkgokr: I think I'm making a very reasonable low level observation about the argument you were making above.
21:28:07ldleworkI'm not trying to be unreasonable at all. But if the point is confusing I'll drop it.
21:28:29mat4sorry, what was the argument again ? I'm lost in different postings
21:29:06gokrSo you think its interesting to say that... the C++ team can always reimplement Smalltalk, and thus can always "win"? Well, fine, as i said - no point in discussing.
21:29:48ldleworkI thin the premise was, at large enough program sizes, with languages like C++ and Java, you're forced to simply reinvent smalltalk, or die trying with some isnane XML dsl.
21:32:20*yglukhov_ joined #nim
21:32:20*yglukhov quit (Read error: Connection reset by peer)
21:32:38gokrThe simple point I was making (which Araq btw grokked easy enough) is that statically compiled languages, especially when used in large complex systems, don't help that much. This has been seen in practice in history. And I suspect it has largely to do with the "straight jacket" of the type systems causing workarounds and insane code.
21:33:06gokrAnd in fact, performance is often not the main key either. Its maintenance and ability to adapt quickly.
21:33:38AraqWell but to be fair, pleny of large C++ codebases prove the opposite too.
21:33:47mat4as addition: I think that most higher level Smalltalk aren't able to express with Langauges like C++
21:34:09gokrHowever, I do find it very interesting that Araq would contemplate making a dynamically typed language. I had never expected to hear those words :)
21:34:39AraqThere is no evidence the typical AAA game title could have been written in Smalltalk instead.
21:34:45gokrmat4: True, most of those systems engage in meta programming which is obviously not at all easily done in C++.
21:35:45AraqI remember one console title that was programmed in Lisp and they had to rewrite large parts in C++
21:36:15AraqI doubt their Lisp system was just badly designed.
21:36:23mat4I've onced talked to a programmer from IBM which chooses Smalltalk for a really sophisticated and large database product because of its meta- and dynamic programming features
21:37:07gokrmat4: yeah. It's the obvious case. Finance. Large manufacturing systems etc.
21:37:34Araqgokr: well it's just "dynamically typed" as the starting point to get the simplicity. as I said, 2 additional things would be added on top of that
21:37:59Araqone to easily get back the runtime efficiency
21:38:24gokrAraq: I agree, for raw low level performance Smalltalk is not it. Just like Java isn't really either.
21:38:33Araqone to get back type safety and hopefully far exceed the state of the art in this aspect.
21:39:22Araqin other words there would be code, then decoupled from that efficiency annotations
21:39:37Araqand then decoupled from that proof and typing annotations
21:40:17gokri would love to see a language that is malleable and dynamic like Smalltalk - but able to later on be "coached" into really hard performant code, using annotations.
21:40:25gokrIts kinda like what Dart is doing I guess.
21:40:34gokrOr could do.
21:40:37Araqand I think it would throw away any plan to ever do this stunt with incremental compilations.
21:40:40gourgokr: do you still do smalltalk/pharo?
21:41:07gokrgour: For the moment I don't. I spend daytime messing with javascript and what not. And free time I spend on "Ni".
21:41:40gokrAraq convinced me the other day to turn the Ni interpreter stackless - so that is my next task there.
21:42:10gourgokr: Ni is scripting language ala smalltalk?
21:42:18gokrWell... kinda.
21:42:46gokrI got inspired by Rebol actually. Which is very Forth-ish/Lisp-ish in syntax and semantics.
21:43:16gokrSo I hacked up Ni as a Rebol-ish language, but then I started drifting towards Smalltalk by adding keyword syntax etc.
21:43:31gokrIts pure fun. And I think its getting interesting.
21:44:11*yglukhov_ quit (Remote host closed the connection)
21:44:17gokrhttps://github.com/gokr/ni
21:44:45gokrIt does have a REPL, and I just switched to using ... the stuff in Nim that wraps linenoise. So you get history and line editing.
21:45:26Araqoh btw "Even if a software application is big, usually at most 10% of its code is frequently used."
21:46:26AraqUnreal Engine is claimed to have a "flat profile" meaning that after diverse rounds of optimizations they got it to the point where lots of things are equally performance critical
21:46:29gokrgour: But its truly for the ... insatiably interested. :) No solid language manual yet.
21:46:45gourgokr: ok, i got it ;)
21:47:11gokrgour: But do play around if you are interested. It's only about 1100 loc I think.
21:47:23Araqand that doesn't even take WCET into account.
21:47:38gourgokr: well, i've to play with nim first ;)
21:47:44gokrWCET?
21:48:03Araq"worst case execution times"
21:48:07gokrAh
21:48:14Araqimportant for hard realtime stuff.
21:48:20gokryeah
21:48:52gokrmat4: Didn't you play around with some VM thingy?
21:49:00mat4yes
21:49:05gokrHow are things going there?
21:49:10*brson quit (Ping timeout: 250 seconds)
21:49:12AraqI happened to work for such a company, you know. They support hard realtime with Java.
21:49:19gokr(and oh, Ni runs in nodejs btw, that was insane)
21:49:23Araqyou know what they do?
21:49:34gokrNo objects :)
21:49:38Araqthe compile all of the Java code ahead of time.
21:49:41Araq*they compile
21:50:08gokrYeah, I know. In those cases its more important to have predictable performance.
21:50:25mat4gokr: I use it as environment for my processor design
21:50:31gokrAh, cool.
21:51:06gokrAraq: Its not that I am against AOT. I just haven't seen ANY statically typed language matching the malleability and live coding experience Smalltalk offers. I want both.
21:51:34gokrSmalltalk/X can compile AOT too IIRC.
21:51:43gokrBut... never used it.
21:51:55gokrI suspect they do something like you do :)
21:51:59gokr(compile to C)
21:52:25mat4also I'm writing a 'pure' concatenative language at current for my own which is 'pure' dynamic to ease development
21:52:50gokrAh, neat! In Nim?
21:53:29mat4yes
21:54:01gokrmat4: I am right now toying with c2nim-wrapping the Arduino libs.
21:54:42gokrI have a ... MediaTek Linkit ONE that I want to see if I can get Nim (and Ni) going on.
21:54:47mat4that's great news
21:55:27Araqanyway, it's nice to hear you guys actually like methods and want them to stay in the language :-)
21:55:29mat4I hope to have an Arduino like IDE ready soon for my project
21:55:51gokrThe Arduino IDE is friendly enough to show what they hell its doing when compiling. So I am making a Makefile out of that (and other sources on the net).
21:56:39gokrAraq: I like them a LOT. Of course open for alternatives, but don't just remove them because... then you lost me at least :)
21:56:56gokrThe Ni interpreter uses them a lot.
21:57:24Araqwell I have an alternative besides 'interface'
21:57:44gokrAnd I do like the fact that Nim has no "class/traits/interface" group-of-behaviors-concept.
21:57:57gokrIn fact... that inspired me to not introduce it in Ni either.
21:58:15gokrI am gonna try something else crazy for polymorphism in Ni.
21:59:06mat4personally I found no real use for such abstractions. Compile time contract support would be nice however (requires, final etc.)
21:59:28gokrmat4: But you are a Forth guy. :)
21:59:39mat4right
21:59:51gokrWhich I really respect. Forth is the Zen.
22:00:02gokrI love it in theory, but never got around to actually code it.
22:00:23gokrAnd of course... no automatic memory management etc... not really 2016 :)
22:00:23mat4it's mor a philosophy than a language
22:00:38gokrIn Ni I do try to capture some of those values though.
22:00:46gokrFor example, there are no keywords in Ni either.
22:01:28gokrAnd while I don't have a stack for arg passing - it works similarly.
22:03:04*Varriount_ is now known as Varriount
22:03:12mat4Your language is concatenative as I see, for which a stack representation is only an implementation strategy not mandatory
22:03:26gokrAraq: IIRC there is no mechanism today to write Nim code that can analyze a Nim module (the AST) and spit out another Nim module? I mean, without annotating the first module.
22:03:47gokrmat4: Good point.
22:04:17gokrmat4: I ran with threads the other day, that was fun.
22:04:50gokrmat4: Creates a separate interpreter in the spawned thread :)
22:05:12mat4ah yes, I choosed the same approach
22:05:55gokrAraq: For stackless, am I correct that using procvars I can stuff the "next call" into the activation record, and let the interpreter loop use that to dispatch further?
22:06:23Araqthat sounds it would work
22:06:46gokrItching to try it out soon. Doesn't seem that hard.
22:06:48Araqgokr: surely there is a way, but it's a bit ugly with staticRead and parseStmt
22:07:22gokrAraq: Reason I ask is because... it would be super cool to be able to generate glue code for wrapping Nim modules for use in Ni.
22:08:12gokrHas the use case never come up before?
22:08:34gokrOutside of the compiler I mean ;)
22:08:48Araqusually .push myMacro is good enough
22:09:03Araqit's often overlooked that it is possible.
22:09:11Araqin fact ... I'm not sure it's possible.
22:09:15Araqnever tried it :-)
22:09:23gokrEh. ".push myMacro"?
22:09:29Araqit's an accidentical feature if it works
22:10:52Varriount<3 Closures
22:13:50Araqso .. nobody wants to hear my alternative to methods that have never been done elsewhere afaict
22:14:00*Varriount_ joined #nim
22:14:00*Varriount quit (Disconnected by services)
22:14:06*derka quit (Ping timeout: 245 seconds)
22:15:48gokrAraq: I definitely do, just chatted with mat4 a bit :)
22:16:11gokrAraq: Hit us with the cool shit.
22:19:36mat4what are these alternatives ?
22:21:33AraqI'm preparing a gist
22:24:11*Dildosan joined #nim
22:26:41filwiti'm interested in this method alternative
22:28:19*gour quit (Quit: WeeChat 1.4)
22:29:01Araqhttps://gist.github.com/Araq/03629a7e9e4da243c59f
22:29:21Araqthe vtable creations etc can already be done conveniently via a macro
22:29:59Araqbut currently the delegation aspect would require ugly converters and the .delegate(this) is currently quite impossible to achieve
22:30:39Araqthe .delegate pragma is also useful for all kind of wrappers, was a topic on the forum
22:31:33AraqI think D does something very similar with its "alias this" idea.
22:31:49Araqwhich is a way to introduce restricted type converters.
22:32:23Araqbut we extend the idea to get rid of the traditional idea that 'method' needs to be a language builtin
22:33:06*brson joined #nim
22:38:11gokrAraq: I can't say I understand the exact implications. It seems every concrete (instantiated) type will correspond to a unique vtable?
22:39:39Araqwell one implication is that we trade multi methods for traditional methods
22:40:22Araqbut are more flexible in how it's done and need more macros to make it convenient
22:41:11*Demon_Fox joined #nim
22:41:46filwitcan't this basically already be done with a "macro `.`(obj:T, call:string)" ?
22:43:01Araqhmm good question, I like to ignore that overloading of `.` is in the language
22:43:03gokrAraq: Ah, right. Only dispatch on receiver.
22:43:14Araqgokr: exactly.
22:44:38*yglukhov joined #nim
22:45:55*vendethiel- quit (Ping timeout: 260 seconds)
22:46:06filwityeah i know for almost a fact that I could make a macro lib which provides this delegate feature.. you can just use {.pure inheritance.} instead of your {.delegate.} to specify to the `.` macro which fields should be consider for delegation
22:47:54filwiteg: type Delegate {.pure inheritable.} = object; type VTable = object of Delegate ...; type Foo = tuple[vtable:Vtable]; let f: Foo; f.fuzzbuzz();
22:48:56filwitso basically, Araq, you've already made this feature in the language without considering it yet! meta-programming FTW
22:49:32filwitactually, what would be very nice for this type of thing is user-defined pragmas for type fields
22:49:32Araqno, zahary did it.
22:49:39filwitoh, okay
22:50:01Araqand he is usually very aware of what it's possible with the features he put into Nim.
22:50:12*yglukhov quit (Ping timeout: 248 seconds)
22:50:47filwitzahary makes all these features, but I don't think I've very seen him on the forums and only very rarely on #nim...
22:51:18filwitthen again I don't exactly hang out here all too often myself, so maybe I've just missed him
22:52:05Araqwell he made all these features and then left it to me to get them stable :P
22:52:36Araqnot sure I like this division of work.
22:52:48ldleworkI'm surprised methods are hard to support as a language feature
22:53:03filwityeah i feel your pain, but the rest of us love concepts!
22:53:34ldleworka concept doesn't do the same thing
22:53:45ldleworkI cannot recieve default implementations from a concept
22:53:45filwiti was responding to Araq
22:53:47ldleworkoh
22:54:15Araqldlework: well they are not hard to support if people think they are fine the way they are now.
22:54:37ldleworkI would certainly not worry too much about them and I would document their pitfalls.
22:54:43ldleworkThe future is longer than the past, so to speak.
22:55:08*dashed joined #nim
22:55:58Araqbut in an overly complex language I'm longing for things to remove ;-)
22:56:43filwitI accidentally do `Foo(x:-1)` sometimes.. which is a syntactical bug.. and I hate that it is. It's a very minor thing that I rarely run into, but it gets under my skin..
22:57:10Araqhmm? that's ugly, why do you do that?
22:57:48filwiti don't like putting spaces around the ':' in parameters? idk.. i think it groups things together better
22:58:00Araqnot around.
22:58:02filwitbut then I should just learn to get used to the other way to I don't accidentally do that
22:58:11ldleworkfilwit: just after
22:58:12Araqafter the colon, like it's done in English: See?
22:58:55filwityeah, but it groups things better when you've got lots of them.... (foo:123, bar:"234, a,b:2345)
22:59:29Araqor you use postfix unary minus: Foo(x:123.`-`)
22:59:59filwitlol, no haha I'll just occasionally put spaces when I need them, or learn to always do it
23:00:29filwitactually I tried to define a `:-` template (like we have a `..<`) but it doesn't work
23:00:55Araqcolons cannot start an operator iirc
23:01:18Araqso we could support foo:-1 but still ... it's ugly.
23:01:59filwitoh, that must have been recent addtion cause I swear I remember making an example where you could use `x := ...` as a replacement for `var x = ...`
23:03:13Araqhmm true, := is actually in the test suite
23:03:28Araqnever mind, I don't know Nim.
23:03:32ldleworkhehe
23:03:39ldleworknow he listens
23:09:08ldleworkfilwit: are you building a PoC for the "delegate composition" ?
23:09:22ldleworkor "compositional delegate" I guess
23:09:32filwitPoC?
23:09:41ldleworkproof of concept you said you could build it with macros
23:10:21filwitoh no, that's very easy though I could make you a gist in a couple minutes if you want (though I'm guessing you could do it too)
23:10:56ldleworkI'm so burnt out writing macros for a few months :P
23:12:26filwitbtw, I was looking at the log and noticed that I missed your comment before about how your ECS wasn't using continuous memory, and that such designs usually don't work well cause they're hard to manage, etc..
23:13:33mat4probably it would be better if the language is be splitted into implementation levels because of the every time increase of features. Otherwise I fear at some point the whole compiler get unmaintable (either because of compiler level feature support or excessive meta programming dependencies)
23:13:39ldleworkWell, they are hard to create "front-end" abstractions for.
23:13:41*Dildosan quit (Quit: Leaving)
23:13:55mat4^is splitted
23:14:01filwiti just wanted to comment on that saying that's what this Maikelin guy from the forums and I where talking about the other day.. it's actually not too hard to group components into separate arrays and manage them if you have decent meta-programming
23:14:22filwit(don't think i said his name right)
23:14:43ldleworkfilwit: my entire ECS is generated from a macro, so that they are stored as tables is totally abstracted and underlying implementation detail right now
23:15:23ldleworkI will switch over to arrays once I'm at a point where I'm noticing bottle neck in my game for sure.
23:15:27filwityeah i was browsing your gist/github a little bit ago
23:15:59ldleworkwhat did you think overall
23:16:35filwiti only glanced through your stuff, but overall the code looks good
23:16:59ldleworkah ok
23:17:02filwiti didn't pick up on everything that's going on, or what you where trying to accomplish in what i was reading through mostly, just browsing through things
23:17:19ldleworkmagic.nim basically generates all the code
23:17:27ldleworktypes are generated systematically
23:17:32ldleworkprocs are generated with parseStmt
23:17:41ldleworkyou define some component types
23:17:55ldleworkand then you do `aggregate(NewTypeName, [Component1, Component2])
23:18:09ldleworkthis emits two new types, a NewTypeName and a NewTypeNameManager
23:18:14filwitahh... magic.nim is one I didn't look at, thought that was going to be something else..
23:18:21ldleworkhehe
23:18:50*mat4 quit (Quit: Verlassend)
23:18:53filwiti see
23:19:19ldleworkNewTypeName is basically a struct of references to Component1, Component2, etc
23:19:19filwitbtw, did you see the prototype ECS i made for the guy on the forums the other day?
23:19:38ldleworkreferences to instances of those types which are stored in tables, keyed by entity id
23:19:47ldleworknope
23:19:50filwitit uses a similar concept to your aggregate thing, but stores them in separate arrays (instead of building types)
23:19:58filwitthe syntax ends up being the same though
23:20:07filwit(not the same, similar)
23:20:19ldleworkfeel free to link me
23:20:20filwiter.. here one sec..
23:20:29filwithttps://gist.github.com/PhilipWitte/c14a4913e2fbc3704643
23:21:16filwitdon't worry about read the entire 'brim.nim' file, lol.. the macros are a bit too complex to just browse.. but you get an idea from the 'app.nim' file about the goal
23:22:40filwitbasically the idea is that you have different "aggregate groups" (called componentGroup in the gist), and a "world" which is a collection of these... then some fancy macros which allow you to add any combination of components and it will place those into their matching group
23:23:25filwitthen you can 'call' and procedure and it will pass every instance of each component in groups which match the proc's parameters
23:23:34ldleworkah cool
23:23:42ldleworkI might just go ahead and change aggregate to an expression macro
23:23:54ldleworkit comes off as 'lighter' in the callsite
23:24:02ldleworkthanks
23:24:34filwitidk, aggregate is a pretty good name, really
23:24:42filwiter wait... i misread that
23:24:55ldleworktype Entity = aggregate(Position, Velocity)
23:25:05ldleworklooks much lighter than
23:25:14ldleworkaggregate(Entity, [Position, Velocity])
23:25:40filwitah yes, i agree completely... i was wondering exactly what 'aggregate' did (until you just told me).. but if I saw "type X = aggregate(..)" i would know implicitly
23:25:48ldleworkexactly
23:26:01ldleworkfilwit: I like your thing. I don't quite agree with how your "systems" are exposed on the front-end but I could see how someone might.
23:26:42ldleworkOh well I guess I have the problem
23:26:49ldleworkIn that aggregate emits two types.
23:26:57filwitwell this is an adaptation of some other (similar) ideas I've been playing with, and I used his terminology for this example (I don't call things this)
23:27:20ldleworkfilwit: I like the api, where systems have a reference to the manager and they can just say
23:27:27ldlework"give me all the entities with X, Y and Z components"
23:27:31ldleworkOr any combination thereof
23:27:34ldleworkAnd then do whatever
23:27:44filwitbut the main goal of his project was very similar to mine.. ie, keep all the components for each entity inline with each other so iterating over them is as cache-efficient as possible
23:27:47ldleworkInstead of having 'registered' systems, which are called and passed a specific list, etc
23:28:04ldleworkyou mean
23:28:14ldleworkkeeping all the component values, in homogenous arrays
23:28:22ldleworkIE, all the positions in one array
23:28:26ldleworkall the velocities in another array
23:28:54ldlework?
23:29:01filwityes, but also keeping their counterpart component in order (per entity)
23:29:19ldleworkI don't know what you mean by that last part
23:29:32ldleworkso that in each array, Entity1's components are all first?
23:29:45ldleworkIE keep the individual lists ordered by entity?
23:30:07filwityeah.. if I'm understanding what you're asking..
23:30:17ldleworkWhat's the advantage of doing that?
23:30:24ldleworkkeeping the component arrays sorted by entity
23:30:25filwitbasically an "entity" is just and index inside a specific componentGroup
23:30:38ldleworkwhat if not all entities have all the components
23:30:47filwitand each component doesn't need to store any entity reference at all (not even an ID)
23:31:21filwitthat's why there's separate component groups
23:31:31ldleworkso in your system, you cannot add and remove components
23:31:34ldleworkto an entity
23:31:39filwitso one group has (Pos, Vel, string)... another (Pos, Foo), etc..
23:31:51filwityes you can, but via copy
23:32:00ldleworkBut
23:32:07ldleworkIf you have 3 components
23:32:12ldleworkthat means you have to have 9 groups of those arrays
23:32:19ldleworkfor every possible combination of active componetns
23:32:43ldleworkor more right
23:32:55filwitno, no.. each group just has an array for each component, it doesn't multiply the more you add to each one or anything
23:33:06ldleworkNo I'm saying
23:33:10ldleworkIf I wanted to in your system
23:33:44ldleworkStart with an empty entity, then add a Pos, then remove a pos, then add a Vel then remove a Vel, then add a Name and remove a name, then add a Pos and Vel, then remove a Pos and Vel, then add a Pos and Name....
23:33:48ldleworkand so on for every combination
23:33:55ldleworkthen I need to create a group for every possible combination
23:34:04ldleworkmeaning you have tons and tons of arrays representing all the possible groups
23:34:21ldleworkIt seems like in your system, you need to know up front, all the possible entity runtime-types.
23:34:41ldleworkIn my system you say, "Entitys can have A, B, C ... X, Y and Z components"
23:34:46filwitsure, but how often do you really want to do that? it's like static vs dynamic typing.. often there are specific patterns to an entities state
23:34:49ldleworkAnd then you can create components of any kind.
23:34:56ldleworkAnd you use JSON to define those novel types
23:35:14ldleworkSo that people who don't want to compile your code can contribute new entity types which change gameplay and so on through data alone.
23:35:29ldleworkAnd gameplay mechanics, or even scripting can invent new ones on the fly.
23:35:45filwityou can still do that kind of thing, you just do it via a plugin system (DLL)
23:35:57ldleworkI'm going with totally data driven.
23:36:48ldleworkBut I do see the point of yours. You can easily create a ShipType and a PowerUp type and so on by combining your components.
23:37:11ldleworkThey don't need to be defined at runtime, and therefore you can loop over all ships incredibly fast, all powerups really fast and so on.
23:37:36ldleworkIn my system, you kinda have to be querying component arrays a lot, unless I fully automate caching.
23:38:23filwitexactly... memory reads takes ~200 cycles on a x86_64 machine.. and cache reads in 64bytes at a time, so continous memory reads are important (benchmark it sometime and you'll see)
23:38:51ldleworkI have no desire to worry about performance at all right now.
23:39:26filwiti understand that too, but actually I'm partially doing this to also make code easier to write... as odd as that sounds
23:39:29ldleworkso many other abstractions to write
23:40:17filwitbut there are some things that definitely get complicated to do with continuous memory (namely maintaining safe references)
23:41:05ldleworkfilwit: what kind of game do you eventually wnat to write
23:41:17ldleworkalso you should come hang out in #nim-gamedev
23:41:44filwitk i'll hang out there next time i get on (gonna head out soon)
23:42:13*derka joined #nim
23:42:43filwitidk exactly what kind of game I want to make.. I enjoy certain types of games a lot, but I'm wouldn't mind working on things outside of those
23:43:59ldleworklike a open world wilderness survival roguelike with data-driven content so the world can be filled with millions of things that ca nbe broken down and recombined into different things with tools and crafting?
23:44:46ldleworkMy worldgen so far is totally data-driven too
23:44:52filwitI only really play a couple games, and much more rarely these days.. but one of my favorites (that I still play from time-to-time) is Skyrim
23:45:01filwitwhich is something very like what you described...
23:45:19ldleworkfilwit: sure, skyrim, but top-down tile-based and turn-based
23:45:35filwithow do you do turn-based + open-world?
23:45:46ldleworkwhat do you mean?
23:46:09filwitokay nevermind... I was thining open-world == MMO.. my mistake
23:46:33ldleworkthink top-down 2D retro-tile-based graphics, turnbased minecraft with no mining.
23:47:18*yglukhov joined #nim
23:47:50ldleworkjust wilderness survival, flora, fuana, the elements, day-night, seasonal changes, tanning, boiling deer stomachs for waterskins, making salt from marsh waters, crafting bows, making layered clothes and armors
23:47:57ldleworkthat's what I want to start with anyway
23:48:14filwitsounds interesting
23:48:38ldleworkfilwit: you should play Cataclysm DDA
23:48:41filwitby "top down" you mean something like Zelda: A Link to the Past ?
23:48:45ldleworkwhich is essentially what I'm describing
23:48:55ldleworkBut it has more gamesystems to support more items
23:49:08ldleworkIt has sprawling cities you can explroed jsut filled with endless stuff in the houses and stores and stuff
23:49:15ldleworkeverything can be broken down and built back up
23:49:54ldleworkthere's a vehicle system, a system for building an installing bionics into yourself, a whole building system, a system for simulating your immune system and the effects of disease and medicine, layered clothing and exposure system
23:50:16filwitthis terminal game?
23:50:26ldleworkit has an SDL version with graphical tiles too
23:51:03ldleworkexample of the map, http://staticdelivery.nexusmods.com/mods/411/images/1-0-1433569030.png
23:51:22ldleworkexample of gameplay, http://staticdelivery.nexusmods.com/mods/411/images/1-1-1393234669.png
23:51:36*yglukhov quit (Ping timeout: 245 seconds)
23:51:46ldleworkhttp://www.cesspit.net/misc/catatile10e.gif
23:52:15filwitfor some reason this reminds me of that old "Bolo" mac OS9 game I used to play as a kid
23:52:17ldleworkthere are other tilesets
23:52:26ldleworkisometric, 32x32 full color, etc
23:52:30ldleworkI just like the retrodays look
23:52:39ldleworkI got the author to allow me to use the full tileset for my own game
23:52:42ldleworkwoot
23:53:10ldleworkfilwit: you should just join me and we should be this game
23:53:12filwityeah Tile games are fun to make, it's a whole world in itself
23:53:30ldleworks/be/make
23:53:37filwitldlework: well maybe, but I'm focused a few other things right now
23:54:02ldleworkyeah sure, wait until I've implemented all the boilerplate I see how it is
23:54:14filwitlol
23:55:13filwitno but really, I'm just starting to look for new work, and I don't know what my schedule will be like + I want to continue my own project as well (it's more 3D OpenGL stuff)
23:55:46filwitbut working with other's on a Nim game project does sound fun
23:56:25filwitit would be nice it we could start a Nim game jam or something based around a specific project like there (where many people could contribute)
23:56:38filwitlike this*
23:57:38filwitwhat time-zone are you in, btw?
23:57:50filwiti'm in Pacific time
23:57:57ldleworksame
23:58:01filwitokay cool
23:58:23filwiti used to be eastern, and that was a lot easier talking to #nim where most people are germany/uk
23:58:45ldleworkyeah :(