<< 18-08-2017 >>

00:02:49skrylar_why do math heads write less readable things like "for x in 1 <= x <= n" instead of just "for each x"
00:03:14skrylar_in this case it's not possible for a range to be outside of x, so the extra runes just lower the legibility of the paper
00:03:20krux02that is not math heads
00:03:31krux02and by the way that would be invalid code
00:03:50skrylar_"For each row r where 1 ≤ r ≤ n and r ≠ j ,"
00:04:13krux02I have no idea who would write that
00:04:18skrylar_it's in a math book.
00:04:50krux02I would write (for r in 1 .. n: if r != j: [...]
00:05:01skrylar_well they're not writing computer code, so
00:05:10krux02pseudocode
00:05:15krux02very cool stuff
00:05:17skrylar_but its less readable than just saying "for x in [1, n]" or just "for every x"
00:05:37krux02I realized that when you have a good programming language it is often much more readable that pseudocode
00:05:49krux02(but nim is not there yet :()
00:05:59skrylar_dunno, nim has a lot of hacky things i use
00:06:09skrylar_you can make templates for just one function to use :>
00:06:41skrylar_i think i do that in some neural net code because it allows you to read "current_layer" where that actually is somevar[someindex]
00:08:16krux02honestly Nim does not encourage you to write clean code
00:08:23krux02it lets you do a lot of horrible things
00:08:32krux02that is also how the compiler code reads
00:08:35krux02very badly
00:08:35skrylar_dunno. its clean enough for me. but then i think using #defines is acceptable ;x
00:08:52skrylar_have sometimes used defines in c/c++ that live for one function, just because less boilerplate
00:09:03krux02a lot of injected code via dirty templates and no idea where actually variables come from
00:09:24krux02well I did that, too, and I don't see it as dirty
00:09:25skrylar_then use better templates :>
00:09:28krux02I see it as very clean
00:09:46krux02because it is very local and the definition of the define/template is also close to where it is used
00:09:49skrylar_then again i don't use a lot of code i haven't written or written the bindings for, so i know where all this stuff came from
00:09:55krux02it is a good usage of templates/defines
00:09:57skrylar_but yea. macros/templates require discipline or your code and compile time goes to hell
00:10:18krux02yes
00:10:28krux02bit in nim it's not as bad as it is in c++
00:10:28skrylar_i mostly use templates for rewrites/D aliases
00:10:42skrylar_D let you alias stuff like "colour" to "color"
00:10:47skrylar_or "left" to "x"
00:11:03krux02in c++ templates are instanciated for each compilation unit just so that the linekd removes all but one instance
00:11:12krux02at lot of optimizations go directly to the bin
00:11:15skrylar_NOW yea. it used to be worse
00:11:48skrylar_i think my pipe dream would just be a lisp/smalltalk esque compiler tho
00:12:06skrylar_do small jit compiles on the fly because you don't need to run these heavyweight optimizers every debug cycle
00:12:08krux02well I would be happy if nim would remove a few features
00:12:14krux02then nim would be my dream language
00:12:23skrylar_what, like the gc? lol
00:12:28krux02yes
00:12:39skrylar_everybody always wishes for that
00:12:40krux02I don't use it
00:12:44skrylar_it's the least-bad GC i've seen yet
00:13:05krux02well it is thread local, and therad local allocation is a smart default
00:13:21krux02that is what it used to be when there was only one thread
00:13:38krux02then with multitherading the wrong design chose has been made
00:13:39skrylar_well. biggest bitch about GCs is that you don't control the stoppage. but you can build the incremental GC and use it as a sleeper
00:13:48skrylar_which for games and some servers is just fine
00:14:57skrylar_my complaint is that nobody's GCs talk to one another
00:15:12skrylar_so you get bad situations like if Lua and Nim want to co-exist they end up oblivious to each other's memory usage
00:15:34skrylar_in the case of Go i think they rewrote a lua interpreter just to have shared memory o_o
00:17:55skrylar_meh. someone requested a toml4 reader
00:19:09skrylar_krux02, i still use inheritance but its sorta eeh. careful use of it
00:19:17skrylar_Go's inheritance mostly
00:19:27krux02you mean embedding
00:19:48skrylar_last time i used go was trying to do a whole gui engine as a component model
00:19:55skrylar_so it was shallow inheritance and generic behavior objects
00:20:00skrylar_Unusual but neat.
00:21:42krux02yes that is also what c++ does
00:21:51krux02but c++ also has virtual inheritance
00:22:42krux02There is very little chance that a c++ developer actually fully understands virtual inheritance, because the syntax is cryptic and it's usage is so rare that is really is very hard to understand
00:23:16skrylar_isn't that what everyone else just calls interfaces
00:23:27skrylar_or what we'd use a method for. lol
00:23:32krux02but since I developed scala, where that behaviour (or at least a very similar one) is the default and the syntax is compact and therefore very easy to play around with, I do fully understand it
00:23:53skrylar_although i did get bitten by methods lack of a super; proccall was weird to find
00:23:57krux02no virtual inheritance is not virtual methods
00:24:20krux02it is for multiple inheritance when you inherit from two classes that have the same base class
00:24:29skrylar_ah diamond inheritance
00:24:33skrylar_i never did that
00:24:34krux02yes
00:24:44krux02well the default inheritance is like in go
00:24:50krux02the super type gets embeddet
00:25:10krux02and c++ can do multiple inheritance, so it really is very go like
00:25:11skrylar_i prefer composition over inheritance usually
00:25:29krux02but with it comes the problem that in that diamond case you have the base clas twice
00:25:44krux02those fields are embedded twice
00:25:54krux02and virtual inheritance "solves" it.
00:26:03krux02by confusing everybody
00:27:39skrylar_yea i just don't use that model x.x
00:30:22skrylar_its so weird. when i started learning to code, dirty rects were a common thing in gui. now people are just disposing of geometry every frame
00:32:41krux02well, most people have no idea about programming
00:34:18skrylar_you don't save a whole lot with dirty rects on modern gpus
00:34:37skrylar_i played around with immguis though. i understand the appeal but i'll just stick to scene graphs
00:35:37skrylar_one of the hidden costs of immguis is that you're paying api call costs for each one so stuff like unity (or worse, lua without luajit etc) you get to pay a lot of round-trips to make disposable geometry. but retained apis are just like
00:35:40skrylar_"this warning label = shown"
00:40:25krux02well I like the idea of immguis for development a lot
00:40:51krux02but I don't like the idea to rerender text each frame
00:40:59krux02text rendering is still one of the slower things to do
00:41:35krux02and immguis are one of the areas where I think that modern hardware power is spent well for development efficiency
00:42:04skrylar_IMHO its bankrupcy caused by using crap languages that shunned macros
00:42:33skrylar_i got to looking at the pros/cons, and they're almost entirely cons. artists don't like immgui, tooling doesn't like immgui, hardware doesn't optimize for immgui, but it does let solo devs play around with gui
00:42:47krux02well there is still this other language made by Jonathan Blow that might be a serious competition to Nim
00:42:54skrylar_that being said with a couple macros you can have the immgui experience with a retained api so
00:42:57krux02unlike Nim it seems more focussed on what is important
00:42:58skrylar_that's probably a worthwhile goal
00:43:14krux02generally simpler in the implementation and that might pay off eventually
00:43:23krux02but other than that it shares almost the same benefits
00:43:28krux02but I haven't used it yet
00:43:38skrylar_he's making a games language, nim is a systems language
00:43:57skrylar_it might be neat some time after never when it comes out, but we have nim right now :>
00:44:02krux02well, not sure where you see the difference
00:44:49krux02well there is a lot of progress going on with it, and he already realead great software, so he knows how to get things finished
00:45:25krux02I just made a funny PR: https://github.com/nim-lang/Nim/pull/6253
00:45:35krux02it is basically doing what rust does
00:47:00skrylar_i dunno. it just looks more like nim doesn't have active developers and blow has enough money to coast on his own thing
00:47:37skrylar_when i look around its like well we have a package manager now but half the codes not in it
00:47:54subsetparkcan I fake choosenim -y with some piping and yes?
00:48:34krux02not sure how important a package manager is though
00:48:44krux02we have github and can search on our own
00:49:12krux02Go can import from github, package manager? Who cares
00:49:27krux02well they are installey eventually
00:50:53skrylar_lot of people care considering "go get someproject" is becoming a standard install manta
00:51:15skrylar_it's also standard for python (pip), ruby (gems), node (npm)
00:52:29FromGitter<krux02> I personally think go is a very good language to learn programming
00:52:46skrylar_its a nice C
00:52:56krux02well it has a lot of nice C things
00:53:00krux02but no it's not a nice C
00:53:10krux02it can't replace C
00:53:13krux02so it's not a nice C
00:53:25skrylar_nothing will ever replace c/c++
00:53:33skrylar_it's a cancer(++) that has metasticized too big to stop
00:53:45krux02well not really
00:54:05krux02I think C can't die
00:54:36krux02just beacause it is the main compilation target for a lot of languages not just nim
00:54:57krux02and it is used for drivers and stuff like that where low level control is important
00:55:01krux02but c++?
00:55:11skrylar_i ended up coming back to nim because Go lacked acceptable metaprogramming, and Red's priorities are bonkers
00:55:18skrylar_well, go does "have" it
00:55:26krux02For application development ther just needs to be a language that truly understands what is important in c++ and make a better languaeg out of it
00:55:38krux02most of the time the new languages utterly fail at that task
00:55:40skrylar_D1 did that, didn't take
00:55:57krux02Java? just the parts of c++ that should be avoided, great language
00:56:15krux02D was gc, too
00:56:25skrylar_it's hard to impossible to compete against those langs because people expect you to ship gui builders and visual studio clones and its like even great langs can't make those from no budget
00:56:30skrylar_D1 was gc optional
00:56:35skrylar_you could shut it off and never touch it
00:56:57skrylar_they botched that rule in D2
00:57:07krux02how that?
00:57:20skrylar_wrote a lot of bad code and then canonized the bad code instead of fixing it
00:57:30skrylar_"hey half our stdlib is bad so lets just rewrite history guys"
00:58:13krux02well nim has also a lot of bad code in the stdlib
00:58:43skrylar_GCs aren't evil. Some early GCs were bad. Some modern GCs lack tuning knobs. But there was a weird whitepaper that talked about one of the ML compiler's collectors outperformed boost smart pointers
00:58:43krux02that is why I barely use the stdlib
00:58:58Xekrux02: what do you mean by "bad code"?
00:59:08krux02I don't say GC is evil, but enforcing it, is
00:59:16krux02GC should at least be optional
00:59:27skrylar_it sort of is in nim, although i think silicing requires it
00:59:36skrylar_isn't there an ARC branch now
01:00:43skrylar_My main frustration with GC is 1) most aren't incremental, 2) they don't tend to respond well to manual collection windows and 3) they tend to think ignoring finalizers is ok
01:01:08krux02Xe: https://github.com/nim-lang/Nim/pull/6253
01:01:11krux02sorry
01:01:21krux02I mean: https://github.com/nim-lang/sdl2/blob/master/examples/sdl_opengl_example.nim#L125
01:01:23skrylar_if they are obedient i can at least set health flags so servers don't drop heavy requests on a node thats mid-collection, which is something .NET/Java fail at IIRC
01:02:21skrylar_krux02, is that immediate mode GL i see
01:02:24skrylar_disgraceful :e
01:03:05skrylar_ah well it was a lot more newbie friendly at least
01:03:19krux02the problem is gc is that the gc is a global thing, ant it can only be configured globally, but when the system grows and becomes more complex, i single point to config the GC is just not enough
01:03:43krux02for one subsystem you need config A, and for the other one you need config B
01:03:47krux02that can't work
01:04:05skrylar_you shouldn't generate lots of garbage in the first place and its not a problem though
01:04:13krux02that immediate mode GL is not the problem, the casting of the event types is
01:04:28skrylar_well the immediate GL is deprecated for years tho
01:04:48skrylar_as for casting events.. eeh
01:05:17skrylar_It can't be helped without shuffling data out of the C class in to nim, or ultimately hiding it behind templates that typechecked and then cast it anyway
01:05:43skrylar_the second would probably be my preference, since the typecheck can be made in to a debug assertion
01:06:32krux02or here: https://github.com/nim-lang/Nim/blob/47a7f2fff795be3c4c28059cfa573f5d6069af44/lib/pure/htmlgen.nim#L196
01:06:40krux02use a keyword as a template name
01:08:24krux02skrylar_: well normally I don't need to generate garbage at all if the seq type and the string type would not be implemented so badly
01:10:30skrylar_send in a patch to use realloc i guess
01:10:44skrylar_it does tweak me when i see C++ type code where they do malloc and free instead of reallocs
01:11:07skrylar_sometimes the memory allocator had more space to give but you went ahead and trashed it with a new alloc because we're C++ so why do we care about memory fragmentation \o/
01:12:07skrylar_although the +1 with nim is you can make your own seqs if you just wanted some strange bucketing logic
01:12:44*chemist69 quit (Ping timeout: 246 seconds)
01:22:50*yglukhov joined #nim
01:23:35*mal`` quit (Quit: Leaving)
01:23:57*heinrich5991 quit (Ping timeout: 240 seconds)
01:24:38*mal`` joined #nim
01:26:45*chemist69 joined #nim
01:26:57*yglukhov quit (Ping timeout: 240 seconds)
01:31:55*heinrich5991 joined #nim
02:08:15*skrylar_ quit (Remote host closed the connection)
02:17:44*pilne joined #nim
02:39:41*vivus quit (Quit: Leaving)
02:39:48*v17d joined #nim
02:44:30*krux02 quit (Remote host closed the connection)
02:59:55*def-pri-pub joined #nim
03:07:36*dddddd quit (Remote host closed the connection)
03:13:35*rauss joined #nim
03:15:26*v17d quit (Ping timeout: 240 seconds)
03:16:17*endragor joined #nim
03:28:05*v17d joined #nim
03:35:55*pilne quit (Quit: Quitting!)
04:32:04*def-pri-pub quit (Quit: leaving)
04:41:20*rrgg joined #nim
04:42:53*rrgg left #nim ("WeeChat 1.4")
05:51:29*v17d quit (Ping timeout: 248 seconds)
05:56:40*rauss quit (Quit: WeeChat 1.9)
06:14:00*mahsav2 joined #nim
06:15:24*mahsav quit (Read error: Connection reset by peer)
06:18:01*mahsav2 quit (Ping timeout: 240 seconds)
06:32:49*ShalokShalom_ joined #nim
06:35:35*ShalokShalom quit (Ping timeout: 240 seconds)
06:42:52*nsf joined #nim
06:43:06*mahsav joined #nim
06:58:47*Vladar joined #nim
07:01:00*nattefrost joined #nim
07:01:25*v17d joined #nim
07:25:23*gangstacat joined #nim
07:50:08*gokr joined #nim
07:54:49*Arrrr joined #nim
08:01:41*yglukhov joined #nim
08:03:41*yglukhov quit (Read error: Connection reset by peer)
08:04:04*yglukhov joined #nim
08:08:26*yglukhov quit (Ping timeout: 240 seconds)
08:08:27*endragor quit (Read error: Connection reset by peer)
08:10:59*ch4tbridge joined #nim
08:11:19*endragor joined #nim
08:11:22*xet7 joined #nim
08:24:26*couven92 joined #nim
08:25:09*yglukhov joined #nim
08:51:58*Ven joined #nim
08:52:21*Ven is now known as Guest37379
08:55:04*ShalokShalom_ is now known as ShalokShalom
08:57:20*Yardanico joined #nim
08:58:55*adeohluwa joined #nim
09:00:33*jinshil quit (Quit: Good-bye!)
09:16:32*dom96|w joined #nim
09:22:23*gokr quit (Ping timeout: 246 seconds)
09:38:06*gokr joined #nim
09:45:30*dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…)
09:47:23*dom96|w joined #nim
09:50:11*BitPuffin|osx joined #nim
09:53:41*Guest37379 quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
10:17:55Yardanicohow can I create a unique procedure name inside of dirty template?
10:19:00euantoris the procedure always going to have a similar name format? You could always maintain a global counter and increment it so you have `someProc_1`, `somreProc_2`, etc
10:19:31Yardanicowell I've tried that
10:19:45Yardanicothe problem is - I'm trying to use a template inside of a macro, and after that getAst() on it
10:19:53YardanicoAraq said in IRC that templates are better than quote do?
10:19:57*v17d quit (Ping timeout: 240 seconds)
10:20:40euantorI'm not 100% sure, I haven't tried to do anything like that before
10:21:02Araqwell if you use a .dirty template then by definition it doesn't support "gensym"
10:21:10Yardanicoah, ok then
10:21:13Araqyou can pass the proc name as a template paramter though
10:21:22Araqand in the macro use genSym(...)
10:21:37Yardanicoah, ok
10:22:28YardanicoAraq, I pneed to pass proc name as "untyped" or "typed"?
10:24:16Araqit doesn't matter, getAst ignores the template's types
10:27:41*arnetheduck joined #nim
10:30:18*Matthias247 joined #nim
10:33:41*v17d joined #nim
10:49:52*ch4tbridge quit (Remote host closed the connection)
10:55:50YardanicoCan I add current filename to logger format?
10:56:21Yardanicoe.g. if I call logging procedure from file foo.nim, it would print "[13:55:39][N][foo.nim] Something"
10:58:16*haha_ joined #nim
11:01:48Araqdunno, can you?
11:03:06*ch4tbridge joined #nim
11:08:21*adeohluwa quit (Quit: Connection closed for inactivity)
11:09:32*mahsav2 joined #nim
11:10:03*mahmudov joined #nim
11:12:27*mahsav quit (Ping timeout: 240 seconds)
11:37:16*mahmudov quit (Ping timeout: 255 seconds)
11:41:02FromGitter<faustinoaq> > nothing will ever replace c/c++ ⏎ ⏎ Perhaps not "ever" but "in a long time", *skrylar_:* Maybe Nim can compile to Rust in the future 
11:42:51FromGitter<faustinoaq> Also, LLVM is a good backend https://github.com/arnetheduck/nlvm
11:46:17*enthus1ast- quit (Quit: Lost terminal)
11:49:15FromGitter<Smaehtin> https://gist.github.com/zacharycarter/844b9898e06def6d18e00e3d209aaf9d - hmm, flow-sensitive typing in Nim, or just an ugly hack? :D
12:04:30*dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…)
12:09:36*mahmudov joined #nim
12:13:27*dave24 quit (Ping timeout: 246 seconds)
12:14:33*dave24 joined #nim
12:20:53*endragor quit (Quit: Leaving...)
12:21:27*dave24 quit (Ping timeout: 240 seconds)
12:23:18*dave24 joined #nim
12:34:42*couven92 quit (Quit: Client disconnecting)
12:36:17AraqYardanico: I dunno if the logging module comes with this feature but it's pretty easy to do either way
12:36:33Yardanicomacros.lineinfo?
12:36:47Yardanico(I mean get filename)
12:36:54Araqsystem.instantionInfo
12:37:20Araqyou need to wrap your log call in a template for this but this is exactly what you need to do anyway
12:37:28Yardanicoyeah
12:37:35Yardanicothanks
12:37:46*dom96|w joined #nim
12:41:17*mahsav joined #nim
12:43:13*mahsav2 quit (Ping timeout: 248 seconds)
13:07:58*couven92 joined #nim
13:22:30*endragor joined #nim
13:24:11dom96|wMaybe we could get some ideas from this: https://gist.github.com/lattner/31ed37682ef1576b16bca1432ea9f782
13:40:24*rauss joined #nim
13:44:17*dddddd joined #nim
13:47:12*vivus joined #nim
13:56:43*haha_ quit (Quit: haha_)
13:57:05FromGitter<andreaferretti> What's up with the flow sensitive typing example?
13:57:16FromGitter<andreaferretti> Does the compiler know about options or what?
13:57:18FromGitter<andreaferretti> :-o
13:57:28euantorPosted that in #nim-offtopic earlier dom96|w, looks interesting
13:58:17euantorasync/await makes sense, but it looks like they're going the C# way with it and generating a state machine at compile time which is a little bit complex
13:59:15FromGitter<andreaferretti> oh I see, the `x` was injected by the template
13:59:27FromGitter<andreaferretti> really an ugly hack!
13:59:34FromGitter<andreaferretti> :-D
13:59:54FromGitter<superfunc_twitter> yeah I was gonna go with hack haha
14:11:58*dddddd_ joined #nim
14:12:05*dddddd quit (Ping timeout: 240 seconds)
14:23:05*couven92 quit (Ping timeout: 240 seconds)
14:24:10FromGitter<Smaehtin>
14:28:05*PMunch joined #nim
14:29:25*PMunch quit (Client Quit)
14:29:47*PMunch joined #nim
14:33:27*dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…)
14:35:45*dom96|w joined #nim
14:48:26FromGitter<andreaferretti> It's actually pretty cool! :-D
14:48:28*ofelas joined #nim
14:53:02FromGitter<Smaehtin> Yeah, I think so too! You can sort-of mimick flow-sensitive typing in that way
14:56:12FromGitter<Smaehtin> The same principle can be used to make something like: ⏎ ⏎ ```if widget.ofType(ListView): ⏎ widget.addItem(...) # widget is ListView here``` [https://gitter.im/nim-lang/Nim?at=5997000c2723db8d5eb9cd51]
14:57:23Yardanicothere are variant types in nim also
14:59:11*mahmudov quit (Ping timeout: 248 seconds)
15:03:15FromGitter<krux02> TODO Nim In Action arrived, yaya
15:03:17*dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…)
15:04:43FromGitter<krux02> not todo, I mean today and instead of yaya i mean yay
15:04:45FromGitter<krux02> I can't type
15:08:18*krux02 joined #nim
15:13:54FromGitter<Smaehtin> Of course ... Nim has everything!
15:14:52FromGitter<Smaehtin> I've had the e-book version of Nim in Action for a while, it's really nice!
15:23:01*nsf quit (Quit: WeeChat 1.9)
15:37:03*BitPuffin|osx quit (Ping timeout: 248 seconds)
15:40:29*Sembei joined #nim
15:40:44*Matthias247 quit (Read error: Connection reset by peer)
15:42:32*Pisuke quit (Ping timeout: 260 seconds)
15:46:09FromGitter<krux02> I am a bit happy now because of the book
15:46:19FromGitter<krux02> I already had my doubts that it will ever arrive
15:46:22FromGitter<krux02> but it did
15:46:27FromGitter<krux02> and I am happy
15:59:18Yardanicohow to make my application use less ram? Well I don't have any issues with performance, just curious that I would need to do
16:02:35*Sentreen quit (Ping timeout: 240 seconds)
16:03:47*mahsav2 joined #nim
16:05:35*mahsav quit (Ping timeout: 246 seconds)
16:05:57*endragor quit (Remote host closed the connection)
16:06:29*endragor joined #nim
16:07:30FromGitter<krux02> well I once did set a limit for all applications that I start from the shell
16:07:55FromGitter<krux02> very useful, because istead of swapping and making my system horribly slow the program just crashes because of not enough memory
16:08:18Yardanicowell my program takes ~10-30mb ram, but it was lower some time ago :)
16:08:19FromGitter<krux02> but generally, use efficient memory structures
16:08:34FromGitter<krux02> well my recommendation, don't use ref types
16:08:37Yardanicoah
16:08:43Yardanicomaybe that's the problem?
16:09:04YardanicoI use them almost everythere. So instead of "let something = SomeRefType" I would do "var something = SomeObjType" ?
16:09:14Yardanico: instead of =
16:09:20YardanicoI think you understood me
16:09:26FromGitter<krux02> ref types have the overhead of the pointer that references them, and the header of the object itself
16:09:43FromGitter<krux02> well you can stull use let
16:09:47Yardanicowell I know
16:09:51Yardanicobut I often need to change objects
16:10:10Yardanicoand what's the best GC if I don't care about amazing GC speed but I care about RAM?
16:10:11FromGitter<krux02> it's better coder, when you don't reed to
16:10:21*endragor_ joined #nim
16:10:26FromGitter<krux02> only change the ``result`` variable
16:10:30*MyMind joined #nim
16:11:11FromGitter<krux02> make a factory function and that one sets all members of result but when it returns, don't touch it, unless you really need to
16:11:11*endragor quit (Ping timeout: 248 seconds)
16:11:34FromGitter<krux02> well the fastest GC is when you don't need GC
16:11:57FromGitter<krux02> but GC itself does not affect memory usage
16:12:12FromGitter<krux02> just when all your types are reference types because you program in something like java
16:12:25FromGitter<krux02> then the fact that all types are reference types consts you a lot of memory
16:12:26*Sembei quit (Ping timeout: 240 seconds)
16:13:09Yardanicoah, ok then
16:14:35*endragor_ quit (Ping timeout: 240 seconds)
16:15:38*Sentreen joined #nim
16:16:03*Pisuke joined #nim
16:16:37FromGitter<andreaferretti> in general, I suggest to use `let` for things that you don't want to mutate and `var` for things that you need to mutate
16:17:00FromGitter<andreaferretti> then use `ref` if you want to allocate the object on the heap instaed of the stack
16:17:19Yardanicowell I know about let vs var difference
16:17:37*MyMind quit (Ping timeout: 248 seconds)
16:17:59FromGitter<andreaferretti> this is usually because: ⏎ ⏎ 1) either the object outlives the current function, or ⏎ 2) the object is big and you fear that passing it by value will incur the cost of copying [https://gitter.im/nim-lang/Nim?at=59971337ee5c9a4c5fd4f4ac]
16:18:21FromGitter<andreaferretti> (but the compiler can actually optimize this by passing a pointer on the stack, at least in some cases)
16:19:00FromGitter<andreaferretti> another reason to use `ref` types is when the type refers to itself
16:19:09FromGitter<andreaferretti> as would happen in a tree or a linked list
16:19:20FromGitter<andreaferretti> otherwise, stick to allocating on the stack
16:19:39FromGitter<andreaferretti> it will be faster, more predictable and will save you memory
16:20:01krux02http://ix.io/zgy
16:21:08krux02don't use linked lists, and trees don't necessarily need pointers
16:22:12krux02instead of pointers, one can also use indices to an array
16:22:47krux02indices can be, depending on the expected array length much smaller than a pointer
16:24:52krux02how do I deveop on the compiler, when the change in system.nim would break the current implementation of the compiler?
16:26:25FromGitter<andreaferretti> well, I was not suggesting to use linked lists, just making a point :-)
16:26:48FromGitter<andreaferretti> `ref` types allow recursion in type definitions
16:29:46*arnetheduck quit (Ping timeout: 255 seconds)
16:30:15krux02yea I know, but linked lists they are the default beginners example, but in practice they should just be avoided
16:30:28krux02I would prefer if it would be a less popular datastructure
16:30:49krux02I think the c++ dequeue is the better linked list
16:34:44krux02its implementation is unspecified, but it is probably several chunks of continuous memory
16:36:46*ch4tbridge quit (Remote host closed the connection)
16:46:37YardanicoWhy I'm getting "Error: illegal capture 'msg'" after I've changed attachesproc attaches*(msg: Message, vk: VkApi): Future[seq[Attachment]] {.async.} = to proc attaches*(msg: var Message, vk: VkApi): Future[seq[Attachment]] {.async.} = (previously Message was a ref object, now it's an object)
16:47:00YardanicoIf I try to use "msg" inside of this proc, I'm getting this error
16:51:31FromGitter<Smaehtin> @Yardanico you cannot use var parameters in async procs
16:51:45Yardanicolol
16:52:25Yardanicowell so I need to stick to ref types then :(
16:53:37*nattefrost quit (Ping timeout: 276 seconds)
16:53:40FromGitter<Smaehtin> Or `ptr` :)
16:53:41krux02Yardanico: maybe you can make a local copy and capture that
16:53:48krux02yes or ptr
16:54:39krux02how do I compile nim with a compiler from somewhere else?
16:54:50krux02when I run ./koch it tries to bootstrap itself
16:54:58krux02and that is something I break :D
16:56:27*vivus quit (Quit: Leaving)
16:56:48Yardanicokrux02, wouldn't it be worse than ref types? If I would do local copies
17:06:07krux02well I don't know you code, but local copies are normally not a bad thing
17:06:20krux02a local copy only consumes temorary memory on the stack
17:06:32krux02so it does never eat up all your ram
17:06:52krux02in extreme cases it can cause a stack overflow, but tha is generally not the case unleass you allocate big arrays on the stack
17:07:01krux02(or deep recursion)
17:10:11*Trustable joined #nim
17:25:01krux02Araq: are you there? If yes, can you tell me the tool again that helps developing the compiler
17:25:38krux02I want to change something in system.nim but then I can't run nim anymore, because it relies on system.nim
17:26:05*dddddd_ quit (Ping timeout: 240 seconds)
17:37:29*yglukhov quit (Remote host closed the connection)
17:39:22*dddddd_ joined #nim
17:40:05*nhywyll joined #nim
17:43:23*yglukhov joined #nim
17:44:53*yglukhov quit (Remote host closed the connection)
17:51:37*yglukhov joined #nim
17:53:11*acidx joined #nim
17:56:05*yglukhov quit (Ping timeout: 240 seconds)
17:56:57*haha_ joined #nim
17:59:44*haha_ quit (Client Quit)
18:08:38*nsf joined #nim
18:09:16*dddddd_ quit (Quit: Hasta otra..)
18:09:37*dddddd_ joined #nim
18:09:42*dddddd_ is now known as dddddd
18:11:47Araqkrux02: that's not a question of tooling
18:11:54Araqhere is what you can do:
18:12:04Araq# system.nim
18:12:10Araqwhen defined(newStuff):
18:12:11Araq A
18:12:13Araqelse:
18:12:16Araq oldThing
18:12:32Araqkoch temp c -d:newStuff program.nim
18:12:38FromGitter<krux02> ah, ok
18:13:02FromGitter<krux02> does make sense
18:14:19*sz0 quit (Quit: Connection closed for inactivity)
18:18:52*andrzejku joined #nim
18:18:53andrzejkuhey
18:18:55andrzejku:)
18:19:22Araqhmm my disk is full with nothing obvious I could delete
18:21:27AraqI am gonna remove every directory that starts with a dot
18:21:47FromGitter<krux02> how about you use a disk usage analyzer
18:21:59FromGitter<krux02> then you will find out that you have a gigantic download folder
18:23:01*haha_ joined #nim
18:23:10FromGitter<krux02> whenever I do that, I find out that what my usual memory eaters are
18:23:24FromGitter<krux02> I did not have memory space problems anymore in years
18:23:40FromGitter<krux02> but when I did it normally was movies and games
18:24:33FromGitter<krux02> and other people collect hard drive dumps, that eats memory quickly
18:24:56*v17d quit (Ping timeout: 240 seconds)
18:26:11*haha_ quit (Client Quit)
18:27:17krux02Araq: is the define(nimnomagic64) still relevant?
18:27:46Araqread compiler/condsyms.nim
18:27:57*haha_ joined #nim
18:27:59Araqiirc that's always defined now
18:29:37Araqdisk usage analyser? what's that, I'm on OSX here. there will be 20 different programs that do this, every single one will be crap and in the end I'll copy some cryptic shell script and hope for the best
18:30:32krux02well the first one I used was integrated in KDE
18:30:44krux02it shows graphically what eats most bytes
18:31:02Araqand why is it that every website can now detect my adblocker?
18:31:29Araqaren't adblockers supposed to be undetectable?
18:32:18Araqno, I will not disable my adblocker for your crappy website. I'll use a different website then, thank you very much.
18:33:08krux02I use baobab
18:33:28krux02for disk usage
18:33:37Araqwow that's almost a word
18:33:56krux02and for add blocking, I heared μBlock Origin is the best (not μBlock)
18:34:03*relaxbox joined #nim
18:34:12krux02yea I had to look it up how it was called
18:35:04FromGitter<Smaehtin> μBlock Origin + anti-adblock filters + anti-anti-adblock filters + anti-anti-anti-adblock filters ... and you'll still get some sites that block you because you're using an adblocker
18:35:15*yglukhov joined #nim
18:36:45krux02oh I just realized I have 52 GB in trash
18:38:15*haha_ quit (Quit: haha_)
18:38:35Araqand the tool only lets me see dirs and files, not delete anything, yay
18:39:26*yglukhov quit (Ping timeout: 240 seconds)
18:39:47*v17d joined #nim
18:39:59*haha_ joined #nim
18:40:24krux02first world problems
18:40:30krux02you get the information you need
18:40:50krux02the kde tool was a bit better, because it was integratetd in the file browser
18:42:42Araqno, not "first world problems", given all the hype OSX got, I actually expect its braindead "Finder" program to do that for me
18:42:51Araqout of the box.
18:42:54krux02Araq: is condsyms for new features, too?
18:43:12Araqit's the general mechanism we use for patching system.nim, yes
18:43:28krux02well I don't really use file browsers anymore
18:43:33krux02I have my launchers
18:43:42AraqI mean so that both old and new compilers can use the same system.nim
18:44:16Araqwell ok but "it's so broken I stopped using it" is basically my point as well
18:44:17krux02so I should add a new define in there
18:44:24Araqyes
18:44:32krux02and old compilers will just not know it
18:45:15krux02I think I am still most familiar with the windows XP file browser
18:45:24krux02because I used that for a very long time
18:45:50krux02on linux that thing switched so often and I never really liked one (except the one from KDE3)
18:46:04krux02and eventually I just did not use them anymore
18:46:14krux02drop down terminal
18:46:16krux02yay
18:46:48krux02well ok I still use the one for mounting usb drives, but that is rara
18:46:50krux02rare
19:05:22*Jesin joined #nim
19:07:08*xet7 quit (Quit: Leaving)
19:19:38*gangstacat quit (Quit: Leaving)
19:25:57*haha_ quit (Quit: haha_)
19:32:08*endragor joined #nim
19:36:26*endragor quit (Ping timeout: 240 seconds)
19:46:20krux02Araq: I currently try to get rid of int as a distinct type, so that functions don't need to be overloaded for int anymore
19:46:55krux02but I broke something I did not expect to break
19:47:58krux02Error: internal error: wanted: tyInt got: tyInt64
19:53:58*rauss quit (Quit: WeeChat 1.9)
19:58:15*Vladar quit (Remote host closed the connection)
20:01:18*haha_ joined #nim
20:06:55*relaxbox quit ()
20:08:57*RelaxBox joined #nim
20:09:10FromGitter<zacharycarter> I need a web app idea
20:09:42krux02zacherycartey: your 3d engine in webassembly
20:10:24FromGitter<zacharycarter> krux02: not a bad idea
20:11:15FromGitter<zacharycarter> I'm trying to figure out an idea for a web app though as well
20:11:16krux02it's is also an advantage to me, because it paves the way for me to publish to webassembly
20:11:42krux02I think there will be some friction initially
20:14:35FromGitter<zacharycarter> I imagine so
20:23:26*ShalokShalom quit (Remote host closed the connection)
20:24:03*Yardanico quit (Remote host closed the connection)
20:27:01*Arrrr quit (Read error: Connection reset by peer)
20:32:50krux02zacharycarter: well I try to focus on the things that are important
20:33:54FromGitter<zacharycarter> krux02: debugging web assembly compilation errors isn't the most joyous thing in the world
20:34:51krux02well when you think about it, programming isn't the most joyous thing, because it contains a lot of reading compilation errors
20:35:10krux02it just becomes fun as soon as you are successful in what you wat to do
20:35:15FromGitter<zacharycarter> true
20:35:23FromGitter<zacharycarter> it's just webassembly errors look like this
20:35:32krux02so get good at webassembly and you will see joy in it, and it is an important technology
20:35:45krux02it helps outside of the Nim community as well
20:35:48FromGitter<zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59974fa480d90ca0241326f8]
20:35:53krux02you might be able to make money from it
20:36:31FromGitter<krux02> well I had problems getting to know how to debug with gdb
20:36:39FromGitter<krux02> it is horrible to use from the command line
20:37:29FromGitter<krux02> but then at some point it is just nice to use when you actually know what you are doing
20:37:32FromGitter<krux02> same with emacs
20:42:29*haha_ quit (Quit: haha_)
20:49:10*gokr quit (Ping timeout: 240 seconds)
20:58:50*ShalokShalom joined #nim
20:59:23RelaxBoxwhat's the deal with slices and arrays / openarrays? Can they be sliced?
21:01:24RelaxBoxlooks like not, if I've learned how to read the type mismatch errors
21:04:42*gokr joined #nim
21:13:35*gokr quit (Ping timeout: 248 seconds)
21:16:37FromGitter<stisa> RelaxBox : looks like there's no overloaded `[]` with slices for openarray, don't know why really. You can do something like this I guess https://play.nim-lang.org/?gist=f2a7111712aadec58675af462197181b
21:19:09FromGitter<TiberiumN> @stisa or you can just convert openarray to seq :)
21:19:20FromGitter<TiberiumN> But yeah, this has a lot of overhead
21:37:33*xmonader joined #nim
21:38:31xmonaderfor parseopt2 library, ./echo hello "-n" -> why -n here is parsed as a switch even if it's enclosed in double quotes?
21:40:43*def-pri-pub joined #nim
21:42:29*andrzejku quit (Remote host closed the connection)
21:42:34*BitPuffin|osx joined #nim
21:48:28*RelaxBox quit (Ping timeout: 240 seconds)
21:52:30FromGitter<krux02> well that is the shell
21:53:17FromGitter<krux02> xmonader: the double quotes are something that are processed by the shell the program you launch doesn't know about the double quotes
21:53:25FromGitter<krux02> it just gets the arguments
21:53:25*BitPuffin|osx quit (Ping timeout: 240 seconds)
21:54:14FromGitter<krux02> eg: ./echo 'hello world' "foo bar" xyz\ abc
21:54:40FromGitter<krux02> will have the arguments list ["hello world", "foo bar", "xyz abc"]
21:55:40xmonader@krux02, You're correct, my mistake thank you :)
21:57:39FromGitter<krux02> I am listening to the Unreal soundtrack
21:57:56FromGitter<krux02> I kind of miss the style of such games.
21:59:00FromGitter<krux02> but on the other hand I recently got myself Dark Souls, that is what I like about old games
22:00:10*mahmudov joined #nim
22:12:35*endragor joined #nim
22:16:55*endragor quit (Ping timeout: 240 seconds)
22:21:44*couven92 joined #nim
22:33:40krux02Araq: well I think I need help for this
22:34:43AraqI'm here, kinda
22:34:53krux02cool
22:35:25krux02I am in the nim compiler, and I try to get rid of the distinct int
22:35:58krux02so that int is defined to be one of int8 int16 int32 or int64
22:36:27krux02but it breaks the int literal
22:36:56krux02in the expression ``let x : int32 = 123`` I get a type mismatch
22:37:09krux02and I don't understand the type matching process
22:38:23Araqwell if you get rid of int, rename tyInt to tyOldInt and let the type checker make you fix it?
22:39:20krux02how should I proceed then?
22:39:33krux02integer literals are a bit complicated afaik
22:39:54krux02meaning let x = 123 will be of type int == int64
22:40:08krux02bit let x : int8 = 123 should work, too
22:41:05krux02so the literal can't be fixed to be type int64
22:48:21*Jesin quit (Ping timeout: 240 seconds)
22:49:20Araqdoesn't seem hard, the compiler uses tyInt and t.n.intVal for an integer literal
22:49:31Araqyou could use tyInt32 and t.n.intVal instead
22:51:02*Jesin joined #nim
22:51:29krux02well it might not be hard for you, but I don't exactly know how the literal encode the state that it does not yet have a fixed type or not.
22:51:59AraqI just told you how it works inernally
22:52:17krux02you think, but I still feel puzzled
22:53:55krux02I don't feel comfortable to use tyInt32 for "the node has an unspecified integer type"
22:55:29Araqwell I dunno why tyInt is so annoying for you that you're gonna change ~80_000 lines of code
22:57:09krux02well it is
22:57:34Araqbut you should read the manual first
22:57:41Araqhow it currently works
22:58:02krux02well good, nim in action arrived today :P
23:00:27*couven92 quit (Quit: Client Disconnecting)
23:01:05*nhywyll quit (Ping timeout: 240 seconds)
23:01:44krux02no I change this, for the reason that I think it is an improvement to that language by taking away something
23:02:05krux02and it get's me to understand the internals of the compiler better
23:02:15krux02so I do it
23:02:43krux02I really want to make nim as my default language to use.
23:02:52krux02And I use a little subset of Nim that I like
23:03:05krux02and from that subset I would like to make sure that I really like it
23:03:18krux02and I would like to make this subset a really good language
23:03:39krux02and this includes taking away the distictiveness of the integer type
23:11:13dom96you want to relax the integer type rules?
23:13:59Araqkrux02: fine with me but it's lots of tedious work
23:14:14krux02I know
23:14:19AraqI dunno what else I could explain to you
23:14:29AraqNim has the notion of an "int literal" type
23:14:38krux02yes
23:14:40Araqthat's currently not a TypeKind
23:14:51krux02how is it encoded then?
23:15:05Araqbut just tyInt with t.n (the node part of the type) set to its value
23:15:33Araqyou could use tyInt32 with t.n for this
23:15:53Araqor keep tyInt with t.n and all the other usages of tyInt become tyInt32
23:16:37krux02then how is this different to an int32 literal?
23:17:09Araqan int32 literal is a node with type tyInt32 and t.n == nil
23:17:41Araqan int literal would be a node with type tyInt32 and t.n != nil
23:18:18krux02and where is the value stored in an int32 literal then?
23:18:22Araqbut you could also rename tyInt to tyIntLit and make the code more obvious
23:18:34Araqan int32 literal is not a type!
23:18:36krux02yes I will
23:18:41Araqit's a node!
23:18:56Araqan int literal is a node with a special "int literal" type
23:19:00krux02ah the type has the value
23:19:04krux02I get it
23:19:05Araqbig difference, yes
23:21:25krux02still very confusing to me
23:22:09krux02when I have a int32 literal, I have a node with the value and the type with kind == tyInt32
23:22:44krux02when I have a literal thas is yet unspecified, the value is stored in the type, but then what value has the node then?
23:25:02Araqthe value that you think it has
23:25:08Araqit exists twice
23:26:02krux02ok
23:26:06krux02so confusing
23:26:43Araqnot really
23:27:26*Jesin quit (Read error: Connection reset by peer)
23:28:28krux02well for me it is
23:28:33krux02that is a bit abusive
23:28:47krux02you spent a lot of time there and probably are totally used to it
23:28:53krux02for me this is complicated
23:29:09krux02and hard to grasp
23:30:22krux02I really like Nim like it is, but I really want to smoth a few edges before I can truly say it is the language to go.
23:30:54krux02e.g. I want to safely be able to disable the GC when I don't use ref types at all
23:31:01krux02yea already said that
23:32:06krux02btw for the PR with the compile time offsetof and sizeof, it works everything that it needs is that the builtin types have the values set correctly internally for alignment depending on the platform.
23:32:31krux02you said you want that PR, as soon as that is done, tha PR will not fail anymore.
23:40:03Araqwell there was a change in the plans, but I can merge it tomorrow. good night
23:42:03*xmonader quit (Quit: Leaving)
23:55:25*nattefrost joined #nim
23:56:25*Trustable quit (Remote host closed the connection)