<< 08-04-2017 >>

00:12:49*zachcarter joined #nim
00:21:23ldleworkIs there any way to print a typedesc?
00:21:52ldlework.name
00:22:09ldleworknope
00:22:35*Jesin joined #nim
00:22:42ldleworkhmm dang it tells me the lowest type
00:28:20ldleworkIf you have some subtype relationships
00:28:35ldleworkand you have a subtype value in a context where it is considered the basetype
00:28:44ldleworkis there anyway at all to check whether it is one of the subtypes?
00:41:15*nsf quit (Quit: WeeChat 1.7)
00:44:31*Jesin quit (Quit: Leaving)
00:47:18zachcarterI think you can try casting it to the subtype
00:59:35ldleworkyeah but how do you test
01:01:29zachcarterhmm
01:01:42zachcarterI guess if it’s a ref type you can just check for nil, if it’s an object I’m not sure
01:02:17ldleworkno I mean
01:02:24ldleworklets say you have a tree structure
01:02:31ldleworkof nodes that all share a base type
01:02:37ldleworkthey refer to each other via a base type
01:02:41ldleworkyou have a node and you get its parent
01:02:45ldleworkas the base type
01:02:52ldleworkand you wanna do something depending on what kind of parent it has
01:02:54ldleworkhow do you know?
01:04:00zachcarteroh I see
01:04:48zachcarterdo you have a gist or anything I can play with? I’m not 100% sure off the top of my head but I may be able to figure something out
01:05:44*chemist69 quit (Ping timeout: 256 seconds)
01:12:29*yglukhov joined #nim
01:16:59*yglukhov quit (Ping timeout: 260 seconds)
01:18:06*chemist69 joined #nim
01:19:53ldleworkI have this method, https://gist.github.com/dustinlacewell/f96b00a8434be69826a1b98240fd3120 and I get: Error: for a 'var' type a variable needs to be passed on line 7
01:19:59ldleworkwhat does it want me to do?
01:20:58zachcartery isn’t mutable
01:21:20zachcarterdoes drawPoint take a mutable parameter?
01:21:42ldleworkhttps://wiki.libsdl.org/SDL_RenderDrawPoint
01:22:08zachcarterhrm
01:22:53ldleworkmakes no sense
01:23:29ldleworkI've literally made everything var
01:23:43zachcartertry maybe
01:23:45zachcartery.cint
01:23:57zachcarteronly other thing I can think of
01:24:38ldleworkthe error is on the for-loop line
01:24:48ldleworkif I replace the draw with an echo of a string it still complains
01:24:57zachcarterah okay
01:25:04ldlework var y: int
01:25:06ldlework for y in top..bottom:
01:25:08ldlework echo "wtf"
01:25:10ldleworkstill complains
01:26:01*Nobabs27 joined #nim
01:26:52ldleworkzachcarter: isn't that mysterious?
01:26:58zachcarterit’s confusing me for sure
01:27:02zachcarterI’m trying to replicate with glot.io
01:27:05zachcarternot having much luck :/
01:27:46ldlework...I ... I think its the range function?
01:27:54ldleworkwhen I hardcode numbers instead it works
01:27:55ldleworkwtffff
01:29:06zachcarterI tried even creating a type
01:29:14zachcarterwith int properties
01:29:19zachcarterbut it worked fine haha
01:29:24zachcarteryou must have done something special :P
01:29:53ldleworkthe bigger the application I write the more fragile the compiler becomes
01:31:18zachcarterthere’s *probably* an explanation but everyone that has a lot of knowledge is asleep atm besides like Varriount and ftsf
01:46:37*rupil joined #nim
02:01:51*PMunch quit (Quit: leaving)
02:03:06*chemist69 quit (Ping timeout: 240 seconds)
02:13:15*Jesin joined #nim
02:17:03*chemist69 joined #nim
02:30:10*Jesin quit (Quit: Leaving)
02:35:10zachcarterwhat’s up with `shr` vs just shr
02:42:10*vendethiel- quit (Ping timeout: 260 seconds)
02:43:11*vendethiel joined #nim
02:49:44zachcarterhttps://github.com/zacharycarter/nimrl
02:56:31bozaloshtshcool
02:57:57bozaloshtsh`shr` lets you use the operator as a function syntax if thats what you were asking
02:58:02bozaloshtshor rather proc syntax
02:59:25bozaloshtshI've only found such syntax to be useful when working with funky templates
03:11:35zachcarterah okay thanks you
03:14:22*yglukhov joined #nim
03:19:26*yglukhov quit (Ping timeout: 268 seconds)
03:20:53*shashlick quit (Ping timeout: 240 seconds)
03:22:02*shashlick joined #nim
03:48:38FromGitter<Varriount> zachcarter: What are you creating now?
03:48:52zachcarterwell I want to start building my game with frag
03:49:06zachcarterand my game uses a LOT of procedural generation
03:49:44FromGitter<Varriount> roguelike ftw!
03:49:46zachcarterso I’m going to start porting a library I depended on a lot
03:49:50zachcarteryup!
03:50:06zachcarterthankfully the author / maintainer of the library is a friend via libgdx
03:50:12zachcarterso he’s helping me :D
03:50:28FromGitter<Varriount> libgdx is one of the few libraries that makes working in Java tolerable.
03:50:36zachcarteragreed
03:50:51zachcarterthis is one class I’ll eventually need to port
03:50:54zachcarterif I want to support my map generator
03:51:41zachcarterhttps://github.com/SquidPony/SquidLib/blob/master/squidlib-util/src/main/java/squidpony/squidmath/GreasedRegion.java
03:52:43zachcarterhttps://github.com/zacharycarter/mapgen - is the map generator I was working on for my game, shortly before deciding to drop all my Java work and switch to Nim
03:59:10*BitPuffin|osx quit (Ping timeout: 260 seconds)
04:03:08ldleworkzachcarter: my game uses a lot of procgen too...
04:03:32zachcarterIdlework: you may find the lib I’m working on useful then
04:03:53ldleworkzachcarter: we're both working on similar libraries..
04:03:59zachcarterah haha
04:04:00ldleworkhere's my map generator in action, http://i.imgur.com/XpfYVLK.png
04:04:15zachcarternice
04:04:54ldleworkzachcarter: are you making a roguelike?
04:05:13ldleworkI'm making a clone of Cataclysm DDA, but more bent towards magic realism
04:05:19zachcarterjust figured out I could zoom :P
04:06:08zachcarterI guess I’m going for a roguelite, it’s definitely going to have some roguelike mechanics
04:06:41ldleworkzachcarter: read this https://www.rockpapershotgun.com/2016/11/14/cataclysm-dark-days-ahead/
04:07:10zachcarterreading now
04:08:20FromGitter<Varriount> I have yet to see a map generator that makes proper oceans.
04:08:29zachcarterwater is hard
04:08:39*FromGitter * Varriount want *oceans*, not lakes
04:08:47ldleworkIf you look at my picture
04:08:56ldleworkyou can just imagine the same thing at a different scale
04:09:01ldleworkits just a parameter
04:09:06zachcarterwell technically the maps I made are world wrapping in four dimensions
04:09:14zachcarterso you could project them onto an icosahedron
04:09:39zachcarterthey use 4d noise to generate so you would have oceans
04:09:49zachcarterI didn’t do lakes, and I spent way too much time on rivers
04:10:11FromGitter<Varriount> zachcarter: Perlin, or Simplex?
04:10:33zachcarterI used a whole bunch of different types of noise I was using the accidental noise library from Josha Tippetts or a port of it anyway
04:10:48zachcarterand I believe he uses open simplex
04:10:55zachcarterbut I’m not 100% sure on that
04:11:23zachcarterthe world map generator was just a small portion of my plroject
04:11:24zachcarterproject*
04:11:35FromGitter<Varriount> Neat. I can't say I understand how to implement a noise generator, but I know that simplex is supposed to be an improvement upon perlin
04:11:41zachcartershaded ascii planets
04:11:50zachcarterspaceship dungeons with lock and key puzzles
04:11:56FromGitter<Varriount> :O
04:12:02zachcarterzelda-esque dungeons with graph constraint grammars
04:12:54zachcarterhttps://twitter.com/Hahaitsfunny/status/801933402849026048
04:13:00zachcarterthere’s a screenshot of the spaceship dungeons
04:13:46ldleworkcool
04:14:04zachcarterthanks
04:14:23FromGitter<Varriount> zachcarter: Amazing. Far beyond my knowledge!
04:14:51zachcarterVarrount: lots of graph theory :P also studying a lot of other people’s code haha
04:14:57zachcarterVarriount*
04:15:39FromGitter<Varriount> I'll have to study yours sometime. :D
04:17:55zachcarter:D looking forward to getting some stuff working in Nim
04:44:14*chinchilla joined #nim
04:52:15*def-pri-pub joined #nim
04:58:57ldleworkCan anyone help me understand this error? https://gist.github.com/dustinlacewell/d2142bac3a0ede5172ba4aa031f167f6
04:59:13ldleworkthe line number in the error is adjusted for the gist
05:01:36ldleworkVarriount any idea?
05:02:24*rupil quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
05:04:07FromGitter<Varriount> ldlework: Do you define a base method?
05:04:18ldleworkyeah
05:04:25ldleworkhttps://gist.github.com/dustinlacewell/d2142bac3a0ede5172ba4aa031f167f6#file-resize-nim-L19
05:04:48FromGitter<Varriount> I mean, using {.base.}
05:05:16ldleworkit doesn't seem to change anything
05:05:25FromGitter<Varriount> I'm not sure methods will work with generics though.
05:06:47ldleworkso you can make an inheritance tree, but you can't reuse it for different types
05:07:24*Nobabs27 quit (Quit: Leaving)
05:07:56FromGitter<Varriount> ldlework: Let me think.
05:08:25FromGitter<Varriount> ldlework: Not many people need dynamic dispatch in addition to generics.
05:08:48ldleworkI don't understand how other people write software
05:08:59ldleworkI want every line factored...
05:09:37ldleworkIt seems to be mostly working
05:10:11FromGitter<Varriount> ldlework: Worst case, just add a member storing the procedure you want to call.
05:10:55ldleworklol
05:11:06FromGitter<Varriount> I'm still looking on the forum.
05:12:32FromGitter<Varriount> Once @Araq is on, I'd ask him for more information.
05:15:47FromGitter<Varriount> ldlework: If you aren't expecting others to create derivative of those types (as in, you will always fully control the inheritance hierarchy) you can use object variants instead.
05:16:24ldleworkI started with object variants
05:16:29ldleworkit was case city
05:16:43*yglukhov joined #nim
05:16:44ldleworkmethods are nice because they allow you to highly factor the implementation
05:16:49ldleworkat least when it works..
05:17:18ldleworkVarriount, a generic BSP is an interesting data structure challenge
05:17:30ldleworkyou have leaves that should be able to hold T
05:17:33FromGitter<Varriount> ldlework: Use a template to handle the cases for you?
05:17:50ldleworkI'm not satisfied with that answer
05:18:02FromGitter<Varriount> ldlework: Is that all the code? I'm getting a type undefined error when I try to run the code.
05:18:10ldleworkif I can't make this simple data structure I'm decidedly unhappy with the state of things
05:18:15ldleworkVarriount, no
05:18:36ldleworkI've already backed away from methods for resize
05:18:40ldleworkrunning into other issues now :)
05:18:49ldleworkfor example now that I'm using procs
05:19:02ldleworkthe branching node stores its child nodes as the base type
05:19:10ldleworkand now it wants to call .resize on the child node
05:19:18ldleworkbut it can't use the right implementation
05:19:26ldleworkbecause all the .resize's are procs
05:19:31ldleworkif they were methods it would just use the right one
05:19:41FromGitter<Varriount> ldlework: I can't do much without a look at your current implementation.
05:19:42ldleworkbut it couldn't "instantiate" resize
05:19:52FromGitter<Varriount> It also helps if I can run the implementation.
05:20:56ldleworkwell you'll need to clone dadren and install it from source
05:21:55ldleworkVarriount, https://github.com/dustinlacewell/dadren/tree/bsp
05:22:13ldleworknimble install -y && cd examples/bsp2/ && make run
05:22:22ldleworkThis is in the proc state
05:22:46ldleworkwhere the resize implementations are like, "woah there's no resize for BSPNode"
05:22:51ldleworkof course there isn't
05:22:59ldleworkyou can try to make them methods again
05:23:33ldleworkVarriount, basically methods are nice because they put all the type checking into runtime
05:23:47ldleworkinto the Runtime
05:23:50*yglukhov quit (Ping timeout: 260 seconds)
05:24:04ldleworkIE not in your code
05:24:46ldleworkobject variants make your code look like a series of ladders as you have the same series of case statements in all the things that touch the variant
05:25:07FromGitter<Varriount> I understand that.
05:25:08ldleworkyou basically take on all that complexity into your own implementation
05:26:14FromGitter<Varriount> ldlework: You've finally forced me to install Nim on another laptop.
05:26:51FromGitter<Varriount> Until now I've been able to get away with using glot.io
05:28:02ldleworkhehe
05:28:50ldleworki appreciate the attention
05:32:10ldleworkVarriount, for your convenience, cd ../../ && nimble install -y; cd examples/bsp2 && make run
05:32:53ldleworkfrom inside bsp2
05:34:35FromGitter<Varriount> I want to work on that method version
05:35:33ldleworkVarriount, the changes are fairly simple
05:36:00ldleworkchange them to methods, and make the generic one the base method of BSPNode
05:36:03*yglukhov joined #nim
05:37:15ldleworkthen it will complain that it cannot instantiate resize, and it will point you to the declaration of Leaf
05:37:22ldleworkwhatever that's supposed to imply
05:37:24ldleworklol
05:44:25ldleworkVarriount, I assume you're confounded in a paralyzing coma suffocating on your own bile at this point?
05:44:35ldleworkwrithe slowly if that's the case
05:44:39FromGitter<Varriount> Nah, just testing things.
05:55:52FromGitter<Varriount> ldlework: Got past the "cannot instantiate" error.
05:56:29ldleworkVarriount, extrodinary
05:56:58FromGitter<Varriount> The code had signatures like `method deleteT (self: BSPTree[T], target:Leaf)`. The `Leaf` type wasn't being instanted with a type.
05:59:31ldleworkVarriount, I just assume where that's possible that the compiler is implying them
06:01:30FromGitter<Varriount> ldlework: You're certainly putting the type inferencing system through the wringer.
06:02:47ldleworkinferring
06:02:53ldleworkthat's the word I couldn't conjure
06:09:49FromGitter<Varriount> ldlework: The error I get after that is either a compiler bug, or some type inferencing error.
06:11:52ldleworkVarriount, what is it
06:13:12*yglukhov quit (Read error: Connection reset by peer)
06:13:48*yglukhov joined #nim
06:14:25FromGitter<Varriount> ldlework: It was
06:14:32FromGitter<Varriount> ``````
06:14:39FromGitter<Varriount> ```main.nim(150, 10) Error: undeclared field: 'root'``````
06:14:57FromGitter<Varriount> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=58e87fe3f22385553d1e1bcb]
06:15:09zachcarterhow do I do for(;;) in Nim?
06:15:26FromGitter<Varriount> zachcarter: `while True`?
06:15:28ldleworkVarriount, root is a field on the BSPTree
06:15:31zachcarterah right thanks
06:15:58FromGitter<Varriount> ldlework: That error went away once I changed `delete` to a procedure (since it didn't need to be a method)
06:16:28FromGitter<Varriount> Now I get ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=58e8803db52518ed4def30aa]
06:17:38ldleworkVarriount, welcome to my world
06:17:49ldleworkthe world where you have an instance of a subtype in a basemethod
06:17:59ldleworkand you can't use any of your subtype methods
06:18:01ldlework:(
06:18:25ldleworkVarriount, you didn't change the proc version to a base method
06:18:54FromGitter<Varriount> That's the system.nim procedure for resizing memory blocks
06:20:05ldleworkVarriount, ah well do you still need a base method?
06:20:42FromGitter<Varriount> I made `method resizeT (self: Leaf[T], region: Region[float]) {.base.}` the base method. The error doesn't show it.
06:22:02ldleworkVarriount, but Leaf isn't a base class of ParentNode or VSplit or HSplit
06:22:24FromGitter<Varriount> ldlework: My mistake.
06:22:36FromGitter<Varriount> ldlework: Are you sure you aren't overcomplicating things?
06:22:37ldleworkhopefully that fixes it
06:22:48ldleworkVarriount, I'm writing code how I think about the code in my head
06:22:48FromGitter<Varriount> What should be the base then?
06:22:54ldleworkVarriount, look at the types
06:22:58ldleworkBSPNode is the base
06:23:03ldleworkLeaf inherits that
06:23:07ldleworkParentNode also inherits that
06:23:18ldleworkVSplit and HSplit inherit ParentNode
06:23:36ldleworkBSPNode -> Leaf
06:23:43ldleworkBSPNode -> ParentNode -> VSplit
06:23:46ldleworkBSPNode -> ParentNode -> HSplit
06:24:14ldleworkI don't think its overcomplicated. ParentNode is ideally for code that works on both VSplit and HSplit
06:24:20ldleworkLeaf doesn't contain children
06:24:24ldleworkThey all have a region
06:24:38FromGitter<Varriount> Ok, that fixed it. Now I just get a C compiler error because I'm not targeting the right children.
06:24:45FromGitter<Varriount> *right architecture
06:24:48ldleworkomg
06:24:53ldlework<3 <3 <3 <3 <3
06:25:44FromGitter<Varriount> ldlework: I hope you appreciate how complicate the compiler code has to be to handle programs like this.
06:29:36ldleworkI do, its the reason I use Nim
06:29:55ldleworkI can't wait to see the PR
06:31:14FromGitter<Varriount> ldlework: What should the compiled program do?
06:32:18ldleworkVarriount, you can hit h or v to split the currently highlighted region
06:32:23ldleworkd to delete
06:32:28ldleworkhopefully the math is correct
06:32:34ldleworkit should be a proper 2D BSP
06:32:37ldleworklike a tiling window manager
06:32:42ldleworkexcept you can't resize the partitions yet
06:32:55FromGitter<Varriount> Only one region seems to exist. It just gets cut in half.
06:35:29ldleworkVarriount, you can keep pressing the keys
06:35:36ldleworkthe red highlighted region is the one that gets cut
06:35:46ldleworkif its not working its probably due to you taking over during a refactor
06:35:52ldleworkbut if its compiling now I can probably work it
06:36:45FromGitter<Varriount> "taking over"?
06:37:08ldleworkVarriount, yeah when you started coding on it
06:37:12ldleworkI pushed up what I had
06:37:26ldleworkIt was midrefactor trying to get things to work
06:37:37ldleworkso if you got it to compile and it doesn't work as described I'm just saying no big surprise
06:37:45FromGitter<Varriount> Ah. I thought you were implying I was taking over the project or something.
06:37:53ldleworkalso you can hit f to get a printout of the current structure
06:39:27FromGitter<Varriount> https://github.com/dustinlacewell/dadren/compare/bsp...Varriount:patch-1
06:39:27*brson quit (Quit: leaving)
06:39:46FromGitter<Varriount> https://github.com/dustinlacewell/dadren/pull/2
06:41:21ldleworkso you really did just add abunch of T's
06:41:24ldlework:D
06:42:01ldleworkAh yeah the original bug is still there
06:42:04ldleworkVarriount thank you!
06:44:38*def-pri-pub quit (Quit: leaving)
06:53:30ldleworkis there a way to turn inference off?
06:55:59zachcarterThe openarray type cannot be nested: multidimensional openarrays are not supported because this is seldom needed and cannot be done efficiently.
06:56:02zachcarter:P speak for yourself
06:56:04zachcarterI need it
06:59:00*rauss quit (Quit: WeeChat 1.7)
06:59:59ldleworklol
07:02:21ldleworkVarriount, I love you.
07:03:11ldleworkI think we should start a domestic partnership
07:03:13FromGitter<Varriount> ldlework: Not really.
07:03:20ldleworkah
07:03:51FromGitter<Varriount> zachcarter: What are you trying to do? Perhaps there's a workaround.
07:04:09zachcarteryeah I can use multidimensional sequences
07:04:22zachcarterjust roguelikes often model map data with 2d arrays
07:04:31zachcarterso multidim openarrays would be nice
07:05:04zachcarteror I could just pack my 2d arrays into 1d arrays
07:05:24FromGitter<Varriount> zachcarter: an open array is just a (length, pointer) pair
07:05:41zachcarterah okay
07:06:03FromGitter<Varriount> You can emulate that if you really need to.
07:06:28zachcarterI think I can just use 1d arrays
07:09:41FromGitter<Varriount> Zachcarter: that might be more performant too.
07:09:51zachcarteryeah I agree
07:10:07FromGitter<Varriount> I assume you meant to use a 1d stay to store the 2d data, and just use multiplication?
07:10:14zachcarterexactly
07:10:49FromGitter<Varriount> Don't forget to keep in mind sequence copying semantics
07:17:50*yglukhov quit (Remote host closed the connection)
07:18:52*yglukhov joined #nim
07:23:38*yglukhov quit (Ping timeout: 268 seconds)
07:31:12*nsf joined #nim
07:44:45*yglukhov joined #nim
08:08:28*chinchilla left #nim ("ii - 500 SLOC are too much")
08:13:46Araqvarriount: oh come on now, everybody knows seqs/strings copy on assignment except when the compiler optimizes it away. it's how C++ avoids the GC and Nim may do the very same soon too. It's not the obviously stupid design you think it is.
08:14:47ldleworkVarriount, https://gfycat.com/CompleteIdleCur
08:16:37Araqbesides, the problem exists for any large object, not just strings and seqs
08:17:19FromGitter<Varriount> Araq: Anyone coming from C#, Java, or Python is going to assume strings and sequences don't copy.
08:17:53Araqyeah, but we're in #nim here
08:18:24Araqnot in #nim-for-people-assuming-never-reading-anything
08:19:30Araqor #nim-for-people-requiring-performance-without-knowing-any-profiling-tools
08:21:34ldleworkhopefully nim can grow to be for a wide range of people
08:34:15FromGitter<couven92> I read sth about the Python to Nim project yesterday... I think that will also help bringing nim to the masses! :)
08:35:25*Arrrr joined #nim
08:35:25*Arrrr quit (Changing host)
08:35:25*Arrrr joined #nim
08:53:31*zachcarter quit (Quit: zachcarter)
09:09:26dom96hello
09:10:21ldleworkhi dom96
09:12:42FromGitter<Varriount> Python to Nim project?
09:13:51ldleworkVarriount did you see the gif
09:17:05dom96I didn't see the gif
09:17:45ldleworkhttps://zippy.gfycat.com/CompleteIdleCur.webm
09:18:42dom96cool, but what is the end goal of this?
09:25:50ldleworkwindow management
09:25:57ldleworkthink emacs
09:26:31*Matthias247 joined #nim
09:26:39ldleworkit will be resizable and there will be dropdown so you can change what a pane is looking at
09:27:12dom96oh, so you're making a tiling window manager?
09:28:01ldleworkim offering tiling services in my game library
09:28:11ldleworkfor viewports etc
09:28:27*Matthias247 quit (Read error: Connection reset by peer)
09:29:46*Matthias247 joined #nim
09:31:50dom96hrm, I wish text editors had a feature where you can block select an area of whitespace and then paste some stuff in there.
09:32:05ldleworkneat idea
09:32:17dom96That way I could easily show the AST and the code that it represents side-by-side.
09:32:43ldleworkdom96 what you working on in general
09:32:53dom96deserialisation of JSON
09:33:06ldleworkdont we have that
09:33:13ldleworkoh
09:33:18dom96No, we have marshal.
09:33:22ldleworknon marshalled?
09:33:23ldleworkhuh
09:33:29dom96Marshal only happens to use JSON
09:33:38dom96And it doesn't work in the JS target
09:33:41ldleworkhow can that even work in type safe lang
09:33:43dom96I'm writing a macro to do it.
09:33:49ldleworki see
09:34:02ldleworkheroic
09:35:10*gokr joined #nim
09:35:41dom96yeah, it's not as easy as I thought
09:37:45*kunev quit (Quit: е те!)
09:41:29FromGitter<couven92> @Varriount I came an entry in the nim forum yesterday where someone talked about pypy to nim... iirc
09:42:34*kunev joined #nim
09:44:48dom96did somebody say they were working on it though?
09:49:18dom96I don't suppose anyone would know how to get the name of a type from a `Sym` instead of the underlying type structure? (which getType gives me)
09:52:22*gokr quit (Quit: Leaving.)
09:53:45dom96ahh, `getTypeInst` does it. Thanks for the hint in #3681 krux02 :)
09:56:39dom96Araq: Should `getType` be deprecated?
10:08:00dom96I created a PR https://github.com/nim-lang/Nim/pull/5679 :)
10:11:24*PMunch joined #nim
10:17:08*Tiberium joined #nim
10:18:09*Matthias247 quit (Read error: Connection reset by peer)
10:43:45*yglukhov quit (Remote host closed the connection)
10:48:14*zachcarter joined #nim
10:51:42*yglukhov joined #nim
10:54:02*yglukhov quit (Remote host closed the connection)
11:03:46*vlad1777d joined #nim
11:31:46*nsf quit (Quit: WeeChat 1.7)
11:37:03*kier quit (Ping timeout: 240 seconds)
11:38:16zachcarterPython to Nim?
11:38:54Tiberiumzachcarter, yeah
11:39:11TiberiumI think this would be even more useful in modern world than pas2nim
11:39:14Tiberium(sorry araq)
11:39:34zachcarterhrm I need a Java2Nim :P
11:40:07Tiberiumwe need <anylang>2nim
11:40:13zachcartertruth
11:40:46Tiberiumso after we're converting all apps in the world, including linux or some other OS'es, or creating our own
11:48:15zachcarterhrm
11:48:27zachcarterstill trying to determine if multidimensional sequences are the way to go for holding map data
11:52:55ArrrrThe alternative being?
11:53:26*kunev quit (Quit: е те!)
11:54:10*yglukhov joined #nim
11:57:31*yglukhov quit (Remote host closed the connection)
11:59:49*kunev joined #nim
12:01:14zachcarternot sure
12:01:30zachcarterArrrr: any suggestions?
12:03:01FromGitter<Varriount> zachcarter: What kind of map?
12:03:30FromGitter<Varriount> And how will you need to interact with it? How will it be displayed?
12:03:49zachcarterwell it will be tiled
12:04:11zachcarterso a very simple example would be -
12:05:08zachcarterhttps://gist.github.com/zacharycarter/dd5643d623cc89c9bd0380d52b699011
12:05:25zachcarterthat would represent say a 5x5 room with walls and an opening
12:06:23zachcarteressentially all I need for drawing is to be able to iterate over the map and check the content of each cell to know what to draw
12:06:33FromGitter<Varriount> Will the map need to be mutable? Will it always be rectangular?
12:06:42zachcarterit will need to be mutable it will always be rectangular
12:06:55zachcarterits contents will need to be mutable
12:07:09zachcartermaps generally won’t need to be resized after creation
12:07:15FromGitter<Varriount> Well then, an array sound like the best choice.
12:07:22zachcarterI think so too
12:07:27zachcartermy only problem with arrays is
12:07:42zachcarterwell I guess I don’t actually
12:07:53zachcarterI was thinking I wouldn’t be able to create literals like in my examples
12:07:56zachcarterexample*
12:08:05zachcarterbut I guess if I just leave off the inner arrays I essentially have the same thing
12:08:17FromGitter<Varriount> Yep.
12:08:25zachcarterI just need to use index multiplication to get to the correct row / column
12:08:48zachcarteramazing what sleep will make you realize :P
12:08:54zachcarterand talking things through with Varriount :D
12:09:45*yglukhov joined #nim
12:11:02FromGitter<Varriount> Just create a procedure that does the multiplication and access for you. Wrap the array in an object type
12:11:36zachcarterright
12:11:47zachcarterwell I think I’m going to end up using seqs anyway
12:12:08zachcarterthe whole not knowing the array size at compile time is going to force my hand
12:12:22zachcarterI won’t need to resize them but their size may be calculated at runtime
12:15:04dom96Oooh, is this the start of a rogue-like?
12:15:40zachcarterdom96: https://github.com/zacharycarter/nimrl
12:15:48dom96btw guys, Ludum Dare 38 is happening in 2 weeks.
12:15:58dom96Nim is perfect for that competition :)
12:16:12zachcarteryeah I’ll probably build something with frag for it
12:16:59dom96cool. I bet ftsf will be competing as well. ftsf placed 4th in the last one IIRC
12:17:26zachcarterniceeee
12:18:49federico3 we need a 2D library contest first
12:19:42zachcarteryou have different types of 2D though
12:20:06zachcartera large / complex 2d game is not going to be able to be built with SDL2 alone I’m sorry
12:20:16zachcarterthe renderer will NOT keep up
12:20:34dom96the renderer? what do you mean?
12:20:55zachcartersdl2 abstracts away rendering to the graphics API that the device is running on supports
12:20:55dom96An abstraction will certainly help with complex 2D games.
12:21:03zachcarterwhich is nice
12:21:19zachcarterexcept the renderer does not support draw call batching
12:21:42zachcarternor does sdl2 support texture atlases
12:21:58zachcarterso you’re going to be stuck writing your own OpenGL code if you want to handle either of those scenarios
12:22:25zachcarterwhich any large / complex game is going to need
12:23:18dom96what are texture atlases?
12:23:33dom96is sfml any better in this regard?
12:23:37zachcarterSFML is not
12:23:44zachcarterfrag is :P
12:24:08zachcartertexture atlases consist of an atlas file and a large texture file that has been packed with a bunch of smaller texture files
12:24:19zachcarterso you may have a single texture that actually has 100 other textures packed into it
12:24:44zachcarterthe atlas file will contain the position and UVs of the textures which are packed into the larger texture
12:25:05zachcarterthis prevents the GPU from having to switch textures all the time, which has performance implications if your’e switching textures enough
12:25:52dom96cool.
12:26:03zachcartereven with texture atlasing though, SDL2 suffers from the whole non draw call batching thing
12:26:12zachcarterwhere every submission to the renderer gets its own draw cal
12:26:14zachcartercall
12:26:15dom96Good enough for Ludum Dare though, right?
12:26:32zachcarteroh yeah
12:27:23zachcarterI don’t think you’d start noticing performance issues with SDl2 alone until you started rendering large maps with lots of textures
12:27:30zachcarteror large scenes rather
12:29:00zachcarterthe game I’m building (the roguelike game) couldn’t be built with solely sdl2
12:29:24zachcartermaybe if I was just drawing colored rectangles / text but I plan on using graphical tiles
12:35:33*BitPuffin|osx joined #nim
12:35:59*kier joined #nim
12:37:43dom96I actually like the ASCII look that older roguelikes have
12:37:51dom96Not that I've tried that many
12:37:56dom96Really only NetHack.
13:03:59FromGitter<Varriount> I like actual art. :|
13:06:16*Tiberium quit (Remote host closed the connection)
13:06:36*Tiberium joined #nim
13:09:29Arrrryou mean realistic art
13:13:09Arrrrzachcarter, what do you mean when you say 'non draw call batching thing' ?
13:13:36zachcarterhrm?
13:13:43zachcarterI mean SDL2 doesn’t do draw call batching
13:14:48ArrrrIt blits the surface, isn't it?
13:14:59zachcarterit does but think about this
13:15:41zachcarterevery surface blit for a regtangular draw object is essentially sending data for four vertices and texcoords
13:15:52*dddddd joined #nim
13:15:53zachcarterI’m not sure if SDL2 uses indexed drawing but I doubt it, even so let’s assume it does
13:16:02zachcarterand sorry I meant six vertices
13:16:18zachcarterif it’s using indexed drawing it’s submitting data for 3 verts and then six indices
13:16:41zachcarternow if you’re drawing 100 textures in one frame
13:16:54zachcarterwhat makes more sense - one draw call consisting of 300 vertices and 600 indices?
13:17:09zachcarteror one hundred draw calls with 3 verts and 6 indices each
13:17:13zachcarterbecause SDL2 will do the latter
13:17:27Arrrrmmm
13:17:30zachcarter(if it even supports indexed buffers - which I’m guessing it doesn’t)
13:17:48zachcarter(it’s most likely more like 100 draw calls with 6 vertices and 0 indices)
13:18:25ArrrrIt could draw everything in one texture. For simple 2D things can be faster
13:18:55zachcarterit could, but chances are you’re not going to have a single texture representing your game scene
13:19:00zachcarterit’s going to be composed of a bunch of different textures
13:19:21ArrrrWell, then that's not surface blitting.
13:19:33zachcarterit is, it’s just blitting multiple surfaces
13:19:56zachcartersimple trivial example is this
13:20:07zachcarterframeBegin()
13:20:10zachcarterdrawPlayer()
13:20:15zachcarterdrawMonster()
13:20:18zachcarterframeEnd()
13:20:26zachcartersdl2 would make 2 draw calls
13:20:32zachcarterwhen if it was optimized it would make one
13:22:48ArrrrWell, in that case you are right.
13:23:55zachcarteryeah :/ I’m not trying to bash sdl2 I just don’t see it being a viable option for larger projects
13:24:08FromGitter<Varriount> It becomes important when you start having many such calls
13:24:13zachcarterexactly
13:24:31ArrrrWell, this game was made in sdl https://www.kag2d.com/en/
13:24:38ArrrrAt least, the classic version
13:24:40zachcartersure
13:24:44zachcarterbut I doubt they used the sdl2 renderer
13:24:50zachcarterI’m guessing they wrote their own OpenGL rendering code
13:25:01ArrrrMmm that makes sense.
13:28:04Tiberiumwow, vscode configured with 1ms save delay feels much smoother
13:28:09Tiberiumbecause nimsuggest is also fast
13:28:17Tiberiumso new errors are highlighted instantly
13:28:51arnetheduck@Araq, the tyAlias and sighash stuff sure makes it easier to do types for llvm ;)
13:41:17zachcarterhow do you buffer text in Nim for stdout?
13:41:26zachcarteror is there an echo w/o a newline?
13:48:24federico3zachcarter: stdout.write
13:50:56zachcarterthank you federico3
14:08:11*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
14:11:32FromGitter<cooldome> Gents, could you please give me a push on why this does not compile: macro dseq(len : int) : typed = ⏎ let procTyped = newNimNode(nnkBracketExpr).add(bindSym("newSeq")).add(bindSym("int")) ⏎ result = newCall(procTyped, [len]) ⏎ ⏎ let a = dseq(10) [https://gitter.im/nim-lang/Nim?at=58e8ef95f22385553d1f8f74]
14:11:46zachcartercan you put that into a gist please?
14:11:52zachcarteror something similar?
14:13:56FromGitter<cooldome> sure, here it is as gist https://gist.github.com/cooldome/0f334cc0feaf5ac1c60082b73eec8a25
14:14:07zachcarterthanks
14:27:24*zaquest left #nim ("Leaving")
14:27:57zachcarterhrm cooldome: macros are my weak point right now, not sure how to fix this
14:29:56FromGitter<Varriount> I'll take a look in a sec.
14:30:45FromGitter<cooldome> Thank you, will wait for you answer
14:35:33FromGitter<Varriount> @cooldome You're creating a procedure call and returning it. I'd the result of that procedure call being assigned to anything?
14:36:56FromGitter<cooldome> it is assigned to variable 'a', no?
14:37:21FromGitter<cooldome> and I have tried calling macro with keyword discard, does not help either
14:41:45Tiberiumlol
14:42:02TiberiumI just translated this script to Nim https://github.com/jhoward/Python-Neural-Network/blob/master/nn.py#L24
14:42:06Tiberiumwasn't hard
14:42:12TiberiumI literally copy-pasted entire chunks of code
14:43:24Tiberiumand it worked :D (I forgot that range's equivalent in Nim is "for x in 0..<something")
14:44:01Tiberiumyeah, code isn't efficient as I think
14:45:28FromGitter<Varriount> @cooldome Ah, found the problem
14:46:11FromGitter<Varriount> First off, you might want to use `ident` instead of `bindSym`
14:47:43FromGitter<Varriount> That correctly matches the tree of the expression you want.
14:48:33FromGitter<Varriount> Second, always make a macros return value `untyped`. Technically `typed` and `untyped` shouldn't matter for a macro, but there are subtle differences due to compiler logic.
14:50:02FromGitter<Varriount> @cooldome https://glot.io/snippets/eor0inasgv
14:53:39FromGitter<Varriount> @cooldome @zacharycarter A good function to use in macros is the `quote` operator. https://glot.io/snippets/eor0lt955l
14:59:20FromGitter<Varriount> @dom96 By the way, you can increase the size of the glot.io editor. Click the gear above the editor on the right-hand side, and you'll see a 'lines' setting.
15:04:07FromGitter<cooldome> Thanks Varriount, untyped as return typed made a difference
15:04:08Tiberiumwat
15:04:14TiberiumNim supports unicode variable names? lol
15:04:24Tiberium"let π = 3.14" works
15:04:55FromGitter<Varriount> Tiberium: Why not?
15:06:38Tiberiumjust impressed :)
15:07:48Tiberiumnot many compiled languages support unicode names
15:10:05Tiberiumjust curious (xD): can I change "var" to something else? like "variable a". just curious
15:10:18Tiberiumif it's a part of the syntax, I can't, but I can with macros I think
15:10:45arnetheduckTiberium, well, C & C++ to start with? ;)
15:11:21Tiberiumarnetheduck, C has only limited support :)
15:12:03Tiberiumsame with C++, it depends on compiler
15:12:08Tiberiumlimited support only
15:12:23Tiberiumhmm, let me see if Nim can compile "var  = 1"
15:12:33Tiberiumyes, Nim can
15:15:49arnetheduckah, well, I guess.. anything > C(++)11 is supposed to support it, but then..
15:19:02*gangstacat quit (Quit: Ĝis!)
15:20:17FromGitter<Varriount> C++: The kitchen sink language
15:23:57Tiberiumcan I do something like "if a equals b" so I want to replace == to "equals"? Or I would replace strings?
15:33:45FromGitter<stisa> Tiberium : Not sure, I think the closest you can get is ``2.equals 2`` (using a template)
15:34:04dom96You can try defining proc `equals`(...)
15:34:08dom96but I don't think it will work
15:37:33*zachcarter quit (Quit: zachcarter)
15:37:55*zachcarter joined #nim
15:42:40*zachcarter quit (Ping timeout: 260 seconds)
15:47:14*krux02 joined #nim
15:50:31*krux02 quit (Remote host closed the connection)
15:51:05*krux02 joined #nim
15:53:38*krux02 quit (Remote host closed the connection)
16:00:06*dddddd quit (Remote host closed the connection)
16:03:28*krux02 joined #nim
16:14:33*BitPuffin|osx quit (Ping timeout: 240 seconds)
16:21:16*Trustable joined #nim
16:28:25FromGitter<battila7> @dom96 Just bought the book, really looking forward to start playing with it
16:29:08Tiberiumhow can I get simple string from readFile() ?
16:31:55dom96battila7: awesome, let me know if you have any questions :)
16:32:01dom96Tiberium: What's a "simple string"?
16:32:15Tiberiumdom96, a string so I can use "replace" on it
16:32:42Tiberiumoh wait
16:33:15dom96readFile returns a TaintedString probably
16:33:20Tiberiumyeah
16:33:22TiberiumIt works now
16:33:24dom96TaintedString == string (unless you're in taint mode)
16:33:25Tiberiumit's my fault
16:37:14*arnetheduck quit (Ping timeout: 260 seconds)
16:38:22*zachcarter joined #nim
16:54:54krux02Tiberium: when you want to have a file that you want to be able to change inplace, memory mapping of the files help you
16:55:13Tiberiumkrux02, thanks, but no :) I want to "translate" files
16:55:17Tiberiumso multiple replaces
16:55:34krux02but be aware that when you do that, this is not supposed to be used with very big files wher you insert something in the middle
16:56:01krux02so you want sed :P
17:04:16*Matthias247 joined #nim
17:06:25*Tiberium quit (Remote host closed the connection)
17:08:58*PMunch quit (Quit: leaving)
17:11:26*zachcarter quit (Ping timeout: 240 seconds)
17:39:55krux02Araq: are you available to be questioned?
17:41:41krux02I would like to know how I can bind procs like offsetof alignof sizeof to the function I just edited
17:43:26dom96You should really just ask here first.
17:43:53dom96Highlighting Araq all the time will discourage him from being here (in fact, I think it already is starting to make him appear in IRC less often)
17:44:11dom96If nobody answers then you can highlight someone.
17:44:47dom96As for your question, what is "the function [you] just edited?"
17:57:40*Matthias247 quit (Read error: Connection reset by peer)
18:01:10FromGitter<battila7> Is there a way to define a parameter type to be *a tuple with a `name` field and some other fields I don't care about*?
18:02:25*ngc joined #nim
18:08:06*shashlick quit (Ping timeout: 240 seconds)
18:09:43*shashlick joined #nim
18:13:27FromGitter<stisa> @battila7 a Concept maybe? I don't think you can do that otherwise, I don't see how you would declare the type
18:13:44*Tiberium joined #nim
18:14:06*yglukhov quit (Remote host closed the connection)
18:18:09FromGitter<battila7> @stisa I've thought about something inline. But using a Concept seems good idea.
18:18:17FromGitter<battila7> As I see, Nim lacks interfaces, therefore using Concepts in an interface kind of style is idiomatic, or something I should not do?
18:19:52dom96Indeed. Concepts can also be used as an interface.
18:20:06krux02dom96: You are right, I think it's much nicer to properly formulate the question in the forum, and that is what I just did
18:20:21krux02on that way he (or you if you know it) can answer me any time
18:20:29FromGitter<stisa> I'm sorry, I haven't used concepts much yet. I think they are something like a restriction on the type, but keep in mind they can't be used in seq/array etc
18:21:11krux02stisa: well that is not entirely true
18:21:30krux02you can't create an array with an element type of a concept
18:21:43*yglukhov joined #nim
18:22:34krux02but at any time where you declare a function with a concept as type parameter (a generic) you can in fact use the conept on an array type, because in this context the type is actually a single computed type
18:23:53FromGitter<battila7> That's great! I was a bit scared about this, but Concepts are much more powerful as I see than interfaces
18:24:02FromGitter<stisa> Yes sorry, that wasn't clear. I meant you can't do something like `var x : seq[MyConcept] = @[myconc1, myconc2 ...]`.
18:24:26FromGitter<battila7> Actually, I've just tried that and crashed the compiler
18:24:48krux02all elements of an array need to be the same type, and a concept on it's own is not yet a type
18:25:18FromGitter<battila7> So in 1.0 this might be possible?
18:25:33krux02you should share you code
18:25:40krux02I am sorry I haven't really used concepts yet
18:26:01krux02and I think most of the time people use concepts the problem can use used with much simpler design decisions
18:26:04*yglukhov quit (Remote host closed the connection)
18:26:16dom96Concepts are still under development.
18:26:34dom96The devel branch implements many improvements and additions to them.
18:26:53krux02sure the way you asked the question only leads to conceps as the answer, but I am pretty sure if you share a bit more context of your problem, I might give you a hint on how you can solve your problem without using concepts
18:27:09dom96I'm not sure whether this is implemented already, but it is definitely planned: var x: seq[vtref MyConcept]
18:27:34krux02cool
18:27:35FromGitter<battila7> I've been playing around with the language for a week or therefore I don't really have any code, I'm just experimenting
18:27:41krux02I did not know it, but it makes senes
18:28:15krux02makes compile type polymorphism automatically (and only when needed) into runtime polymorphism
18:28:25FromGitter<stisa> dom96 uhuh that sounds interesting
18:28:35krux02reminds me of my prototype for go interfaces in Nim
18:28:49dom96Yep, I think it's pretty cool.
18:28:58dom96Although I'm not the biggest fan of the 'vtref' name.
18:29:18*yglukhov joined #nim
18:30:00dom96But in all likelihood you won't be using it this way anyway. We have the 'interface' keyword reserved, so I think it makes sense to define a 'vtref concept' by just writing 'interface'.
18:30:31*dom96 already suggested that to zahary and Araq :)
18:31:30*krux02 quit (Remote host closed the connection)
18:31:32FromGitter<battila7> That'd be great, looks much cleaner
18:32:09*zachcarter joined #nim
18:49:54*Ven joined #nim
18:50:18*Ven is now known as Guest22771
18:50:30*Tiberium quit (Remote host closed the connection)
18:50:54*Tiberium joined #nim
19:08:58*Guest22771 quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:09:08FromGitter<Varriount> dom96: I just read BountySource. It's nice to know the donations are doing something. :D
19:09:58dom96Yeah, just paid zahary for his work on concepts :)
19:10:07dom96Need to write another update
19:13:13FromGitter<Varriount> I do wish new features could be discussed in the forum first, but that's up to zahary and araq, not me.
19:19:21dom96I wish so too and I try to encourage that.
19:19:39dom96If you could do the same it would go a long way :)
19:20:29dom96The concept spec is in the manual now though, so do read it if you've got some time and give feedback.
19:21:39FromGitter<Varriount> dom96: I love reading. :)
19:24:15dom96It lives https://github.com/nim-lang/Nim/blob/feature/json-macro/tests/stdlib/tjsonmacro.nim :D
19:28:38FromGitter<Varriount> dom96: Loading JSON to an object?
19:28:44dom96yep
19:34:34FromGitter<Varriount> dom96: Is there a way for an object to customize how it is loaded?
19:35:09dom96What sort of customisation do you have in mind?
19:36:53FromGitter<Varriount> discarding metadata, reinterpreting the JSON
19:38:11dom96It only maps the fields you specify in your type definition
19:38:19dom96Not sure what you mean by "reinterpreting the JSON"
19:43:23Araqconcepts have been discussed extensively in the forum
19:45:17dom96Araq: Any thoughts on my JSON macro?
19:46:27Araqseems to be exactly what I wanted to add to the stdlib
19:46:31Araq:-)
19:47:54dom96great :)
19:49:48FromGitter<Varriount> I wonder if C++ would be able to do anything like your macro.
19:50:13Araqno, it cannot do it.
19:51:49*Ven joined #nim
19:52:12*Ven is now known as Guest89504
19:52:19FromGitter<Varriount> zacharycarter: So much for that guys assertions that C/C++ macros are superior to Nim's
19:53:10FromGitter<Varriount> Araq, dom96: There was this person on a channel in Quakenet that was convinced C-style macros were superior to Nim macros.
19:53:33FromGitter<Varriount> Needless to say, zacharycarter and I were nonplussed.
19:53:40*Guest89504 quit (Client Quit)
20:00:40*zachcarter quit (Quit: zachcarter)
20:05:23ldleworknim lol holy shit!
20:05:30ldleworks/nim/dom96
20:05:58*Trustable quit (Remote host closed the connection)
20:06:06dom96just for you ldlework :P
20:07:17ldleworkDo other languages have this?
20:07:47dom96doesn't Go?
20:07:47FromGitter<Varriount> Have what?
20:08:17dom96I assume JSON to object deserialisation
20:08:32*dom96 isn't sure what to call it, unmarshalling? deserialization?
20:09:23ldleworkYeah unmarshalling.
20:09:41FromGitter<Varriount> "This process of serializing an object is also called marshalling an object.[2] The opposite operation, extracting a data structure from a series of bytes, is deserialization (which is also called unmarshalling)."
20:09:51FromGitter<Varriount> https://en.wikipedia.org/wiki/Serialization
20:09:56ldleworkOKOK
20:10:17ldleworkGo has type-generative json deserialization?
20:10:26ldleworkdom96: that's what your macro is doing right? Generating new types on the fly?
20:10:38Xeldlework: by using struct tagging
20:10:48Xeit's actually really elegant
20:10:58Xehttps://mholt.github.io/json-to-go/
20:11:04Xepaste arbitrary json on the left side
20:11:20ldleworkXe: yes, but do you have to do this as an external step?
20:11:22FromGitter<Varriount> ldlework: The macro doesn't generate new types, it creates a procedure for loading existing types from json.
20:11:45*gokr joined #nim
20:11:50ldleworkThat sounds like marshalling...?
20:12:12FromGitter<Varriount> unmarshalling.
20:12:44ldleworkyeah
20:12:49dom96You give the macro a type
20:12:56dom96It reads the JSON into that type
20:13:04dom96s/reads/unmarshals/
20:13:04ldleworkisnt that whas the marshal module does?
20:13:09FromGitter<Varriount> reading == deserialization == unmarshalling, writing == serialization == marshalling
20:13:30dom96yes, but the marshal module only happens to use JSON
20:13:35dom96The underlying format could change
20:13:44FromGitter<Varriount> ^
20:13:51dom96Plus, the format expects some Nim-specific info
20:14:04dom96So your JSON could fail to parse because of that
20:14:18dom96And most importantly for me, it doesn't support the JS backend.
20:14:23ldleworkI see
20:14:25FromGitter<Varriount> dom96: I assume this macro will be in the JSON module?
20:14:35dom96yep
20:16:27FromGitter<Varriount> What about a corresponding serialization macro?
20:16:45dom96Don't need a macro for that
20:16:55dom96JSON already has `%` for that purpose
20:17:10dom96I use it in that test
20:17:57ldleworkXe: fwiw, struct tagging seems like the hackiest thing I've ever heard of.
20:18:22ldleworkBut I'm prone to hate anything related to Golang by default.
20:18:27dom96In the future I will probably generalise this macro so that it can be used for other formats.
20:19:36dom96You could already use it actually by just converting your format's data type to a JsonNode.
20:20:00FromGitter<Varriount> Hm. One problem with the current JSON serialization is that it isn't streaming/incremental.
20:21:07FromGitter<Varriount> You have to generate the entire intermediate representation (JsonNode) before writing to file.
20:22:00*Arrrr quit (Quit: Leaving.)
20:22:09FromGitter<Varriount> Actually, it looks like you need to use 2 intermediate representations, object -> JsonNode, JsonNode -> string
20:23:18*zachcarter joined #nim
20:23:52dom96Sure, but then you can always just write the JSON manually.
20:25:44*zachcarter quit (Read error: Connection reset by peer)
20:26:27*zachcarter joined #nim
20:27:02*Tiberium quit (Remote host closed the connection)
20:30:00*yglukhov quit (Remote host closed the connection)
20:31:34*Tiberium joined #nim
20:52:55*yglukhov joined #nim
20:58:35def-wow, --gc:boehm compiles so much faster
21:01:54*PMunch joined #nim
21:07:11Araqfor me --gc:markAndSweep produces the fastest compiler
21:07:24Araq0.3s bootstrap difference
21:08:09Araq4s (refc) vs 3.6s (boehm) vs 3.3s (m&s)
21:12:23FromGitter<Varriount> What are the performance characteristics of each collector?
21:13:25*gokr quit (Ping timeout: 240 seconds)
21:23:47*vlad1777d quit (Quit: Leaving)
21:23:48*zachcarter quit (Quit: zachcarter)
21:37:32def-Araq: nono, that's not what I mean. I mean compiling my binaries with --gc:boehm
21:37:50def-because the Nim compiler can't be reused from nimcache I presume
21:38:09def-s/Nim compiler/Nim gc/
21:43:05*Yuken_ joined #nim
21:43:55ldleworkYuken_: You can start working through this, https://nim-lang.org/docs/tut1.html
21:44:00ldleworkThere's a part 2
21:44:12Yuken_Now, to figure out what editor to use...
21:44:18ldleworkI'm free today so just expect that at least I am here to answer your questions
21:44:32ldleworkOnce you make it through the tutorial we can make a simple Dadren app
21:44:59*yglukhov quit (Remote host closed the connection)
21:45:33FromGitter<Varriount> Yuken_: I'd recommend Sublime Text, but the plugin has some bugs at the moment that I'm fixing.
21:45:50FromGitter<Varriount> You could go with the VSCode plugin, if you already have that installed.
21:45:54Yuken_Varriount, doubt Sublime would run well on this machine ;o
21:46:09FromGitter<Varriount> Yuken_: Then VSCode is probably out as well.
21:46:22Yuken_It might run, I'm not 100% sure. Rather crappy thing.
21:46:23Yuken_CPU: 2 x AMD Athlon(tm) Dual Core Processor 5050e (AuthenticAMD) @ 1000MHz w/ 512 KB L2 Cache **
21:46:27Yuken_with 4GB of RAM and a 6150SE
21:46:40def-Araq: should I report v2 bugs or are they known? It prints some "introduced bug" stuff
21:47:04FromGitter<battila7> VSCode and its plugin is pretty stable, I highly recommend them
21:47:18FromGitter<Varriount> Yuken_: Sublime Text is using 101 Mb of memory on my Macbook
21:47:37FromGitter<Varriount> Yuken_: There are also plugins for Vim and (I think) emacs
21:48:05FromGitter<Varriount> Basically, any IDE that is easily language agnostic has a plugin.
21:48:13FromGitter<Varriount> (IntelliJ doesn't count)
21:50:16*Tiberium quit (Read error: Connection reset by peer)
22:02:02FromGitter<TiberiumPY> I use and recommend vscode too - with nimsuggest and 1ms auto save delay error highlights are instant
22:03:59FromGitter<Varriount> Yes, but VSCode's memory footprint and CPU usage might be a bit too high for such a machine.
22:04:09cheatfateYuken_, Sublime Text is the fastest alternative you can get...
22:06:00FromGitter<TiberiumPY> @Varriount 4gb should be sufficient, but cpu may slow it down
22:06:24ldleworkHow do you install nimsuggest for vscode
22:06:28FromGitter<TiberiumPY> By the way, for me it feels that VSCode is faster than Atom
22:10:03*Sentreen quit (Ping timeout: 240 seconds)
22:11:04Yuken_Mmkay then, I'll try out VSCOde first as that is what I used under Windows on my other PC and very much enjoy it
22:11:13Yuken_if that doesn't work, Sublime - and if that doesn't work, I guess nano will have to do :^)
22:12:16FromGitter<battila7> Startup time is less that Atom's for sure
22:19:51*bjz joined #nim
22:21:14ldleworkWell if the Nim extenstion on the marketplace is doing anything I can't tell what it s doing
22:21:20ldleworkits certainly not completing anything useful
22:21:26ldleworkfor vscodee
22:22:47FromGitter<TiberiumPY> It can use nimsuggest for errors at least
22:23:03*Sentreen joined #nim
22:23:19FromGitter<TiberiumPY> And btw, is there intelligent auto completion? In nimsuggest
22:23:33ldleworkwhere does nimsugget comefrom?
22:23:39ldleworkdo I have to install that separately?
22:25:10*chatter30 joined #nim
22:26:17FromGitter<TiberiumPY> If you compile from source, you can compile it to
22:26:20FromGitter<TiberiumPY> *too
22:26:22*chatter30 quit (Client Quit)
22:27:28FromGitter<TiberiumPY> Most useful nimsuggest feature - error highlighting, it helps a lot
22:27:40FromGitter<TiberiumPY> (compile time errors)
22:29:00*FromGitter * Varriount will stay faithful to Sublime Text
22:29:33FromGitter<Varriount> I'd rather have a browser that doesn't eat up half a GB of memory on startup.
22:29:39FromGitter<Varriount> *editor
22:31:21FromGitter<TiberiumPY> But unused ram ==
22:31:32FromGitter<TiberiumPY> Useless ram, isn't it?
22:31:53FromGitter<TiberiumPY> So if I have 4-5gb free I can afford this :)
22:32:51FromGitter<Varriount> That is, until you need to spin up a virtual machine or two.
22:33:26FromGitter<TiberiumPY> Ah, then yes
22:34:30FromGitter<TiberiumPY> I really think about buying additional 8gb's to my 8gb's, because it's doesn't cost much money and it's useful
22:34:53FromGitter<Varriount> I'm in the group of programmers who think using a browser framework to make an editor is frivolous and wasteful.
22:35:17ldleworkIt reuses technology
22:35:25ldleworkSublime invented his own UX kit
22:35:32ldleworklook at emacs
22:35:38ldleworkno one wants to touch the core
22:35:51FromGitter<Varriount> ldlework: WxWidgets?
22:35:57ldleworkif you use tech that is guaranteed to be updated as time goes on that's pretty good
22:35:57cheatfateldlework, https://en.wikipedia.org/wiki/Skia_Graphics_Engine
22:36:28FromGitter<Varriount> ^ That's what Sublime Text 3 uses
22:36:32dom96Varriount: Sometimes Worse is Better.
22:36:51FromGitter<Varriount> dom96: I shudder at such a philosophy.
22:37:12ldleworkOK so sublimetext 3 made a better choice than ST2
22:37:30FromGitter<Varriount> ldlework: I'm not sure that ST2 doesn't use Skia as well.
22:37:40ldleworkThe original used his own at least
22:37:49cheatfateVarriount this information was obtained only because somebody reverse engineered ST3, but nobody disassembled ST2...
22:37:49ldleworkWe're missing the point
22:38:14ldleworkIf you're pointing to Skia as saying "Look they didn't roll their own" then surely web-tech is even further along that spectrum
22:38:31cheatfateThere no need in web tech for text editor
22:38:51ldleworkExcept now anyone familiar with those technologies can contribute
22:38:52cheatfatetext editor must to be fast and able to handle many lines of code
22:39:02ldleworkI bet that number is several several magnitutdes larger than Skia
22:39:04FromGitter<Varriount> Web tech was meant to display html pages, which come in all shapes and sizes and need to be able to change entirely.
22:39:24FromGitter<Varriount> An editor is fairly static by comparison.
22:39:37ldleworkExcept now emacs and display gifs and video
22:39:56FromGitter<battila7> I think introducing web techs in desktop apps such as code editors is one of the best things that happened in the past years
22:40:22FromGitter<Varriount> I just want memory footprints and CPU usage to be better.
22:40:37ldleworkI don't really run into problems with running out of cpu or memory
22:40:40ldleworkbut maybe I'm spoiled
22:41:00FromGitter<Varriount> I've come close.
22:41:28ldleworkMaybe when I haven't rebooted in weeks and chrome has 98 of my memory for some reason
22:41:40FromGitter<battila7> I usually do, when using my notebook with 4GBs
22:41:54FromGitter<TiberiumPY> Maybe some memory leak ldlework
22:42:03ldleworkno doubt
22:42:11FromGitter<battila7> It's not leaking just being greedy
22:43:35ldleworkI simply don't understand how to get nim completion to work in vscode
22:43:45*ldlework gives up
22:44:09FromGitter<TiberiumPY> I'll explain tomorrow for you (i mean later today)
22:47:10dom96ldlework: Just make sure you've got nimsuggest in your PATH
22:47:17ldleworkI do
22:47:28dom96then I dunno
22:47:35ldleworkoh now its working
22:47:42ldleworknice
22:47:46FromGitter<TiberiumPY> :)
22:47:53ldleworknow to get it working in emacs
22:47:56ldleworklol
22:48:06FromGitter<TiberiumPY> Also you may want to have auto save
22:48:32ldleworkIt needs a side bar on the right
22:48:35FromGitter<Varriount> In other news, I've seen Windows 10 run with 2 GB of RAM
22:48:37ldleworkwith a list of all the top-level names
22:53:05dom96No wonder people are still using Windows XP
22:53:21FromGitter<Varriount> dom96:?
22:53:47dom962GB seems like a lot to me
22:58:15FromGitter<battila7> Eventually after backend development with Java and Spring one can not look at RAM the way before
22:58:59FromGitter<Varriount> @battila7 I have a love/hate relationship with IntelliJ and Pycharm too. Great editors, horribly memory usage.
22:59:06FromGitter<Varriount> Both use Java.
23:00:02dom96wow. VS Code is only using 130MB of RAM
23:00:08FromGitter<Varriount> Which ultimately leads to one of Nim's characteristics that I greatly appreciate: memory usage.
23:00:10dom96Nimsuggest is using... A lot
23:00:15dom96And there seem to be like 10 instances of it
23:00:32dom96One of them is using 1.1GB
23:00:34FromGitter<battila7> IntelliJ might be the best Java IDE out there but you should not try running two instances with 4GBs of RAM :smile:
23:01:20FromGitter<battila7> @dom96 That's a bit scary
23:02:13FromGitter<Varriount> dom96: Unfortunately, the only way I can see to decrease that is to strip out all the extra compiler behavior.
23:02:40FromGitter<Varriount> Or have a memory profiling tool
23:02:49dom96Varriount: huh? I'm pretty sure it's leaking memory.
23:03:32dom96It is an old version though. It's possible that this was fixed already.
23:08:05FromGitter<Varriount> ldlework: How is dadren going? Anymore odd errors to puzzle out?
23:08:32*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
23:10:06ldleworknice I got completion working in emacs now
23:10:26ldleworkVarriount, no more odd puzzles yet. Next challenge is making it so you can resize the partitions
23:10:32*bjz joined #nim
23:12:52ldleworkVarriount, wanna help in general? Or just looking for nim compiler errors to chew on? :D
23:13:48*Nobabs27 joined #nim
23:43:27*Matthias247 joined #nim
23:52:18*zachcarter joined #nim
23:52:41*nsf joined #nim
23:54:44*def-pri-pub joined #nim
23:58:45zachcarteroooo just saw all this talk about dom96’s macro - nice!