<< 09-12-2017 >>

00:01:31*nsf quit (Quit: WeeChat 1.9.1)
00:03:04*yglukhov joined #nim
00:07:32*yglukhov quit (Ping timeout: 255 seconds)
00:45:52*Sembei quit (Quit: WeeChat 2.1-dev)
00:48:47*rbrt quit (Quit: Oíche mhaith)
00:52:33FromGitter<RedBeard0531> @dom96 updated. I left it as `fut.addCallback proc(f: Future[T]) =` since the syntax gets weird when I tried to put the proc on the next line.
00:55:11dom96I changed it manually :)
01:15:25*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
01:16:33*rbrt joined #nim
01:16:58FromGitter<Varriount> Araq: You should tell http://www.gii.upv.es/tlsf/main/used about your use of TLSF
01:19:05*madpat quit (Ping timeout: 240 seconds)
01:28:04*madpat joined #nim
01:32:27*madpat quit (Ping timeout: 240 seconds)
01:41:17*rbrt quit (Quit: Oíche mhaith)
01:42:07*madpat joined #nim
01:46:58*rbrt joined #nim
01:47:26*vlad1777d quit (Ping timeout: 260 seconds)
01:49:00*rbrt quit (Client Quit)
02:07:54*guest_monkey joined #nim
02:08:17guest_monkeyhi, how do i delete my Nim Forum account?
02:14:59*vivus quit (Quit: Leaving)
02:16:31FromGitter<zacharycarter> @Varriount - I just realized, I'm pretty sure it's possible to write code for Unity w/ Nim
02:17:37FromGitter<Varriount> @zacharycarter I thought Unity was C# and Javascript only?
02:18:36FromGitter<zacharycarter> https://docs.unity3d.com/560/Documentation/Manual/NativePlugins.html
02:18:39FromGitter<zacharycarter> says it's legacy though :/
02:18:47FromGitter<zacharycarter> dunno if it would work w/ the current version of Unity
02:19:39FromGitter<zacharycarter> oh, it is
02:19:40FromGitter<zacharycarter> https://docs.unity3d.com/Manual/NativePlugins.html
02:21:26FromGitter<zacharycarter> I was just told you had to reload the editor to reload a native plugin though so who knows
02:22:31FromGitter<Varriount> @zacharycarter I wonder which would be better - good support for Unity, or good support for Unreal Engine
02:23:50FromGitter<zacharycarter> Unity has a much larger user base
02:24:17FromGitter<zacharycarter> but I don't know if it has the kind of user base that would evaluate Nim
02:24:22FromGitter<Varriount> :/
02:25:13FromGitter<zacharycarter> I was checking out Stingray / Lumberyard yesterday to evaluate those for Nim
02:25:14FromGitter<Varriount> I feel like Unreal Engine is gaining traction though. I keep seeing a number of video on Youtube demonstrating neat things people have done with UE.
02:25:49FromGitter<Varriount> Though, given Youtube's heuristic recommendations, that's probably just confirmation bias.
02:25:58FromGitter<zacharycarter> Stringray can call native code via Lua
02:26:20FromGitter<zacharycarter> but I think Stingray is also one of the best written engines
02:27:04FromGitter<zacharycarter> Lumberyard is just a fork of crytek so I think it's also using LuaJIT
02:27:07FromGitter<Varriount> But how popular is it?
02:27:14FromGitter<zacharycarter> not very now that Autodesk owns it
02:27:29FromGitter<zacharycarter> it's just really well architected
02:28:04FromGitter<zacharycarter> and the engineering team is smart
02:28:19FromGitter<zacharycarter> http://bitsquid.blogspot.com/
02:29:45FromGitter<zacharycarter> https://bitbucket.org/bitsquid/foundation
02:29:57FromGitter<zacharycarter> was part of the core of the bitsquid, now stingray engine
02:30:28FromGitter<Varriount> Looks pretty neat.
02:30:37FromGitter<Varriount> By the way, how is your own engine coming along?
02:31:09FromGitter<zacharycarter> Well... I'm kind of in decision paralysis mode
02:31:31FromGitter<zacharycarter> I want to use Nim in whatever project I work on
02:32:27FromGitter<zacharycarter> I want to make a game and the RTS genre was brought up and I think a RTS would be a pretty challenging game genre to implement
02:32:39*guest_monkey left #nim (#nim)
02:33:09FromGitter<zacharycarter> so I've gotten hooked on that idea, but I also want to make the game open source - so I first started exploring how to produce 2d art but then someone mentioned the game would be better off 3d
02:33:32FromGitter<zacharycarter> so then I started thinking about whether I want to use 3d or not, and if I do, what my options are as far as engines go
02:33:50FromGitter<zacharycarter> Godot seems to be the only viable option, and I don't really want to use godot
02:34:06FromGitter<zacharycarter> besides just using bgfx and writing my own game and trying to keep the engine work minimal
02:34:15FromGitter<Varriount> What are your reasons for not wanting to use Godot?
02:34:55FromGitter<zacharycarter> At the moment it's not very well documented, especially the newer features
02:35:56FromGitter<zacharycarter> I also have no idea how it's going to perform
02:37:06FromGitter<zacharycarter> and of course it's an engine I don't know the codebase of so doing anything besides writing extension / gameplay code means learning the codebase
02:39:29*SenasOzys quit (Ping timeout: 248 seconds)
02:40:53FromGitter<zacharycarter> @Varriount I've recently been thinking about trying to reproduce : https://github.com/JoeyDeVries/Cell but in Nim and with BGFX
02:41:54subsetparkMan - AoC Day 7 gave me a run for my money but I got it down.
02:43:03subsetparkI never really made any wrong moves, I just made each right move subtly wrong, the first time.
02:43:05FromGitter<Varriount> AoC?
02:43:15subsetparkAdvent of Code - http://adventofcode.com/2017
02:46:20*d10n-work quit (Quit: Connection closed for inactivity)
02:49:50*skrylar joined #nim
02:50:16*rauss joined #nim
02:54:33skrylarmratsim: looks like binding zstd isn't too big of a deal
02:59:31*chemist69 quit (Ping timeout: 240 seconds)
03:11:21*CavariuXx joined #nim
03:11:57CavariuXxHi dom96 are you available or someone who has some experience crosscompiling nim? Sorry to bother
03:13:04FromGitter<zacharycarter> what are you trying to target?
03:13:09FromGitter<zacharycarter> and from what OS?
03:13:44*chemist69 joined #nim
03:13:45skrylarNimble: Error: unhandled exception: Connection was closed before full request has been made [ProtocolError]
03:13:46skrylar:(
03:13:47CavariuXxI'm trying yo target i686 architecture and I'm in Linux 64bits Ubuntu, I compiled binutils and gcc without dependencies
03:14:17CavariuXxBut whenever I try to compile nim with the crosscompiler I get size of array 'Nim_and_C_compiler_disagree_on_target_architecture' is negative
03:14:38CavariuXxAnd I'm setting --cpu:i386 (since theres no i686 option)
03:15:16FromGitter<zacharycarter> I think that means you're using the wrong compiler
03:15:47FromGitter<zacharycarter> I could definitely be wrong though
03:15:51CavariuXxI am manually setting the compiler with --gcc.exe
03:16:41CavariuXxI was trying to be solo just following osdev wiki with nim but ended copying the basics from nimkernel but it isn't working :(
03:17:19FromGitter<zacharycarter> I think your problem is you're trying to compile to an architecture that your compiler doesn't support
03:18:26CavariuXxhmm for target while compiling gcc I put i686 and it's the architecture the whole wiki uses
03:18:31CavariuXxany idea how I could test this?
03:19:36FromGitter<zacharycarter> generally when cross compiling, at least in my experience, you need a toolchain that targets the architecture you're trying to compile to
03:20:28FromGitter<cavariux> I moved from irc to gitter, but thanks will look into it
03:20:36*CavariuXx quit (Quit: Page closed)
03:21:31FromGitter<zacharycarter> No problem, let me see if I can point you to an example of how to do it
03:22:11FromGitter<cavariux> If you have one it would be great thanks
03:22:34FromGitter<zacharycarter> so this is the part of the docs you need to read : https://nim-lang.org/docs/nimc.html#cross-compilation
03:22:39FromGitter<zacharycarter> especially this part
03:23:42FromGitter<cavariux> thank you  will give it a read
03:23:45FromGitter<zacharycarter> well that whole section is relevant to your question so it's all important :)
03:23:50FromGitter<zacharycarter> np
03:27:52FromGitter<zacharycarter> maybe also check out - https://wiki.ubuntu.com/ToolChain ? I'm not sure :/
03:33:01*madpat quit (Ping timeout: 260 seconds)
03:36:46*marenz_ joined #nim
03:40:36*marenz__ quit (Ping timeout: 260 seconds)
03:50:32*yglukhov joined #nim
03:53:59FromGitter<Varriount> @cavariux Hm, I don't know when Nimkernel was last tested. dom96 would know more.
03:54:28FromGitter<Varriount> However It's probably around nighttime where he is now.
03:54:41*yglukhov quit (Ping timeout: 248 seconds)
03:54:41FromGitter<cavariux> @Varriount do you know his time zone so I can talk to him?
03:55:07FromGitter<cavariux> Cause I'm cloning nimkernel directly and following everything even doing my own tweaks but nothing 
03:55:21FromGitter<Varriount> I know he's somewhere in the UK
03:55:40FromGitter<Varriount> What problems are you currently having?
03:55:56FromGitter<cavariux> gcc and nimbase aren't good pals
03:56:19FromGitter<cavariux> it continues throwing me an error of C and Nim not sharing the same architecture
03:56:28FromGitter<cavariux> When I'm using the same compiler for everything
03:56:56FromGitter<Varriount> Then your Nim compiler was built for 64 bit, and GCC is using 32 bit or vise-versa
03:57:04FromGitter<cavariux> (https://files.gitter.im/nim-lang/Nim/1RYQ/image.png)
03:57:05FromGitter<Varriount> There should be a flag... Hm
03:57:43FromGitter<cavariux> GCC more than sure is using 32 but Nim could be 64
03:58:19FromGitter<Varriount> Before you try building Nimkernel, have you tested out a simple 'hello world' program?
03:58:52FromGitter<cavariux> Yep, but it ran
03:59:19FromGitter<Varriount> Hm.
03:59:49FromGitter<Varriount> https://github.com/dom96/nimkernel/blob/master/main.nim.cfg
04:00:11FromGitter<cavariux> I'm using that one and have been tweaking it to try test different --cpu and flags
04:00:23FromGitter<Varriount> `--cpu:i386` means that the Nim compiler will target i386 (32bit) when compiling main.nim
04:00:44FromGitter<Varriount> So you'll need to pass in flags to gcc that tell it to compile 32-bit executables
04:01:03FromGitter<Varriount> (using `--passC` and `--passL`
04:01:05FromGitter<Varriount> )
04:01:49FromGitter<cavariux> Okay that makes sense but I'm compiling GCC with 32 bits using i686 architecture
04:02:37FromGitter<Varriount> Is this the GCC that the instructions say to build?
04:03:03FromGitter<cavariux> I tried those instructions failed then moved to read OSDev wiki and failed again
04:03:23FromGitter<cavariux> I have tried i586 and i686 with same results
04:03:49FromGitter<Varriount> How did the GCC builds fail?
04:05:01FromGitter<cavariux> The gcc build doesn't fail, the one that fails is when I try to compile Nim, it throws me this error ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a2b60ed87680e6230ec95f5]
04:07:50FromGitter<Varriount> @cavariux What is the output of `which gcc`?
04:08:17FromGitter<cavariux> The path where I compiled the cross compiler
04:11:45FromGitter<Varriount> @cavariux Could you compile this using the cross-compiled gcc? https://gist.github.com/Varriount/22bc8c1476fe34a60104a073ac1dd929
04:12:19FromGitter<cavariux> I'm recompiling the cc but after will try
04:29:23FromGitter<Varriount> @cavariux Any luck?
04:43:08FromGitter<cavariux> When I try compile your code I don't have the standart in the standalone compiler
04:43:12FromGitter<cavariux> And still no luck with the other code
04:44:16FromGitter<cavariux> (https://files.gitter.im/nim-lang/Nim/Ld5y/image.png)
04:44:25FromGitter<cavariux> Will go to sleep but that's my error
04:44:35FromGitter<cavariux> Thanks for the help still will try again tomorrow with fresh brain
04:47:45*endragor joined #nim
05:06:06*endragor quit (*.net *.split)
05:06:06*skrylar quit (*.net *.split)
05:06:06*xet7 quit (*.net *.split)
05:06:06*dexterk quit (*.net *.split)
05:06:06*SunDwarf quit (*.net *.split)
05:06:07*kier quit (*.net *.split)
05:06:07*craigger quit (*.net *.split)
05:06:07*onionhammer quit (*.net *.split)
05:06:07*ryanhowe quit (*.net *.split)
05:06:07*macsek1911[m] quit (*.net *.split)
05:06:08*unclechu quit (*.net *.split)
05:06:08*xkapastel quit (*.net *.split)
05:06:08*noonien quit (*.net *.split)
05:06:08*surma quit (*.net *.split)
05:06:08*Nikky quit (*.net *.split)
05:06:08*Lord_Nightmare quit (*.net *.split)
05:06:09*Guest35620 quit (*.net *.split)
05:06:09*chemist69 quit (*.net *.split)
05:06:09*planetis[m] quit (*.net *.split)
05:06:09*TheManiac quit (*.net *.split)
05:06:09*watzon quit (*.net *.split)
05:06:09*Miguelngel[m] quit (*.net *.split)
05:06:09*Jipok[m] quit (*.net *.split)
05:06:09*Demos[m] quit (*.net *.split)
05:06:09*redlegion quit (*.net *.split)
05:06:10*mal`` quit (*.net *.split)
05:06:10*Xe quit (*.net *.split)
05:06:10*benoliver999 quit (*.net *.split)
05:06:10*notdekka[m] quit (*.net *.split)
05:06:10*byteflame quit (*.net *.split)
05:06:11*vqrs quit (*.net *.split)
05:06:11*exit70 quit (*.net *.split)
05:06:11*flyx quit (*.net *.split)
05:06:11*JStoker quit (*.net *.split)
05:06:11*awal quit (*.net *.split)
05:06:11*Amun_Ra quit (*.net *.split)
05:06:11*GaveUp quit (*.net *.split)
05:06:11*programisto quit (*.net *.split)
05:06:11*jsn- quit (*.net *.split)
05:06:12*rauss quit (*.net *.split)
05:06:12*avsej quit (*.net *.split)
05:06:12*ftsf quit (*.net *.split)
05:06:12*earenndil quit (*.net *.split)
05:06:12*Tanger quit (*.net *.split)
05:06:12*heinrich5991 quit (*.net *.split)
05:06:12*MosterAbyss quit (*.net *.split)
05:06:12*enthus1ast quit (*.net *.split)
05:06:12*yaiyan quit (*.net *.split)
05:06:12*niv quit (*.net *.split)
05:06:13*ldlework quit (*.net *.split)
05:06:13*def- quit (*.net *.split)
05:06:13*pigmej quit (*.net *.split)
05:08:19*MrAxilus[m] quit (Ping timeout: 243 seconds)
05:08:28*hohlerde quit (Ping timeout: 245 seconds)
05:08:32*jivank[m] quit (Ping timeout: 240 seconds)
05:08:32*dyce[m] quit (Ping timeout: 251 seconds)
05:08:46*shashlick quit (Ping timeout: 264 seconds)
05:08:47*georgeg[m] quit (Ping timeout: 252 seconds)
05:09:23*ehmry quit (Ping timeout: 276 seconds)
05:11:07*vqrs joined #nim
05:11:07*exit70 joined #nim
05:11:07*awal joined #nim
05:11:07*JStoker joined #nim
05:11:07*flyx joined #nim
05:11:07*Amun_Ra joined #nim
05:11:07*GaveUp joined #nim
05:11:07*jsn- joined #nim
05:11:07*programisto joined #nim
05:11:46*Xe joined #nim
05:13:23*Xe quit (Changing host)
05:13:23*Xe joined #nim
05:14:01*yaiyan joined #nim
05:14:01*niv joined #nim
05:14:01*ldlework joined #nim
05:14:01*def- joined #nim
05:14:01*pigmej joined #nim
05:14:35*chemist69 joined #nim
05:14:35*redlegion joined #nim
05:14:35*mal`` joined #nim
05:14:35*benoliver999 joined #nim
05:15:08*madpat joined #nim
05:15:08*endragor joined #nim
05:15:08*skrylar joined #nim
05:15:08*xet7 joined #nim
05:15:08*dexterk joined #nim
05:15:08*SunDwarf joined #nim
05:15:08*kier joined #nim
05:15:08*craigger joined #nim
05:15:08*onionhammer joined #nim
05:15:08*ryanhowe joined #nim
05:15:56*rauss joined #nim
05:15:56*avsej joined #nim
05:15:56*ftsf joined #nim
05:15:56*earenndil joined #nim
05:15:56*Tanger joined #nim
05:15:56*enthus1ast joined #nim
05:15:56*MosterAbyss joined #nim
05:16:35*heinrich5991 joined #nim
05:18:25*madpat quit (Ping timeout: 248 seconds)
05:18:55*madpat joined #nim
05:19:12*arnetheduck joined #nim
05:39:52*xkapastel joined #nim
05:39:52*noonien joined #nim
05:39:52*surma joined #nim
05:39:52*Nikky joined #nim
05:39:52*Lord_Nightmare joined #nim
05:39:52*Guest35620 joined #nim
05:40:03*xkapastel quit (Max SendQ exceeded)
05:41:06*xkapastel joined #nim
05:54:46*skrylar quit (Remote host closed the connection)
05:54:57*marenz_ quit (Ping timeout: 240 seconds)
05:56:13*yglukhov joined #nim
06:00:31*yglukhov quit (Ping timeout: 248 seconds)
06:04:47*dddddd quit (Remote host closed the connection)
06:08:57*madpat quit (Ping timeout: 240 seconds)
06:15:06*madpat joined #nim
06:16:20GitDisc<awr> is there a canonical way to overload the `$` operator on a type?
06:17:26GitDisc<awr> If I make a proc overloading `$` for the type, it works, but only within that module. but when I echo a var of that type from another module the system.nim `$` is used
06:21:42FromGitter<kayabaNerve> *
06:22:09FromGitter<kayabaNerve> Oh... for one with an existing $
06:22:16FromGitter<kayabaNerve> I think you have to specify in that case
06:23:45FromGitter<kayabaNerve> In myModule: proc `$`*(data: type): string = ⏎ ⏎ myModule.$(data) (I think...) ⏎ ⏎ You could also declare a proc and set it to equal the exported module from the file? [https://gitter.im/nim-lang/Nim?at=5a2b8164c65707ba2b2e2105]
06:26:45GitDisc<awr> well I want to overload $ so i don't have to explicitly call a proc when I echo a var of that type
06:28:49GitDisc<awr> I could just make a toString proc instead, but I'd like to do `echo(foo)` instead of the more verbose `echo(foo.toString())`
06:28:52FromGitter<kayabaNerve> So then can't you declare a proc in each file that is equal to the exported proc
06:28:57FromGitter<kayabaNerve> Or use as?
06:29:29FromGitter<kayabaNerve> (import as)
06:30:31GitDisc<treeform> what existing $ are you trying to override?
06:30:36GitDisc<awr> the system.nim one
06:30:43GitDisc<treeform> for which type?
06:31:41GitDisc<awr> a vector type that I made. It has a SIMD type in it so it doesn't look great when printed
06:32:22GitDisc<treeform> example?
06:34:00GitDisc<awr> ```nim
06:34:00GitDisc<awr> type m128* {.importc: "__m128i", header: "emmintrin.h".} = object
06:34:00GitDisc<awr> type Vector = object
06:34:00GitDisc<awr> simd :m128
06:34:00GitDisc<awr> ```
06:34:26GitDisc<awr> whoops
06:34:30GitDisc<awr> Vector should be public
06:34:45*jivank[m] joined #nim
06:36:25GitDisc<awr> I may have came up with something. system.nim $ doesn't work on distinct types. If I say Vector is a distinct object and borrow `.` i can define my own $ proc
06:38:25*xkapastel quit (Quit: Connection closed for inactivity)
06:41:41*BitPuffin|osx joined #nim
06:49:28*Survey_Helper joined #nim
06:49:36Survey_HelperHi
06:50:12Survey_HelperDoes anybody want to take a survey: https://www.provenbyusers.com/cs.php?c=567c871
06:51:49*astronavt joined #nim
06:57:05*astronavt quit (Quit: Leaving...)
06:57:28*astronavt joined #nim
07:03:59*Survey_Helper quit (Ping timeout: 260 seconds)
07:12:28FromGitter<mratsim> Travis OSX + Homebrew is broken :/
07:13:37FromGitter<mratsim> ```code paste, see link``` ⏎ ⏎ (Note: I need GCC for an optional dependency of Arraymancer) [https://gitter.im/nim-lang/Nim?at=5a2b8d21540c78242da1dd5f]
07:28:38Araqis that a Nim problem?
07:29:43*nsf joined #nim
07:30:46*solitudesf joined #nim
07:30:53Araqbtw am I the only one who finds "Unladen Swallow" a very dirty name?
07:35:31*endragor quit (Remote host closed the connection)
07:36:38*nohusuro joined #nim
07:42:30*mal`` quit (Quit: Leaving)
07:51:24*solitudesf quit (Ping timeout: 246 seconds)
07:52:32*mal`` joined #nim
07:57:33*notdekka[m] joined #nim
07:57:44*kunev joined #nim
07:58:07*claudiuinberlin joined #nim
08:00:45*madpat quit (Read error: Connection reset by peer)
08:04:16*georgeg[m] joined #nim
08:04:50FromGitter<Varriount> Araq: Are you talking about the failed Python JIT?
08:05:24*NimBot joined #nim
08:06:21*def- quit (Ping timeout: 240 seconds)
08:06:22*gangstacat quit (Ping timeout: 264 seconds)
08:10:26*def- joined #nim
08:10:35*gangstacat joined #nim
08:22:47Araqbtw TLSF based allocation landed in devel :-)
08:23:01Araqalloc/dealloc is O(1) new() is not.
08:25:01FromGitter<mratsim> @Araq, no it’s not Nim it’s a Travis problem
08:58:34*Vladar joined #nim
08:59:34*yglukhov joined #nim
09:01:25*jivank[m] quit (Remote host closed the connection)
09:01:26*notdekka[m] quit (Read error: Connection reset by peer)
09:01:26*georgeg[m] quit (Remote host closed the connection)
09:04:03*yglukhov quit (Ping timeout: 250 seconds)
09:09:00*Jipok[m] joined #nim
09:14:40*ShalokShalom joined #nim
09:14:57*ShalokShalom quit (Remote host closed the connection)
09:15:23*Jipok[m] quit (Remote host closed the connection)
09:19:22*Jipok[m] joined #nim
09:29:23*astronavt quit (Remote host closed the connection)
09:30:23*salewski joined #nim
09:30:57*dyce[m] joined #nim
09:30:58*Demos[m] joined #nim
09:30:58*ehmry joined #nim
09:30:58*Miguelngel[m] joined #nim
09:30:58*unclechu joined #nim
09:30:58*watzon joined #nim
09:31:04*planetis[m] joined #nim
09:31:04*jivank[m] joined #nim
09:31:04*notdekka[m] joined #nim
09:31:04*macsek1911[m] joined #nim
09:31:04*MrAxilus[m] joined #nim
09:31:04*shashlick joined #nim
09:31:05*TheManiac joined #nim
09:31:05*georgeg[m] joined #nim
09:31:05*byteflame joined #nim
09:31:06*hohlerde joined #nim
09:33:05salewskiAraq, I have the feeling that for object variants all objects have the same, maximum size?
09:33:18Araqtrue
09:33:38salewskiSo Udiks recommendation https://forum.nim-lang.org/t/3373 may be not always optimal.
09:34:33salewskiIs it allowed for object variants to use the same member name for different variants?
09:35:45salewskiFor example node.number when number can me float or int?
09:35:55Araqno.
09:36:11salewskiOK, i guessed that.
09:36:28*miran joined #nim
09:38:23salewskiOK, will do some tests with objects variants, bye.
09:42:31*Ven`` joined #nim
09:49:11*Ven`` quit (Ping timeout: 240 seconds)
09:50:45salewskiWell, and the discriminator field will consume additional memory, I assume the discriminator is not removed in release mode.
09:51:38salewskiSo it I would make the array elements object variants, I would waste some memory.
09:52:33salewskiAnd if I would make the array itself the object variant, it would not have much benefit.
09:53:09salewskiIt is really a hard task to find the best implementation.
09:55:30Araqwell instead of seq/array of object variant you sometimes can do object variant of seqs
09:55:51*sz0 joined #nim
09:57:27salewskiYes I know, but I assume that in that case I have to query the discriminator often.
09:58:18salewskiObject variants would simplify the code, if I have array elemenents each with a bounding box member and
09:58:43salewskiwith a variant part which is a ref pointer or the leaf content.
09:59:51*SenasOzys joined #nim
10:00:41salewskiBecause the code mostly deals with the bounding box, and only in rare cases accesses the pointer to next element or content.
10:03:08salewski(Well, I assume that object variants with a common part are allowed. It is not mentioned in the manual, but I assume so.)
10:05:44salewskiYes, common part works!
10:15:00*vlad1777d joined #nim
10:25:17*Yardanico joined #nim
10:27:07FromGitter<abijahm> hello guys , what is the ideal size to read from a file while sending it over http ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a2bba7bc65707ba2b2ef2a6]
10:29:57FromGitter<abijahm> this could be used to prevent the high memory usage of jester when sending huge files
10:41:16*jjido joined #nim
10:50:10*salewski quit (Quit: WeeChat 1.9.1)
10:59:32*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
11:10:37*noonien quit (Quit: Connection closed for inactivity)
11:10:45*Trustable joined #nim
11:25:52Araqabijahm: this was fixed in devel, I think.
11:27:31Araqit should use AsyncFile which should do some smart buffer size guessing
11:27:37Araq(I dunno if it currently does)
11:28:00*Trustable quit (Remote host closed the connection)
11:47:05*solitudesf joined #nim
11:49:55*Yardanico_ joined #nim
11:52:33*Yardanico quit (Ping timeout: 248 seconds)
11:58:29*Yardanico_ quit (Quit: Quit)
11:58:43*Yardanico joined #nim
12:26:17*jjido joined #nim
12:29:07*Yardanico quit (Remote host closed the connection)
12:30:06*Yardanico joined #nim
12:30:11*Sentreen quit (Ping timeout: 240 seconds)
12:32:49*xet7 quit (Quit: Leaving)
12:43:34*Sentreen joined #nim
12:46:25*Yardanico quit (Remote host closed the connection)
13:08:44*dddddd joined #nim
13:09:21*solitudesf quit (Ping timeout: 248 seconds)
13:11:34*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:14:12*jjido joined #nim
13:17:15*solitudesf joined #nim
13:24:49*kier quit (Ping timeout: 248 seconds)
13:36:47*kier joined #nim
13:48:54*miran quit (Ping timeout: 246 seconds)
13:49:27Araqwho can help? https://forum.nim-lang.org/t/3405
13:54:12jjidogetContent with timeout does not take a HttpClient. Not sure why
13:56:36*BitPuffin|osx quit (Ping timeout: 246 seconds)
13:58:51dom96because handling timeouts in async code is done differently
13:59:58Araqbtw, https://github.com/nim-lang/Nim/issues/5589
14:00:30*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:01:50*solitudesf quit (Ping timeout: 255 seconds)
14:03:35*solitudesf joined #nim
14:04:39*Trustable joined #nim
14:12:21*Sentreen quit (Ping timeout: 260 seconds)
14:12:28Araqso strange. suddenly it started to work
14:12:34Araqand now it doesn't anymore
14:18:10*Snircle joined #nim
14:18:44Araqugh, why is read not simply implemented with a call to readBuffer?
14:18:51Araqwho accepted this code
14:24:39*Sentreen joined #nim
14:25:47*arnetheduck quit (Ping timeout: 276 seconds)
14:27:53FromGitter<abijahm> how do you read from a future using a callback ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a2bf2e9540c78242da388ab]
14:34:27FromGitter<abijahm> since i cannot use await in the callback function
14:36:12*marenz_ joined #nim
14:38:30*arnetheduck joined #nim
14:38:44Araqyou set the future's callback?
14:38:54*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:39:04AraqgetOverlappedResult apparently takes the Overlapped object out of the event queue
14:40:11Araqso whenever we use it, we must call GC_unref
14:40:24Araqonly asyncfile is affected
14:49:51dom96Araq: got it fixed? :)
14:49:57Araqno.
14:51:46Araqfor every request we leak a PCustomOverlapped
14:52:49*dddddd quit (Ping timeout: 248 seconds)
14:53:45dom96Are you sure? IIRC that's deallocated in poll()
14:54:30*dddddd joined #nim
14:55:08AraqI'm pretty sure, yes
14:55:31Araqand I know it's usually deallocated in poll()
14:55:46Araqbut not under load on Win64, for reasons that escape me
14:57:30*fvs joined #nim
14:58:37fvshi, just wrapped up lzma lib, please test and provide feedback, it's available here: https://github.com/freevryheid/nim-lzma
15:03:30*jjido joined #nim
15:07:08GitDisc<Lite5h4dow> would anyone mind looking at my code and siving me thier opinion?
15:07:24GitDisc<Lite5h4dow> would anyone mind looking at my code and giving me thier opinion on it?
15:09:27*arnetheduck quit (Ping timeout: 240 seconds)
15:09:57*claudiuinberlin joined #nim
15:27:51*jjido quit (Ping timeout: 240 seconds)
15:48:47*dddddd quit (Ping timeout: 248 seconds)
15:53:06*dddddd joined #nim
16:01:08GitDisc<treeform> if you post your code here we might, but maybe forums are a better place for that?
16:09:22subsetparkIs it possible to apply {.used.} to an enum member?
16:15:07*dexterk quit (Quit: Konversation terminated!)
16:21:07*astronavt joined #nim
16:26:45*chemist69 quit (Ping timeout: 246 seconds)
16:37:38*fvs left #nim ("ERC (IRC client for Emacs 25.3.1)")
16:41:19*chemist69 joined #nim
16:49:08*endragor joined #nim
17:14:28*nsf quit (Quit: WeeChat 1.9.1)
17:19:27*dddddd quit (Ping timeout: 248 seconds)
17:21:12*endragor quit (Remote host closed the connection)
17:21:55*nohusuro quit (Remote host closed the connection)
17:26:02*dddddd joined #nim
17:37:25*jjido joined #nim
17:53:54*jjido quit (Read error: Connection reset by peer)
17:54:20planetis[m]can anyone else build latest devel?
17:55:59*jjido joined #nim
17:56:26planetis[m]I cleared my build directory but it still fails
18:01:08*yglukhov joined #nim
18:01:18FromGitter<Yardanico> Lite5h4dow: just post the link to your source code
18:01:31FromGitter<Yardanico> but it's better to make a thread at forum :)
18:07:28Araqplanetis[m], travis and appveyor are green
18:07:32Araqworks for me (tm)
18:11:34*xkapastel joined #nim
18:28:47*nsf joined #nim
18:32:51*arecaceae quit (Remote host closed the connection)
18:33:10*arecaceae joined #nim
18:38:54FromGitter<Yardanico> open-source motto: "works for me" :)
18:50:39*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:54:07planetis[m]sheep it worked!
18:56:30planetis[m]note to self: next time I should delete the pkg directory too
19:00:09FromGitter<Yardanico> never had to do that tbg
19:00:13FromGitter<Yardanico> *tbh
20:09:34FromGitter<RedBeard0531> Is there any way to bind actions to non-terminals in the pegs module? Or to figure out which path matched? I'm trying to figure out how to use it to build an AST rather than just test for validity.
20:10:02*sz0 quit (Quit: Connection closed for inactivity)
20:11:15AraqRedBeard0531: patch the pegs module, it's pretty straight-forward.
20:11:23Araqbut pegs suck :-)
20:12:02Araqyou might want to look into strscans.nim module for inspiration
20:12:03FromGitter<RedBeard0531> Do you have a preferred alternative, or just hand-rolled?
20:12:24FromGitter<RedBeard0531> I looked at it, but it lacked alternation
20:12:32AraqI do hand-rolled but I learned parsers before I learned Nim.
20:13:03Araqit takes many wrong starts before I write macros that automate what I do
20:13:48AraqKarax solves tree construction, Ormin SQL creation, lexim lexer generation, ??? solves parser generation
20:14:10Araq:P
20:14:11FromGitter<RedBeard0531> parsing is generally my most hated part of programming, so I generally look for the easiest way to just get it over with
20:14:29AraqI copy an existing lexer and parser and adapt it
20:14:36FromGitter<RedBeard0531> hmm, I'll take a peek at lexim
20:14:43FromGitter<RedBeard0531> that may be enough
20:14:49Araqall languages are the same really, it's just some typing excercise
20:15:28Araqkeywords -- check, string literals -- check, comment handling -- check, some special chars like [ ] -- check
20:15:41Araqthe hardest parser was for RST.
20:15:55Araqbecause it has no traditional lexing/parsing phase split.
20:16:26FromGitter<RedBeard0531> boost::spirit may be a horrible monstrosity, but it is generally tolerable and mostly works
20:17:06AraqNim's macro sytem is really sweet for a parser generator but I haven't yet found a satisfying DSL.
20:17:25FromGitter<alehander42> I think most parser dsl-s/generators have usually two weaknesses, it's hard to specify how exactly you want the generated tree to look and error reporting
20:17:56Araqyeah, and these two requirements take up 80% of the code!
20:18:49Araqit doesn't matter how short your if token == colon: nextToken() code becomes
20:19:06FromGitter<alehander42> :D yep, I still think the first part is more or less doable in a powerful enough dsl (you can still refine the tree in a little pass after parsing)
20:19:12FromGitter<alehander42> but error reporting is a bitch
20:19:35FromGitter<RedBeard0531> I think action-binding seems to solve problem 1 fairly well. But "expected one of ':', '{', or ','" style error message suck
20:20:43FromGitter<alehander42> action-binding as attaching a code block to an action?
20:21:04Araq<pattern>: action is the easy part
20:21:35Araqproblem is that <pattern> can be cryptic and weak (can it do back references? unifications?)
20:21:54Araqand the other problem is that 'action' takes up most of the code
20:22:28Araqand may contain crap like $_ $1 $3
20:23:16FromGitter<alehander42> overally I dream of a purely declarative language which can *also* specify the shape of the resulting tree, because such a format would be suitable to generate a parser in many languages
20:23:57Araqthere are some compiler compilers that are more declarative
20:24:37FromGitter<alehander42> about the $_ I always thought you can just label important nodes or to infer names for them, often an ident is used once in a rule
20:24:52Araqthey never convinced me though. the next problem that comes up then is that parsing is actually the easiest step in a compiler anyway...
20:25:36Araqsemantic checking and code generation are much harder and when you struggle with parsing already, well ... good luck then
20:25:52*vivus joined #nim
20:28:24FromGitter<alehander42> eg something like ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a2c4768540c78242da50672]
20:29:46Araqwhat's that 'ws' doing here? couldn't affort a real lexer?
20:29:55FromGitter<alehander42> yeah, but that's the point, parsing is more easily automatable, so especially if you can roll and iterate quickly on your initial parser/grammar and optimize it and the error reporting if you really need
20:30:33FromGitter<alehander42> well it all depends on the dsl rules :D
20:30:50FromGitter<alehander42> you can automatically look for optional whitespace
20:31:08FromGitter<alehander42> I am just used to being more explicit (and I usually don't write a separate lexer :( )
20:31:16Araqas I said, don't give up the lexer/parser split, things degenerate into clusterfucks if you don't have it (RST...)
20:32:05Araqquick iterations are quicker when you can't fuck up.
20:32:45FromGitter<alehander42> well it depends on the lang that you parse, for a lot of cases it's not such a big deal
20:33:14FromGitter<alehander42> I haven't used RST why is it problematic there
20:33:38Araqwell read my code to find out.
20:34:04*SenasOzys quit (Read error: Connection reset by peer)
20:34:25*SenasOzys joined #nim
20:35:57FromGitter<alehander42> `roSupportSmilies` ⏎ that's gonna be good .. :D
20:46:33*nsf quit (Quit: WeeChat 1.9.1)
20:57:59FromGitter<RedBeard0531> @Araq I'm looking into https://github.com/nim-lang/Nim/issues/6512 since I think I know *how* to solve it, but I don't know *where*. PreMain calls systemInit000() which seems promising, but that I can't figure out where that is defined. Is that the right place to register a c++ terminate handler (similar to a signal handler), and if so, where is it defined?
20:59:35Araqgg systemInit compiler
20:59:35Araqcompiler\cgen.nim
20:59:35Araq 934: "\tsystemInit000();$N" &
20:59:47Araq(gg is my shortcut for nimgrep)
21:00:09FromGitter<RedBeard0531> Yeah, I found the call site
21:00:27FromGitter<RedBeard0531> but I can't find the definition for that function
21:02:40Araq 1074: proc getInitName(m: PSym): Rope =
21:02:40Araq 1079: result = getSomeInitName(m, "Init000")
21:03:05FromGitter<RedBeard0531> ahh, that explains it. thanks
21:03:11Araqit's the generic way of creating init procs for modules
21:03:17Araqsystem.nim is not special.
21:03:41Araqin other words
21:03:55Araqyou should patch system.nim to install a crash handler in C++ mode
21:04:02Araqand not the codegen
21:04:27GitDisc<treeform> hey Araq, if you are here, may I have your thoughts on my last comment, about the sql pretty printer? https://github.com/nim-lang/Nim/pull/6879
21:05:33FromGitter<RedBeard0531> Well my thought is that it should only happen when nim is building a program not a library
21:05:59FromGitter<RedBeard0531> although, I guess that could be done with a `when` block
21:06:07*dddddd quit (Ping timeout: 248 seconds)
21:07:29Araqtreeform, I'm in fact outlining my ideas right now
21:08:20GitDisc<treeform> cool
21:08:39GitDisc<treeform> we can also do vice chat if you prefer, wait I am on discord, you are not...
21:12:21FromGitter<RedBeard0531> Is there a list of the standard defines that can be when'ed on?
21:15:05Araqwhen defined(cpp) and appType != "lib"
21:15:40Araqtreeform, meh I had some overly complex meta programming solution with macros and templates
21:15:52Araqbut it's hard to explain, so instead in a nutshell.
21:16:17Araquse 2 passes. first pass renders tree into a seq of *tokens* (not a single string)
21:16:33Araqsecond pass turns token stream into a single string.
21:16:56GitDisc<treeform> that sounds resonable
21:17:01Araqtokens can have instruction-like character like "increase indentation"
21:17:28GitDisc<treeform> I do that with the typography library I am making. A typeset pass, then a rastarzation pass. Different, but the same.
21:17:34Araqor "optional newline here if in 'long mode'"
21:17:59Araqand whether you are in long mode or not depends on the predicted line lengths
21:18:00GitDisc<treeform> do you think there should be a 2 modes or 3?
21:18:25GitDisc<treeform> yeah len that can be set but defaults to like 80 or 120...
21:18:32*dddddd joined #nim
21:18:39Araqjust use 80.
21:18:54Araqnobody minds, it's generated code, nobody should mess with it.
21:19:11GitDisc<treeform> I want to use this for pretty printing.
21:19:11Araqit shouldn't be overly verbose/excessive though.
21:19:32GitDisc<treeform> Do you think we should have like a fast mode? and Slow pretty printer mode?
21:19:55Araqwell you're free to spend the effort you need. I would keep it as simple as reasonable.
21:20:02GitDisc<treeform> The SQL we have floating around has indents that are more then 80 chars...
21:20:17Araqwhat's the need for a fast mode?
21:20:35Araqjust make it fast, but why should "fast" imply "all is ugly"
21:21:14GitDisc<treeform> fast could imply don't do the indentation checking stuff?
21:21:31GitDisc<treeform> so there is a single string buffer
21:21:31Araqthat's probably free.
21:21:34GitDisc<treeform> not a tree of string
21:21:43GitDisc<treeform> not a tree of strings
21:21:49Araqit's not a tree. it's a seq of string.
21:22:06Araqand you can create an optimized StringSeq data type and add it to the stdlib
21:22:17Araqit would be useful for many things
21:23:14AraqI wanted to write a similar thing for JSON
21:23:25Araqand do some benchmarking :-)
21:23:29GitDisc<treeform> it seems simpler for JSON, the grammer is so much smaller.
21:23:41GitDisc<treeform> Oh you mean the StringSeq, not the prettyprinter?
21:23:46Araqyes.+
21:24:01AraqI called it a "PackedJson"
21:24:01GitDisc<treeform> I dont get how you want StringSeq to work?
21:24:42GitDisc<treeform> I see it as sql of buffes that has the sting and some thing extra, weather it should indent after
21:24:50GitDisc<treeform> but it also needs to know how long it goes?
21:25:06GitDisc<treeform> probably best stored as a tree?
21:26:41Araqa PackedJson just a blob that uses variable length integers for the lenghts of the subcomponents. you can only access it in a mostly linear fashion but that's usually all that is required
21:27:24Araqsince JSON can represent "list of strings" you could use it as a StringSeq too, ofc
21:28:13GitDisc<treeform> in PackedJson nodes are contiguous in memory so less GC pressure?
21:28:26Araqyes.
21:28:48Araqit would be quite comparable to a single string
21:28:53GitDisc<treeform> I remmber reading about a C JSON parser that would just create pointsers to orignal string it was parsing
21:29:08GitDisc<treeform> and would replace " whith 0x00
21:29:19GitDisc<treeform> so that null terminated C strings would work.
21:29:22Araqyeah ... something like that but don't use pointers
21:29:38Araqthey take up too much space and don't allow realloc()
21:29:50GitDisc<treeform> yeah some sort of offsets are better.
21:30:02Araqexactly.
21:30:21GitDisc<treeform> but ahhh ... we are doing SQL not JSON?
21:30:38GitDisc<treeform> PackedJson idea is cool, isnt SQL different?
21:30:49Araqso ... ? you use the PackedJson as your buffer target for your SQL pretty printer
21:30:53Araqwhere is the problem?
21:31:01GitDisc<treeform> oh ok I get it now.
21:31:23GitDisc<treeform> I though you wanted some thing like PackedSQL
21:31:48GitDisc<treeform> instead of json grammer it was SQL grammer.
21:33:19Araqhttps://sqlite.org/src4/doc/trunk/www/varint.wiki I wanted to use this for the length informations in the blob
21:34:46GitDisc<treeform> I wrote a TTF parser, and its full of this stuff from the 1990s.
21:34:58GitDisc<treeform> I ma not a huge fant of trying to sequese out every bit
21:35:10Araqit's a standard library.
21:35:17GitDisc<treeform> unless it can be showen to improve performance.
21:35:45Araqcache miss is 100+ cycles.
21:36:12Araqwhen I optimize things, I make them smaller.
21:36:38GitDisc<treeform> you are probably better at it then I am.
21:37:01Araqor worse. :-)
21:37:36GitDisc<treeform> in the TTF format they used these tricks everywhere, and I am like just use zlib with real compression.
21:38:46Araqbut real compression might end up being slower
21:39:09Araqso you have to hack specialized solutions into everything :-)
21:39:27Araqbut hey, json is not even that specialized, it's quite flexible
21:39:46GitDisc<treeform> I guess I don't buy it, but to prove it otherwise I would not to write the oposite thing and bench it, which is a ton of work. So I only have a gut feeling.
21:39:59GitDisc<treeform> JSON is use a ton it should be done for JSON though.
21:40:31GitDisc<treeform> I agree that duing all this research for JSON and XML is good. But probably not SQL or TTF files.
21:40:41GitDisc<treeform> I think we are way off track now...
21:40:46*lastjedi joined #nim
21:40:49Araq{"key": "value", "key2": 0.9}
21:40:52GitDisc<treeform> What would you like me to do wit hthe SQL thing?
21:42:24Araqthat takes up 29 bytes. you know what takes more space? 4 pointers.
21:42:53Araqas I said, render into a seq of tokens
21:43:03GitDisc<treeform> I can't argue with that.
21:43:10Araqand then render the seq of tokens into a single string.
21:43:11GitDisc<treeform> Where do I put if it should indent or not?
21:43:30GitDisc<treeform> and when indent should end?
21:43:36GitDisc<treeform> oh part of tocken
21:43:40Araqyes
21:44:07GitDisc<treeform> so a RenderToken would have like a string and the type it is
21:44:26GitDisc<treeform> and it would also need to know how many children it should indent
21:44:37GitDisc<treeform> but thats like packing a tree in a seq
21:45:16GitDisc<treeform> or it could read peoples indent levels untill it hits its own indent level
21:45:38GitDisc<treeform> Sould it try to do the 3 modes? Or just do 2 modes?
21:46:39*libman joined #nim
21:47:50Araq2 modes.
21:49:03GitDisc<treeform> ok
21:57:09Araqbtw I agree that file formats should just use general compression methods. for simplicity. but my PacketJson idea is about getting the max speed out of a modern CPU, not about simplicity.
21:57:31GitDisc<treeform> I agree with you if its JSON.
21:57:48Araqcould be wrong of course and it will be slower. it's an interesting experiment.
21:58:17GitDisc<treeform> Why do incodings at all, you can just scan the JSON everytime?
21:58:39GitDisc<treeform> At work I did just this for a huge speed up, I have a proc that can get a key out of JSON string.
21:59:05GitDisc<treeform> Because I don't need the whole json file just a few keys, parsing full json is slow, i just basicaly peck the data I need out.
21:59:49*arecaceae quit (Remote host closed the connection)
21:59:51GitDisc<treeform> You need to counting opening {[", stifng escape \" and only check : for if its a key.
22:00:08*arecaceae joined #nim
22:00:09Araqthat works but with a couple of length infos you can skip fields
22:00:30Araqplus it can be hard to get all the escaping rules right
22:00:48Araq':' must not be in a string literal, for instance
22:01:11GitDisc<treeform> string literal can only have /" or " as terminator.
22:01:16GitDisc<treeform> I think it works out?
22:01:56GitDisc<treeform> I left the code at work can't show you. But the json pecker was quite a bit faster then parsing. But then my json files are in the Gigabytes.
22:02:26GitDisc<treeform> I bleed cahce misses, hardrive misses ...
22:03:04GitDisc<treeform> new line json terminated log files
22:03:13Araqit works "out" but it is unstructured.
22:03:41GitDisc<treeform> I think it logicall works out?
22:03:51GitDisc<treeform> you can never find a key in a []
22:04:01GitDisc<treeform> or in a " "
22:04:12Araqfor example, extractString() on a json needs to handle escapes
22:04:36Araqon a PackedJson it doesn't, there are no escapes, there is length information available.
22:05:00GitDisc<treeform> yes I think PackedJson would be cool.
22:06:05GitDisc<treeform> in my prev company, Pushbullet, we used this new format we invented called string json
22:06:09Araqand when you use variable sized integers the length information is a single byte most of the time, same space requirement as a zero terminator
22:06:20GitDisc<treeform> which was just like json but did not allow numbers, everyting must been string
22:06:38GitDisc<treeform> and no bom or required to be utf8
22:06:50GitDisc<treeform> and no bom and was required to be utf8
22:07:28GitDisc<treeform> In PackedJson, what if you want to know a single key? Or some length?
22:07:34GitDisc<treeform> you would have to scan the whole thing?
22:07:43GitDisc<treeform> p = PackedJson ...
22:07:50GitDisc<treeform> p[1000]
22:07:50Araqwell string literals are prefixed with a length field
22:07:53Araqand so are lists
22:08:09GitDisc<treeform> but say you have list of 10000
22:08:13Araqlists have in fact 2 prefixes
22:08:20GitDisc<treeform> and you need to get an element in the middle?
22:08:23Araqone for the total lenght in bytes
22:08:31Araqone for the number of elements
22:08:51Araqthat's enough to be able to skip into the i'th element
22:09:00GitDisc<treeform> Say each element is like 1K?
22:09:09GitDisc<treeform> you would have 1000 cache misses?
22:09:18GitDisc<treeform> as jump from element to element?
22:09:37GitDisc<treeform> while with a pointers it would be like 2?
22:09:47Araqprobably. :-) I thought about a two level structure
22:09:57GitDisc<treeform> PackedJson would be great for tiny JSONs though
22:10:04GitDisc<treeform> they would probably get all caches and be super fast.
22:10:52Araqone level for fixed size stuff that points to the variably sized stringA\0stringB\0 part
22:11:18GitDisc<treeform> I think what you need for JSON is like a several representations that you can just pick that is best for your usecase
22:11:27Araqyeah.
22:11:38GitDisc<treeform> full parser full pointer we have now
22:11:50GitDisc<treeform> packed json, less memory use, faster for small things
22:12:07GitDisc<treeform> non parsed json, just get the thing you want and get out
22:12:09Araqwith the two level setup you can do key deduplications
22:12:27Araqit could be "good enough" for everything :-)
22:12:36GitDisc<treeform> hmm
22:12:56GitDisc<treeform> I have written a parser and generator for the mac's binary plist format
22:13:12GitDisc<treeform> it kind of does a bit of these bit fiddly stuff.
22:13:54GitDisc<treeform> you have basically a structure in these 16bit integers, then a kind of like a data section with all of the variable strings in the back.
22:15:21GitDisc<treeform> https://gist.github.com/treeform/cc4bfd8965c13e5229729a1e2a826830
22:15:32GitDisc<treeform> It kind of does the 2 level inderection you talked about
22:16:04GitDisc<treeform> the entire strucutre lives in the first half of the file
22:16:11GitDisc<treeform> you can can walk through it quickly
22:16:18GitDisc<treeform> but the data lives in the back
22:16:52*Trustable quit (Remote host closed the connection)
22:17:33GitDisc<treeform> http://fileformats.archiveteam.org/wiki/Property_List/Binary
22:18:24Araqwell I don't claim I'm the first with this idea
22:19:13GitDisc<treeform> I like how it can encode list of sizes 0-16 in one byte
22:19:26GitDisc<treeform> and dicts and sets as well.
22:19:32GitDisc<treeform> small ints also are just 1 byte
22:19:36Araqbut I'm becoming a fan of datastructures that are identical in RAM and on disk :-)
22:20:12GitDisc<treeform> Did you watch Jonothan Blow talk about relative pointers in data?
22:20:28GitDisc<treeform> I don't know if JBlow is respectead here or not, but the talk was interesting.
22:21:18AraqI respect him, but I got disappointed when he reinvented thread local storage without noticing :P
22:21:43GitDisc<treeform> Idea was is that you would have 16 bit or an 8bit pointer from the currect location of the pointer to the next thing, compiler would know about it and they would just work.
22:21:48Araqyeah, I think I watched that talk
22:22:01GitDisc<treeform> He got this idea from x86 talk with JMP instruction
22:22:04*endragor joined #nim
22:22:17GitDisc<treeform> x86 not talk , x86 spec ... you know
22:23:48GitDisc<treeform> I think he also wanted to just load the whole game level with memory map, and just have it work, no parsing required.
22:23:59Araqyeah but you should use explicit offsets instead of pointers. why? because they transform temporal memory safety into spatial memory safety issues.
22:24:23Araqwhich are much easier to deal with if you are not a fan of Rust's borrow checker.
22:24:48GitDisc<treeform> saidly I don't know anything about Rust's borrow checker.
22:25:07Araqthis was well known when they designed Ada. unfortunately it lost against C++
22:26:27*endragor quit (Ping timeout: 240 seconds)
22:26:46GitDisc<treeform> what was well known? borrow checker, explicit offsets instead of pointers, short pointers?
22:26:52GitDisc<treeform> I think you lost me.
22:26:54Araqinterestingly in Rust people are encouraged to use array+index instead of pointer too if the lifetimes get too hairy
22:27:07*lastjedi quit (Remote host closed the connection)
22:27:33GitDisc<treeform> array+index has advatanges if your array moves about.
22:27:41Araqtreeform: It was well known that array+index are MUCH better than pointers ;-)
22:28:00Araqapart from the messy notation.
22:28:13Araqwhich can be dealt with when you have a macro system...
22:28:25AraqI did a live stream about it
22:28:39GitDisc<treeform> Sorry did not see.
22:30:53GitDisc<treeform> Can macros throw custom errors? I run into this problem with heavy macros in https://github.com/stavenko/nim-glm .
22:31:04GitDisc<treeform> where for each invalid thing I did it would say some thing like
22:31:09Araqmacros.error
22:31:48GitDisc<treeform> some thing thing like "proc not found [][x][y][z] can [][a][c][d]"
22:31:57GitDisc<treeform> it was just very dense to understand
22:32:00GitDisc<treeform> what was going on
22:32:13GitDisc<treeform> it should just say "can't add vec2 to vec3 bro"
22:32:46Araqyeah, it's on my todo
22:32:50GitDisc<treeform> but when you write heavy macros people seem to forget about ergonimics and quality compile errors.
22:33:11Araqpartly the macro API is to blame
22:33:19Araqbut we know how to fix it
22:33:33GitDisc<treeform> cool.
22:33:59GitDisc<treeform> I though it might be invediable direction they just roll into, like boost in c++
22:35:22Araqnah, I'm optimistic
22:35:49GitDisc<treeform> thats my biggest fear with a ton of macro ussage, is that its just super hard to know what is going on.
22:35:59Araqstill have new tricks in my sleeves.
22:36:07GitDisc<treeform> cool
22:36:39Araqin the meantime, I do -d:debugKaraxDsl and see what is going on :-)
22:37:30GitDisc<treeform> unrelated, have you thought of making an x86 backend? Not because it would be usefull, but because it would be cool?
22:37:37Araqeverybody should have a -d:debug<My>Dsl switch, it's one line of code
22:37:55Araqat the macro body end, write
22:38:13Araq when defined(debugXxxDsl): echo repr result
22:38:34GitDisc<treeform> thanks I will use this.
22:39:12Araqthere is also macros.expandMacro iirc
22:39:22Araqthat you can annotate your code with
22:39:44*Vladar quit (Quit: Leaving)
22:39:56Araqx86 backend? I considered to produce x86 instead of my VM bytecode
22:40:04GitDisc<treeform> I have not done that many macro writing yet. Mainly because templates seems todo most things.
22:40:30Araqbut my VM is about Nim's ASTs that don't benefit from asm. in fact, direct asm generation makes it much harder.
22:40:50GitDisc<treeform> yes I think VM bytecode is better.
22:41:09Araqthe current VM uses a symbolic representation that plays well with the rest of the compiler and the GC it uses
22:41:36AraqI couldn't do that with a JIT.
22:42:18GitDisc<treeform> yeah, and using it for compiler you can't interface with C as easly.
22:42:34Araqof course, if my ASTs would just be compressed blob-like things... ;-)
22:42:36*nsf joined #nim
22:43:35Araqbut I can't rewrite 80K LOC to play with an idea that will probably fail
22:43:50GitDisc<treeform> haha nope
22:44:10Araqso ... I target JSON instead :P
22:51:31GitDisc<treeform> do the crazy experiments were its simpler?
22:51:41Araqyes
23:04:57*solitudesf quit (Ping timeout: 240 seconds)
23:13:56*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
23:14:16*endragor joined #nim
23:18:21*endragor quit (Ping timeout: 240 seconds)
23:21:08*jjido joined #nim
23:49:32*xet7 joined #nim
23:56:10*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)