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:33 | FromGitter | <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:11 | dom96 | I changed it manually :) |
01:15:25 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
01:16:33 | * | rbrt joined #nim |
01:16:58 | FromGitter | <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:17 | guest_monkey | hi, how do i delete my Nim Forum account? |
02:14:59 | * | vivus quit (Quit: Leaving) |
02:16:31 | FromGitter | <zacharycarter> @Varriount - I just realized, I'm pretty sure it's possible to write code for Unity w/ Nim |
02:17:37 | FromGitter | <Varriount> @zacharycarter I thought Unity was C# and Javascript only? |
02:18:36 | FromGitter | <zacharycarter> https://docs.unity3d.com/560/Documentation/Manual/NativePlugins.html |
02:18:39 | FromGitter | <zacharycarter> says it's legacy though :/ |
02:18:47 | FromGitter | <zacharycarter> dunno if it would work w/ the current version of Unity |
02:19:39 | FromGitter | <zacharycarter> oh, it is |
02:19:40 | FromGitter | <zacharycarter> https://docs.unity3d.com/Manual/NativePlugins.html |
02:21:26 | FromGitter | <zacharycarter> I was just told you had to reload the editor to reload a native plugin though so who knows |
02:22:31 | FromGitter | <Varriount> @zacharycarter I wonder which would be better - good support for Unity, or good support for Unreal Engine |
02:23:50 | FromGitter | <zacharycarter> Unity has a much larger user base |
02:24:17 | FromGitter | <zacharycarter> but I don't know if it has the kind of user base that would evaluate Nim |
02:24:22 | FromGitter | <Varriount> :/ |
02:25:13 | FromGitter | <zacharycarter> I was checking out Stingray / Lumberyard yesterday to evaluate those for Nim |
02:25:14 | FromGitter | <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:49 | FromGitter | <Varriount> Though, given Youtube's heuristic recommendations, that's probably just confirmation bias. |
02:25:58 | FromGitter | <zacharycarter> Stringray can call native code via Lua |
02:26:20 | FromGitter | <zacharycarter> but I think Stingray is also one of the best written engines |
02:27:04 | FromGitter | <zacharycarter> Lumberyard is just a fork of crytek so I think it's also using LuaJIT |
02:27:07 | FromGitter | <Varriount> But how popular is it? |
02:27:14 | FromGitter | <zacharycarter> not very now that Autodesk owns it |
02:27:29 | FromGitter | <zacharycarter> it's just really well architected |
02:28:04 | FromGitter | <zacharycarter> and the engineering team is smart |
02:28:19 | FromGitter | <zacharycarter> http://bitsquid.blogspot.com/ |
02:29:45 | FromGitter | <zacharycarter> https://bitbucket.org/bitsquid/foundation |
02:29:57 | FromGitter | <zacharycarter> was part of the core of the bitsquid, now stingray engine |
02:30:28 | FromGitter | <Varriount> Looks pretty neat. |
02:30:37 | FromGitter | <Varriount> By the way, how is your own engine coming along? |
02:31:09 | FromGitter | <zacharycarter> Well... I'm kind of in decision paralysis mode |
02:31:31 | FromGitter | <zacharycarter> I want to use Nim in whatever project I work on |
02:32:27 | FromGitter | <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:09 | FromGitter | <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:32 | FromGitter | <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:50 | FromGitter | <zacharycarter> Godot seems to be the only viable option, and I don't really want to use godot |
02:34:06 | FromGitter | <zacharycarter> besides just using bgfx and writing my own game and trying to keep the engine work minimal |
02:34:15 | FromGitter | <Varriount> What are your reasons for not wanting to use Godot? |
02:34:55 | FromGitter | <zacharycarter> At the moment it's not very well documented, especially the newer features |
02:35:56 | FromGitter | <zacharycarter> I also have no idea how it's going to perform |
02:37:06 | FromGitter | <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:53 | FromGitter | <zacharycarter> @Varriount I've recently been thinking about trying to reproduce : https://github.com/JoeyDeVries/Cell but in Nim and with BGFX |
02:41:54 | subsetpark | Man - AoC Day 7 gave me a run for my money but I got it down. |
02:43:03 | subsetpark | I never really made any wrong moves, I just made each right move subtly wrong, the first time. |
02:43:05 | FromGitter | <Varriount> AoC? |
02:43:15 | subsetpark | Advent 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:33 | skrylar | mratsim: 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:57 | CavariuXx | Hi dom96 are you available or someone who has some experience crosscompiling nim? Sorry to bother |
03:13:04 | FromGitter | <zacharycarter> what are you trying to target? |
03:13:09 | FromGitter | <zacharycarter> and from what OS? |
03:13:44 | * | chemist69 joined #nim |
03:13:45 | skrylar | Nimble: Error: unhandled exception: Connection was closed before full request has been made [ProtocolError] |
03:13:46 | skrylar | :( |
03:13:47 | CavariuXx | I'm trying yo target i686 architecture and I'm in Linux 64bits Ubuntu, I compiled binutils and gcc without dependencies |
03:14:17 | CavariuXx | But 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:38 | CavariuXx | And I'm setting --cpu:i386 (since theres no i686 option) |
03:15:16 | FromGitter | <zacharycarter> I think that means you're using the wrong compiler |
03:15:47 | FromGitter | <zacharycarter> I could definitely be wrong though |
03:15:51 | CavariuXx | I am manually setting the compiler with --gcc.exe |
03:16:41 | CavariuXx | I 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:19 | FromGitter | <zacharycarter> I think your problem is you're trying to compile to an architecture that your compiler doesn't support |
03:18:26 | CavariuXx | hmm for target while compiling gcc I put i686 and it's the architecture the whole wiki uses |
03:18:31 | CavariuXx | any idea how I could test this? |
03:19:36 | FromGitter | <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:28 | FromGitter | <cavariux> I moved from irc to gitter, but thanks will look into it |
03:20:36 | * | CavariuXx quit (Quit: Page closed) |
03:21:31 | FromGitter | <zacharycarter> No problem, let me see if I can point you to an example of how to do it |
03:22:11 | FromGitter | <cavariux> If you have one it would be great thanks |
03:22:34 | FromGitter | <zacharycarter> so this is the part of the docs you need to read : https://nim-lang.org/docs/nimc.html#cross-compilation |
03:22:39 | FromGitter | <zacharycarter> especially this part |
03:23:42 | FromGitter | <cavariux> thank you will give it a read |
03:23:45 | FromGitter | <zacharycarter> well that whole section is relevant to your question so it's all important :) |
03:23:50 | FromGitter | <zacharycarter> np |
03:27:52 | FromGitter | <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:59 | FromGitter | <Varriount> @cavariux Hm, I don't know when Nimkernel was last tested. dom96 would know more. |
03:54:28 | FromGitter | <Varriount> However It's probably around nighttime where he is now. |
03:54:41 | * | yglukhov quit (Ping timeout: 248 seconds) |
03:54:41 | FromGitter | <cavariux> @Varriount do you know his time zone so I can talk to him? |
03:55:07 | FromGitter | <cavariux> Cause I'm cloning nimkernel directly and following everything even doing my own tweaks but nothing |
03:55:21 | FromGitter | <Varriount> I know he's somewhere in the UK |
03:55:40 | FromGitter | <Varriount> What problems are you currently having? |
03:55:56 | FromGitter | <cavariux> gcc and nimbase aren't good pals |
03:56:19 | FromGitter | <cavariux> it continues throwing me an error of C and Nim not sharing the same architecture |
03:56:28 | FromGitter | <cavariux> When I'm using the same compiler for everything |
03:56:56 | FromGitter | <Varriount> Then your Nim compiler was built for 64 bit, and GCC is using 32 bit or vise-versa |
03:57:04 | FromGitter | <cavariux> (https://files.gitter.im/nim-lang/Nim/1RYQ/image.png) |
03:57:05 | FromGitter | <Varriount> There should be a flag... Hm |
03:57:43 | FromGitter | <cavariux> GCC more than sure is using 32 but Nim could be 64 |
03:58:19 | FromGitter | <Varriount> Before you try building Nimkernel, have you tested out a simple 'hello world' program? |
03:58:52 | FromGitter | <cavariux> Yep, but it ran |
03:59:19 | FromGitter | <Varriount> Hm. |
03:59:49 | FromGitter | <Varriount> https://github.com/dom96/nimkernel/blob/master/main.nim.cfg |
04:00:11 | FromGitter | <cavariux> I'm using that one and have been tweaking it to try test different --cpu and flags |
04:00:23 | FromGitter | <Varriount> `--cpu:i386` means that the Nim compiler will target i386 (32bit) when compiling main.nim |
04:00:44 | FromGitter | <Varriount> So you'll need to pass in flags to gcc that tell it to compile 32-bit executables |
04:01:03 | FromGitter | <Varriount> (using `--passC` and `--passL` |
04:01:05 | FromGitter | <Varriount> ) |
04:01:49 | FromGitter | <cavariux> Okay that makes sense but I'm compiling GCC with 32 bits using i686 architecture |
04:02:37 | FromGitter | <Varriount> Is this the GCC that the instructions say to build? |
04:03:03 | FromGitter | <cavariux> I tried those instructions failed then moved to read OSDev wiki and failed again |
04:03:23 | FromGitter | <cavariux> I have tried i586 and i686 with same results |
04:03:49 | FromGitter | <Varriount> How did the GCC builds fail? |
04:05:01 | FromGitter | <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:50 | FromGitter | <Varriount> @cavariux What is the output of `which gcc`? |
04:08:17 | FromGitter | <cavariux> The path where I compiled the cross compiler |
04:11:45 | FromGitter | <Varriount> @cavariux Could you compile this using the cross-compiled gcc? https://gist.github.com/Varriount/22bc8c1476fe34a60104a073ac1dd929 |
04:12:19 | FromGitter | <cavariux> I'm recompiling the cc but after will try |
04:29:23 | FromGitter | <Varriount> @cavariux Any luck? |
04:43:08 | FromGitter | <cavariux> When I try compile your code I don't have the standart in the standalone compiler |
04:43:12 | FromGitter | <cavariux> And still no luck with the other code |
04:44:16 | FromGitter | <cavariux> (https://files.gitter.im/nim-lang/Nim/Ld5y/image.png) |
04:44:25 | FromGitter | <cavariux> Will go to sleep but that's my error |
04:44:35 | FromGitter | <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:20 | GitDisc | <awr> is there a canonical way to overload the `$` operator on a type? |
06:17:26 | GitDisc | <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:42 | FromGitter | <kayabaNerve> * |
06:22:09 | FromGitter | <kayabaNerve> Oh... for one with an existing $ |
06:22:16 | FromGitter | <kayabaNerve> I think you have to specify in that case |
06:23:45 | FromGitter | <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:45 | GitDisc | <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:49 | GitDisc | <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:52 | FromGitter | <kayabaNerve> So then can't you declare a proc in each file that is equal to the exported proc |
06:28:57 | FromGitter | <kayabaNerve> Or use as? |
06:29:29 | FromGitter | <kayabaNerve> (import as) |
06:30:31 | GitDisc | <treeform> what existing $ are you trying to override? |
06:30:36 | GitDisc | <awr> the system.nim one |
06:30:43 | GitDisc | <treeform> for which type? |
06:31:41 | GitDisc | <awr> a vector type that I made. It has a SIMD type in it so it doesn't look great when printed |
06:32:22 | GitDisc | <treeform> example? |
06:34:00 | GitDisc | <awr> ```nim |
06:34:00 | GitDisc | <awr> type m128* {.importc: "__m128i", header: "emmintrin.h".} = object |
06:34:00 | GitDisc | <awr> type Vector = object |
06:34:00 | GitDisc | <awr> simd :m128 |
06:34:00 | GitDisc | <awr> ``` |
06:34:26 | GitDisc | <awr> whoops |
06:34:30 | GitDisc | <awr> Vector should be public |
06:34:45 | * | jivank[m] joined #nim |
06:36:25 | GitDisc | <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:36 | Survey_Helper | Hi |
06:50:12 | Survey_Helper | Does 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:28 | FromGitter | <mratsim> Travis OSX + Homebrew is broken :/ |
07:13:37 | FromGitter | <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:38 | Araq | is that a Nim problem? |
07:29:43 | * | nsf joined #nim |
07:30:46 | * | solitudesf joined #nim |
07:30:53 | Araq | btw 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:50 | FromGitter | <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:47 | Araq | btw TLSF based allocation landed in devel :-) |
08:23:01 | Araq | alloc/dealloc is O(1) new() is not. |
08:25:01 | FromGitter | <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:05 | salewski | Araq, I have the feeling that for object variants all objects have the same, maximum size? |
09:33:18 | Araq | true |
09:33:38 | salewski | So Udiks recommendation https://forum.nim-lang.org/t/3373 may be not always optimal. |
09:34:33 | salewski | Is it allowed for object variants to use the same member name for different variants? |
09:35:45 | salewski | For example node.number when number can me float or int? |
09:35:55 | Araq | no. |
09:36:11 | salewski | OK, i guessed that. |
09:36:28 | * | miran joined #nim |
09:38:23 | salewski | OK, 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:45 | salewski | Well, and the discriminator field will consume additional memory, I assume the discriminator is not removed in release mode. |
09:51:38 | salewski | So it I would make the array elements object variants, I would waste some memory. |
09:52:33 | salewski | And if I would make the array itself the object variant, it would not have much benefit. |
09:53:09 | salewski | It is really a hard task to find the best implementation. |
09:55:30 | Araq | well instead of seq/array of object variant you sometimes can do object variant of seqs |
09:55:51 | * | sz0 joined #nim |
09:57:27 | salewski | Yes I know, but I assume that in that case I have to query the discriminator often. |
09:58:18 | salewski | Object variants would simplify the code, if I have array elemenents each with a bounding box member and |
09:58:43 | salewski | with a variant part which is a ref pointer or the leaf content. |
09:59:51 | * | SenasOzys joined #nim |
10:00:41 | salewski | Because the code mostly deals with the bounding box, and only in rare cases accesses the pointer to next element or content. |
10:03:08 | salewski | (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:44 | salewski | Yes, common part works! |
10:15:00 | * | vlad1777d joined #nim |
10:25:17 | * | Yardanico joined #nim |
10:27:07 | FromGitter | <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:57 | FromGitter | <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:52 | Araq | abijahm: this was fixed in devel, I think. |
11:27:31 | Araq | it should use AsyncFile which should do some smart buffer size guessing |
11:27:37 | Araq | (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:27 | Araq | who can help? https://forum.nim-lang.org/t/3405 |
13:54:12 | jjido | getContent with timeout does not take a HttpClient. Not sure why |
13:56:36 | * | BitPuffin|osx quit (Ping timeout: 246 seconds) |
13:58:51 | dom96 | because handling timeouts in async code is done differently |
13:59:58 | Araq | btw, 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:28 | Araq | so strange. suddenly it started to work |
14:12:34 | Araq | and now it doesn't anymore |
14:18:10 | * | Snircle joined #nim |
14:18:44 | Araq | ugh, why is read not simply implemented with a call to readBuffer? |
14:18:51 | Araq | who accepted this code |
14:24:39 | * | Sentreen joined #nim |
14:25:47 | * | arnetheduck quit (Ping timeout: 276 seconds) |
14:27:53 | FromGitter | <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:27 | FromGitter | <abijahm> since i cannot use await in the callback function |
14:36:12 | * | marenz_ joined #nim |
14:38:30 | * | arnetheduck joined #nim |
14:38:44 | Araq | you set the future's callback? |
14:38:54 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:39:04 | Araq | getOverlappedResult apparently takes the Overlapped object out of the event queue |
14:40:11 | Araq | so whenever we use it, we must call GC_unref |
14:40:24 | Araq | only asyncfile is affected |
14:49:51 | dom96 | Araq: got it fixed? :) |
14:49:57 | Araq | no. |
14:51:46 | Araq | for every request we leak a PCustomOverlapped |
14:52:49 | * | dddddd quit (Ping timeout: 248 seconds) |
14:53:45 | dom96 | Are you sure? IIRC that's deallocated in poll() |
14:54:30 | * | dddddd joined #nim |
14:55:08 | Araq | I'm pretty sure, yes |
14:55:31 | Araq | and I know it's usually deallocated in poll() |
14:55:46 | Araq | but not under load on Win64, for reasons that escape me |
14:57:30 | * | fvs joined #nim |
14:58:37 | fvs | hi, 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:08 | GitDisc | <Lite5h4dow> would anyone mind looking at my code and siving me thier opinion? |
15:07:24 | GitDisc | <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:08 | GitDisc | <treeform> if you post your code here we might, but maybe forums are a better place for that? |
16:09:22 | subsetpark | Is 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:20 | planetis[m] | can anyone else build latest devel? |
17:55:59 | * | jjido joined #nim |
17:56:26 | planetis[m] | I cleared my build directory but it still fails |
18:01:08 | * | yglukhov joined #nim |
18:01:18 | FromGitter | <Yardanico> Lite5h4dow: just post the link to your source code |
18:01:31 | FromGitter | <Yardanico> but it's better to make a thread at forum :) |
18:07:28 | Araq | planetis[m], travis and appveyor are green |
18:07:32 | Araq | works 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:54 | FromGitter | <Yardanico> open-source motto: "works for me" :) |
18:50:39 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:54:07 | planetis[m] | sheep it worked! |
18:56:30 | planetis[m] | note to self: next time I should delete the pkg directory too |
19:00:09 | FromGitter | <Yardanico> never had to do that tbg |
19:00:13 | FromGitter | <Yardanico> *tbh |
20:09:34 | FromGitter | <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:15 | Araq | RedBeard0531: patch the pegs module, it's pretty straight-forward. |
20:11:23 | Araq | but pegs suck :-) |
20:12:02 | Araq | you might want to look into strscans.nim module for inspiration |
20:12:03 | FromGitter | <RedBeard0531> Do you have a preferred alternative, or just hand-rolled? |
20:12:24 | FromGitter | <RedBeard0531> I looked at it, but it lacked alternation |
20:12:32 | Araq | I do hand-rolled but I learned parsers before I learned Nim. |
20:13:03 | Araq | it takes many wrong starts before I write macros that automate what I do |
20:13:48 | Araq | Karax solves tree construction, Ormin SQL creation, lexim lexer generation, ??? solves parser generation |
20:14:10 | Araq | :P |
20:14:11 | FromGitter | <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:29 | Araq | I copy an existing lexer and parser and adapt it |
20:14:36 | FromGitter | <RedBeard0531> hmm, I'll take a peek at lexim |
20:14:43 | FromGitter | <RedBeard0531> that may be enough |
20:14:49 | Araq | all languages are the same really, it's just some typing excercise |
20:15:28 | Araq | keywords -- check, string literals -- check, comment handling -- check, some special chars like [ ] -- check |
20:15:41 | Araq | the hardest parser was for RST. |
20:15:55 | Araq | because it has no traditional lexing/parsing phase split. |
20:16:26 | FromGitter | <RedBeard0531> boost::spirit may be a horrible monstrosity, but it is generally tolerable and mostly works |
20:17:06 | Araq | Nim's macro sytem is really sweet for a parser generator but I haven't yet found a satisfying DSL. |
20:17:25 | FromGitter | <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:56 | Araq | yeah, and these two requirements take up 80% of the code! |
20:18:49 | Araq | it doesn't matter how short your if token == colon: nextToken() code becomes |
20:19:06 | FromGitter | <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:12 | FromGitter | <alehander42> but error reporting is a bitch |
20:19:35 | FromGitter | <RedBeard0531> I think action-binding seems to solve problem 1 fairly well. But "expected one of ':', '{', or ','" style error message suck |
20:20:43 | FromGitter | <alehander42> action-binding as attaching a code block to an action? |
20:21:04 | Araq | <pattern>: action is the easy part |
20:21:35 | Araq | problem is that <pattern> can be cryptic and weak (can it do back references? unifications?) |
20:21:54 | Araq | and the other problem is that 'action' takes up most of the code |
20:22:28 | Araq | and may contain crap like $_ $1 $3 |
20:23:16 | FromGitter | <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:57 | Araq | there are some compiler compilers that are more declarative |
20:24:37 | FromGitter | <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:52 | Araq | they 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:36 | Araq | semantic 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:24 | FromGitter | <alehander42> eg something like ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a2c4768540c78242da50672] |
20:29:46 | Araq | what's that 'ws' doing here? couldn't affort a real lexer? |
20:29:55 | FromGitter | <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:33 | FromGitter | <alehander42> well it all depends on the dsl rules :D |
20:30:50 | FromGitter | <alehander42> you can automatically look for optional whitespace |
20:31:08 | FromGitter | <alehander42> I am just used to being more explicit (and I usually don't write a separate lexer :( ) |
20:31:16 | Araq | as I said, don't give up the lexer/parser split, things degenerate into clusterfucks if you don't have it (RST...) |
20:32:05 | Araq | quick iterations are quicker when you can't fuck up. |
20:32:45 | FromGitter | <alehander42> well it depends on the lang that you parse, for a lot of cases it's not such a big deal |
20:33:14 | FromGitter | <alehander42> I haven't used RST why is it problematic there |
20:33:38 | Araq | well 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:57 | FromGitter | <alehander42> `roSupportSmilies` ⏎ that's gonna be good .. :D |
20:46:33 | * | nsf quit (Quit: WeeChat 1.9.1) |
20:57:59 | FromGitter | <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:35 | Araq | gg systemInit compiler |
20:59:35 | Araq | compiler\cgen.nim |
20:59:35 | Araq | 934: "\tsystemInit000();$N" & |
20:59:47 | Araq | (gg is my shortcut for nimgrep) |
21:00:09 | FromGitter | <RedBeard0531> Yeah, I found the call site |
21:00:27 | FromGitter | <RedBeard0531> but I can't find the definition for that function |
21:02:40 | Araq | 1074: proc getInitName(m: PSym): Rope = |
21:02:40 | Araq | 1079: result = getSomeInitName(m, "Init000") |
21:03:05 | FromGitter | <RedBeard0531> ahh, that explains it. thanks |
21:03:11 | Araq | it's the generic way of creating init procs for modules |
21:03:17 | Araq | system.nim is not special. |
21:03:41 | Araq | in other words |
21:03:55 | Araq | you should patch system.nim to install a crash handler in C++ mode |
21:04:02 | Araq | and not the codegen |
21:04:27 | GitDisc | <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:33 | FromGitter | <RedBeard0531> Well my thought is that it should only happen when nim is building a program not a library |
21:05:59 | FromGitter | <RedBeard0531> although, I guess that could be done with a `when` block |
21:06:07 | * | dddddd quit (Ping timeout: 248 seconds) |
21:07:29 | Araq | treeform, I'm in fact outlining my ideas right now |
21:08:20 | GitDisc | <treeform> cool |
21:08:39 | GitDisc | <treeform> we can also do vice chat if you prefer, wait I am on discord, you are not... |
21:12:21 | FromGitter | <RedBeard0531> Is there a list of the standard defines that can be when'ed on? |
21:15:05 | Araq | when defined(cpp) and appType != "lib" |
21:15:40 | Araq | treeform, meh I had some overly complex meta programming solution with macros and templates |
21:15:52 | Araq | but it's hard to explain, so instead in a nutshell. |
21:16:17 | Araq | use 2 passes. first pass renders tree into a seq of *tokens* (not a single string) |
21:16:33 | Araq | second pass turns token stream into a single string. |
21:16:56 | GitDisc | <treeform> that sounds resonable |
21:17:01 | Araq | tokens can have instruction-like character like "increase indentation" |
21:17:28 | GitDisc | <treeform> I do that with the typography library I am making. A typeset pass, then a rastarzation pass. Different, but the same. |
21:17:34 | Araq | or "optional newline here if in 'long mode'" |
21:17:59 | Araq | and whether you are in long mode or not depends on the predicted line lengths |
21:18:00 | GitDisc | <treeform> do you think there should be a 2 modes or 3? |
21:18:25 | GitDisc | <treeform> yeah len that can be set but defaults to like 80 or 120... |
21:18:32 | * | dddddd joined #nim |
21:18:39 | Araq | just use 80. |
21:18:54 | Araq | nobody minds, it's generated code, nobody should mess with it. |
21:19:11 | GitDisc | <treeform> I want to use this for pretty printing. |
21:19:11 | Araq | it shouldn't be overly verbose/excessive though. |
21:19:32 | GitDisc | <treeform> Do you think we should have like a fast mode? and Slow pretty printer mode? |
21:19:55 | Araq | well you're free to spend the effort you need. I would keep it as simple as reasonable. |
21:20:02 | GitDisc | <treeform> The SQL we have floating around has indents that are more then 80 chars... |
21:20:17 | Araq | what's the need for a fast mode? |
21:20:35 | Araq | just make it fast, but why should "fast" imply "all is ugly" |
21:21:14 | GitDisc | <treeform> fast could imply don't do the indentation checking stuff? |
21:21:31 | GitDisc | <treeform> so there is a single string buffer |
21:21:31 | Araq | that's probably free. |
21:21:34 | GitDisc | <treeform> not a tree of string |
21:21:43 | GitDisc | <treeform> not a tree of strings |
21:21:49 | Araq | it's not a tree. it's a seq of string. |
21:22:06 | Araq | and you can create an optimized StringSeq data type and add it to the stdlib |
21:22:17 | Araq | it would be useful for many things |
21:23:14 | Araq | I wanted to write a similar thing for JSON |
21:23:25 | Araq | and do some benchmarking :-) |
21:23:29 | GitDisc | <treeform> it seems simpler for JSON, the grammer is so much smaller. |
21:23:41 | GitDisc | <treeform> Oh you mean the StringSeq, not the prettyprinter? |
21:23:46 | Araq | yes.+ |
21:24:01 | Araq | I called it a "PackedJson" |
21:24:01 | GitDisc | <treeform> I dont get how you want StringSeq to work? |
21:24:42 | GitDisc | <treeform> I see it as sql of buffes that has the sting and some thing extra, weather it should indent after |
21:24:50 | GitDisc | <treeform> but it also needs to know how long it goes? |
21:25:06 | GitDisc | <treeform> probably best stored as a tree? |
21:26:41 | Araq | a 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:24 | Araq | since JSON can represent "list of strings" you could use it as a StringSeq too, ofc |
21:28:13 | GitDisc | <treeform> in PackedJson nodes are contiguous in memory so less GC pressure? |
21:28:26 | Araq | yes. |
21:28:48 | Araq | it would be quite comparable to a single string |
21:28:53 | GitDisc | <treeform> I remmber reading about a C JSON parser that would just create pointsers to orignal string it was parsing |
21:29:08 | GitDisc | <treeform> and would replace " whith 0x00 |
21:29:19 | GitDisc | <treeform> so that null terminated C strings would work. |
21:29:22 | Araq | yeah ... something like that but don't use pointers |
21:29:38 | Araq | they take up too much space and don't allow realloc() |
21:29:50 | GitDisc | <treeform> yeah some sort of offsets are better. |
21:30:02 | Araq | exactly. |
21:30:21 | GitDisc | <treeform> but ahhh ... we are doing SQL not JSON? |
21:30:38 | GitDisc | <treeform> PackedJson idea is cool, isnt SQL different? |
21:30:49 | Araq | so ... ? you use the PackedJson as your buffer target for your SQL pretty printer |
21:30:53 | Araq | where is the problem? |
21:31:01 | GitDisc | <treeform> oh ok I get it now. |
21:31:23 | GitDisc | <treeform> I though you wanted some thing like PackedSQL |
21:31:48 | GitDisc | <treeform> instead of json grammer it was SQL grammer. |
21:33:19 | Araq | https://sqlite.org/src4/doc/trunk/www/varint.wiki I wanted to use this for the length informations in the blob |
21:34:46 | GitDisc | <treeform> I wrote a TTF parser, and its full of this stuff from the 1990s. |
21:34:58 | GitDisc | <treeform> I ma not a huge fant of trying to sequese out every bit |
21:35:10 | Araq | it's a standard library. |
21:35:17 | GitDisc | <treeform> unless it can be showen to improve performance. |
21:35:45 | Araq | cache miss is 100+ cycles. |
21:36:12 | Araq | when I optimize things, I make them smaller. |
21:36:38 | GitDisc | <treeform> you are probably better at it then I am. |
21:37:01 | Araq | or worse. :-) |
21:37:36 | GitDisc | <treeform> in the TTF format they used these tricks everywhere, and I am like just use zlib with real compression. |
21:38:46 | Araq | but real compression might end up being slower |
21:39:09 | Araq | so you have to hack specialized solutions into everything :-) |
21:39:27 | Araq | but hey, json is not even that specialized, it's quite flexible |
21:39:46 | GitDisc | <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:59 | GitDisc | <treeform> JSON is use a ton it should be done for JSON though. |
21:40:31 | GitDisc | <treeform> I agree that duing all this research for JSON and XML is good. But probably not SQL or TTF files. |
21:40:41 | GitDisc | <treeform> I think we are way off track now... |
21:40:46 | * | lastjedi joined #nim |
21:40:49 | Araq | {"key": "value", "key2": 0.9} |
21:40:52 | GitDisc | <treeform> What would you like me to do wit hthe SQL thing? |
21:42:24 | Araq | that takes up 29 bytes. you know what takes more space? 4 pointers. |
21:42:53 | Araq | as I said, render into a seq of tokens |
21:43:03 | GitDisc | <treeform> I can't argue with that. |
21:43:10 | Araq | and then render the seq of tokens into a single string. |
21:43:11 | GitDisc | <treeform> Where do I put if it should indent or not? |
21:43:30 | GitDisc | <treeform> and when indent should end? |
21:43:36 | GitDisc | <treeform> oh part of tocken |
21:43:40 | Araq | yes |
21:44:07 | GitDisc | <treeform> so a RenderToken would have like a string and the type it is |
21:44:26 | GitDisc | <treeform> and it would also need to know how many children it should indent |
21:44:37 | GitDisc | <treeform> but thats like packing a tree in a seq |
21:45:16 | GitDisc | <treeform> or it could read peoples indent levels untill it hits its own indent level |
21:45:38 | GitDisc | <treeform> Sould it try to do the 3 modes? Or just do 2 modes? |
21:46:39 | * | libman joined #nim |
21:47:50 | Araq | 2 modes. |
21:49:03 | GitDisc | <treeform> ok |
21:57:09 | Araq | btw 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:31 | GitDisc | <treeform> I agree with you if its JSON. |
21:57:48 | Araq | could be wrong of course and it will be slower. it's an interesting experiment. |
21:58:17 | GitDisc | <treeform> Why do incodings at all, you can just scan the JSON everytime? |
21:58:39 | GitDisc | <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:05 | GitDisc | <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:51 | GitDisc | <treeform> You need to counting opening {[", stifng escape \" and only check : for if its a key. |
22:00:08 | * | arecaceae joined #nim |
22:00:09 | Araq | that works but with a couple of length infos you can skip fields |
22:00:30 | Araq | plus it can be hard to get all the escaping rules right |
22:00:48 | Araq | ':' must not be in a string literal, for instance |
22:01:11 | GitDisc | <treeform> string literal can only have /" or " as terminator. |
22:01:16 | GitDisc | <treeform> I think it works out? |
22:01:56 | GitDisc | <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:26 | GitDisc | <treeform> I bleed cahce misses, hardrive misses ... |
22:03:04 | GitDisc | <treeform> new line json terminated log files |
22:03:13 | Araq | it works "out" but it is unstructured. |
22:03:41 | GitDisc | <treeform> I think it logicall works out? |
22:03:51 | GitDisc | <treeform> you can never find a key in a [] |
22:04:01 | GitDisc | <treeform> or in a " " |
22:04:12 | Araq | for example, extractString() on a json needs to handle escapes |
22:04:36 | Araq | on a PackedJson it doesn't, there are no escapes, there is length information available. |
22:05:00 | GitDisc | <treeform> yes I think PackedJson would be cool. |
22:06:05 | GitDisc | <treeform> in my prev company, Pushbullet, we used this new format we invented called string json |
22:06:09 | Araq | and 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:20 | GitDisc | <treeform> which was just like json but did not allow numbers, everyting must been string |
22:06:38 | GitDisc | <treeform> and no bom or required to be utf8 |
22:06:50 | GitDisc | <treeform> and no bom and was required to be utf8 |
22:07:28 | GitDisc | <treeform> In PackedJson, what if you want to know a single key? Or some length? |
22:07:34 | GitDisc | <treeform> you would have to scan the whole thing? |
22:07:43 | GitDisc | <treeform> p = PackedJson ... |
22:07:50 | GitDisc | <treeform> p[1000] |
22:07:50 | Araq | well string literals are prefixed with a length field |
22:07:53 | Araq | and so are lists |
22:08:09 | GitDisc | <treeform> but say you have list of 10000 |
22:08:13 | Araq | lists have in fact 2 prefixes |
22:08:20 | GitDisc | <treeform> and you need to get an element in the middle? |
22:08:23 | Araq | one for the total lenght in bytes |
22:08:31 | Araq | one for the number of elements |
22:08:51 | Araq | that's enough to be able to skip into the i'th element |
22:09:00 | GitDisc | <treeform> Say each element is like 1K? |
22:09:09 | GitDisc | <treeform> you would have 1000 cache misses? |
22:09:18 | GitDisc | <treeform> as jump from element to element? |
22:09:37 | GitDisc | <treeform> while with a pointers it would be like 2? |
22:09:47 | Araq | probably. :-) I thought about a two level structure |
22:09:57 | GitDisc | <treeform> PackedJson would be great for tiny JSONs though |
22:10:04 | GitDisc | <treeform> they would probably get all caches and be super fast. |
22:10:52 | Araq | one level for fixed size stuff that points to the variably sized stringA\0stringB\0 part |
22:11:18 | GitDisc | <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:27 | Araq | yeah. |
22:11:38 | GitDisc | <treeform> full parser full pointer we have now |
22:11:50 | GitDisc | <treeform> packed json, less memory use, faster for small things |
22:12:07 | GitDisc | <treeform> non parsed json, just get the thing you want and get out |
22:12:09 | Araq | with the two level setup you can do key deduplications |
22:12:27 | Araq | it could be "good enough" for everything :-) |
22:12:36 | GitDisc | <treeform> hmm |
22:12:56 | GitDisc | <treeform> I have written a parser and generator for the mac's binary plist format |
22:13:12 | GitDisc | <treeform> it kind of does a bit of these bit fiddly stuff. |
22:13:54 | GitDisc | <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:21 | GitDisc | <treeform> https://gist.github.com/treeform/cc4bfd8965c13e5229729a1e2a826830 |
22:15:32 | GitDisc | <treeform> It kind of does the 2 level inderection you talked about |
22:16:04 | GitDisc | <treeform> the entire strucutre lives in the first half of the file |
22:16:11 | GitDisc | <treeform> you can can walk through it quickly |
22:16:18 | GitDisc | <treeform> but the data lives in the back |
22:16:52 | * | Trustable quit (Remote host closed the connection) |
22:17:33 | GitDisc | <treeform> http://fileformats.archiveteam.org/wiki/Property_List/Binary |
22:18:24 | Araq | well I don't claim I'm the first with this idea |
22:19:13 | GitDisc | <treeform> I like how it can encode list of sizes 0-16 in one byte |
22:19:26 | GitDisc | <treeform> and dicts and sets as well. |
22:19:32 | GitDisc | <treeform> small ints also are just 1 byte |
22:19:36 | Araq | but I'm becoming a fan of datastructures that are identical in RAM and on disk :-) |
22:20:12 | GitDisc | <treeform> Did you watch Jonothan Blow talk about relative pointers in data? |
22:20:28 | GitDisc | <treeform> I don't know if JBlow is respectead here or not, but the talk was interesting. |
22:21:18 | Araq | I respect him, but I got disappointed when he reinvented thread local storage without noticing :P |
22:21:43 | GitDisc | <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:48 | Araq | yeah, I think I watched that talk |
22:22:01 | GitDisc | <treeform> He got this idea from x86 talk with JMP instruction |
22:22:04 | * | endragor joined #nim |
22:22:17 | GitDisc | <treeform> x86 not talk , x86 spec ... you know |
22:23:48 | GitDisc | <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:59 | Araq | yeah but you should use explicit offsets instead of pointers. why? because they transform temporal memory safety into spatial memory safety issues. |
22:24:23 | Araq | which are much easier to deal with if you are not a fan of Rust's borrow checker. |
22:24:48 | GitDisc | <treeform> saidly I don't know anything about Rust's borrow checker. |
22:25:07 | Araq | this was well known when they designed Ada. unfortunately it lost against C++ |
22:26:27 | * | endragor quit (Ping timeout: 240 seconds) |
22:26:46 | GitDisc | <treeform> what was well known? borrow checker, explicit offsets instead of pointers, short pointers? |
22:26:52 | GitDisc | <treeform> I think you lost me. |
22:26:54 | Araq | interestingly 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:33 | GitDisc | <treeform> array+index has advatanges if your array moves about. |
22:27:41 | Araq | treeform: It was well known that array+index are MUCH better than pointers ;-) |
22:28:00 | Araq | apart from the messy notation. |
22:28:13 | Araq | which can be dealt with when you have a macro system... |
22:28:25 | Araq | I did a live stream about it |
22:28:39 | GitDisc | <treeform> Sorry did not see. |
22:30:53 | GitDisc | <treeform> Can macros throw custom errors? I run into this problem with heavy macros in https://github.com/stavenko/nim-glm . |
22:31:04 | GitDisc | <treeform> where for each invalid thing I did it would say some thing like |
22:31:09 | Araq | macros.error |
22:31:48 | GitDisc | <treeform> some thing thing like "proc not found [][x][y][z] can [][a][c][d]" |
22:31:57 | GitDisc | <treeform> it was just very dense to understand |
22:32:00 | GitDisc | <treeform> what was going on |
22:32:13 | GitDisc | <treeform> it should just say "can't add vec2 to vec3 bro" |
22:32:46 | Araq | yeah, it's on my todo |
22:32:50 | GitDisc | <treeform> but when you write heavy macros people seem to forget about ergonimics and quality compile errors. |
22:33:11 | Araq | partly the macro API is to blame |
22:33:19 | Araq | but we know how to fix it |
22:33:33 | GitDisc | <treeform> cool. |
22:33:59 | GitDisc | <treeform> I though it might be invediable direction they just roll into, like boost in c++ |
22:35:22 | Araq | nah, I'm optimistic |
22:35:49 | GitDisc | <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:59 | Araq | still have new tricks in my sleeves. |
22:36:07 | GitDisc | <treeform> cool |
22:36:39 | Araq | in the meantime, I do -d:debugKaraxDsl and see what is going on :-) |
22:37:30 | GitDisc | <treeform> unrelated, have you thought of making an x86 backend? Not because it would be usefull, but because it would be cool? |
22:37:37 | Araq | everybody should have a -d:debug<My>Dsl switch, it's one line of code |
22:37:55 | Araq | at the macro body end, write |
22:38:13 | Araq | when defined(debugXxxDsl): echo repr result |
22:38:34 | GitDisc | <treeform> thanks I will use this. |
22:39:12 | Araq | there is also macros.expandMacro iirc |
22:39:22 | Araq | that you can annotate your code with |
22:39:44 | * | Vladar quit (Quit: Leaving) |
22:39:56 | Araq | x86 backend? I considered to produce x86 instead of my VM bytecode |
22:40:04 | GitDisc | <treeform> I have not done that many macro writing yet. Mainly because templates seems todo most things. |
22:40:30 | Araq | but my VM is about Nim's ASTs that don't benefit from asm. in fact, direct asm generation makes it much harder. |
22:40:50 | GitDisc | <treeform> yes I think VM bytecode is better. |
22:41:09 | Araq | the current VM uses a symbolic representation that plays well with the rest of the compiler and the GC it uses |
22:41:36 | Araq | I couldn't do that with a JIT. |
22:42:18 | GitDisc | <treeform> yeah, and using it for compiler you can't interface with C as easly. |
22:42:34 | Araq | of course, if my ASTs would just be compressed blob-like things... ;-) |
22:42:36 | * | nsf joined #nim |
22:43:35 | Araq | but I can't rewrite 80K LOC to play with an idea that will probably fail |
22:43:50 | GitDisc | <treeform> haha nope |
22:44:10 | Araq | so ... I target JSON instead :P |
22:51:31 | GitDisc | <treeform> do the crazy experiments were its simpler? |
22:51:41 | Araq | yes |
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…) |