<< 26-12-2018 >>

00:01:01*kapil____ quit (Quit: Connection closed for inactivity)
00:02:18*demond joined #nim
00:02:30*demond left #nim ("++++++")
01:03:44*Tyresc quit (Quit: WeeChat 2.4-dev)
02:07:08*Cthalupa quit (Ping timeout: 245 seconds)
02:08:04*Cthalupa joined #nim
02:25:01*plushie quit (Quit: plushie)
03:00:08*banc quit (Quit: Bye)
03:03:39FromGitter<m4d3bug> anyone knows how to install the local nimble's packeage and check the version of it?
03:09:44*abm quit (Ping timeout: 268 seconds)
03:16:25*banc joined #nim
03:28:30*Cthalupa quit (Ping timeout: 250 seconds)
03:30:12*Cthalupa joined #nim
04:14:56*kapil____ joined #nim
04:40:14shashlickYou just run nimble install in the folder with the nimble file
04:40:36shashlickCheck version in the nimble file or with nimble path pkgname
05:39:37*craigger_ quit (Quit: bye)
05:42:17*craigger joined #nim
05:57:12*azuri5 joined #nim
06:09:26*nsf joined #nim
06:33:53*kapil____ quit (Quit: Connection closed for inactivity)
06:40:50*Cthalupa quit (Ping timeout: 272 seconds)
06:42:00*Cthalupa joined #nim
07:09:00*Cthalupa quit (Ping timeout: 268 seconds)
07:11:05*Cthalupa joined #nim
07:15:30*azuri5 quit (Quit: azuri5)
07:47:39*azuri5 joined #nim
08:04:16FromGitter<zacharycarter> shashlick: I tried nimterop - https://gist.github.com/zacharycarter/1e28d218df3000e712e1888eb2a2a4bc
08:04:23FromGitter<zacharycarter> but it is throwing errors
08:09:37*azuri5 quit (Quit: azuri5)
08:13:20shashlickfirst blood
08:15:24shashlickI presume you are using https://github.com/floooh/sokol/blob/master/sokol_app.h
08:23:07shashlickyou shouldn't define SOKOL_IMPL since you really only want to pull in the procs and structs/enums
08:23:44shashlickof course nimterop doesn't recognize anything even without that
08:26:32*xet7 quit (Ping timeout: 244 seconds)
08:44:03FromGitter<zacharycarter> yeah
08:44:11FromGitter<zacharycarter> hmm - I think first I need to get this working without nimterop
08:44:17FromGitter<zacharycarter> which I'm struggling through now...
08:44:35*azuri5 joined #nim
08:44:44FromGitter<zacharycarter> stupid clang is giving me a huge headache...
08:46:10FromGitter<zacharycarter> `nim c --nimcache:. --noMain --noLinking --header:rvb.h rvb.nim`
08:46:17FromGitter<zacharycarter> `clang -I/Users/zachcarter/.choosenim/toolchains/nim-0.19.0/lib –framework Foundation -fobjc-arc *.c`
08:46:24FromGitter<zacharycarter> ```clang: error: no such file or directory: 'Foundation'``````
08:46:26FromGitter<zacharycarter> wtf.....
08:49:50shashlickminor grammar limitations - will fix in nimterop
08:53:38FromGitter<zacharycarter> I think I'm getting somewhere
09:06:07*azuri5 quit (Quit: azuri5)
09:10:03FromGitter<zacharycarter> okay - I almost got sokol_app working (I think) - but I'm encountering something strange
09:10:28FromGitter<zacharycarter> I have this Nim proc signature - `proc entry(argc: cint; argv: UncheckedArray[cstring]): sapp_desc {. ⏎ exportc.} = discard`
09:10:53FromGitter<zacharycarter> I don't understand why - but the C code it's generating is - `N_NIMCALL(void, entry)(int argc, tyArray_z9ac6Ez5VSEHe9bC2NMwuc7Q argv, tyObject_sapp_desc_koj3ul75m4z2W3jZTshMHw* Result);`
09:11:03FromGitter<zacharycarter> the return type is becoming a parameter
09:16:26FromGitter<zacharycarter> I guess that's just how it works and I've never tried calling Nim from C before?
09:20:06*stefanos82 joined #nim
09:23:42leorizezacharycarter: you should look into the `N_NIMCALL()` macro
09:24:03leorizeoh, it does become a parameter here
09:24:07leorizeno idea why
09:32:45FromGitter<zacharycarter> I think the solution to all of this is just to port sokol to Nim
09:32:47FromGitter<zacharycarter> :P
09:32:59FromGitter<zacharycarter> or at least sokol_app
09:33:03FromGitter<zacharycarter> that's all I'm after atm anyway
09:39:38*xet7 joined #nim
09:45:54*azuri5 joined #nim
09:56:49*azuri5 quit (Ping timeout: 250 seconds)
10:04:16*dorelix quit (Remote host closed the connection)
10:31:16*krux02 joined #nim
10:34:11*Trustable joined #nim
10:53:33FromDiscord_<exelotl> I hadn't heard of sokol before, it looks very nice :D
11:06:59*krux02 quit (Remote host closed the connection)
11:07:27*wildlander quit (Quit: Konversation terminated!)
11:42:50*stefanos82 quit (Remote host closed the connection)
11:47:38*Trustable quit (Remote host closed the connection)
12:07:11*NimBot joined #nim
12:31:04FromGitter<zacharycarter> exeltol: may want to check out oryol as well
12:45:45FromGitter<zacharycarter> anyone know why nimpretty - when formatting on save in VSCode is adding a line of whitespace every time I save?
12:56:42FromGitter<zacharycarter> I'm finding it difficult to exactly understand what nimpretty does
13:03:04*narimiran joined #nim
13:05:09FromGitter<zacharycarter> seems to line everything up to wherever the first line is indented - which isn't want I want
13:11:20FromGitter<gogolxdong> windows build failed Error: cannot open 'C:\Nim\tools\vccenv\vccexe.nim'
13:18:07*steshaw quit (Quit: Connection closed for inactivity)
13:41:55*kapil____ joined #nim
13:48:16FromGitter<gogolxdong> ./koch.exe tools
13:51:54*krux02 joined #nim
13:52:41FromGitter<gogolxdong> ah, remove the old ./kock.exe and build from csource works.
13:55:00*Vladar joined #nim
13:57:03*azuri5 joined #nim
14:00:55*wildlander joined #nim
14:07:42*whaletechno joined #nim
14:58:02*Vladar quit (Remote host closed the connection)
14:58:32FromGitter<Varriount> @zacharycarter Interesting... Do you have screenshots?
14:58:34*Tyresc joined #nim
15:23:02*azuri5 quit (Quit: azuri5)
15:26:08*filcuc joined #nim
15:27:41filcucis correct that nimsuggest doesn't give any suggestion to files that are not "imported" from the project file
15:27:42filcuc?
15:29:03filcucwith this behaviour it seems like that the only option for an IDE is to launch an instance for each .nim file
15:29:08filcuccorrect?
15:29:21*azuri5 joined #nim
15:29:36leorizeit should be able to provide suggestion for any .nim file
15:29:48leorizeif not then it's a bug I believe
15:30:06leorizenimsuggest is meant to be run once per project
15:35:07filcucleorize: it seems to work only for nim files somehow connected to the project file
15:35:49filcucleorize: checking what vscode plugin does confirm me
15:35:57filcucleorize: it spawns a nimsuggest instance for nim file
15:37:25filcucleorize: same the emacs plugin
15:37:46filcuc(and now i'm working on integrating nimsuggest to qtcreator)
15:38:01filcuchttps://codereview.qt-project.org/#/c/248612/
15:39:02*azuri5 quit (Quit: azuri5)
15:42:42*azuri5 joined #nim
15:44:09*xet7_ joined #nim
15:46:35*Sembei joined #nim
15:46:46*Pisuke quit (Ping timeout: 272 seconds)
15:48:16*xet7_ quit (Client Quit)
15:49:04*xet7 quit (Quit: Leaving)
15:54:01*xet7 joined #nim
16:10:28*abm joined #nim
16:15:27*abm quit (Quit: Leaving)
16:20:30dom96filcuc: AFAIK you can just make requests on files that are not a part of your project and nimsuggest will automagically parse it
16:20:52dom96If VS Code and Emacs are creating a separate instance of nimsuggest for each file then that is pretty bad
16:31:40filcucdom96: it works only if the given file is referenced from the "project" file
16:31:46filcucdom96: at least that's what i see
16:32:12filcucdom96: i do understand that from emacs POV there's no concept of project so for emacs this behaviour is fine
16:32:42filcucdom96: but for vscode no. And i think that the author worked around this issue by simply creating multiple instances of nimsuggests
16:33:16dom96It's not about the editor though. Nim has a concept of a project in this case
16:34:11dom96or rather I should say it has a concept of a "project file"
16:34:57filcucdom96: yes and basically from an editor POV it maps to the concept of "target"
16:35:24filcucdom96: for example an editor could build multiple targets
16:35:47filcucdom96: so the completion should match the build flags for the given target
16:36:07filcucdom96: that said without going offtopic that's what i see
16:36:29dom96yes. It isn't always possible to determine the project file AFAIK
16:36:47dom96But that's how Araq built nimsuggest, so we need to discuss this with him
16:37:21filcucdom96: yes..and it could be *fine*. The problem comes if you want to integrate nimble
16:37:37dom96oh? How so?
16:37:52filcucdom96: because imho each nimble task should map to a "target"
16:38:09filcucdom96: but how can i determine the project file for the given nimble task?
16:39:44filcucdom96: (well one could argue that mapping a nimble task to a "target" could be wrong)
16:40:12dom96Sadly nimble tasks are too abstract
16:40:19filcucdom96: correct
16:40:52filcucdom96: probably for IDE POV we could create simple tasks (executable, library etc)
16:41:10filcucdom96: but i'm biased by my knowledge of CMake
16:42:51*azuri5 quit (Ping timeout: 250 seconds)
16:43:00filcucdom96: i plan to finish the integration of nimsuggest in qtcreator during these holydays
16:43:07filcucdom96: at least a very simple integration
16:45:59dom96Well, I think this is only a problem when you want to get this "project file"
16:46:04dom96for a specific target
16:46:16dom96an IDE can easily get the task list and allow you to execute specific tasks
16:49:35*kapil____ quit (Quit: Connection closed for inactivity)
16:51:44filcucdom96: yes but you want also autocompletion (so you need to have project file for each task)
16:53:11dom96I would say it's about time nimsuggest can take a project /directory/ and parse all the .nim files instead of relying on this "project file" concept
16:58:32filcucdom96: well :D in this case problem solved
17:03:28*narimiran quit (Remote host closed the connection)
17:05:08*Vladar joined #nim
17:05:16*narimiran joined #nim
17:15:42dom96We'll need to convince Araq of that :)
17:18:30filcucdom96: well seems reasonable :) otherwise we (IDE devs) will have to find a way to emulate that behaviour
17:19:44filcucdom96: honestly i'm very close to start creating a basic Nim parser for having full control of suggestions and ide integrations
17:20:38filcucfor sure less correct but at least on my full control
17:20:50dom96I planned to create a Language Server Protocol client that combines a simple "look for `proc searchTerm`" with nimsuggest
17:21:14dom96because it is so damn frustrating to see nimsuggest failing to find a proc that is literally in the same file...
17:21:26dom96(I've seen that with other languages too to be fair)
17:22:30dom96I really wish I had the time to work on it, or that people who have taken it upon themselves to create an LSP Nim client followed my plan ;P
17:22:55filcucLSP?
17:25:03filcucah ok now got it
17:30:05FromGitter<alehander42> well, people have free will .. :D
17:34:38FromGitter<arnetheduck> filcuc the own-parser for tooling idea has crossed my mind as well - I started looking at what it would take to make the lexer freestanding and it's not too hard actually - then one could create tools on top of that which could be more or less flexible. `clang-format` takes a similar approach.. currently, the way the tools are organised is very hard to understand and above all, very hard to customize, because
17:34:38FromGitter... they're so tightly mixed with the compiler itself
17:35:21FromGitter<arnetheduck> ping me if you ever get anywhere with that idea :)
17:35:45filcucok
17:36:01filcucarnetheduck: do you have language requirements?
17:36:09filcucpython, nim, c++?
17:36:37*krux02 quit (Remote host closed the connection)
17:36:40FromGitter<arnetheduck> @filcuc my preference would be nim, so the environment is self-contained, to the greatest extent possible
17:36:44filcucprobably i could start it in nim and expose some kind of c-interface for using it in qtcreator (c++)
17:36:56filcucok
17:44:21*minus joined #nim
17:44:35FromGitter<arnetheduck> speaking of exposing nim to c/c++ - does anyone know of any examples of where that's done? ie where nim code is used as a library in some bigger application
17:46:58*narimiran quit (Remote host closed the connection)
17:47:47*narimiran joined #nim
17:48:13filcucarnetheduck i think that not trivial..or at least care must be taken in order to initiale the nim garbage collector
17:48:30filcucarnetheduck probably the safest approach is to use some sort ipc
17:48:37*kapil____ joined #nim
17:50:35minusokay, who's jinglepinging nim ads there
17:57:51FromGitter<arnetheduck> filcuc, yeah, that's my concern also - though technically, the gc only acts on memory that's been allocated through nim.. one issue would be initializing the stack bottom. one way to make it work could actually be to use boehm - it should be guaranteed safe for the whole application, though I suspect you might run into nim issues given it's not tested that much
18:01:08filcucarnetheduck i think that threading is the main problem
18:01:41filcucarnetheduck so you will have to register somehow the threads
18:24:15*smitop joined #nim
18:24:38smitopWhat is the difference between the db_sqlite lib and the sqlite3 lib?
18:27:15dom96sqlite3 is a thin wrapper over the C library, db_sqlite is a high-level module on top of that
18:35:53*filcuc quit (Ping timeout: 245 seconds)
18:58:06AraqBoehm is super stable IME, no known Nim specific problems
18:58:20AraqI never found a binary for Windows though
18:58:32Araqit's also part of the test suite
19:03:34dom96Araq: Can we get nimsuggest to accept a project directory instead of a project file?
19:04:02Araqit already does that, pass it a directory and it figures out the main Nim file
19:04:21Araqdisclaimer: This feature isn't tested much...
19:10:19dom96oh great. Then you should document this better :P
19:10:27dom96filcuc: ^^^
19:15:47FromGitter<arnetheduck> Araq, the test suite tells you what works, not what is broken :)
19:18:19Araqspeaking of which ... https://digitalcommons.lsu.edu/cgi/viewcontent.cgi?article=1572&context=gradschool_dissertations
19:18:33Araqnew GC algorithm, completely "local"
19:18:57Araqbreakthrough in GC technology IMHO, unfortunately hard to understand and implement
19:19:30Araqbut maybe we find a superhero who implements it for us
19:20:29Araqit might also be buggy, in the past these "correctness proofs" were astonishingly bad
19:22:01*zachk joined #nim
19:41:24*filcuc joined #nim
19:56:46FromDiscord_<PusiteGA> hi anyone knows if there is some board that can run https://github.com/CMU-Perceptual-Computing-Lab/openpose at at least 10fps , this sounded nice but chines dude told me 6mb limit on data files
19:56:47FromDiscord_<PusiteGA> https://www.indiegogo.com/projects/sipeed-maix-the-world-first-risc-v-64-ai-module#/
19:57:48FromDiscord_<PusiteGA> i have a greate uber idea, if there is some board like rpi3 that can run this live , litteraly i think evry 3rd family in USA would buy my idea if its under 100$
20:15:58Zevvwow, multithreaded GC
20:16:06*OrganicAnywhere joined #nim
20:17:53Zevv"three counters and a pointer are required for each object"
20:20:46Araqyep, it's pretty expensive though you can store this info in 2 words if you do it right
20:28:40*Vladar quit (Remote host closed the connection)
20:35:26FromGitter<unreadable> why isn't the class macro in the stdlib?
20:35:29FromGitter<unreadable> https://nim-by-example.github.io/macros/
20:35:32FromGitter<unreadable> as seen there
20:41:03*minus left #nim ("WeeChat 2.3")
20:50:53dom96unreadable: mainly because when you use Nim enough you no longer miss this syntax
20:53:54*masterdonx quit (Quit: ZNC - http://znc.in)
20:54:32*masterdonx joined #nim
20:54:40FromGitter<unreadable> or maybe procedural over oop ;P
21:00:45*endragor joined #nim
21:03:54*smitop quit (Quit: Connection closed for inactivity)
21:21:11*ee7[m] joined #nim
21:27:10FromGitter<zacharycarter> @Varriount - I don't but I also turned off format on save and problem is solved :)
21:28:42OrganicAnywhereIs this <https://nim-lang.org/docs/gc.html> correct and currently implemented?
21:29:32OrganicAnywhere(not including the --gc:v2 part, of course)
21:30:11Araqyes
21:43:24*smitop joined #nim
21:47:09*minos joined #nim
21:47:56minosHello. How can I check if an OrderedTable has been initialized? If I try to iterate when not initialized I get an IndexError
21:50:11ZevvThe data seq is not exported, so I can not check if this is empty
21:50:18Zevvso not sure
21:50:28*narimiran quit (Ping timeout: 245 seconds)
21:51:26FromGitter<zacharycarter> it'd be nil otherwise I think
21:51:41FromGitter<zacharycarter> since it's a ref object
21:51:53FromGitter<zacharycarter> so a `!= nil` check against the table object should work
21:52:29minosthats the OrderedTableRef, right?
21:52:53FromGitter<zacharycarter> yes
21:52:55FromGitter<zacharycarter> well
21:53:23FromGitter<zacharycarter> yeah - sorry it is
21:53:34smitopIs it safe to use the marshal module to load untrusted data?
21:54:38FromGitter<zacharycarter> is it safe to use any module to load untrusted data :P
21:54:39minoszacharycarter, ok I could switch to a ref and use nil check indeed. although I feel a proc for checking if a table is initialized would come in handy
21:55:38FromGitter<zacharycarter> minos: you could create a RFC suggesting so, or maybe ask again when more core devs are on, orrrr start a forum post
21:55:42FromGitter<zacharycarter> all viable options I think
21:55:58FromGitter<zacharycarter> smitop: I wasn't trying to be rude, but I'm not sure what safety measures you're looking for
21:56:16FromGitter<zacharycarter> what do you need the marshal module for?
21:56:33Araqmost collections should follow the "starts as empty" rule
21:56:46Araqbut since that rule is new, only seqs and strings obey
21:57:02Araqbut hey, how hard is it to init your collections.
21:57:25FromGitter<zacharycarter> Araq - it's funny
21:57:41FromGitter<zacharycarter> today I was writing some Nim code for a game engine subsystem
21:57:57FromGitter<zacharycarter> and I started adding isInitialized properties too the context objects for my subsystems
21:58:12FromGitter<zacharycarter> well - at firs they were just global variables inside modules
21:58:42FromGitter<zacharycarter> and then it just led to a ton of boilerplate / ugliness in regards to checking them when initialize was called or another procedure was called which depending on state being initialized
21:59:01FromGitter<zacharycarter> and I ended up just tearing it all out...
21:59:14FromGitter<zacharycarter> sometimes I feel like people want their hands held a bit too much
21:59:44FromGitter<zacharycarter> but I guess this is why people don't like programming in C anymore as well
21:59:53AraqI planned a "game programming in Nim" video just for you
22:00:14FromGitter<zacharycarter> well - I'm back to just using Nim and ditching C++
22:00:26FromGitter<zacharycarter> I think the whole - "getting things done" argument works both ways with Nim
22:00:44FromGitter<zacharycarter> and tbh - I haven't run into actual limitations, with half the reasons I point to, for not using Nim
22:00:54FromGitter<zacharycarter> I've never hit a performance wall where I've needed parallelism
22:01:07FromGitter<zacharycarter> and I've never felt that compile times have been so bad that I need not code reloading
22:01:22Araqparallelism in Nim is not hard, but you need to plan for it from the beginning
22:01:58Araqand avoid the GC. Which isn't really as tedious to do as people imagine it to be, but the libs are lacking to do that
22:02:49FromGitter<zacharycarter> I think even more than the libs lacking to make working without the gc more ergonomic, is a large(ish) programming demonstrating such a pattern
22:03:02*minos quit (Quit: Lost terminal)
22:03:08FromGitter<zacharycarter> most forum threads I read about memory management outside of the traditional GC end up being black holes
22:03:17OrganicAnywhereWill language and/or the standard library be GC-independent for v1.0?
22:04:02FromGitter<zacharycarter> I've changed my tactics up re: my game / engine project in 2 ways
22:04:11FromGitter<zacharycarter> 1) I'm writing a game now along with the engine, side by side
22:04:26FromGitter<zacharycarter> 2) I'm not going to worry about advanced topics like parallelism until I need to
22:04:31AraqOrganicAnywhere: we don't know. The terminology is also all bad, requires an update
22:04:51OrganicAnywhereTerminology?
22:04:59OrganicAnywhereYou mean the term "garbage collector"?
22:05:03OrganicAnywhereOr something else?
22:05:43AraqGC is not a good term, it can mean "automatic memory management" (which C++, Rust, ... do have)
22:05:57Araqor it can mean "tracing"
22:07:42FromGitter<zacharycarter> I'm also writing a proper 3d rendering pipeline this time
22:07:57FromGitter<zacharycarter> a minimal one, and then a PBR one - that's what I'm working on now
22:08:24OrganicAnywhereAraq: this? <https://en.wikipedia.org/wiki/Tracing_garbage_collection>
22:08:27FromGitter<zacharycarter> and my main focus on this engine is going to be strategy games - I want to start out with some type of historical one - I haven't decided b/w the American Civil War vs another one yet
22:08:49OrganicAnywhereWait, no.
22:09:08FromGitter<arnetheduck> https://github.com/nim-lang/Nim/issues/7832#issuecomment-447828943 is a fun side effect of forgot-to-init + seqs becoming not-nil :)
22:09:15FromGitter<zacharycarter> OrganicAnywhere: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.151.2018&rep=rep1&type=pdf
22:09:54FromGitter<zacharycarter> I view initTable like calling newTable
22:10:02FromGitter<zacharycarter> it's not like you have to call newTable and then initTable
22:10:08FromGitter<zacharycarter> that would be turrible
22:10:18FromGitter<zacharycarter> only having to call one though - IMO - isn't bad at all
22:10:39FromGitter<zacharycarter> although I think it'd be nice if Table followed the pattern of everything else - and used `newTable` instead of `initTable`
22:11:43FromGitter<zacharycarter> OrganicAnywhere: there are probably better sources for finding info on Nim's GC algorithm
22:11:50FromGitter<arnetheduck> well, in C++ you just `map<a, b>()` and you're done - no need to call anything at all
22:11:52FromGitter<zacharycarter> but that's A white paper on the algo it uses
22:12:01FromGitter<zacharycarter> well that's because C++ has constructors
22:12:19FromGitter<zacharycarter> Nim forces the programmer to write their own - and the style in which their written is not enforced
22:12:52FromGitter<arnetheduck> well, that's a developer experience feature that makes the language easier to use.. it's utterly meaningless to have a table on which initTable has not been called
22:13:01FromGitter<zacharycarter> but I view having to call - `map<a, b>()` - very much like having to call `initTableA,B ()`
22:13:13*endragor quit (Remote host closed the connection)
22:13:42FromGitter<zacharycarter> I guess it's as meaningless as having a `Map[A,B]` variable that you haven't assigned `map<a, b>()` to yet - no?
22:13:48FromGitter<zacharycarter> in C++
22:14:08FromGitter<arnetheduck> well, let me rephrase that - you don't have to call it - the compiler does it for you so that the `map` never ever has an "invalid state" in which it behaves weirdly
22:14:23FromGitter<zacharycarter> I see
22:14:53FromGitter<zacharycarter> it seems to me though that this is somewhat unavoidable - isn't it?
22:14:57FromGitter<arnetheduck> once you've declared a `map<a,b> myvar;`, that's it. you can use it and never worry.
22:14:57FromGitter<zacharycarter> in Nim I mean
22:15:15*steshaw joined #nim
22:15:28FromGitter<zacharycarter> based on the overall design of collections
22:15:49Araqvar a, b: Table
22:15:52Araqif cond:
22:15:53FromGitter<arnetheduck> in current nim, sort of.. the map implementation could have an `initialized` field that gets checked for every mutating access - then it wouldn't fail like that (and you wouldn't need a constructor)
22:16:01Araq a = f(); b = g()
22:16:04Araqelse:
22:16:12Araq a = h(); b = k()
22:16:55Araq^ implicit init of a, b is not universally a good thing, depending on the costs of the initializations
22:17:20Araqit's much better to do control flow checking instead, IMO.
22:17:27FromGitter<arnetheduck> basically - `Table` could be rewritten so that the "uninitialized" state would never be visible to the end user - a bit like the strings and seqs still are nil, but there's `if seq == nil: do this` injected everywhere
22:18:01Araqthat's true, there are multiple valid designs here
22:18:37AraqI personally want 'var x: T' to mean 'of type T, not inited, check it's inited before use'
22:18:44FromGitter<arnetheduck> Araq, that's just bad code that's asking for trouble... ie `let (a, b) = if cond: (f(), g()) else: ...`
22:19:15Araqarnetheduck: your syntax doesn't work in all cases
22:20:21Araqanyhow IMO 'var x: T' shouldn't mean 'var x = default(T)' because the explicit variant is not harder to write
22:21:17AraqI need to update my RFC. Figured out how to solve the cases that the people brought up
22:22:18FromGitter<zacharycarter> so if I don't want to use the GC
22:22:37FromGitter<zacharycarter> what allocation / freeing procs should I be using?
22:23:49Araqyou use fixed size arrays like in 1970
22:23:57FromGitter<arnetheduck> well... Araq, if you can prove with control flow checking that your variable is never used ininitialized, it means effectively that my syntax covers all the cases..
22:24:09FromGitter<zacharycarter> intersting
22:24:20FromGitter<zacharycarter> I think you said that a few weeks ago - I need to study this
22:24:22AraqI know you don't want to do that but you'll be surprised how far it gets you in game development
22:25:06FromGitter<zacharycarter> erm - it's not that I DON'T want to do it
22:25:32Araqoh and you can use all of Nim's stdlib if you run these parts in its own thread
22:25:52Araqthe GC is thread local after all
22:26:03FromGitter<zacharycarter> it's that I wasn't alive in the 1970s and I did't start programming until 2008 and I'm not sure I've encountered the pattern before at least encountered and recognized that I've encountered it
22:26:20AraqXD
22:26:42shashlickAraq what's the most efficient way to share stuff between threads in Nim? Channels?
22:26:59FromGitter<zacharycarter> Channels are not the most efficient
22:27:02FromGitter<zacharycarter> they're the easiest
22:28:02FromGitter<arnetheduck> btw, Araq.. the lexer currently streams in the source code.. is that a.. requirement? one of the things that crossed my mind was that with an `mmap`:ed buffer, the lexer could just return indices and you wouldn't have to allocate so many small strings
22:28:07Araqshashlick: channels are for when you don't want to share stuff
22:28:23shashlickTrue
22:28:46shashlickSo using locks then?
22:28:51FromGitter<arnetheduck> shashlick, efficient, how? in terms of man-hourse spent hunting down bugs?
22:29:31FromGitter<zacharycarter> locks won't be enough - you need to use the shared heap
22:29:33FromGitter<zacharycarter> if you want to share
22:29:54Araqarnetheduck: we don't allocate many small strings afaik, we need to create the PIdents but they are shared
22:29:54FromGitter<zacharycarter> and then use synchronization primitives - locks / conds or atomics
22:29:56shashlickPerformance wise
22:30:22FromGitter<zacharycarter> shashlick - this project has a job system that uses a lock-free work stealing queue
22:30:30shashlickSo we don't have a library that makes this relatively clean?
22:30:45FromGitter<zacharycarter> https://github.com/sheosi/tart
22:30:56FromGitter<zacharycarter> it's not possible to make clean - because you' need to use unsafe Nim
22:31:05FromGitter<zacharycarter> and the community views unsafe Nim as unclean
22:31:13FromGitter<zacharycarter> thus - channels
22:31:28FromGitter<zacharycarter> at least that's my naive perspective on things
22:31:40shashlickWell if it is abstracted and well tested, why not
22:31:55FromGitter<zacharycarter> because you need unsafe pointers to memory allocated on the shared heap
22:32:06FromGitter<zacharycarter> so people are going to see ptr and pointer - and like Araq said, they're going to need to work with fixed size arrays
22:32:40FromGitter<zacharycarter> it's not that it's not doable - it's that it's not Nim that people are used to writing and it's also stuff that tends to have very little example code out there on github / the forum
22:32:57FromGitter<zacharycarter> at least people that primarily write in Nim
22:33:22FromGitter<zacharycarter> I have a feeling if you're used to programming in C - these are not new concepts to you
22:33:30shashlickWell getting good at multi threading is getting more and more crucial
22:33:36FromGitter<zacharycarter> but to someone coming from Python - and unsafe pointer is like devil magic
22:33:51AraqI'd argue that it's forgotten knowledge for C programmers too
22:33:55FromGitter<arnetheduck> Araq, well, the use of ropes in the compiler is one of those things that could probably be improved - ie they're generally slow compared to better buffer management due to how they wreck cache and all that.. with mmap on the source side and a big output buffer that doesn't get reallocated on the c side, you could probably gain a good few %
22:34:20Araqyeah but that's the shitty codegen, not the lexer
22:34:23FromGitter<zacharycarter> Nim's GC doesn't make multi-threading easier - but multithreading isn't necessarily easy in any language
22:34:28shashlickHaving a nice abstraction that hides the unsafe stuff will make these capabilities more accessible to the community
22:34:37FromGitter<arnetheduck> well, it starts at the lexer, because that's where the ropes get created
22:34:44FromGitter<zacharycarter> you're always going to have a need to manage synchronization
22:34:53Araqno, the lexer doesn't create ropes.
22:34:57FromGitter<zacharycarter> but Nim you have to worry about where data is allocated in memory as well
22:35:07FromGitter<zacharycarter> shashlick: I'm not sure the unsafe stuff can be hidden
22:35:11FromGitter<zacharycarter> but I'm not 100% positive either
22:35:13AraqI didn't say "use pointers".
22:35:17FromGitter<arnetheduck> no? then I misread it somewhere..
22:35:25AraqI said "use fixed size arrays".
22:35:48FromGitter<arnetheduck> but the ast holds ropes all over the place that could be replaced by indices into a big source buffer
22:35:54Araqthey are not "unsafe" in Nim, on the contrary they are the most safe construct.
22:36:11FromGitter<arnetheduck> but that of course would kill the ability to stream in the source
22:36:24FromGitter<zacharycarter> okay - well I don't understand enough about how to use unsafe arrays to comment on this further then - I'm must speaking to my experience in the matter, which is limited
22:36:47Araqaliasing problems mitigated, cannot OOM, no "use after free", no reallocations
22:37:19Araqno double free, easy to parallelize
22:38:18FromGitter<zacharycarter> so is this just like creating an array like - `var gameObjects: Array[1000, GameObject]`
22:38:44FromGitter<zacharycarter> and `GameObject` is a non-ref object?
22:39:29Araqyup.
22:40:39Araqarnetheduck: the streaming is fine and I remain unconvinced about mmap.
22:41:25Araqyeah I know it often wins in benchmarks but maybe I want the compiler to use less memory and have it run on 32bit systems. Why waste precious address space
22:45:38*xet7 quit (Remote host closed the connection)
22:45:59*zachk quit (Read error: Connection reset by peer)
22:46:28FromGitter<arnetheduck> well, that's what I'm asking, basically... and you should end up with at least comparable memory usage given that you have much less book-keeping to do.. excepting those pathological cases with giant comments of course.
22:51:03AraqI doubt it works out well. assuming identifiers are most important you keep a slice (a, b) to 'foo' in your mmap'ed buffer. now if 'foo' is used again in the source code and you use a different slice (c, d) you reduce the value of your caches
22:51:20Araqif you use the old (a, b) you need to find the old one somehow
22:51:36Araqusually with a hash table
22:52:17*zachk joined #nim
22:52:41Araqand then it's just a variant of our PIdent stuff
22:53:24Araqand that's all guesswork, before we do anything, we could measure/profile the compiler...
22:53:41AraqI never saw the lexer or the parser on the critical path
22:53:53Araqit's all lost in semcheck and stupid rope handling
22:55:24shashlickso i've been wanting to use nims as the scripting language for the text editor i'm working on
22:55:27FromGitter<arnetheduck> well, I actually did a branch that just changed rope to string, which kind of worked, but added a 50% bonus extra time to compilation - would need to make a few adjustments here and there
22:55:50shashlicki cannot think of a way to interact with the nims process without stdin/out - any ideas?
22:55:51Araqit's called "RAM", but it isn't. mmap says "look, even more things are now RAM". that doesn't convince me.
22:56:04shashlicki'm not keen on pulling in the compiler into the editor like nimble though
22:56:07Araqshashlick: the compiler API shows how to do that
22:56:24Araqyou extend the API, some calls call into your native Nim code
22:56:27*nsf quit (Quit: WeeChat 2.3)
22:56:29FromGitter<arnetheduck> (before a non-rope solution would fly)
22:56:59shashlicki was able to get a minimal nim distro with nim.exe, lib\system and a few other files so have enough to run a good amount of stuff in 2mb
22:57:30shashlickbut once i spawn a nim e script.nims, i have limited ways for it to interact with the editor
22:57:37Araqshashlick: NimEdit uses Nimscript
22:58:01Araqand as shitty as it may be, it shows how things can be done, it compiles with devel
22:58:06shashlickdoes it pull in the compiler?
22:58:27Araqyes, the parts that Nimscript need (which is much of it)
22:58:52shashlicki see, i'm trying to avoid that, just like the idea to remove compiler from nimble
22:58:56Araqarnetheduck: tried to only change ccgcalls to use strings?
22:59:19shashlickany way besides stdin/out to interact with the nimscript process?
22:59:38FromGitter<arnetheduck> @Araq I changed so `type Rope = string`
22:59:40shashlickcan i use sockets or ipc or something to that order?
22:59:46FromGitter<zacharycarter> shashlick: https://github.com/capocasa/scnim - is a project that apparently avoids using Nim's GC
22:59:49shashlickin the vm
22:59:53FromGitter<zacharycarter> at least in some capacity
23:00:11Araqshashlick: well you have to pick your poison
23:00:44Araqany IPC mechanism could work but they are all equally terrible
23:01:17shashlickbut can I do that in nimscript - in the vm
23:03:55Araqzacharycarter: also kudos for developing a game and engine at the same time though I'd argue you should only program your game. then you write another one, reusing the code worth reusing
23:04:04Araqand then you can extract an "engine" out of it.
23:06:44Araqshashlick: you can extend the VM but the default VM is weak in supporting these mechanisms by design
23:07:06Araqas I don't want my compiler to open socket connections
23:07:24FromGitter<zacharycarter> Araq: thank you and true - but I've done this at this point enough with Nim and built enough shoddy " game engines" that I tend to have an okay understanding of what needs to stay in "game land" vs "engine land"
23:08:09FromGitter<zacharycarter> zengine I think did this well - but the rendering pipeline in zengine was very weak and I've learned quite a bit about how to build a rendering pipeline since then
23:08:33FromGitter<zacharycarter> also - I'm starting to understand (I think) about what you're getting at with fixed-size arrays
23:09:38shashlickAraq: understandable
23:10:15Araqwho brought up http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.151.2018&rep=rep1&type=pdf ? it's excellent
23:11:54FromGitter<zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c240aba5064a51f837ee086]
23:12:05AraqOrganicAnywhere: the wikipedia link is on point
23:12:09FromGitter<zacharycarter> doesn't touch the GC at all as far as I can tell
23:12:31FromGitter<zacharycarter> Araq: I did - but all I did was google deferred reference counting with cycle detection
23:12:43FromGitter<zacharycarter> and it was the first link (or one of the first few) :P
23:13:58FromGitter<arnetheduck> Araq, you should maintain an awesome-memory-management-papers list in the doc folder ;)
23:14:46FromGitter<zacharycarter> IMO Nim is a great avenue to learning about ^ if you're learning programming top-down
23:14:53Araqwell I thought I read them all. but it turns out, new algorithms are still being found
23:15:23FromGitter<zacharycarter> I tried learning C in HS and wasn't ready for it at the time
23:15:38FromGitter<zacharycarter> and then when I started programming for a job, it was VB.NET then C# then Java
23:16:00FromGitter<zacharycarter> but I wasn't getting exposed to any memory management concepts
23:16:28FromGitter<zacharycarter> Nim really helped (me anyway) bridge that gap and allow me to work in both "worlds"
23:17:14FromGitter<zacharycarter> I could have probably done something similar with Go - but Go is not fun to program in
23:17:34FromGitter<zacharycarter> or by writing my own GC in C once I understood more of C
23:17:58FromGitter<zacharycarter> I think Nim was a softer landing spot though
23:21:25Araqthanks. What I find remarkable is that Pascal originally offered 'new' but no 'free' and no GC.
23:22:19dom96websockets are broken :(
23:23:31Araqand I used to think "that's broken". And now I think, "that works". ;-)
23:23:41Araqdom96: how so?
23:23:57FromGitter<zacharycarter> heh
23:24:06dom96I've recompiled snake's server and it fails now
23:25:29*filcuc quit (Quit: Konversation terminated!)
23:29:16dom96Guessing there are regressions on the client side too
23:32:26dom96Anyone know if there is a way to tell VS Code to ignore all errors in a file?
23:32:30FromGitter<zetashift> @shashlick I've been faring really well with your choosenim x64 version thanks, no big things except those dll's for no
23:32:34dom96I hate seeing red everywhere for include files
23:45:05shashlick@zetashift: thanks buddy - i need to get those changes through dom96 - am in the middle of several other projects so that's been tabled
23:45:38shashlickand main headache is recreating the test setup i had
23:46:26ee7[m]I should do what timotheecour says here, right? https://github.com/nim-lang/Nim/pull/10099
23:46:29ee7[m]Is that the best practice?
23:46:57ee7[m]I was assuming the commits could just be squashed if desired.
23:49:30dom96There isn't really a best practice here
23:49:52dom96GitHub is annoyingly bad at allowing to specify that another PR is a dependency of your PR
23:50:29ee7[m]Your best practice is "use phabricator"? :)
23:51:12AraqI have no idea how that ever passed my review process
23:51:26Araqint(n/2) ? makes no sense
23:52:18FromGitter<zetashift> @shashlick yea just reporting after a fair bit of usage
23:53:11dom96ee7[m]: yep :P
23:53:25Araqee7[m]: I press "squash"
23:54:50ee7[m]:)
23:59:36shashlick@zetashift: thanks again, i'll ping you once i get that cleaned up so that we can get it through