<< 04-12-2013 >>

00:02:53*brson quit (Ping timeout: 240 seconds)
00:08:03MFlamerAraq: why are TNimNode and TNimType needed in the generated code?
00:10:34BitPuffinis there an infinite integer type?
00:10:42BitPuffin"infinite"
00:11:33BitPuffinBigInt
00:14:13MFlamerAraq: I see if I compile with --checks:off they are not necessary, so obviously for runtime checks
00:16:57MFlamerso, nevermind on that q
00:20:49VarriountBitPuffin, as of yet, no. Though if you manage to wrap GMP, you'll be forever in our good graces.
00:23:24BitPuffinVarriount: meh, I think 2^63 -1 will be enough world sections in each direction :P
00:24:45EXetoCare you sure?
00:27:59BitPuffinEXetoC: lol fairly (I know that you are joking) if one section is 1km^2 and it takes 10 minutes to walk 1km then you'd have to walk for 92233720368547758070 minutes to crash the game
00:32:02*jimmt joined #nimrod
00:32:12BitPuffinwhich is ~112089590725665678.2 months
00:32:27EXetoCyeah that's a decent limit
00:33:54BitPuffinwhich is ~9340799227138807 years
00:34:09BitPuffinit's probably gonna be fine lol
00:35:09*jimmjenn quit (Ping timeout: 246 seconds)
00:35:17BitPuffinand most players will probably not walk in a straight line either
00:35:44BitPuffinand if they walk diagonally that number increases by sqrt(2) :P
00:36:09EXetoC:E
00:36:44EXetoCassaultcube decided that it was a feature rather than a bug
00:38:01EXetoCok that's not the same thing
00:39:24EXetoCthey don't normalize the movement direction, so you basically end up holding two movement keys all the time as that means you travel faster. it's kinda stupid
00:39:47BitPuffinah
00:39:49BitPuffinthat's retarded
00:41:32VarriountBitPuffin, Or you could just use another integer
00:41:47BitPuffinVarriount: what do you mean?
00:42:21VarriountWell, for example, if you had a grid
00:42:40Varriount*2d grid
00:43:38Varriountyou would store coordinates as [(xCoord,xRegion),(yCoord,yRegion)]
00:44:18VarriountIt's not unlimited, but close enough.
00:44:49BitPuffinVarriount: I don't see the difference
00:45:16BitPuffinVarriount: I was already talking about sections, which is basically the grid squares, and they are indexed by a 64bit integer
00:45:51BitPuffinso a section is indexed by sections[xregion][yregion]
00:46:00BitPuffinand you are in one of these regions
00:46:14BitPuffinso your position will probably be relative to the center of the region
00:46:30VarriountBitPuffin, if you want to expand the range, all you have to do is add another parent region
00:46:44BitPuffinoooooh
00:46:47BitPuffinyou mean like that
00:47:04BitPuffinVarriount: don't you think that 9340799227138807 years of walking time is enough though?
00:47:24VarriountBitPuffin, not when we have memory editors. :D
00:47:39*jimmt is now known as jennjimm
00:47:50BitPuffinwell if people are using memory editors they are gonna crash the game anyway ;)
00:47:57VarriountTrue.
00:48:19BitPuffinhowever one could make it infinite somehow with a linked list or something like that
00:48:25BitPuffinthat you traverse
00:48:30BitPuffinbut that could go south
00:49:16VarriountBitPuffin, what do you think BigNums are?
00:49:29BitPuffinVarriount: cool
00:49:58VarriountAlthough, a linked list is a rather simplistic one that isn't *quite* infinite
00:50:21BitPuffinwell some kind of list at least
00:50:27BitPuffinthat isn't indexed by numbers
00:50:49Varriounthttp://en.wikipedia.org/wiki/Bignum#Implementation_issues
00:52:22VarriountBitPuffin, also http://www.laurentluce.com/posts/python-integer-objects-implementation/
00:52:39VarriountPython's ints are technically bignums by default.
00:55:30VarriountI wish they would teach things like this in CS classes. :(
01:02:55EXetoCmeep
01:03:29BitPuffinVarriount: gotta take a look at that some day
01:03:32BitPuffinEXetoC: moop
01:05:05BitPuffinEXetoC: just as I am gonna use glfw :P
01:06:33BitPuffinEXetoC: glfw was the cool one right? not wrapper
01:07:15OrionPKMglfw doesnt do much but give you a window
01:07:29EXetoCnim-glfw
01:09:23EXetoCOrionPKM: yeah but I thought it needed some default args :p
01:09:31BitPuffinuh
01:09:33BitPuffinwhat's the thing again
01:09:35BitPuffinwhen debug?
01:09:39BitPuffinwhen defined(debug) ?
01:10:10OrionPKMyou should look at horde3$
01:10:12OrionPKM3d
01:10:31BitPuffinOrionPKM: no I'm writing my own rendering stuffs
01:10:46OrionPKMwhat for?:p
01:11:16BitPuffinOrionPKM: my game
01:13:16OrionPKMIdk. as someone who has reinvented the wheel a lot, I think you're better off using an existing engine
01:13:22EXetoCI see a single use of "when debug" in the nimrod dir
01:14:09*hoverbear quit (Quit: Textual IRC Client: www.textualapp.com)
01:14:37EXetoCOrionPKM: depends on what the goal is
01:14:47EXetoCbut I guess you can learn plenty of stuff by going in any direction
01:16:29OrionPKMif the goal is to learn graphics, use glfw. if the goal is to make it finished product, use an engine
01:16:40*MFlamer quit (Ping timeout: 245 seconds)
01:18:33OrionPKMor if your goal is to make a sweet game engine in nimrod, then by all means use glfw :)
01:19:00EXetoChell yeah
01:20:03BitPuffinwtf why can't I import devel/logging
01:20:12*Demos joined #nimrod
01:20:57EXetoCis the root dir even in the path?
01:21:06EXetoCbecause it's in the same dir as 'lib'
01:21:19BitPuffindunno this is the arch pkg
01:21:25BitPuffinaur
01:21:28BitPuffin*
01:21:40BitPuffinbut maybe I should just ditch that anyway
01:21:43BitPuffincauses so much pain
01:22:49OrionPKMVarriount if you want to start off the ST plugin repo, go ahead, otherwise i'd just start from scratch since I dont want to base it off of the existing ST plugin
01:22:56OrionPKMI'll port over my added functionality
01:23:26BitPuffinOrionPKM: I don't like working with existing engines
01:23:33BitPuffinOrionPKM: however horde3d is pretty good
01:23:39BitPuffinbut it's not that active
01:23:55OrionPKMno, it's not.. but afaik it's a solid foundation
01:24:18BitPuffinplus I'm a graphics guy
01:24:27OrionPKMhttps://github.com/attilaz/horde3d-x/tree/gles2_d3d11
01:24:28BitPuffinso I like doing that dirty work
01:24:30EXetoCBitPuffin: I mean, it's probably not even installed, if you look at nimrod's root dir
01:24:34OrionPKMmmk
01:24:38EXetoCwhere lib and devel is in the same dir
01:24:48BitPuffinEXetoC: yeah I don't care, I'm gonna get rid of the aur version right away anyway
01:25:12BitPuffinthen we'll see :D
01:25:24EXetoCno I don't think that matters
01:25:44Demoshorde3d looks just OK, not great. I dun think there are any really good FOSS graphics engines
01:26:11BitPuffinEXetoC: well it matters for my mood
01:26:15BitPuffinthe aur version is a pain
01:26:27BitPuffinbecause it wants to download the full repo with every update etc
01:26:51EXetoCso I guess you have to re-distribute that module yourself for now
01:26:56EXetoCyeah that sucks
01:27:03BitPuffinyeah I guess
01:27:08BitPuffinI'll just copy it
01:28:42BitPuffinwhen debug didn't work
01:28:45BitPuffinhmm
01:29:54EXetoCDemos: OGRE? but I don't know if they're improving it much these days
01:30:32DemosOGRE is not what I would call "clean"
01:30:47BitPuffinogre sucks
01:30:56OrionPKMDemos it's not about the demos
01:31:00OrionPKMit's about the artwork
01:31:03BitPuffinirrlicht is pretty okay, as long as you wanna extend it
01:31:08OrionPKMand how well structured the engine is
01:42:40*ics joined #nimrod
01:45:44*DAddYE_ quit (Remote host closed the connection)
01:46:17*DAddYE joined #nimrod
01:50:18*DAddYE_ joined #nimrod
01:50:29*DAddYE quit (Ping timeout: 248 seconds)
01:53:36*mflamer joined #nimrod
01:53:51EXetoCit appears to me that e-books are priced in a ridiculous manner
01:54:45*DAddYE_ quit (Ping timeout: 246 seconds)
01:55:16BitPuffinEXetoC: hm
01:55:25BitPuffinError: unhandled exception: unknown error [EGLFW]
01:55:30BitPuffinError: execution of an external program failed
01:56:12BitPuffinEXetoC: in getPrimaryMonitor
01:56:19EXetoC:o
01:56:36BitPuffinah
01:56:40BitPuffinglfw.init() :P
01:56:49BitPuffinthat wasn't in your example!!
01:58:19BitPuffinEXetoC: shouldn't THints be exported?
01:58:49EXetoCmaking changes now
02:01:52BitPuffinEXetoC: any chance you know if I can check that the context creation was successful
02:01:58BitPuffinlike the correct GL version loaded etc
02:04:38DemosglfwGetError or somesuch
02:04:50Demosit will fail if it can not load the hinted context
02:06:03BitPuffinah so if it does get created it initialized successfully?
02:06:30EXetoCyes
02:06:33EXetoCchanges pushed
02:07:30Demosah sorry, pass a void(*)(int, const char*) to glfwSetErrorCallback
02:07:37Demosit will be called when there is an error
02:08:10BitPuffindoesn't EXetoC's lib already do that?
02:08:11Demosfrom there you can throw a nimrod exception I guess
02:08:12BitPuffindidn't check
02:09:15Demosyou should likely check the return value of glfwInit
02:10:04EXetoCyup doing that
02:10:06Demosyeah no idea how much error code -> exception stuff EXetoC does, I have only used glfw from c++
02:10:23BitPuffinyeah I used glfw in C/C++ and D
02:10:31Demosif you ask for an openGL version that glfw can not make than it should fail and error
02:10:31BitPuffinit's a bit different with EXetoC's lib though :)
02:10:41BitPuffinI did ask for a version
02:10:53EXetoCDemos: actually, you should throw only after said callback has returned, but yeah
02:11:14Demoswell one could throw from the callback (maybe)
02:11:43EXetoCI'm trying to be safe in this regard
02:12:29Demosyeah throwing from the callback may cause the exception to propagate into the C code and "bad things" could happen
02:13:58EXetoCright
02:19:34EXetoCBitPuffin: I tried to make it really convenient, but newWnd is obviously not always the first function to be called
02:19:37EXetoCis it working now?
02:20:11BitPuffinEXetoC: Is what working? I think it was already working lol
02:20:13BitPuffin:P
02:20:57EXetoCeh nevermind
02:22:09BitPuffinEXetoC: why is sampleRate asserted to be <= 192000 ?
02:24:18BitPuffinin nim-ao?
02:25:02EXetoCis that ever exceeded?
02:26:26EXetoCwhatever, I'll remove it
02:26:56BitPuffinEXetoC: 320 is not an uncommon samplerate
02:27:00BitPuffinthere is also 500
02:27:04BitPuffinnever seen that though
02:27:42BitPuffinhttp://en.wikipedia.org/wiki/Vorbis#Technical_details
02:30:12EXetoCthat's not the same thing is it? but anyway
02:32:55BitPuffinoh wait
02:32:58BitPuffinsamplerate and bitrate
02:33:01BitPuffinno that's not the same
02:33:30BitPuffinEXetoC: do you know if there is any limit on how many devices one can create?
02:34:26BitPuffinyeah there is nothing higher than 192 afaik for sample rates
02:34:29EXetoCnot that I can recall. it's probably a really high platform-dependent limit, if any
02:34:54BitPuffinbecause my environment sounds is recorded in 96k
02:35:03BitPuffinand I was thinking maybe I'd export the music in 192
02:35:06BitPuffinor maybe not
02:35:14BitPuffinMaybe I should keep it all in 96
02:36:05BitPuffinhot damn 5,644,800 exists
02:36:15BitPuffinDouble-Rate DSD, 1-bit Direct Stream Digital at 2x the rate of the SACD. Used in some professional DSD recorders.
02:36:33EXetoCyeah
02:36:49BitPuffinwho would use that xD
02:37:16fowli was writing a bunch of xlib stuff
02:37:32fowlopening windows, etc, really ugly stuff
02:37:41fowli just deleted it and using glfw instead
02:38:16BitPuffinEXetoC: but why is bitdepth limited to 16
02:39:33BitPuffinkind of silly to have to use float16 aint it :D
02:40:11EXetoCBitPuffin: I'm not sure if > 44.100 makes sense generally speaking. The nyquist frequency is at the limit of human hearing at that point (~22000 hz)
02:40:38EXetoCBitPuffin: usually shorts are used
02:40:47*brson_ quit (Quit: leaving)
02:41:03EXetoCmost sound cards deal with 16 bits
02:41:18EXetoCanyway, I got rid of all those restrictions
02:41:52BitPuffinEXetoC: well you can do either fixed point or floating point
02:42:12BitPuffinyeah I guess you're right
02:43:02BitPuffinbut I wanna do float :D
02:43:09EXetoCso you'd pass int16's then. I can't remember if I used float too, but then it's just a matter of doing a conversion
02:43:47BitPuffinmaybe there's a restriction in ao too
02:43:48BitPuffinI dunno
02:46:35EXetoCI got this in some old project "let mono = samples.map(proc(x: TR): int16 = int16(x * TR(high(int16)) * 0.05))"
02:46:54*DAddYE joined #nimrod
02:47:15EXetoCand then I convert to stereo simply by inserting each element twice into another sequence, before passing it to the device
02:48:01BitPuffinyou mean another channel?
02:50:09EXetoChere's a snippet that doesn't compile, but which demonstrates it https://gist.github.com/EXetoC/26a32d87027186767114
02:51:15*DAddYE quit (Ping timeout: 245 seconds)
02:53:31BitPuffinpattern?
02:54:05EXetoCstill confusing though, but the data for the channels is interleaved. so if 'mono' is the signal, then you insert each successive value twice to have it sound the same on both speakers
02:54:23EXetoCBitPuffin: that's some unrelated stuff
02:55:22EXetoCit's currently just a DAW that lacks a graphical interface. a pattern is just a set of notes that you can put somewhere in the timeline
02:56:01BitPuffinah
02:57:38BitPuffinEXetoC: what's TR?
02:58:42EXetoCBitPuffin: R stands for Real
02:58:47EXetoCI'm not doing that anymore
02:58:56BitPuffinah
03:01:12*mflamer quit (Ping timeout: 246 seconds)
03:02:39fowlso whats up newbs
03:03:01BitPuffinnewbin
03:05:04BitPuffinuh
03:05:27BitPuffinEXetoC: https://gist.github.com/BitPuffin/7781679
03:06:04*DAddYE joined #nimrod
03:06:15BitPuffinah
03:06:17*DAddYE quit (Remote host closed the connection)
03:06:19BitPuffinit doesn't link for me?
03:06:24*DAddYE joined #nimrod
03:06:43EXetoC-l:-lao
03:06:59BitPuffinyup
03:07:30BitPuffinEXetoC: why aren't you making it link automatically? :o
03:08:23fowlyou need {.header.} on the functions and {.passl: "-lao".}
03:08:51*Varriount_ joined #nimrod
03:09:59BitPuffinyeah I know
03:10:08*DAddYE_ joined #nimrod
03:10:13EXetoCI probably didn't know about that back then
03:12:02BitPuffinEXetoC: but you wrapped glfw first didn't you?
03:12:02EXetoCfowl: passl doesn't work
03:12:12BitPuffinEXetoC: just set dynlib
03:12:16*DAddYE quit (Ping timeout: 245 seconds)
03:12:16*Varriount quit (Ping timeout: 245 seconds)
03:12:16*Varriount_ is now known as Varriount
03:14:44*xenagi joined #nimrod
03:15:20EXetoCBitPuffin: no I get this then "ERROR: Failed to load plugin /usr/lib/ao/plugins-4/libalsa.so => dlopen() failed"
03:18:50*reactormonk quit (Ping timeout: 245 seconds)
03:19:24BitPuffinah
03:19:24BitPuffinI get this
03:19:24BitPuffinError: unhandled exception: Unable to open audio device [EAo]
03:19:24EXetoCthat too
03:19:24*mflamer joined #nimrod
03:21:14BitPuffinEXetoC: any idea on why?
03:21:36EXetoCno
03:21:55BitPuffin(
03:21:58BitPuffin:(
03:25:12EXetoCBitPuffin: http://www.sendspace.com/file/m2wk93 that's the whole example
03:25:25EXetoCbut I'm adding a proper one tomorrow
03:26:20BitPuffincool I'll check it out!
03:26:23BitPuffinBut I'm gonna sleep now
03:26:49EXetoCyeah oh shit it's late
03:27:30BitPuffinyeah :/
03:27:38EXetoCcreated it back in june apparently
03:27:38BitPuffinI'm really stressed with this project
03:27:41BitPuffindamn it
03:27:44BitPuffinanyways
03:27:45EXetoCok time to hug the pillow
03:27:46BitPuffingoodnight!
03:27:53BitPuffinTalk to you tomorrow
03:27:54EXetoCyeah, silly deadline :p
03:27:59BitPuffinI'm gonna drool all over the pillow
03:28:09BitPuffinEXetoC: well I don't have much of a choice, the game is very seasonal :P
03:28:17EXetoCwill help you with my expert skills
03:28:24BitPuffincool bro :D
03:28:36BitPuffinnight!
03:30:13EXetoCbai
03:33:06*BitPuffin quit (Ping timeout: 245 seconds)
03:57:34*DAddYE_ quit (Remote host closed the connection)
03:58:50*ics quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
04:01:05*ics joined #nimrod
04:01:51*DAddYE joined #nimrod
04:02:24*DAddYE quit (Remote host closed the connection)
04:02:30*DAddYE joined #nimrod
04:03:03*DAddYE quit (Remote host closed the connection)
04:05:36*mflamer quit (Ping timeout: 245 seconds)
04:15:26*mflamer joined #nimrod
04:34:08*xenagi quit (Quit: Leaving)
05:04:01*DAddYE joined #nimrod
05:09:42*DAddYE quit (Ping timeout: 240 seconds)
05:28:44*NimBot joined #nimrod
06:06:25*DAddYE joined #nimrod
06:10:45*DAddYE quit (Ping timeout: 245 seconds)
06:31:26*Varriount_ joined #nimrod
06:34:51*Varriount quit (Ping timeout: 245 seconds)
06:34:51*Varriount_ is now known as Varriount
06:54:51*girvo joined #nimrod
07:48:08*Varriount_ joined #nimrod
07:48:38*girvo quit (Quit: Textual IRC Client: www.textualapp.com)
07:49:53*Varriount quit (Ping timeout: 245 seconds)
07:49:53*Varriount_ is now known as Varriount
07:59:28*Demos quit (Read error: Connection reset by peer)
08:09:58*DAddYE joined #nimrod
08:13:53*jimmt joined #nimrod
08:14:13*DAddYE quit (Ping timeout: 246 seconds)
08:16:58*jennjimm quit (Ping timeout: 260 seconds)
08:17:18*brihat quit (Ping timeout: 245 seconds)
08:22:19*girvo joined #nimrod
08:23:54*girvo left #nimrod (#nimrod)
08:25:59*girvo joined #nimrod
08:34:34*brihat joined #nimrod
09:02:50*noam_ joined #nimrod
09:03:55*Varriount_ joined #nimrod
09:06:10*Varriount quit (Ping timeout: 245 seconds)
09:06:10*Varriount_ is now known as Varriount
09:06:30*dymk joined #nimrod
09:06:50*webskipper quit (Read error: Connection reset by peer)
09:10:15*Araq_bnc joined #nimrod
09:11:15*DAddYE joined #nimrod
09:12:20*noam quit (*.net *.split)
09:12:20*_dymk quit (*.net *.split)
09:12:20*aftershave quit (*.net *.split)
09:12:20*Araq quit (*.net *.split)
09:15:30*DAddYE quit (Ping timeout: 246 seconds)
09:26:00*achim joined #nimrod
09:26:50*ics quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
09:27:15*ics joined #nimrod
09:27:15*dirkk0 joined #nimrod
09:29:15*dirkk0 quit (Client Quit)
09:31:35*ics quit (Ping timeout: 240 seconds)
09:47:41*CarpNet joined #nimrod
09:51:01*noam_ quit (Disconnected by services)
09:51:21*noam__ joined #nimrod
09:51:31*noam__ is now known as noam
10:12:42*DAddYE joined #nimrod
10:13:12*Araq_bnc is now known as Araq
10:17:12*DAddYE quit (Ping timeout: 245 seconds)
10:21:42*aftershave joined #nimrod
11:13:49*DAddYE joined #nimrod
11:17:55*DAddYE quit (Ping timeout: 245 seconds)
11:18:46*girvo quit (Quit: My iMac has gone to sleep. ZZZzzz…)
11:47:46*girvo joined #nimrod
11:47:52*faassen joined #nimrod
12:02:16*girvo quit (Quit: My iMac has gone to sleep. ZZZzzz…)
12:02:34*BitPuffin joined #nimrod
12:02:50BitPuffingood day!
12:02:59BitPuffinEXetoC: did you figure out the noodle doodle?
12:03:34dom96hello
12:03:47BitPuffinhey dom96!
12:05:34dom96hey BitPuffin!
12:05:46EXetoCBitPuffin: ?
12:07:51BitPuffinEXetoC: the ao exception
12:07:57BitPuffindom96: sup? :)
12:08:32dom96Stayed off school today :P
12:09:48BitPuffindom96: sweet xD
12:12:07EXetoCno
12:12:58dom96BitPuffin: Where is this linagl article!?
12:13:09BitPuffindom96: I'm behind my schedule ;_;
12:13:14BitPuffindom96: if I catch up I'll write it
12:13:19dom96what schedule?
12:13:23BitPuffinfor my game
12:15:06*DAddYE joined #nimrod
12:15:26dom96You're coding it in Nimrod right?
12:15:46fowlwe dont use nimrod anymore
12:15:49fowlwe all do PHP
12:16:39BitPuffindom96: yes
12:16:50BitPuffinor actually I decided to go with COBOL
12:19:05dom96hehe, good good.
12:19:35*DAddYE quit (Ping timeout: 245 seconds)
12:19:54BitPuffinao_alsa ERROR: Unable to open ALSA device 'default' for playback => No such file or directory
12:19:56BitPuffinfuuu ^
12:21:51*zahary_ joined #nimrod
12:25:01EXetoCand you're using the default driver?
12:30:54BitPuffinEXetoC: yea
12:31:40BitPuffinEXetoC: https://gist.github.com/BitPuffin/7786741
12:32:36BitPuffinproc newDevice*(fmt: TSampleFmt, driver = TDriver.default): PDevice =
12:33:01EXetoCand you're not using pulse? do any other applications fail in this regard?
12:33:42BitPuffinEXetoC: no I'm not using pulse
12:34:43EXetoCrenoise for example doesn't play nice with my alsa and I have no idea what I'm doing wrong, but I haven't had a problem with libao yet
12:34:43BitPuffinand vlc for example works
12:35:35EXetoCwhat about aplay? if you got some wavs laying around
12:37:00BitPuffinhttps://gist.github.com/BitPuffin/7786807
12:37:02BitPuffininteresting
12:39:02dom96Maybe try changing the default driver in /etc/libao.conf
12:39:28BitPuffinwell
12:39:30dom96Perhaps OSS.
12:39:34BitPuffincome on
12:39:37BitPuffinnot oss :P
12:39:52dom96lol
12:42:16BitPuffinit's not the 1500s
12:42:43EXetoCI don't know if jack needs to be running. does jackd work?
12:43:46EXetoCjack is mentioned, so I'm guessing that it's installed. I don't know what other applications do. maybe they use fallbacks
12:44:19BitPuffindon't think jack needs to be running
12:45:05EXetoCI don't know then, but something is wrong if aplay doesn't work
12:46:33BitPuffinhot damn jack_control start and now the output is this
12:46:58BitPuffinDEBUG Creating audio device
12:47:00BitPuffinjack_client_new: deprecated
12:47:05BitPuffinDEBUG Destroying audio device
12:47:09BitPuffinas it should
12:50:25EXetoCok
12:53:21BitPuffinbut I don't know if that will actually output sound
12:54:05EXetoCtry the code I sent you before
12:54:36BitPuffinEXetoC: don't think i still have the tab
12:55:40EXetoCthe url is still available. http://www.sendspace.com/file/m2wk93
12:55:46EXetoCnimrod c -l:-lao -r main.nim
12:56:18BitPuffinEXetoC: removed some jack shits from asoundrc
12:56:22BitPuffinran alsactl init
12:56:24BitPuffinran the game
12:56:27BitPuffinnemos problemos
12:56:29BitPuffinwith jack started
12:56:41BitPuffinoh right it was a download
12:57:02BitPuffinI'm gonna run your thing just to see if there is any audio
12:58:55BitPuffinEXetoC: it doesn't compile
12:58:59EXetoC:E
12:59:57EXetoCI wonder why
13:00:33BitPuffinEXetoC: because of this https://gist.github.com/BitPuffin/7787084
13:02:08EXetoCI re-built nimrod yesterday. I don't know if that's why it works for me
13:02:19BitPuffinBut I did too
13:02:25BitPuffinyou know when I raged about the whole aur thing
13:03:46EXetoC>.>
13:04:11EXetoCand you remembered to pull?
13:04:29BitPuffinwell it was a fresh clone even
13:07:50EXetoCwill try that
13:09:02EXetoCso the output of 'which nimrod' is correct?
13:10:07BitPuffinyup
13:12:59EXetoCstill works for me
13:13:21BitPuffingit pull
13:13:21EXetoCafter cloning and then building
13:13:23BitPuffinAlready up-to-date.
13:14:01EXetoC5 modules in the archive, right?
13:14:25BitPuffinyup
13:14:41EXetoCI don't know wth is going on then
13:14:45BitPuffinEXetoC: and we're both using arch linux x86_64?
13:15:03EXetoCyes. I use gcc 4.8.1
13:15:23BitPuffin gcc --version
13:15:26BitPuffingcc (GCC) 4.8.2
13:15:27BitPuffinhmm :P
13:16:20*DAddYE joined #nimrod
13:18:34EXetoCit works when bootstrapping with and without -d:release. I don't know what else to try
13:20:32BitPuffincould it seriously be gcc then?
13:20:34*DAddYE quit (Ping timeout: 246 seconds)
13:20:38BitPuffinEXetoC: update your gcc
13:20:54EXetoCI have
13:20:57BitPuffinhm
13:22:39*Mat2_ joined #nimrod
13:22:54*Mat2_ quit (Client Quit)
13:23:11*Mat2_ joined #nimrod
13:24:31EXetoCdo any other projects compile?
13:26:07Mat2_.
13:26:38EXetoClo
13:26:45Mat2_hi all
13:26:50BitPuffinEXetoC: yeah
13:26:53BitPuffinmy game compiles
13:27:02BitPuffinlinagl
13:27:04BitPuffinnim-ogg
13:27:07BitPuffinnim-vorbis
13:27:09BitPuffinerrthin
13:27:21*Mat2_ is now known as Mat3
13:29:10Mat3does one know if the standard value for booleans at declaration is true or false (or even undefined) ?
13:30:15EXetoCpretty sure it's false
13:30:21EXetoCeverything is initialized by default
13:30:24BitPuffinprobably false
13:30:29Mat3thanks
13:37:46EXetoCis --hint working? if so, then I can't figure out how to use it
13:39:21BitPuffinwhat's the corret way of doing what i'm trying to do here?
13:39:23BitPuffinvar fileptr: ptr TOggVorbisFile = cast[ptr TOggVorbisFile](alloc0(sizeof(TOggVorbisFile)))
13:40:38EXetoCnevermind
13:41:34BitPuffinAraq: almighty memory manager, guide me
13:43:23BitPuffinresult = new PAudioFile(file: fileptr)
13:43:26BitPuffinbecomes None
13:43:29BitPuffinwtf is none even :P
13:44:11fowlwtf is new, are we in c++
13:44:25BitPuffinoh wait
13:44:27BitPuffinshouldn't be new
13:44:29BitPuffinlol
13:44:32BitPuffin:D
13:44:42BitPuffinfowl: there is a new keyword though
13:44:53fowlwell thats _new_ to me
13:44:57EXetoCit's not just a proc?
13:44:59*NimWolf joined #nimrod
13:45:02fowl^
13:45:11EXetoCBitPuffin: depends. is PAudioFile part of ogg?
13:45:33BitPuffinEXetoC: no it's in mah game
13:45:46BitPuffintype
13:45:47EXetoCand I don't think there's anything more convenient than alloc0 + sizeof + cast
13:45:48BitPuffin TAudioFile = object
13:45:50BitPuffin file: ptr TOggVorbisFile
13:45:52BitPuffin PAudioFile = ref TAudioFile
13:46:16EXetoCso "new(result); result.file = ..."?
13:46:41fowlEXetoC, thats oldschool
13:46:55fowlkool kids say result = PAudioFile(file: f)
13:47:11EXetoCforgot about that
13:47:11fowlalthough, you probably want a destructor to free that ptr
13:47:31EXetoCimplicit 'new'
13:49:46BitPuffinfowl: already have one
13:49:54BitPuffinit's why I wrapped it in TAudioFile
13:50:11fowldoes that work
13:50:16BitPuffinno idea
13:50:26BitPuffindon't see why it wouldn't
13:50:42fowlbecause {.destructor.} is for value types leaving scope, not reference types
13:51:00fowldestructor is like c++'s ~
13:51:48fowlhttp://build.nimrod-lang.org/docs/manual.html#destructor-pragma
13:54:03fowlwow i didnt know about {.delegator.} or `()` being a valid operator
13:54:12fowli swear every time i look in the manual i learn new things
13:54:22BitPuffinfowl: it's pretty new
13:54:29BitPuffinit's gonna be added to linagl really soon
13:55:05BitPuffinwell I'll keep the destructor thingy
13:55:14BitPuffinbut I'll probably call it explicitly
13:55:22BitPuffinmaybe it will save my ass one day
13:56:42fowlyou know how to finalizer right
13:58:09BitPuffinherp?
13:59:08BitPuffinfowl: there is no such thing in tfm
13:59:46fowlwhat
13:59:49*Varriount_ joined #nimrod
13:59:51EXetoCfinally?
14:00:30fowlBitPuffin, you're right
14:00:37fowlBitPuffin, its probably in the tutorial
14:00:50BitPuffinahhh
14:00:55BitPuffinyeah I know about finally
14:00:57BitPuffinand except
14:00:59BitPuffinetc
14:01:10fowlBitPuffin, when allocating a ref ty: new(result, free) free is proc(x: PType) = free stuff that you need to here
14:01:11BitPuffintime to lunch
14:01:20BitPuffinat least calling open and close doesn't segfault or anything
14:01:24BitPuffinso that's positive
14:01:28fowlhey
14:01:55BitPuffinfowl: but you just told me to not use new
14:01:58BitPuffinlol
14:02:14EXetoChe meant explicitly
14:02:18fowlBitPuffin, fine then, allocate pointers and dont free them, i dont care
14:02:49BitPuffinfowl: well I'd like to use the stuffs you said
14:02:54fowlyou have to use new() if you want to give it a finalizer
14:03:01BitPuffinaha
14:03:03BitPuffincool
14:03:05*Varriount quit (Ping timeout: 246 seconds)
14:03:06*Varriount_ is now known as Varriount
14:03:36BitPuffinfowl: does it matter if the proc is a destructor?
14:04:16fowlidk
14:05:43BitPuffinah
14:05:46BitPuffinit has to be a ref
14:06:25BitPuffinyou can't set a ref to nil?
14:06:27BitPuffinwtf
14:06:56dom96you can
14:06:56BitPuffinwell that added a sigsegv
14:07:02EXetoCI just tried it. it works
14:07:16fowlofc
14:07:25BitPuffinnew(result, close)
14:07:28BitPuffin result.file = fileptr
14:07:58BitPuffinso result.file is nil? wtf
14:08:48EXetoCyes, initially
14:09:08BitPuffinEXetoC: but I called new on it right before
14:09:11EXetoCit shouldn't be after the assignment if fileptr isn't nil
14:09:24BitPuffinit isn't
14:09:56Araqhi NimWolf, welcome. Nice nick.
14:09:58*Mat3 quit (Quit: Verlassend)
14:10:04EXetoCso what should it initialize to if not nil?
14:10:12BitPuffinhttps://gist.github.com/BitPuffin/7787980
14:10:36BitPuffinyes I log excessively
14:11:16*Mat3 joined #nimrod
14:12:41BitPuffinI fail to see how result.file can be new
14:12:43BitPuffinbrb lunch
14:12:49fowlBitPuffin, jeez man
14:12:57BitPuffinfowl: jizz man
14:13:06fowlBitPuffin, you initialized a ref ref TAudioFile
14:13:25EXetoC-.-
14:13:33Mat3what you guys think about the concept of delegate monads for low-level memory access ?
14:13:35BitPuffinahhhh
14:13:38BitPuffinhahahaha
14:13:40BitPuffinlol
14:13:45fowlBitPuffin, you're drunk
14:13:47BitPuffinfowl: nice catch
14:13:53BitPuffinfowl: like your dad then
14:13:59fowlnah he doesnt drink
14:14:05fowllike my mom would be more accurate
14:14:39BitPuffinyay it doesn't crash
14:14:46EXetoCAWESOME
14:14:46BitPuffinfowl: I'll remember than for future slamdowns
14:14:57BitPuffinEXetoC: what is?
14:15:16EXetoCprograms that don't crash
14:15:50fowlis fopen() the one from stdlib.h
14:16:14BitPuffinfowl: no it's from vorbisfile I think
14:16:25BitPuffinEXetoC: you got that right
14:16:41BitPuffinfowl: thanks for the help :D does this mean that the shit will be GCd now?
14:17:08fowlyea
14:17:18fowli like fractions of bitcoins for christmas btw
14:17:42*DAddYE joined #nimrod
14:17:44EXetoCcan I have one bitcoin?
14:18:34BitPuffinfowl: the game won't come out until 26th at best
14:22:21*DAddYE quit (Ping timeout: 272 seconds)
14:23:41*Mat3 cast[ptr array[0..avmNatAdrSpace,uWord]](self.pVmMem)[self.tOpcode.iVmMem] = self.tOpcode.Opcode
14:23:59*Mat3 accessing memory in Nimrod can be so simple
14:26:49C0C0dafuq?
14:26:55C0C0what is that
14:27:12fowlwhat are you working on lol
14:27:38C0C0some kind of VM apparently
14:27:55C0C0another iteration of corewars?
14:28:00C0C0I fucking love corewars
14:28:15Mat3implementing vectored instruction sheduling for my VM design
14:28:34C0C0hmm no corewars?
14:28:37Mat3no
14:29:44C0C0too bad
14:30:18fowlvectored instruction scheduling, sounds fancy
14:37:13BitPuffinyeah I think Mat3 only joined this channel to make us feel stupid
14:37:33EXetoCpfft, game dev is much more hardcore, man
14:37:45BitPuffinawwww yeaaaa
14:37:55Mat3there exist a VM mode where each decoder (for 2 fused instruction slots) executed parallel (as real-time thread). In this case the compiler must be able to assemble opcodes from independent threads (just like for conventional VLIW architectures)
14:38:24C0C0"conventional VLIW architectures"
14:38:34EXetoCit all makes sense now
14:38:45C0C0guess I have some reading to do bevor I can play with you Mat3 ^^
14:39:00BitPuffinpff, I knew that
14:39:16BitPuffineven before I started programming
14:39:26fowllol
14:39:49C0C0^^
14:40:07C0C0Mat3: what exactly are you doing (on a more "explain your granddad level)?
14:40:09C0C0sounds interessting
14:43:06Mat3implementing a minimalistic VM design and environment for a scaled-down Nimrod variant for system-programming as replacement for C
14:43:39EXetoC= win
14:43:40*Mat3 reminds me changing my translator engine
14:44:32Mat3(and make the result on some embedded boards)
14:44:37C0C0hmm?
14:44:48C0C0your implementing a vm for nimrod?
14:45:27C0C0so you can use an interpreted language on embedded devices?
14:46:51Mat3for using a Nimrod alike environment on the device to be precise
14:47:06Mat3http://www.dontronics-shop.com/olimex-duinomite-mini.html
14:47:12Mat3^like these
14:47:14C0C0hmm whats the problem with the nimrod generated C code?
14:47:25C0C0is the GC code not portable?
14:47:39OrionPKMreplacement for C is pretty ambitious :p
14:47:55Mat3it is as I know
14:48:19Araq"delegate monads for low-level memory access" ... please give an example for that
14:48:35AraqI only have some vague idea what you mean
14:48:54Mat3OrionPKM: Not really (these board above uses Basic for example )
14:49:23OrionPKMew :)
14:49:27*NimWolf quit (Quit: Nettalk6 - www.ntalk.de)
14:51:20Mat3Araq: Instead of explicit casting for accessing memory (and by do so, bypassing the type system more or less) think of some intrinsic, free procedures which convert there input as side effect
14:52:00Mat3and handles memory accessing this way
14:54:11Mat3like accessing memory though a set of memory managing functions
14:54:20Araqpeek and poke?
14:54:20Mat3(I hope this makes sense)
14:54:56Mat3something like that, only managed at runtime
14:55:38Araqnot sure how this can work. you'd need some type tags at runtime to be able to check anything
14:58:53*mflamer joined #nimrod
15:01:16Mat3yes, this will need dynamic type tagging as I think about it
15:01:46Mat3however, for an interpretative system this should be of no problem
15:04:09Araqactually
15:04:39AraqI can envision a safeCast that is like 'cast' but the compiler ensures you only perform casts that cannot break memory safety
15:04:58Araqkind of like the typed arrays in JavaScript work
15:05:41Araqnot sure how useful this is for your purposes though
15:08:47Mat3one problem is: Some MCU's featuring an extended Harvard architecture (like some DSP's from TI) and this involves handling of two accessible but different memory spaces
15:09:40Mat3(you can add a third one for SoC devices)
15:09:42Araqtwo different memory spaces looks like we need parametrized pointer types
15:09:50Araqbbl
15:10:31Mat3see you guys later (work)
15:10:32Mat3ciao
15:10:39*Mat3 quit (Quit: Verlassend)
15:16:22mflamerAraq: You still working through TAPL?
15:18:55*DAddYE joined #nimrod
15:23:20*DAddYE quit (Ping timeout: 245 seconds)
15:25:55BitPuffinEXetoC: yeah, above 48khz sampling rate does not really make sense for playback. However for recording 96khz is really good :)
15:27:40OrionPKMaraq there's some issue with idetools that prevents it from actually returning, it just kinda hangs
15:27:49OrionPKMhave you run into that?
15:30:17BitPuffinhowever bitdepth cap at 16bit signed doesn't make sense, since it's also common to use 24
15:33:02mflamerbrb
15:37:59*mflamer quit (Ping timeout: 272 seconds)
15:39:03EXetoCBitPuffin: I don't know why having a nyquist frequency of 48k is any better than ~20k but ok
15:39:31EXetoCBitPuffin: haven't you done an update?
15:39:51EXetoCthose checks have been removed
15:42:04AraqOrionPKM: this could also be the latest babel issue that fowl reported
15:42:18AraqI mean the babel support we had to include into the compiler
15:42:49OrionPKMwhen did he report this?
15:45:23EXetoCBitPuffin: well, it might be useful for when analyzing audio, if that's what you're referring to
15:46:10EXetoCif anti-aliasing is even useful then
15:48:08AraqOrionPKM: he didn't report it yet. Try to comment out the line
15:48:10Araqcompiler/options.nim:274: bringToFront(lazyPaths, it)
15:48:39OrionPKMI'll give it a shot when I get a chance, will let you know.
15:49:21fowlAraq, its fixed
15:49:34fowlAraq, its in the commit removing x11, opengl, etc
15:49:37fowler PR
15:50:33BitPuffinEXetoC: well the nyquist frequency of a pcm signal is half the sampling rate
15:50:52BitPuffinEXetoC: so with 48khz the nyquist frequency is 24khz
15:51:06BitPuffinwhich is silghty above human capability
15:52:12BitPuffinEXetoC: however when it comes to recording it's still useful to go above 48khz 96khz etc because there is more headroom for the low pass filter that helps avoid aliasing
15:52:51BitPuffinEXetoC: so I'll record at 96khz because that the maximum that my m10 handles, but playback in the game will be 48 or so
15:53:11Araqdom96: I merged fowl's pull request but nimbot remains silent
15:53:14Araq:-(
15:53:21NimBotAraq/Nimrod master de3ebb6 fowlmouth [+0 ±0 -21]: removed x11
15:53:21NimBotAraq/Nimrod master 6775485 fowlmouth [+0 ±0 -20]: removed gtk2
15:53:21NimBotAraq/Nimrod master 3d16b9c fowlmouth [+0 ±0 -7]: Removed opengl
15:53:21NimBotAraq/Nimrod master 95e65ee fowlmouth [+0 ±0 -14]: Removed lua, python, tcl, cairo
15:53:21NimBot4 more commits.
15:53:26Araqoh lol
15:53:30BitPuffinEXetoC: but for others using libao with nimrod it's obviously good to be able to play 96khz etc sampling rates
15:53:45AraqI need to go, see you guys later
15:53:50BitPuffinsee you Araq!
15:55:34EXetoCBitPuffin: I'm not sure what you're implying, but maybe I'll read more about this some other time
15:55:44EXetoCBitPuffin: well, the limit was set to 192khz before
15:56:35BitPuffinEXetoC: oh haha :P
15:57:06BitPuffinEXetoC: bit depth of my m10 recorder is 24
15:57:10dom96Have you guys heard of badBIOS? Being able to play sound at a high frequency certainly has it's use for malicious purposes.
15:57:29BitPuffindom96: isn't that just a rumor though
15:58:04BitPuffinEXetoC: I guess the limit should be set to the highest thing that is ever being used 500 something or whatever it was
15:58:14dom96Yeah. But apparently some scientists reproduced a prototype which communicates that way: http://arstechnica.com/security/2013/12/scientist-developed-malware-covertly-jumps-air-gaps-using-inaudible-sound/
15:58:27BitPuffindom96: yeah It's certainly theoretically possible
15:58:38BitPuffinhowever I wonder how that can be lossless
15:58:48dom96I'm actually considering trying it myself for fun heh
15:59:06BitPuffinlol
15:59:08BitPuffinwrite it in nimrod
15:59:17dom96well of course
15:59:38C0C0BitPuffin: why wouldn't it be lossless?
15:59:53C0C0the internet was build via data transission via audio
15:59:57C0C0resends ftw
16:00:12BitPuffinC0C0: well distortion by flying through air
16:00:31fowldata rate is 20 bits/second
16:00:43BitPuffinC0C0: I mean the radio signals you can listen to certainly aren't in the same condition as from where they were transmitted is it?
16:01:20BitPuffinEXetoC: haha okay I'm gonna keep 16 bit depth since alsa warned me :P
16:04:28C0C0BitPuffin: so what?
16:04:40C0C0thats where frequency/phase modulation comes in?
16:05:24EXetoCa 1hz signal just has to be close enough to 1hz in the end I guess
16:05:33BitPuffinEXetoC: okay I'm not gonna use libao
16:07:12EXetoCok
16:07:25C0C0EXetoC: well frequency shifts are rather uncommon no?
16:07:26BitPuffinEXetoC: don't you wanna know why?
16:07:34BitPuffinit's not your fault lol :P
16:08:00EXetoCtoo low level?
16:08:02C0C0afaik the only reason for frequency shifts in the signal (in the secenario) is the doppler effet of moving things
16:08:57OrionPKMAraq, when I comment out that line you mentioned, it no longer hangs, it gives a SIGSEGV instead
16:09:07BitPuffinEXetoC: hell no
16:09:10BitPuffinEXetoC: GPL
16:09:46C0C0EXetoC: which should be rather minor
16:09:54fowlOrionPKM, he's just merged my changes in, try now
16:10:05C0C0especially since there will always be refelcted waves with the original frequence as well
16:10:27C0C0except for someone carrying the computer arround rather fast
16:10:56OrionPKMfowl is it all merged now?
16:11:01fowlyea
16:11:09EXetoCBitPuffin: ok I don't know why that matters
16:11:26BitPuffinEXetoC: because that means my code also has to be GPL licensed
16:12:18OrionPKMfowl SIGSEGV instaed of hang with your changes
16:13:32fowloh..hmm
16:15:17OrionPKMit's an improvement to crash instead of hang though :)
16:16:11EXetoCBitPuffin: I don't think I ever realized that it was that restrictive. I hate it even more now
16:16:28fowlOrionPKM, you did uncomment that line, right
16:16:34OrionPKMyes
16:16:38BitPuffinEXetoC: Yeah the GPL is terrible
16:17:46fowlBitPuffin, i thought you only have to GPL your code if you modify theirs
16:17:56BitPuffinfowl: that's LGPL
16:17:58BitPuffiniirc
16:18:24BitPuffinLGPL let's you statically link and I don't know if it spreads like the GPL the same way
16:20:01*MFlamer joined #nimrod
16:20:10*DAddYE joined #nimrod
16:20:55EXetoCBitPuffin: same with GPL3?
16:22:26BitPuffinEXetoC: even worse with GPL3
16:22:59EXetoCwth
16:23:15BitPuffinI believe GPL3 put another restriction that you can't put GPLv3 software on a device without enabling the user to replace it or modify it or somethnig
16:23:22BitPuffinso it applies to manufacturers more
16:23:27EXetoCfortunately it seems like BSD, MIT, X11 etc are fairly popular these days
16:23:28BitPuffinit's why linux is staying with gpl2
16:23:40EXetoCright
16:23:47BitPuffinEXetoC: yep, and I go even further by putting my stuff in the public domain
16:24:14*DAddYE quit (Ping timeout: 240 seconds)
16:25:20EXetoCok
16:26:14EXetoCmaybe I should wrap portaudio then
16:30:10BitPuffinEXetoC: already working on it
16:30:35BitPuffinhow do i get c2nim to strip underscores?
16:30:47*linkmauve1 joined #nimrod
16:32:05EXetoCBitPuffin: no modifications needed even
16:33:25BitPuffinEXetoC: nope I know
16:36:02EXetoCwhat alternative universe are we in anyway?
16:36:05BitPuffinwhat was the pragma again
16:36:26BitPuffin{.push importc: "Pa_$".} ?
16:36:52BitPuffinfowl: master, tell me iirc
16:37:24BitPuffinah with a 1
16:39:46EXetoCdoes it even make sense to distribute nim-ao under MIT then?
16:40:23BitPuffinEXetoC: that's a gray area that I don't know
16:40:43BitPuffinwell I guess it makes sense
16:40:47BitPuffinthe binding code is mit
16:40:54BitPuffinsince it doesn't actually call the GPL code
16:41:11BitPuffinbut whoever is using the binding is calling GPL code
16:41:18BitPuffinso their code becomes GPL licensed
16:41:26BitPuffinand when they use it your code also becomes GPL'd
16:41:38BitPuffineh
16:41:44BitPuffinClusterfuckPL
16:41:49EXetoC:o
16:42:26BitPuffinportaudio.nim(26, 34) Error: invalid order in enum 'NotInitialized'
16:42:37BitPuffin TErrorCode* {.size: sizeof(cint).} = enum
16:42:40BitPuffin NoError = 0, NotInitialized = - 10000, UnanticipatedHostError,
16:42:57EXetoCyes you'll have to move stuff around
16:43:00BitPuffinshould I just move NoError to the end?
16:43:17EXetoCthe latter doesn't have a value?
16:43:20dom96depends on what value you want UnanticipatedHostError to have
16:44:08BitPuffindom96: well in C I guess that'd be -9999
16:44:17BitPuffinso same here
16:44:39EXetoCthat's an odd set of values then, but maybe that's the case
16:45:06EXetoCso yeah I guess paNoError should be moved
16:45:27BitPuffinwell it fixed the compilation error at least
16:45:28EXetoCare you going to make a high-level wrapper?
16:45:32BitPuffinbut maybe breaks the ballsieball
16:45:48EXetoCI don't think so
16:45:52BitPuffinEXetoC: no don't think so, maybe you could create a separate babel pkg for high level stuff?
16:46:20BitPuffinunless you wanna do it in my repo and say I dedicate any and all copyright interest in this software to the
16:46:23BitPuffinpublic domain. I make this dedication for the benefit of the public at
16:46:25BitPuffinlarge and to the detriment of my heirs and successors. I intend this
16:46:27BitPuffindedication to be an overt act of relinquishment in perpetuity of all
16:46:29BitPuffinpresent and future rights to this software under copyright law.
16:46:38BitPuffinxD
16:46:48EXetoCI think you said it wasn't going to be a problem, so I don't mind in that case
16:47:20BitPuffinwhat being a problem?
16:47:41BitPuffintypedef int PaDeviceIndex;
16:47:45BitPuffin#define paNoDevice ((PaDeviceIndex)-1)
16:47:51BitPuffinso how the fuck do I deal with that
16:48:01EXetoCpublic domain
16:48:09BitPuffinEXetoC: public domain is definitely not a problem
16:48:18*Varriount_ joined #nimrod
16:48:19BitPuffinespecially with CC0
16:48:28BitPuffinbecause it works in countries that don't have public domain
16:48:40BitPuffinwith a fallback thingy
16:48:50BitPuffinguess it's a macro
16:49:19EXetoCbut PaDeviceIndex is a type. wut
16:49:40BitPuffinyeah wth
16:49:46BitPuffinI dunno maybe it's an argument?
16:49:54EXetoC"typedef int PaDeviceIndex; PaDeviceIndex-1" :O
16:50:34*gradha joined #nimrod
16:51:30*Varriount quit (Ping timeout: 245 seconds)
16:51:30*Varriount_ is now known as Varriount
16:51:51BitPuffinEXetoC: I'll go ahead and interpret it like this
16:51:56BitPuffintemplate noDevice(idx: TDeviceIndex): expr =
16:51:59BitPuffin idx - 1
16:52:08BitPuffinany C guru can correct me
16:52:11BitPuffinbecause I ain't one
16:52:51EXetoCdoes that even compile when used?
16:53:01BitPuffinEXetoC: portaudio.h?
16:53:46gradhaOrionPKM: you mentioned idetools hanging, are you running it as a server or starting a fresh compiler for each query?
16:54:55BitPuffinoh ffs
16:55:04BitPuffintype
16:55:05OrionPKMgradha fresh for each query, for now
16:55:06BitPuffin TSampleFormat* = culong
16:55:11BitPuffin Float32* = cast[(TSampleFormat)](0x00000001) #*< @see PaSampleFormat
16:55:28gradhaOrionPKM: hangs in such a way are certainly new
16:55:30EXetoCBitPuffin: The C code is subtracting from a type
16:56:19OrionPKMwell its not hanging anymore gradha, it's giving a SIGSEGV
16:56:23BitPuffinEXetoC: I think it is a macro though?
16:56:38gradhaprogress
16:56:48OrionPKMgradha which is something I've gotten from idetools before
16:57:15EXetoCBitPuffin: yes but it doesn't. it does output -1 though. so make it -1.cint
16:58:43EXetoCI can't even replicate it
16:58:54OrionPKMgradha fowl it seems to happen for whole files, not specific lookups in that file
16:59:04BitPuffinEXetoC: you tried compiling?
16:59:15gradhaOrionPKM: I did stop looking at idetools some months ago but never had a sigsev, might be worth knowing when more or less you started having them for a hypothetical git-bisect
16:59:35EXetoCBitPuffin: I could print it in C++, but it fails when I do it on my own typedef
16:59:38EXetoCit printed -1
17:00:05OrionPKMi.e. for file1.nim idetools always gives a SIGSEGV no matter what row/col, but file2.nim works
17:02:22gradhaOrionPKM: you have file1.nim somewhere for playin with?
17:02:46OrionPKMgradha I'll make a gist later, i'm at work now
17:03:08OrionPKMI tried reproducing it in a smaller file last night, but i'll try again
17:03:19OrionPKMit's happening in a large project right now
17:06:06*boydgreenfield joined #nimrod
17:07:21EXetoCBitPuffin: it's a cast
17:07:40EXetoCI'm forgetting these languages already
17:07:52EXetoCit's fairly cryptic though, right :p
17:11:02BitPuffinEXetoC: lol haha true
17:11:08BitPuffincan't believe we didn't see that
17:11:14BitPuffini'll deal with it
17:11:18BitPuffinjust gotta deal with this
17:11:27BitPuffintypedef void PaStream;
17:11:57BitPuffinc2nim says type TStream* = nil
17:12:03BitPuffinbut that is not legal
17:12:28EXetoCit's probably used as a pointer
17:12:44BitPuffinyeah almost at least
17:12:54BitPuffinbut pointer is a pointer to void
17:12:56BitPuffinthis is void
17:12:59BitPuffinso wut
17:13:14EXetoCso just 'pointer' in nimrod
17:13:51BitPuffinEXetoC: no
17:13:59BitPuffinEXetoC: pointer is void*
17:14:02BitPuffinthis is void
17:14:29EXetoCyes, but it's never used only as PaStream, and I don't know if you can achieve the same thing in nimrod
17:14:33BitPuffinbut yeah they take ptr ptr of TStream lol
17:14:42BitPuffinso I'll rewrite that as a pointer[]
17:15:34EXetoCit does once
17:16:55BitPuffinhow do I write that something is an array without knowing its size?
17:17:27EXetoCit doesn't matter because a pointer is a pointer
17:17:42EXetoCso maybe you'll have to fiddle around with just 'pointer'
17:18:12BitPuffinokay so I'll just rewrite ptr ptr TStream to ptr TStream where TStream is a ptr?
17:18:15BitPuffinpointer*
17:21:18EXetoCno it should be two pointers, but I don't know if it makes sense in nimrod
17:21:41*DAddYE joined #nimrod
17:23:22EXetoChttp://portaudio.com/docs/v19-doxydocs/paex__sine_8c_source.html
17:26:01BitPuffinEXetoC: well it is two pointers now
17:26:15BitPuffinEXetoC: PStream = ptr TStream
17:26:20BitPuffinand TStream = pointer
17:27:50*DAddYE quit (Ping timeout: 240 seconds)
17:27:59BitPuffinError: invalid pragma: importc: "Pa_$1"
17:28:10*zielmicha joined #nimrod
17:29:12BitPuffinfowl: you lied!
17:29:56EXetoCjust 'pointer' might do like I said, but it might be a good idea to make it similar
17:30:24*ics joined #nimrod
17:32:03EXetoCok time to do boring stuff. good luck
17:34:34BitPuffinEXetoC: well I'll change it if it turns out to be bad
17:36:09EXetoCI don't think it matters is what I'm saying. I'm just nitpicking
17:37:12BitPuffinthank the jebus for macros
17:50:47BitPuffin(vim macros)
17:51:12EXetoCya
17:57:35BitPuffinfucking github
17:57:58BitPuffindom96: could you add nim-portaudio to packages?
17:58:12BitPuffinsame everything as nim-ogg and nim-vorbis except different names and urls
17:58:26BitPuffinor gradha
17:58:53gradhaBitPuffin: what is giving you problems?
17:59:14BitPuffingithub
17:59:22BitPuffinERROR: Storage server temporarily offline. See http://status.github.com for GitHub system status.
17:59:33gradhacan't do much about that myself
17:59:42BitPuffinwell it might not even apply to the real repo
17:59:58*DAddYE joined #nimrod
17:59:59BitPuffinbecause it happened after I deleted and reforked
18:00:05BitPuffinbecause I didn't wanna download etc
18:00:11gradhahah, now the truth comes, YOU broke github
18:00:17BitPuffintheir status page says 100%
18:00:32BitPuffinwill the FBI come for me now ;_;
18:02:45EXetoCgradha: no u
18:06:27*brson joined #nimrod
18:07:29BitPuffintime to go home
18:07:32BitPuffinbbl!
18:07:33*BitPuffin quit (Quit: WeeChat 0.4.2)
18:12:52*dirkk0 joined #nimrod
18:15:21Araqhi linkmauve1 welcome
18:15:32linkmauve1Hi. :)
18:15:57linkmauve1I just discovered nimrod yesterday, thanks to Kooda here.
18:16:50gradhawe'll give Kooda a cookie then
18:17:37linkmauve1I’m currently writing a game using Cython/SDL2/OpenGL, and from what I’ve read nimrod fixes all the grips I’ve encountered with Cython/Python.
18:18:22linkmauve1It seems based on the same architecture, except without the python dependency and with a much more sensible type model.
18:20:53linkmauve1I’ve started reading the tutorial, and so far I like this language a lot. :)
18:21:22*NimWolf joined #nimrod
18:21:28EXetoCsame architecture? I'm not sure what that means
18:22:06*NimWolf left #nimrod (#nimrod)
18:22:16*wolfspaw joined #nimrod
18:22:53wolfspawWhat is the idiomatic way for getting input in Nimrod? For example, suppose I want to get a int, an string, and a float. In C++ that would be "cin >> intVar >> stringVar >> floatVar" while in C that would be "scanf ("%i %s %f", &intVar, strVar, &floatVar)".
18:23:16linkmauve1EXetoC, well, the same basic idea, compiling from a high-level language to C, with some type inference and such.
18:23:41*DAddYE quit (Remote host closed the connection)
18:24:22gradhawolfspaw: the base is given in the tutorial "let n = parseInt(readLine(stdin))"
18:24:27EXetoCthere are other targets too, but C is indeed the main one
18:25:22wolfspawgradha
18:25:25wolfspawokay, thanks!
18:26:04OrionPKMwoflspaw you could probably also use scanf, if you wanted to
18:26:20*DAddYE joined #nimrod
18:27:28wolfspawOrionPKM: I find scanf pretty convenient, I'll look in the manual about using C functions then. Thanks!
18:29:58dirkk0linkmauvel: fowl wrote a SDL2 lib here: https://github.com/fowlmouth/nimlibs/tree/master/fowltek
18:30:08linkmauve1Oh, nice. :)
18:30:27linkmauve1I don’t think I will migrate my current project, too much code already written, but for the next one this is good.
18:30:34dirkk0which is working except that some libs are not converted yet (mixer).
18:32:09EXetoCfowl will do anything for a bitcoin
18:32:30linkmauve1^^
18:33:30*CarpNet quit (Quit: Leaving)
18:40:13*shodan45 joined #nimrod
18:52:21*OrionPKM quit (Remote host closed the connection)
18:54:00Araqhi wolfspaw welcome
18:59:18wolfspawthanks Araq! Great language, very good work. I just entered in contact with it, still reading the page docs
19:01:09Araqbe careful when wrapping scanf, int is "long" so you need to use "%ld" instead of "%d"
19:01:46*dom96 waits patiently for his bitcoin wallet to synchronise
19:04:20wolfspawah, I see. okay!
19:08:13*BitPuffin joined #nimrod
19:09:15*wolfspaw quit (Read error: Connection reset by peer)
19:20:28*travisbrady joined #nimrod
19:20:38Araqhi travisbrady welcome
19:20:48travisbradyhello, Araz
19:21:01travisbradypardon me, Araq mit ein 'Q'
19:30:02BitPuffinheyo!
19:30:13gradhaBitPuffin: wb
19:34:28BitPuffinthanks gradha
19:34:31BitPuffindom96: MERGE!!!
19:35:12BitPuffinEXetoC: portaudio coming to babel now
19:35:25BitPuffinEXetoC: I'm guessing you are also switching your project over to portaudio?
19:35:39BitPuffingradha: do you have permission to merge?
19:35:47EXetoCyes. screw GPL
19:35:50gradhaBitPuffin: yes
19:36:14BitPuffingradha: do it bruthaaa
19:36:26BitPuffinEXetoC: yeah it's terrible
19:37:04BitPuffinEXetoC: I guess you might be right about the whole pointer thing, pointer doesn't really know what it's pointing to
19:37:19BitPuffinor meh
19:37:25BitPuffinI think if this works it makes more sense
19:38:50gradhaBitPuffin: so you want this nim-portaudio merged?
19:40:07BitPuffingradha: yes
19:41:06gradhaI wonder if your recent pattern for description "binding for xxx" could be improved, so as to not require people know about portaudio
19:41:41*gradha also wonders if it would help for babel-packages to grow a helper "platforms" attribute
19:41:58BitPuffingradha: well maybe, but I don't have time to fix that now
19:42:22gradhaah, time, if only we could cash it as money
19:43:36gradhahow many users will be kept in the dark until that PR is merged?
19:46:30EXetoCthe tags should give the users a clue
19:46:44NimBotnimrod-code/packages master 1aec83a Isak Andersson [+0 ±1 -0]: Add nim-portaudio
19:46:44NimBotnimrod-code/packages master ab1995e Grzegorz Adam Hankiewicz [+0 ±1 -0]: Merge pull request #38 from BitPuffin/master... 2 more lines
19:47:04BitPuffinEXetoC, gradha: and the name, it's got audio in it
19:47:14dirkk0I barely dare to ask this question, but 'for i in 1..10:
19:47:14dirkk0 echo(i)' is turned into about 90 lines of c code (when I expected rather a dozen): http://pastebin.com/vCVg7dev - is that clang or something else?
19:49:23gradhadirkk0: you don't need to worry about that unless they pay you by LOC, in which case you are already winning
19:50:49gradhadirkk0: still you could try different size options for nimrod if you are worried
19:51:12Araqwell 30 lines are just some typedefs which C manages to generate no assembler for
19:51:59Araqand the other 60 include things like line tracing for your debugging pleasure
19:52:06Araqtry with -d:release
19:52:27EXetoCI bet that'll come up often
19:52:35BitPuffinEXetoC: errday
19:52:46Araqand btw with the right options my "hello world" program has the same size as its C counterpart
19:53:46dirkk0the options would be?
19:54:14BitPuffinAraq: I have never been able to get it to the same size
19:54:27EXetoCAraq: is the single-argument version of `..` supposed to work in conjunction with 'for'?
19:54:31BitPuffinwith gc:none opt:size d:release and so on
19:54:34BitPuffintried lots of stuff
19:54:39EXetoC"for i in ..10"
19:55:37gradhaanybody got "H.P. Lovecraft: The Complete Fiction", is it any good?
19:55:53Araqgradha: I read pretty much all of Lovecraft
19:56:06Araqit's good but by today's standards not scary at all
19:56:06gradhaoh, that explains you writing compilers
19:56:23*OrionPKM joined #nimrod
19:56:30AraqOrionPKM: 60!
19:56:38EXetoCAraq: ok there's no iterator for that. do you think there should be one?
19:56:44dirkk0you are right down to 50 something: http://pastebin.com/KgNFj69h
19:57:37OrionPKMaraq hm?
19:57:47gradhadirkk0: maybe nimrod should generate all the C source code in a single line followed by semicolons
19:57:56*travisbrady quit (Quit: travisbrady)
19:58:07OrionPKMoh, people :p
19:58:10EXetoCdirkk0: yeah but what's left when the C compiler is done with it?
19:58:38AraqEXetoC: no. what would it gain us?
19:58:39dirkk0gradha: that would be cheating compared to the nimrod simplicity.
19:59:34OrionPKM59 now
19:59:58gradhadirkk0: somehow the word simplicity shouldn't include reviewing generated C source code by a tool
20:00:24AraqBitPuffin: -d:release --os:standalone -d:noSignalHandler iirc
20:00:41Araqmaybe --os:standalone ain't necessary, don't remember
20:00:46EXetoCAraq: just a little consistency
20:01:16OrionPKMAraq fowl
20:01:33OrionPKMi think the sigsegv in idetools has to do w/ how the project is structured, or at least one of them is
20:01:52OrionPKMif you import a file thats up a directory, it crashes
20:03:19OrionPKMI had (pseudo) /folder/file1.nim import /file2.nim, it crashed when I looked up a --def in file1, but when I moved file2 into /folder/ it worked
20:04:10gradhathe relative import is using ../ explicitly or through a nimrod.cfg with path=..?
20:04:10dirkk0my point was basically - will I be able to change the c code manually after the nimrod compilation.
20:04:21*mflamer_ joined #nimrod
20:04:46*mflamer_ quit (Remote host closed the connection)
20:04:47Araqdirkk0: yes. nobody does it, but yes you can do it.
20:05:04gradhadirkk0: what changes to you plan on doing?
20:05:05AraqI regularly edit the generated assembler
20:05:55gradhaAraq: but do you use a computer or a butterfly to change the assembler?
20:06:04OrionPKMgradha no, not quite so simple
20:06:29OrionPKMwhen the program is compiled there is actually a 3rd file importing folder/file1
20:06:41OrionPKMthe issue is when the 3rd file is the 'main project' file
20:06:48OrionPKMbut it's not specified in idetools
20:06:58Araqgradha: I have my own autoconf inspired toolchain, so that I can edit the nimrod code, run my scripts and that applies some diffs on the generated assembler to make it faster
20:07:35BitPuffinwhat's the convention for naming types that are procs?
20:07:58dirkk0that's what I was implying. Cool to see that Araq does this, too.
20:08:34EXetoCBitPuffin: that are procs?
20:08:48dirkk0In the JS world pre- and post-processing is needed. Like badly.
20:09:03gradhaAraq: bah assembler, it would be more hardcore if you had implement an autoconf like toolchain to modify the output generated by autoconf
20:09:11BitPuffinEXetoC: type balls = proc(a, b: int)
20:09:54gradhadirkk0: I wouldn't expect the generated C code to be an example of the generated JS code
20:10:03EXetoCI don't know. I use the 'Cb' suffix whenever it makes sense
20:10:28gradhadirkk0: plus for such intimate interaction you could likely implement yourself a fancy bridge with nimrod's emit
20:10:41BitPuffinEXetoC: yeah me too
20:10:45dirkk0gradha: that wasn't my point. Rather SASS and uglyfying.
20:10:47BitPuffinEXetoC: but should I put T in front of it?
20:11:21EXetoCthat makes sense to me
20:11:42gradhadirkk0: sorry, I'm lucky enough to avoid web thingies, so no idea what you are talking about
20:12:17zielmichaDo destructors work on references?
20:12:17dirkk0gradha: you are a very lucky man, then.
20:12:50OrionPKMI dont think I have a good way to determine the "proj.nim" project file dynamically for idetools
20:12:56gradhadirkk0: I even enjoy chocolate, as I'm doing right now
20:13:17*gradha is amazed by SNSD having a dedicated page in the spanish itunes store
20:13:20zielmicha(for things like calling "free" functions of external objects)
20:13:29OrionPKMif anyone has any brilliant ideas, let me know :p
20:13:35EXetoCBitPuffin: hm, maybe I should've just used a Proc suffix, but that's really verbose :>
20:14:23gradhaOrionPKM: you might want to ask zahary_, he also had to use heuristics to detect that for the vim plugin, can't recall what he ended up deciding and why though
20:14:47gradhaOrionPKM: maybe a good idea would be to look for .cfg files and pick the .nim one with the same base name?
20:15:02OrionPKMgradha possibly
20:15:29OrionPKMa .nimrod.cfg you mean? :)
20:15:44gradhaa proj.nimrod.cfg, wouldn't it?
20:16:07OrionPKMyes, but just .cfg could pick up a cfg file like "settings.cfg"
20:16:34gradhamaybe that's why they call them heuristics, because they rarely work
20:17:08OrionPKMhow about I just recurse up and try every .nim file until the call succeeds? :P
20:17:15OrionPKMdont see what could possibly go wrong there
20:18:06OrionPKMit would be nice to get a meaningful error message though, instead of sigsegv
20:18:08gradhayou need to query parents (../../) too to be sure
20:18:13dirkk0gradha: what is nimrods emit?
20:18:20OrionPKMthats what I meant gradha
20:18:25OrionPKMby recursively
20:18:27*Varriount_ joined #nimrod
20:18:30OrionPKMall the way to your root directory :p
20:19:00gradhaOrionPKM: ah, sorry, I'm used to recursivity mean down in the hierarchy, not up
20:19:27gradhadirkk0: here's an example https://github.com/Araq/Nimrod/blob/master/examples/objciface/gnustepex.nim#L4
20:19:30EXetoCso that naming format is only valid when a babel file is present?
20:19:47gradhadirkk0: it allows you to generate specific code for the underlying compiler/platform in cases of great necessity (or pure malice)
20:19:54EXetoCotherwise, should it just be nimrod.cfg?
20:20:28*travisbrady joined #nimrod
20:21:06OrionPKMthe naming format is file.nimrod.cfg
20:21:25OrionPKMthe file.cfg is ignored by the compiler now
20:21:55*Varriount quit (Ping timeout: 245 seconds)
20:21:55*Varriount_ is now known as Varriount
20:22:08gradhathere went the chance to make the filenames "project xxx for nimrod.configuration"
20:22:22dirkk0gradha: I see, thanks.
20:22:22EXetoCand for libs?
20:23:17OrionPKMI dont think it's any different from libraries
20:23:49EXetoCok so it's just an arbitrary prefix
20:24:13OrionPKMarbitrary?
20:24:48OrionPKMyourfilenamehere.nimrod.cfg
20:25:10OrionPKMyourfilenamehere.cfg is ignored by the compiler, but your program can use it
20:25:48Araqzielmicha: yes it should work. there is a bug that keeps destructors from working with generics though
20:29:25gradhathe record of 60 won't be recorded until dom96 is here to verify it in person
20:30:03OrionPKMwe're at 61 now
20:30:18OrionPKMnice thing about having my irc client in a browser :P
20:30:28gradhaOrionPKM: my client says otherwise, that's why we need a third impartial spectator
20:30:43EXetoCOrionPKM: the whole string is the filename, but yeah I know what you mean :p
20:31:41EXetoCso configs for libs are processed?
20:32:57dom9661 doesn't count, varriount was here twice.
20:33:03dom9660 is the current record.
20:33:10Araqhuh? really?
20:33:18AraqI thought we had 65 once
20:33:54OrionPKMI think it's just the project file's cfg
20:34:02dom96I don't think so.
20:34:08dom96Unless I missed that occurrence
20:34:25gradhadom96: you should teach NimBot a few tricks, like how to high five
20:37:47gradhalol, the gnustepex doesn't even compile, nobody noticed so far
20:38:33Araqgradha: well it worked for me once :P
20:39:05gradhamaybe before you copied and pasted, I'm seeing the version at http://gnustep.made-it.com/GSPT/xml/Tutorial_en.html is correct, you have to inherit NSObject, not Object
20:39:46EXetoCOrionPKM: ok so there is indeed a difference, in that there isn't even such a thing as a library cfg :p
20:39:55EXetoCI don't know if it'd be particularly useful
20:41:01gradhaAraq: btw, what's the point of putting the example in a separate dir and have it emit objc rather than put it in a separate file?
20:41:07BitPuffinEXetoC: why the proc suffix?
20:41:12BitPuffinAraq: chime in please
20:42:44EXetoCok Cb then, or nothing if it's not confusing
20:43:19AraqBitPuffin: well?
20:43:41AraqT for everything except P for ptr/ref/var
20:43:51Araqoh and E for exception
20:43:58Araqand F for Effect
20:44:25Araqbut we'll get rid of it anyway
20:44:53EXetoC:<
20:45:21BitPuffinAraq: so no separate prefix for callbacks/procs?
20:45:31AraqBitPuffin: T prefix
20:46:48BitPuffinAraq: and suffix?
20:47:19Araq'er' I guess ... TReader = proc (...)
20:47:37AraqTReadFunc is also common in the wrappers I think
20:47:58BitPuffinhmm
20:48:01BitPuffineven for callbacks
20:48:16zielmichaAraq: they don't, or am I doing something wrong? https://gist.github.com/zielmicha/7795223
20:48:25AraqCb suffix is fine, now go on with your life
20:48:29BitPuffinisn't proc a much better suffic for that lol
20:49:22gradhaAraq: sorry, I see now the gnustep example is indeed correct, for some reason there are two versions of the example which is confusing
20:50:23Araqzielmicha: well your destructor is attached to TThing, not PThing
20:50:31Araqyou need a finalizer for PThing
20:50:48zielmichawith (instance: var PThing) it doesn't work either
20:51:05Araqand yeah it's a feature request that a destructor is made into a finalizer
20:51:40zielmichaso there are no finalizers yet?
20:51:47Araqyes there are
20:52:06Araqas well as destructors but they are not aware of each other
20:52:11zielmichahow are they called? they are not described in manual
20:52:34Araqnew(foo, finalizer) attaches a finalizer to the type of foo
20:52:37Araqconfusing, I know
20:52:57Araqnote that it's really attached to the *type* and not only to the instance
20:53:36gradhaso you can do new(foo, finalizer); new(foo) and the second has the finalizer too? or it gets changed?
20:53:54Araq(instance: var PThing) should work if you put your example in a 'block'
20:54:33zielmichaI think we should mention them in "destructor pragma" manual section. I'll make pull request with changes.
20:54:39Araqgradha: second has finalizer too
20:54:48Araqzielmicha: alright excellent
20:55:57gradhaAraq: how does that work in the context of a 3rd party lib module? The module uses finalizers, but end users import the module and just use normal new, do they get finalizers too?
20:57:35Araqyes they do get finalizers too but nobody creates a module and says 'just new() the stuff'
20:57:53Araqthere will always be some constructor
20:58:14*brson quit (Ping timeout: 240 seconds)
20:59:43*tylere joined #nimrod
20:59:46gradhawith "new(foo, fin1); new(foo, fin2)" is fin2 called for both objects?
21:00:20tylereSo what is the right way to deal with (C-struct style) binary data? Like I say I know a file contains a bunch of, say 16-bit unsigned ints...what's the right way to handle something like that?
21:01:29tylereI mean, I know I could write code by hand to do it, but I kinda hope there is something better
21:01:35tylereSomething like python's struct module
21:02:46*brson joined #nimrod
21:02:48Araqdeclare an object with the proper fields and read that. that has some endian issues though
21:03:26Araqgradha: dunno, either fin1 or fin2. one overwrites the other. or not.
21:03:34tylereAraq: Yea, that's what I'm worried about.
21:03:49tylereThe file I have mind is a bit...weird. Including being in big-endian order
21:04:09gradhaI wrote https://github.com/gradha/epak, there is also the endians module if you prefer that
21:05:05BitPuffinAraq: seriously how do you get a nimrod hello world as a C
21:05:21AraqBitPuffin: I already told you
21:05:28gradhaBitPuffin: echo "Hello C"
21:06:33tylereBitPuffin: Compile it, then look in the nimcache directory
21:08:20*tylere quit (Remote host closed the connection)
21:08:53BitPuffinAraq: ah you did lol!
21:09:18gradhaAraq: with all that talk about nimrod being static it seems finalizers are very dynamic
21:10:16BitPuffinAraq: lib/system.nim(1830, 10) Error: cannot open 'panicoverride'
21:10:19BitPuffinlol
21:10:40gradhaBitPuffin: try without standalone
21:11:13AraqBitPuffin: you can find a panicoverride in the repo.
21:12:02Araqgradha: sometimes I provide a very useful feature before it's perfect
21:12:21BitPuffingradha: makes it hugee
21:12:25BitPuffinno not huge
21:12:26BitPuffinbut yeah
21:12:59gradhaBitPuffin: the other day I compiled hello world to 9KB, how much do you get?
21:13:14BitPuffingradha: 20
21:13:31gradhalooks like your world is bigger than mine then
21:14:18BitPuffinAraq: where should I put it? lib?
21:14:36Araqtests/manyloc/standalone contains an example
21:16:28BitPuffinstill 20k
21:17:00BitPuffinI just copied the panicoverride from there into the dir
21:18:54BitPuffinit dun dinnely work
21:20:15gradhaBitPuffin: use upx on the binary, see how much it compresses your hellos
21:21:11BitPuffin13093 -> 7640 58.35% linux/ElfAMD test
21:21:21gradhawow, amd elfs
21:21:29BitPuffinupx: a.out: NotCompressibleException
21:21:37BitPuffinhaha
21:22:02BitPuffinyay, with compression it is the same!!
21:23:05BitPuffinuh
21:23:16BitPuffinrecompiled and it doesn't compress
21:23:18BitPuffinthat's weird
21:23:53BitPuffinah wait
21:24:27*achim quit (Quit: Computer has gone to sleep.)
21:25:01*gradha waits patiently
21:25:17BitPuffingradha: WAAAIT
21:26:18*gradha compiles and runs "while true: WAAAAIT(BitPuffin)"
21:27:11BitPuffingradha: scrots or it didn't happen
21:27:33gradhaBitPuffin: well, I'm in an infinite loop now, can't do much
21:27:50BitPuffingradha: open another terminal?
21:30:03gradhaBitPuffin: so you want a screenshot of an empty terminal?
21:30:45gradhahttp://dl.dropbox.com/u/145894/t/bitpuffin.png
21:31:15BitPuffingoodt
21:31:24BitPuffinNow let's cherish this moment
21:33:09gradhathere you go, try to optimize this to 10kb https://gist.github.com/gradha/7795983
21:33:46BitPuffinnah
21:33:50BitPuffindon't have time lol :D
21:39:08BitPuffinYAY THE COMPILER HANGS!
21:39:37dom96Araq: How's the nimbuild corruption finding going?
21:39:41BitPuffinBecause that's good when you have a deadline
21:40:04BitPuffinHint: file [Processing]
21:40:12BitPuffin:D :D :D :D :D :D :D :D :D :D
21:40:29gradhaBitPuffin: do you have a diff of what you changed to make that happen? that could be useful
21:40:40AraqBitPuffin: get the latest github version
21:40:45BitPuffingradha: I wasn't even working in that file
21:41:02Araqbabel support was broken
21:41:10BitPuffinwoa dat pull
21:41:11gradhaBitPuffin: it doesn't matter, you had a version which compiles, one which doesn't, see what changed
21:41:43BitPuffingradha: I removed libao and inserted portaudio
21:42:00BitPuffinnow it doesn't hang though
21:42:01BitPuffinwith latest
21:42:09BitPuffinEXetoC: think glfw may have broken with latest
21:42:20BitPuffin/home/isak/.babel/pkgs/nim-glfw-0.1.0/glfw/glfw.nim(1, 20) Error: cannot open 'wrappers/opengl/opengl'
21:42:27*Varriount_ joined #nimrod
21:42:43BitPuffinprobably since it's now in opengl/opengl or something
21:42:49BitPuffinEXetoC: you should also make opengl a dep
21:43:31BitPuffinEXetoC: are you gonna fix it nao or do you want me to pull request?
21:43:43EXetoCthat shouldn't be there anymore
21:43:46EXetoCwill fix it
21:43:49*dirkk0 quit (Quit: Leaving)
21:44:31EXetoCmission accomplished
21:45:24Araqdom96: I'm too tired to work on it
21:46:14*Varriount quit (Ping timeout: 240 seconds)
21:46:14*Varriount_ is now known as Varriount
21:46:42BitPuffinEXetoC: already pushed? :o
21:46:48EXetoCBitPuffin: ya
21:46:51gradhaBitPuffin: your game will be crossplatform?
21:46:52BitPuffinEXetoC: manly
21:46:57BitPuffingradha: yes
21:47:06EXetoCgradha: dude, obviously
21:47:07OrionPKMupx + strip guys
21:47:25gradhaEXetoC: for platform > 1?
21:48:21EXetoCgradha: as opposed to single-platform cross-platform? :p
21:49:16gradhaEXetoC: some people write crossplatform testing only one platform but advertise as n > 1, then those don't compile
21:49:21BitPuffinOrionPKM: after that it does not run lol
21:49:29dom96Araq: pity
21:49:36EXetoCoh. yeah I guess
21:49:37OrionPKMbitpuffin does for my program ;P
21:49:43OrionPKMstrip first, then upx
21:50:07gradhaAraq: if you've finished Lost you could try "Almost Human", heard good things about it
21:50:15BitPuffinOrionPKM: didn't change the size
21:50:19EXetoCAraq: were you saying that it's not possible to have "loadExtensions()" in the code, without getting any errors when no extensions are referenced?
21:50:25dom96gradha: I watch it, it's great.
21:50:42gradhaAraq: there you go, you should trust dom96
21:50:45EXetoCI'm not sure if that's what you thought I was asking about in the first place
21:50:47OrionPKMfor my IRC app it goes to 343 with strip, then 144 with upx
21:50:54OrionPKMgoes to like 230 or so without strip
21:51:00gradhadom96: do cool asian chicks appear?
21:51:10dom96gradha: Not really.
21:51:20gradhadom96: then I'm not watching
21:51:53dom96gradha: There is a Chinese guy that sells live futuristic snails.
21:52:13Araqhmmm "Almost human"
21:52:16dom96As food heh.
21:52:17EXetoCdom96: go on
21:52:25EXetoCinteresting
21:52:28dom96actually, it's technically slugs.
21:52:34dom96except not technically
21:52:39dom96it is precisely slugs
21:52:54Araqbut I also have the Dishonored DLC to play
21:53:27gradhaAraq: play it during the commercials?
21:54:10Araqwhat's that? commercials?
21:54:47Araqinternet's commercials don't work like that
21:54:58gradhayou have youtube without ads?
21:55:06EXetoCadblock!!
21:55:29dom96torrents ftw
21:57:05EXetoCgradha: you don't?
21:57:14gradhaGrimm: "A homicide detective discovers he is a descendant of hunters who fight supernatural forces."
21:57:34EXetoChow exciting
21:57:48gradhaEXetoC: the html5 player doesn't have them, they appear if I run chrome with flash
21:58:00EXetoC:<
21:59:10dom96adblock is so good that I was genuinely surprised at the amount of ads on websites which I would have thought were ad free when using somebody else's computer.
21:59:42gradhadom96: yeah, it's like "wtf, internet looks like this? how do people cope with it?"
22:00:20dom96yep. This reaction is even stronger when watching TV.
22:00:44dom96I must have saved years of my life by watching all my TV shows without any ads.
22:00:59gradhawhen I go to my parents house I actually watch the TV for the ads, they look intriguing when you are not spammed with them
22:02:23gradhaplus they are filled with this "reality people", so many neighbour hot women washing clothes and stuff, waiting for a miracle product to help them
22:02:41OrionPKMgradha, a better description: "A homicide detective discovers he is a descendant of hunters who fight furries."
22:03:24gradhaOrionPKM: since twillight werewolves have lost their beastlyness
22:03:31Araqwell I managed to take showers during the ads when I was still watching TV
22:04:06EXetoCthat's a lot of showers
22:05:15gradhaI've never met a hot neighbour who didn't know about miracle washing mashine powder, there's still hope
22:05:55AraqEXetoC: XD
22:06:15gradhadom96: let me guess, the robot is the black cop
22:06:24dom96gradha: yep
22:06:28dom96He's hilarious
22:06:39dom96That's the brilliance of the show
22:06:55gradha"Detective Valerie Stahl is a sharp beautiful, and very analytical. She has a secret that might go unnoticed.". Admiral Ackbar thinks it's a trap.
22:07:23gradha"Captain Sandra Maldonado, was originally envisioned as a man.". Hmm… I see a pattern here…
22:08:23Araqgradha: link?
22:08:45gradhahttp://sharetv.com/shows/almost_human/cast/valerie_stahl + http://sharetv.com/shows/almost_human/cast/capt_sandra_maldonado
22:09:28dom96gah, spoilers
22:09:48gradhaso it looks like it has come to this
22:10:24*radsoc joined #nimrod
22:10:59gradhadom96: the spoiler is that instead of robots they are all traps?
22:11:16radsocMFlamer : sorry I didn't have much time today to try your LFHT but just got this message at compile time: lockfreehash.nim(23, 18) Error: type mismatch. I'll try again tomorrow.
22:11:17dom96No that Valerie has a secret that might go unnoticed.
22:11:38radsocgood night
22:11:39gradhadom96: that's like a horoscope, you could say that about anybody
22:11:42*radsoc left #nimrod (#nimrod)
22:11:48BitPuffinhmm
22:12:05dom96gradha: true
22:12:15BitPuffinhow do I initialize a proc type to be a certain type?
22:12:16EXetoCBitPuffin: anything bad about nim-glfw's interface? if not, then there's not much else to do
22:12:25EXetoC1-2 procs might be missing, that's all
22:12:30BitPuffinEXetoC: not that has struck me yet at least
22:12:34EXetoCBitPuffin: type? value?
22:12:36EXetoCok
22:12:42BitPuffinEXetoC: value
22:12:43gradha"Araq, creator of nimrod. He has a secret that might go unnoticed."
22:13:03Araqyeah that's damn right
22:13:04gradha"Gradha, honey badger. He has a secret that might go unnoticed."
22:13:07EXetoCa type is just a declaration. you need to create a var
22:13:22BitPuffinEXetoC: yeah I know but how do I make it match the type
22:13:33gradha"Dom96, a god. Has a secret that might go unnoticed."
22:13:43gradhaThere you go, you can fill those in your facebook profile pages
22:13:49BitPuffinEXetoC: or ah it also has to be a ptr
22:14:00BitPuffinhow do I make a proc ptr xD
22:14:03EXetoCno I don't think so
22:14:07dom96hehe
22:14:17EXetoCif the type isn't also a "ptr proc..."
22:14:23BitPuffinEXetoC: it is
22:14:36BitPuffin PDeviceCallback* = ptr TStreamCallback
22:14:38dom96anyone wanna optimise an opengl nimrod benchmark?
22:15:08*gradha takes one step behind the line
22:15:23gradhaoh, so many volunteers!
22:15:45BitPuffinAraq: how do I make a ptr proc
22:15:55EXetoCBitPuffin: no idea. why do you need it? for the sake of binary compatibility?
22:16:03BitPuffinEXetoC: yeah
22:16:28BitPuffinEXetoC: openDefaultStream takes a ptr TStreamCallback
22:17:41AraqBitPuffin: some say it's then "ptr proc ..."
22:17:42dom96I guess the prospect of optimisation isn't as exciting as I thought...
22:18:00BitPuffindom96: it is but I'm busy
22:18:35Araqdom96: the problem is that it'll run optimal on my machine but then on the official benchmark machine will lose against some C++ version with 0.1% time difference
22:19:30dom96Araq: I'll ask the guy about how it compares on his machine.
22:19:38EXetoCBitPuffin: I don't know if that's correctly annotated then
22:19:58EXetoCif you look at portaudio.h
22:20:24BitPuffinEXetoC: I was suspecting that maybe it was c2nim's fault
22:21:42dom96Araq: Just need to get it as fast as possible.
22:22:01BitPuffinEXetoC: what should it be then?
22:22:04BitPuffinjust proc?
22:22:50EXetoCBitPuffin: yes, but then 'ptr' would also have to be omitted from the definition, if TStreamCallback is indeed a proc type
22:23:00Araqdom96: alright show me what you got
22:23:33BitPuffinEXetoC: from the definition?
22:24:02dom96Araq: https://gist.github.com/dom96/485c7a97472d31dc6b6e
22:24:27EXetoCBitPuffin: yeah, the 'ptr' for openDefaultStream
22:24:28EXetoCunless I'm misreading portaudio.h and it is indeed a pointer to a function pointer, but I suspect that it isn't
22:25:04NimBotAraq/Nimrod master da687af Hitesh Jasani [+0 ±1 -0]: Add docs for connecting to postgres with keyword/value connection... 1 more lines
22:25:04NimBotAraq/Nimrod master f340eb3 Grzegorz Adam Hankiewicz [+0 ±1 -0]: Merge pull request #706 from hiteshjasani/master... 2 more lines
22:25:46BitPuffinEXetoC: hmm tricky wan
22:26:36BitPuffinEXetoC: but wouldn't the parameter just be PaStreamCallback callback ?
22:27:04BitPuffinI'm gonna try in
22:28:26EXetoCI think so, if by that you mean "streamCallback: ptr PaStreamCallback" -> "streamCallback: PaStreamCallback"
22:29:02*zielmicha1 joined #nimrod
22:29:05Araqgradha: uh oh
22:29:15Araqwhy did you merge that postgres stuff?
22:29:30Araqlooked suspicous to me
22:29:45gradhathe author changed it into a docstring
22:29:50BitPuffinEXetoC: well I meant in C
22:30:00*zielmicha quit (Ping timeout: 245 seconds)
22:30:39Araqcan somebody enhance the tester to run over any babel package and checks it compiles?
22:30:43EXetoCI guess it depends on what the typedef looks like
22:31:10Araqdom96: no threading this time?
22:31:40dom96no
22:32:14*MFlamer quit (Read error: Connection reset by peer)
22:33:38EXetoCBitPuffin: and I don't see a '*' before the parameter list where the typedef is, but it's included where it's being used
22:33:47EXetoChopefully these are somewhat educated guesses :p
22:34:11Araqdom96: are we allowed to multi-thread it?
22:34:13*MFlamer joined #nimrod
22:34:34dom96Araq: I don't think so.
22:34:47dom96Araq: https://github.com/logicchains/ParticleBench
22:35:02BitPuffinEXetoC: yeah we'll see if this crashes on us :P
22:36:38OrionPKMdont see a nimrod version
22:38:01BitPuffinbenchmarking opengl in different languages is the most pointless thing ever btw
22:38:29VarriountDoesn't it all depend on video drivers?
22:38:40VarriountOr the firmware of the video card?
22:39:05BitPuffinsince it is all pipelined and happens on the gpu, except for in the case where the transfer of calls and data to the GPU happens faster than the application reaches the next call to the gpu there can't be any difference
22:39:14BitPuffinbecause then the bottleneck is on the GPU
22:39:26OrionPKMyeah, should be software rendering benchmark
22:40:06OrionPKMstill the CPU can slow things down a lot for gl programs, i doubt those programs all run at the same speed
22:40:10gradhaAraq: maybe not enhace the tester, but https://gist.github.com/gradha/7796905 builds and tests the stuff
22:40:43BitPuffinAnd I'd say that if you architect your application properly it is very rare that the cpu doesn't reach the point of the next call before the gpu finishes and that's not very relevant to the language
22:40:46Araqgradha: we don't believe in unix shell scripting here
22:40:59EXetoCmaybe it does some CPU-heavy stuff, but then it's not just an OpenGL benchmark
22:41:07EXetoCseems kinda pointless either way
22:41:14BitPuffinEXetoC: well then it's not an opengl benchmark period
22:41:27BitPuffinbenchmarking opengl has nothing to do with the application level
22:41:38BitPuffinwhen you benchmark opengl you benchmark the driver and gpu
22:42:10BitPuffinbut sure the application can be the bottleneck but then it's not related to language, it's the design of the program
22:42:19MFlamerIt's a particle system, thats gonna be cpu bound
22:42:29MFlamerunless its openCL
22:42:36gradhagood night, honey badgers
22:42:48*gradha quit (Quit: bbl, need to watch http://www.youtube.com/watch?v=hcDEWiH-ciw again)
22:42:50dom96indeed, there is a lot of objects created I think.
22:43:11BitPuffinMFlamer: well then it isn't really an opengl benchmark, and I'm pretty sure you should do particle simulation in the vertex shader anyway
22:43:27BitPuffinunless ofc the gpu is extremely busy and the cpu is just hangin around
22:43:35OrionPKMso its called "ParticleBench" not "OpenGL bench"
22:43:39BitPuffinbut at that point it's gonna vary on different hardware anyway
22:43:47OrionPKMOpenGL is just a visualization
22:43:58BitPuffinah
22:43:59BitPuffinwell
22:44:01OrionPKMthats true of every benchmark
22:44:24BitPuffinOrionPKM: well I mean at the point where you make such architecture decisions
22:44:33MFlamerYeah, I suppose a vertex shader would work pretty well for particle stuff
22:44:34BitPuffinwhich you don't really do in benchmarks
22:44:48BitPuffinMFlamer: if not then the compute shader is excellent
22:44:49AraqMFlamer: TAny is as close as Top as you can get when you've value based types
22:45:14*zielmicha1 quit (Ping timeout: 264 seconds)
22:45:15OrionPKMmflamer vertex shaders cant create vertices
22:45:21OrionPKMyou'd need a geometry shader for that
22:45:40EXetoCdo you mean BitPuffin?
22:45:47EXetoCnvm I misread
22:46:34MFlamerAraq: can we instantiate generics with TAny? I havent looked into that one, I'll check it out. Did my use case make a litle sense?
22:47:04Araqhaven't looked at your use case, sorry
22:47:24MFlamerOrionPKM: Yeah, I know tesselation shader even better than geometry shader, right?
22:47:31Araqand TAny is only the representation part at runtime
22:47:40Araqthere are no converters to TAny
22:47:49OrionPKMmflamer I stopped paying attention after SM 3 :)
22:48:06MFlamerAraq: No worries, I knoe you have much more pressing issues
22:48:07OrionPKMI havent done graphics stuff since college
22:48:14BitPuffinOrionPKM: what's vertices got to do with particle simulation
22:48:30OrionPKMeach particle = 1 vertice in a vertex buffer, typically
22:48:43BitPuffinOrionPKM: yeah but the vertex is passed in
22:48:48MFlamerOrionPKM: I'm not up to date either, that arena moves very quickly
22:49:05BitPuffinthat's like suggesting that we can't project geometry because the vertex shader can't create vertices
22:49:05OrionPKMyeah the vertex is created on the CPU
22:49:11OrionPKMunless it's from a geometry shader
22:49:32BitPuffinOrionPKM: yeah but you can still update it in the vertex shader
22:49:40BitPuffinthe simulation doesn't have to happen on the cpu
22:50:40MFlamerbrb
22:50:54OrionPKMyeah you can translate vertices, what's your point
22:51:16BitPuffinOrionPKM: I mean that you can simulate the particle's movement in the vertex shader
22:51:30OrionPKMyes, you can
22:51:34BitPuffinofc it can't react to the environment
22:51:45BitPuffinfor that you'd need to do it either in a compute shader or on the cpu
22:51:58Varriount BitPuffin why not?
22:51:59OrionPKMwell, I wouldn't say that, but okay
22:52:31BitPuffinVarriount: Because the vertex shader deals with one vertex at a time and doesn't know about the surrounding world
22:52:44BitPuffinunless you pass in some uniforms etc, but that storage is limited
22:52:46OrionPKMit can know about the surrounding world if you tell the shader about the surrounding world
22:53:19BitPuffinwell
22:53:32BitPuffinactually that's not even the reason why it can't react to the world
22:53:52BitPuffinsimulating particles in the vertex shaders means that it's stateless and has to be according to a function of time
22:54:26VarriountBitPuffin, how much data can a vertex hold?
22:54:48OrionPKMcolor/xyzw
22:54:58Varriountw?
22:55:06BitPuffinBut I guess you could pass something in to that function of time but then you'd have to keep passing in the same thing in order for the result in the future to be deterministic
22:55:13BitPuffinso you'd run out of memory
22:55:30OrionPKMyou're generalizing
22:55:44BitPuffinVarriount: you mean how many slots there are for uniforms and attributes?
22:56:51OrionPKMvarriount vector4
22:57:19BitPuffinOrionPKM: what do you mean I am generalizing
22:57:33OrionPKMI mean your environment might just be a simple XZ plane
22:57:53OrionPKMparticles could easily bounce off of it
22:58:15BitPuffinOrionPKM: well sure but the environment can't change
22:58:47BitPuffinOrionPKM: and if it does change, in order for the result to be the same you are gonna have to keep passing in all the previous changes continuously
23:00:31*Varriount_ joined #nimrod
23:02:10OrionPKMvarriount did you get my message?
23:02:56BitPuffinVarriount: if you wanna know how much data can be associated per vertex you are gonna have to get the least required vertex attributes for the GL version you are targeting, or for your gpu glGet(GL_MAX_VERTEX_ATTRIBS)
23:03:27BitPuffinVarriount: and then if you want to know how much data can be associated per vertex batch you are gonna have to look up how many uniforms you can have in the gl version or on your gpu
23:03:35*Varriount quit (Ping timeout: 245 seconds)
23:03:35*Varriount_ is now known as Varriount
23:03:43MFlamerAraq: the idea was to have a type that can be used to instantiate a "None" variant of some type like TBTree[string]. Basicly a useless dummy type that can pass for anything, but do nothing
23:04:10Araqwell we have 'void' for that
23:04:15BitPuffin GL_MAX_VERTEX_UNIFORM_COMPONENTS​
23:04:31Araqand TTable[TKey, void] is conceptually a TSet[TKey]
23:04:42Araqit's quite useful indeed
23:04:59MFlameroh, ok maybe that all I need
23:05:39Araqdom96: please post your benchmark on the forum and see what people will come up with
23:07:40EXetoCMFlamer: yeah, I thought it would be useful for some generic args for example
23:08:06EXetoCwhere you do something different if it is "void", but void cannot be instantiated atm
23:09:52MFlamerA simple example is in TMaybe[T] where you would want a None variant that has no fields, so T is useless. I dont want None to need a type to instantiate
23:10:42dom96Araq: Ok, i'll do that later.
23:10:43dom96Good night
23:10:52EXetoCisn't it basically a type in Rust? an enumerator that doesn't have any fields
23:11:16MFlamerI'll have to see how fowl handles this in his Maybe implementation
23:12:00MFlamerTMaybe[T] has 2 variants Just[T] x: T and None
23:13:19MFlamerJust[T] has 1 field of type T, None has no fields so a None of TMaybe[int] should be the same and be interchangeable with a None of TMaybe[string]
23:13:59MFlamerI think I have tried void and it does not serve this purpose
23:14:43MFlamera constructor function "None(): TMaybe[?]".......thats the problem
23:15:08EXetoCyes, it's verbose
23:15:43fowlmine is just tuple[bool, T]
23:15:52EXetoCI think I tried to shorten something similar at one point, but I might've run into a limitation with 'converter' then
23:16:53MFlamerfowl: OK, so true and false are the same size
23:16:56fowli decided to it this way for two main reasons: it doesnt save an space to use a variant type, with variant type its impossible to switch between them without reset()ing the object
23:17:49fowlalso, being able to do if(var (has, val) = someMaybeOp(); has): use val
23:17:53EXetoCMFlamer: what else? should it resize dynamically?
23:18:25MFlamerfowl: Yeah, I'm trying to hack together an alternative rep for variants that uses a struct instead of a union to avoid the size thing, pretty tough though
23:21:05fowlwell i dont see how you can avoid it, None[T] and Just[T] have to be the same size
23:21:17MFlamerEXetoC: not necessarily, thats a different issue. I guess for now I'll have to live witha none constructor like "None[int](): TMaybe[int]"
23:22:23EXetoCfowl: unless you allocate, which is what I was implying. that sucks obviously :p
23:22:51MFlamerfowl: Only with the backend creating a union. Theoreticly possible to generate a different struct for each variant. I have started a compiler patch, but there are some parts of it that I just dont know how to accomplish yet
23:24:00MFlamerYeah, or allocate. Which is how most compilers do ADT's
23:25:26fowlah
23:25:34EXetoCis the difference purely conceptual in this case? struct vs union
23:27:01MFlamerwell, with strucs each variant can be a different size. So, "None" only needs to be a byte or whatever to hold the variant tag, While Some[T] couls be huge
23:27:07MFlamercould*
23:27:52MFlamerbut, you could never reset
23:28:55MFlamerif thats what you meant
23:31:55EXetoCit's common to allocate in this case? I just thought it might incur some runtime overhead
23:34:12MFlamerI'm no expert but, I believe Haskell and Rust (ADT's or enums with fields) are represented as a pointer to the struct(fields) and a variant tag. So each variant is the same size (like 2 words for example)
23:36:29MFlamerthere's another indirection, but that's the price you pay for the elegance of ADT's
23:41:06EXetoCdo you really save so much space in general that it's worth allocating?
23:44:20MFlamerwith a simple type like Maybe, probably not, but with big trees you might
23:45:25EXetoCcan't the actual var be dynamically allocated then? if said programmer realizes that it incurs a lot of overhead
23:46:37EXetoCor maybe that would be a common occurrence. I wouldn't know really
23:48:28MFlamerIn a functional language like haskell, everything is dynamicly allocated but immutable so there is no choice
23:48:45EXetoCright
23:52:33EXetoCso what if the compiler decides what to do for each individual type? if it's not too much work to implement
23:53:31MFlamerwhat do you mean?
23:54:17MFlamerlike, allocate dyn for large stuff and just use a union otherwise?
23:54:29EXetoCsomething like that
23:55:02EXetoCdoes that make sense?
23:56:22MFlamerThe user could just make that decision as it stands now. It just gets more verbose because then you have an object with variants and the seperate objects for the actual fields
23:57:15MFlamerBut, we could also package all this up into a sweet macro
23:58:00MFlamerwhich brings me to a question I've been wanting to ask...
23:58:24MFlamercan you move up the ast in a macro?
23:58:47fowlup from callsite()?
23:58:50EXetoCno, you can't go outside the call site
23:59:03MFlamerlike if the user is in a type block and we want him to call a macro that creates some proc
23:59:12MFlameryes, up from callsite
23:59:29fowlno
23:59:31EXetoCMFlamer: macro for what? for defining the allocation strategy or something else?
23:59:40MFlamerok, thanks fowl
23:59:56fowlonce types are usable in type sections, its concievable that you could return a stmt list where you could define procs