<< 11-04-2017 >>

00:04:39FromGitter<mratsim> going to sleep, thank you all. See you tomorrow
00:12:49*Nobabs27 quit (Quit: Leaving)
00:16:19ldleworkis andreaferretti someone here?
00:18:05FromGitter<mratsim> He is the author of linalg, patty, and a couple other libraries, and also andrea in the forum
00:18:13FromGitter<mratsim> (really going now)
00:20:09ldleworkI'm trying out their interface library
00:20:26ldleworkwhen you try to use a type as an interface but it doesn't implement it you get an infinite recursion until the stack breaks
00:20:28ldlework:(
00:26:59*ftsf joined #nim
00:27:17libmanFor the top meta table on https://en.wikipedia.org/wiki/Nim_(programming_language) - are there any langs we can list that Nim has "Influenced"?
00:34:39libmanOr, for a different conversation starter, DSLs - https://www.reddit.com/r/nim/comments/64knh7/new_to_nim_any_advice_for_making_a_simple_game/
00:45:18*Ven joined #nim
00:45:41*Ven is now known as Guest48040
00:49:20ftsfahoyhoy
00:49:30ldleworkhi ftsf
00:49:36ftsfhey ldlework
00:49:49ldleworkftsf: did you see my bsp
00:50:03ftsfnoo, link?
00:50:23ldleworkftsf: https://zippy.gfycat.com/CompleteIdleCur.webm
00:50:36*Guest48040 quit (Ping timeout: 252 seconds)
00:50:39ftsfvery cool
00:50:57ftsfstoring in a binary tree?
00:51:03ldleworkya
00:51:20ftsfnice
00:51:58ftsfwhat kind of data do you store per node?
00:52:01ldleworkftsf: I'm hoping that you will add a license to nimsynth, I'd like to cannibalize some math and other functions you got
00:52:42ftsfmath is unlicensable ;) but yeah i should add a licence
00:53:00ldleworkftsf: here is my implementation, https://github.com/dustinlacewell/dadren/blob/master/dadren/bsp.nim
00:53:12ldleworkfeel free to use it for your windowing
00:53:56ftsfthanks
00:54:15ldleworkI'm still working on making the regions resizable in my example
00:54:25ldleworkI stopped to study inversion-of-control principles
00:54:37ftsfhmm should it be a binary tree... you might want to split a region into say 3 sub regions rather than 2
00:55:04ldleworkyou can get whatever effect you want with binary splits
00:55:12ldleworkif you think for a moment in your head, you'll realize it
00:55:36ftsfyou can
00:55:42ldleworkespecially if you can resize the regions
00:55:54ftsfbut it's not a nice workflow for non 2 way splits
00:56:22ldleworkwell I'll definitely take a look at what you come up with
00:56:33ftsfhave you used i3wm? i think it must work as a non-binary tree for the structure
00:56:55ldleworkI use qtile with my own hand-rolled layout that simulates the original xmonad Tall layout
00:57:53ldleworkhttps://www.youtube.com/watch?v=NE6IQdwjzso
00:58:21ftsfi think the way i3 does it is hsplit and vsplit can have any number of children. but not all are bspnodes perhaps.
00:59:08ldleworkI think you'd have to decide on an orientation for stacks though
00:59:14ldleworkit'd be too much to have the user manage that
00:59:20ldleworkfor example you might say that
00:59:34ldleworkthe children of a vsplit stack their own children horizontally
00:59:47ldleworkand vice versa
00:59:57ftsfit think it defaults based on the aspect ratio of the node
01:00:01ftsfbut you can override it
01:00:21ldleworkso if the ratio changes
01:00:27ldleworkdoes it change the way they are oriented?
01:00:42ftsfno, set at creation time
01:01:05ldleworkthat seems strange
01:01:13ldleworkmaybe you just didn't have the window fullscreened at the time
01:01:21ldleworknow the window you just created is oriented wrong
01:01:38ftsfhmm not sure what you mean
01:01:54ldleworkI use a tiling window manager, so lets say I had nimsynth tiled to the size
01:02:00ldleworkso it was taller than it was skinny
01:02:05ldleworkwhile I looked at some documentation
01:02:08ftsfyep
01:02:08ldleworkand I create a window
01:02:10ldleworkthen full screen it
01:02:32ldleworknow my pane that would be more useful wide than tall is the other way
01:03:08ftsfsorry... lost me.
01:03:14ldleworkno worries
01:03:23ftsfbut i should do some work ;)
01:03:25ftsf2 days left
01:03:34ldleworkftsf: say hello to k-hos in #nimsynth
01:03:42ldleworkthey described waht they want to use nim for
01:03:55ldleworkand I was like oh yeah I know a guy working that exact list of things
01:04:10ftsfcool
01:04:14ldlework(pico port, simulated hardware, pixel drawing, live module loading)
01:13:30ldleworkGeneral question: are simple base classes with empty methods a fine "poor man's" interface?
01:13:41ldleworkIt seems like you can use them for all the same uses.
01:14:03FromGitter<Varriount> ldlework: I think that's for you to judge.
01:14:12ldleworklol what
01:14:35ldleworkI'm quite literally asking if they have objectively consequential differences
01:14:50FromGitter<Varriount> Well, compared to what?
01:15:00ldleworkinterfaces!
01:15:03FromGitter<Varriount> There are multiple ways to make interfaces
01:15:18ldleworkgolang-like or C#-like interfaces
01:15:19FromGitter<Varriount> Look at the streams module - that uses members of procedures
01:15:43ldleworkSure that's what I mean
01:15:43FromGitter<Varriount> There's also the new vtref stuff, though I don't know if that's implemented yet.
01:16:04ldleworkI'm kind of asking, isn't method-dispatch basically the same thing as interfaces?
01:16:21ldleworkOr in other words, if not what really functionally distinguishes them?
01:16:34ldleworkI can cede that it might be a tough question.
01:16:52ldlework(or that I'm deeply confused)
01:17:10FromGitter<Varriount> Well, an interface asserts that an object fulfills some sort of functionality.
01:17:27FromGitter<Varriount> (object in the general, abstract sense)
01:17:30ldleworkah so inheriting a type doesn't enforce that you overrode all its methods
01:17:32ldleworkI see.
01:17:45FromGitter<Varriount> generally, objects can fulfill multiple interfaces (see java)
01:17:53ldleworkThat's pretty much where abstract classes and abstract methods come in right?
01:17:58ldleworkAh right.
01:18:05ldleworkOK getting more clear now
01:18:11FromGitter<Varriount> And fulfilling an interface doesn't necessarily imply inheriting from it.
01:18:26ldleworkMy brain was getting mushy from all the enterprisy .NET stuff I've been reading
01:18:41ldleworkeverything you just observed makes perfect sense
01:18:49ldleworkespecially the ability to implement multiple interfaces
01:20:06ldleworkSo even if you had abstract classes/methods interfaces would still be distinct that way
01:21:25ldleworkI can't yet whether I would really need my types to be valid for multiple interfaces
01:21:42ldleworkSo I'm slightly inclined to say I wish we had such abstract types/methods in Nim
01:22:06ldleworkBut I leave open the possiblity that wanting the same type to work in different situations is probably useful
01:22:19ldleworkAnd that leaves me wishing that interface library was a bit more mature
01:22:37ldleworkAnd this all leaves me worried that one day I might like golang
01:23:10ldleworkThough having -only- interfaces is annoying.
01:24:11FromGitter<Varriount> As far as I'm concerned, abstract classes are a language-specific feature designed to overcome single-inheritance limitations
01:25:17ldleworkI mean didn't we just discover at least one other utility?
01:26:17ldleworkEnsuring that types passed to polymorphic implementations have supplied their own complete implementations of the expected baseclass "interface"
01:26:26ldleworkI think this is called the Template Pattern
01:27:11ldleworkLike abstract classes get you from raising an exception in unimplemented base class method saying "Override me!"
01:27:14ldleworkto compile time errors
01:27:28ldleworkVarriount, agree?
01:27:52FromGitter<Varriount> I guess.
01:28:17FromGitter<Varriount> Sorry, I'm trying to participate in discussion, write code, and cook dinner at the same time.
01:28:30ldleworkheh seems like you're doing fine to me
01:39:10ldleworkAraq: would there ever be hope for abstract methods in Nim?
01:39:23ldleworkSimple compiler mechanism to force sub-types to implement a method of the base one?
01:40:05*brson quit (Quit: leaving)
01:45:03ldleworkah I see the previous discussion :(
01:46:05ldleworkhttps://github.com/nim-lang/Nim/issues/463
01:58:49*chemist69 quit (Ping timeout: 240 seconds)
02:04:31FromGitter<Varriount> ldlework: Araq doesn't have a high opinion of heavy abstractions
02:05:11FromGitter<Varriount> ldlework: I believe abstract classes clould be implemented with concepts and generics though.
02:07:00ldleworkVarriount, that's no good because you can't keep a list of arbitrary types that satisfy a concept
02:07:54ldleworkproc Add[T](self: Foo, obj: T): self.objs.add(obj)
02:07:56ldleworkwill never work
02:08:15ldleworkproc Add(self: Foo, obj: SomeBase): self.objs.add(obj)
02:08:17ldleworkworks fine
02:08:50FromGitter<Varriount> I mean, use a generic procedure to create the non-abstract portions of an abstract class
02:09:14ldleworkdunno what you mean
02:10:32*mwbrown joined #nim
02:11:02ldleworkVarriount, imagine an object that takes a Strategy. this object is implemented in a library
02:11:06ldleworkhow do you implement it with generics?
02:11:28ldleworkOK find `strategy: T`
02:11:34ldleworkbut what about a list of differing strategies?
02:11:56ldleworkOr like a State in a StateMachine
02:13:05*chemist69 joined #nim
02:14:16FromGitter<Varriount> Make strategy a concept?
02:15:06ldleworkthat doesn't help you store a list of them
02:15:36ldlework(you must still be cooking ;)
02:16:19FromGitter<Varriount> Cleaning up, yeah.
02:16:31ldleworkReplying with your toes, etc
02:16:37ldleworkI can see it now
02:16:41FromGitter<Varriount> Well, the vtref feature should help store concepts
02:17:03ldleworkCan you introduce me to this idea? You have mentioned it a few times in the last week but I've ignored it.
02:36:06ldleworknothing in the issues list
02:42:09FromGitter<vegansk> @ldlework, https://github.com/nim-lang/Nim/blob/c11d7c35dd0dbe54cef108988955c48f4e1fab48/doc/manual/generics.txt#L577
02:44:40ldleworkvegansk is this available today
02:46:53ldleworkthe syntax looks a bit funky
02:49:41ldleworkits too bad there is no pragma-macro syntax for tyeps
02:49:43ldleworktypes
02:56:02FromGitter<Varriount> ldlework: There isn't?
02:57:32ldleworkFromGitter: not matching "vtref"
02:57:33FromGitterldlework, I'm a bot, *bleep, bloop*. I relay messages between here and https://gitter.im/nim-lang/Nim
02:58:53ldleworkVarriount is this feature hypothetical?
02:58:59ldleworkIt sounds like exactly what I want
03:02:50FromGitter<Varriount> ldlework: It's in the development version of the manual. Whether it's actually been implemented, I don't know.
03:05:54ldlework"most popular c# ecs" first result is entitas ECS
03:05:59ldleworkI've been reading about it...
03:06:08ldleworkthey have this code generation system
03:06:14ldleworkso that the end API is super clean...
03:06:28ldlework...it seems SUPER FAMILILAR
03:08:52FromGitter<Varriount> ldlework: Familiar to a certain language that we all know and love?
03:10:23ldleworkVarriount, Dadren's ECS literally does this
03:10:37ldleworkyou call aggregate(Entity, [C1, C2, C3...])
03:10:46ldleworkand boom you get all the classes and method and so on
03:11:15FromGitter<Varriount> ldlework: Convergent design, or did they see dadren and like the concepts there?
03:11:22ldleworkI wont lie that I feel a little proud that I converged on a similar approach to the #1 google result
03:11:27ldleworkVarriount, the former I'm sure
03:12:07libmanDid Nim have UFCS before D? Was Nim the first?
03:12:21ldleworkVarriount, Nim is better in that it has macros and you don't need generation
03:12:36FromGitter<Varriount> Nim has had UFCS since the beginning. When did D get them?
03:12:43ldleworkVarriount, however I was wondering, could Nim ever support IDE integration that could complete the results of macro expansion?
03:13:02FromGitter<Varriount> ldlework: You mean, run a macro in the editor and paste the results in?
03:13:20ldleworkVarriount, no I mean get completion and so on for generated types and procs
03:14:15ldleworkthat would make Dadren way more useful
03:14:25ldleworkI should also get Dadren away from using tables
03:15:29ldleworkOh a thing I wonder if Entitas has is JSON support :D
03:17:40ldleworkThey have some really nice features though I can see why its popular
03:20:04ldleworkInteresting their components are immutable. So you have to replace a component in order to change it.
03:20:15ldleworkThis allows them have reactive caching and event propoagation
03:20:17ldleworkVery cool
03:23:00libmanVarriount: Can't quite figure out, but probably 2012 - http://forum.dlang.org/thread/[email protected]
03:27:06libmanNon-specific use of the phrase "uniform function call syntax" appears in a BS paper from 2003 - http://www.stroustrup.com/N1522-concept-criteria.pdf
03:29:34libmanIf Nim invented ideas that got picked up by other languages, we should write about that. Wikipedia would be a great place.
03:32:45libmanConfirmed - http://www.drdobbs.com/cpp/uniform-function-call-syntax/232700394
03:33:15libman^ "New to version 2.059 of D [...]. It's been around in D since the beginning in a nascent form for arrays, but it's now available for all classes and structs. "
03:37:30FromGitter<Varriount> Nim probably didn't invent UFCS, but it has had it since the start
03:37:44FromGitter<Varriount> For everything
03:41:40libmanThat version of Dlang was 2012 (dlang.org/changelog/2.059.html), but the suggestion was around since before 2009 / "the first D conference" (issues.dlang.org/show_bug.cgi?id=3382)...
03:47:54FromGitter<Varriount> Nimwas first started in 2008
04:00:56*chemist69 quit (Ping timeout: 255 seconds)
04:01:18ldleworkIs there a way to run multiple commands with config.nims
04:01:50ldleworklike if I wanted to compile and run several things
04:03:54libmanSurprises keep on coming on both sides. "The first D conference was actually held in 2007!" "Pascal version of Nim started in 2005!" "Walter Bright is a killer robot sent from the future!" ...
04:05:45libman... "This universe is a simulation written in Nim 13.8 billion years ago!" "The operating system running the simulation was written in Dlang 13.801 billion years ago!"
04:08:21ldleworkI wonder if I will ever understand the contents of this module again, https://github.com/dustinlacewell/dadren/blob/master/dadren/meta.nim
04:18:46*devted quit (Quit: Sleeping.)
04:21:14ldleworkFor small data types like points and sizes and rects and vectors and stuff
04:21:23ldleworkIs there any argument for tuples over objects?
04:21:27ldleworkOr vice versa?
04:21:31ldleworkI'm really confused about this choice
04:21:57ldleworkVarriount can you help me think about it
04:23:53*devted joined #nim
04:24:31*devted quit (Client Quit)
04:26:54ldleworkI guess using object types ensures that you never pass a Size as a Point
04:28:00*chemist69 joined #nim
04:32:40ldleworkah cool! https://github.com/oderwat/nim-screeps
04:34:52FromGitter<Varriount> ldlework: Tuples can't be inherited from
04:35:09FromGitter<Varriount> It's much harder to "customize" them
04:35:24ldleworkVarriount but usually you don't need to do that for basic data types like points and rects
04:35:51ldleworkbut I think the fact that they can't be used interchangably is the reason I'll go with objects
04:36:24FromGitter<Varriount> Tuples are good for returning multiple values, and for ad-hoc data structures.
04:37:33ldleworkdang it doesn't seem like nims will allow you to actually run a command multiple times
04:56:12ldlework Error: parallel 'fields' iterator does not work for 'case' objects
04:56:15ldleworkwhatever that means
04:59:45*gangstacat quit (Ping timeout: 252 seconds)
05:14:51*gangstacat joined #nim
05:19:08*shashlick quit (Ping timeout: 240 seconds)
05:20:24*shashlick joined #nim
05:33:43*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
05:36:41ldleworkhmm Error: request to generate code for .compileTime proc: newIdentifier
05:57:59ldleworkhow do you unit test macros
05:58:12ldleworkI guess call them and then test the result
06:00:56*enthus1a1t joined #nim
06:04:06*enthus1ast quit (Ping timeout: 260 seconds)
06:08:15ldleworkHmm I can't seem to unittest compile-time procs
06:08:23ldleworkAraq: halp
06:10:28ldleworkVarriount any idea?
06:20:37*Vladar joined #nim
06:27:49*yglukhov joined #nim
06:33:57*rokups joined #nim
06:35:17*nsf joined #nim
06:36:34*yglukhov quit (Remote host closed the connection)
06:47:18*bozaloshtsh quit (Ping timeout: 260 seconds)
06:56:15*dexterk_ENKCJ joined #nim
06:56:15*dexterk quit (Disconnected by services)
06:56:16*dexterk_ENKCJ is now known as dexterk
07:12:55ldleworkI just thought of something that would be pretty useful; some form of template that actually returned AST
07:33:05FromGitter<gour> @dom96 morning. any news when your book might be printed?
07:38:51*gokr joined #nim
07:44:35FromGitter<dom96> @gour hopefully by the end of the month, but I can't guarantee that :)
07:45:16FromGitter<dom96> It's mostly in Manning's hands so it's really up to them.
07:46:21*yglukhov joined #nim
07:46:21*yglukhov quit (Remote host closed the connection)
07:46:36*yglukhov joined #nim
07:51:05*libman quit (Quit: Connection closed for inactivity)
07:55:09*couven92 joined #nim
08:07:40FromGitter<gour> @dom96 ok. thank you
08:11:26*ftsf quit (Quit: :q!)
08:16:23*willprice joined #nim
08:21:42ldleworkzachcarter: you around?
08:28:45*couven92 quit (Read error: Connection reset by peer)
08:29:07*couven92 joined #nim
08:30:24FromGitter<gour> btw, is there any ETA for Nim's 1.0 release?
08:36:00FromGitter<Varriount> @gour No
08:36:46*couven92 quit (Ping timeout: 268 seconds)
08:50:48ldleworkVarriount, I've decided to "port" Entitas to Nim
08:52:46FromGitter<Varriount> ldlework: Neat!
08:54:03ldleworkIts a very interesting system
08:54:51*bjz joined #nim
08:54:54ldleworkI also convinced the lady-friend to let me afford Dependency Injection in .NET
08:58:59*couven92 joined #nim
09:10:34*couven92 quit (Ping timeout: 245 seconds)
09:17:30*Arrrr joined #nim
09:17:30*Arrrr quit (Changing host)
09:17:30*Arrrr joined #nim
09:31:56*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
09:34:40*bjz joined #nim
09:34:51*couven92 joined #nim
09:39:33FromGitter<Varriount> :3
09:48:19*couven92 quit (Quit: Bye)
09:52:34ldleworkVarriount, do you bite your thumb at me, sir?
09:54:18*Sembei joined #nim
10:35:15*zahary quit (Quit: Connection closed for inactivity)
10:39:29zachcarterIdlework: sorry am now
10:53:39FromGitter<Varriount> ldlework: I'd much rather but a book describing internals of an operating system or machine
10:55:32*Tiberium joined #nim
10:55:33zachcarterVarriount: how about this weather :P
10:55:38zachcartermakes going into the office difficult
10:56:19FromGitter<Varriount> Hm? It's foggy here
10:56:37zachcarteroh I just meant how it’s so nice in the day time
10:56:46zachcarterat least it was yesterday
10:57:01FromGitter<Varriount> Ah, yes.
10:57:11FromGitter<Varriount> My dogs keep sunbathing outside
10:57:19zachcarterI take mine to doggy day care :P
10:57:58zachcarterI’m sure if he’s allowed to sunbathe outside there he’s doing it too haha
10:58:08zachcarterwhat kind of dogs?
10:58:37FromGitter<Varriount> Small, furry ones. Havenese
10:58:58FromGitter<Varriount> Very affectionate, but not all that bright
10:59:34zachcarterhad to google, I recognize the breed though, cute
11:00:34zachcarterI made a lot of progress on my ship map generator
11:01:05FromGitter<Varriount> ?
11:01:05zachcarterbut I’m trying to optimize a section of code atm that was taking 12 seconds to run on a 512x512 map
11:01:24zachcarternot having much success
11:02:21*Snircle joined #nim
11:02:53*arnetheduck joined #nim
11:04:59zachcarterVarriount: what’s the ? for?
11:05:06zachcarterI told you about the map generator previously didn’t I?
11:06:17Arrrrwhy does it take so much time to run? what is it doing?
11:06:36zachcarterI think I can substitute it with a BFS
11:06:45zachcarterit was trimming non contiguous regions of my map
11:07:14zachcarterit was iterating over all 256k cells
11:07:38ArrrrI see, why does it need to do that?
11:07:39zachcarterand each iteration then looping over 2^18 cells
11:07:50zachcarterbasically it moves through the map
11:08:04zachcarterand checks each cells neighbors to see if they have a certain type of tile occupying the cell
11:08:19zachcarterhere I have a gist of the code
11:08:35zachcarterhttps://gist.github.com/zacharycarter/9660046cfc250abf589d2647ec00c91b#file-trim_non_contiguous-nim-L7-L20
11:08:37zachcarterthis is the inefficient part
11:08:45zachcarterwhich I think I can replace with a BFS implementation
11:09:07zachcarterI mean it just looks inefficient lol - a while loop with a 2d for loop inside
11:10:28ArrrrBut what's the point, what is 'part of ship' doing?
11:11:01zachcarterso part of ship is an array of bools
11:11:11zachcarterbasically saying - yes this tile is a part of the ship or no it’s not
11:11:21zachcarterisPartOfShip does 2 things
11:11:33zachcarter1) it checks to make sure the x, y value is actually in the range of th emap
11:12:08zachcartersince I’m iterating over the map, and checking x + 1 and y + 1 etc, I will eventually encounter border cells and extend beyond the bounds of the map
11:12:28zachcarter2) It checks the partOfShip array to see if the cell has already been marked as being part of the ship or not
11:12:52zachcarterthe point of the function is to fill out the partOfShip array with tiles that are marked as ShipInternals
11:13:05zachcarterany other tile should be set to false in the partOfShip array
11:13:22zachcarterI hope that makes sense
11:13:30ArrrrSo, if i understand correctly, it is a way to check which tiles in the ship overlaps with map tiles
11:13:45zachcarterkind of the map is essentially a procedurally generated ship
11:13:49zachcarterfloating in space
11:13:53zachcarterspace ship*
11:14:01ArrrrAh, like FTL
11:14:07zachcartersort of
11:14:18zachcarterbut yeah think of FTL’s in game screen with the ship view
11:14:48zachcarterso when I’m procedurally generating the map I’m just trying to determine what cells on the map are ship cells and which aren't
11:15:09zachcarterI initialize the array isPartOfShip all to false, so everything is considered non-part of ship to start
11:15:14zachcarterthis function rectifies that
11:15:29SentreenIs there are any particular reason that the nim website is a part of the `nim` repo, instead of being a standalone repo under `nim-lang`?
11:15:57zachcarterSentreen: The nim website is in the processing of being rewritten, I believe the new website is a standalone repo
11:17:02zachcarteras to the existing one - I have no idea
11:17:03*couven92 joined #nim
11:17:21zachcarterArrrr: I’ve built this in Java previously
11:17:25zachcarterif you’d like to see the results :
11:17:39ArrrrAh ok, show us
11:17:59zachcarterhttps://pbs.twimg.com/media/CwypuCgWgAAhHsk.png
11:18:13zachcarterI also generate lock and key puzzles
11:18:15zachcarterfor the maps
11:19:00zachcarterhttps://pbs.twimg.com/media/ChfPq0PWkAIFFbq.png
11:19:16zachcartersecond one was a very early SS
11:19:34zachcarterhttps://pbs.twimg.com/media/CyEKGR5VQAI1hcM.png
11:21:10ArrrrThat's interesting, and how do you determine which cells are part or not of the ship?
11:21:18*Tiberium quit (Remote host closed the connection)
11:21:33*Tiberium joined #nim
11:21:53zachcarterwell to start all the cells are turned off - so non ship
11:22:11zachcarterI start by generating what I refer to as a ship blueprint and I do this with cellular automata
11:22:32zachcarterthat produces an image like : https://camo.githubusercontent.com/9b3d61b7553eb3f746e0f63976a2cce89fb6c2e1/687474703a2f2f692e696d6775722e636f6d2f34513370596c782e706e67
11:22:52zachcarteror something similar, depending on the seed used
11:23:08zachcarterthe point is it represents the shape of a (very organic) looking spaceship
11:23:38zachcarterI can then sample the pixels of this image and figure out where the border of the ship is
11:24:46zachcarterIE anything black represents space, anything white is part of the ships border
11:24:58ArrrrI see, so you have to mark the cells that belongs to the ship but you only know the border
11:25:04zachcarterthen it is just a matter of trimming the non contiguous regions
11:25:11zachcarterpretty much
11:25:52ArrrrI would do this: For each row, if i encounter a white border, fill the rest with white until i find again a white border, and so on
11:26:03ArrrrThen just iterate throught the image and set the map
11:29:07zachcarteryeah I’m trying to figure out why my current code is more complex than that because that would be the logical / naive way to do it I think
11:29:13zachcarterthere must be some other complication I’m not explaining
11:29:42zachcarterI haven’t looked at this code since November though and my memory isn’t the greatest
11:31:58Arrrrlots of mispredictions
11:32:40zachcarterit’s definitely complex code
11:32:46zachcarterin terms of what it’s doing
11:33:08Arrrrhow does it take with -d:release?
11:33:13Arrrr*how much
11:33:17zachcartergood question
11:34:24zachcarterhrm with -d:release it fails to run / compile not sure why
11:35:43ArrrrSometimes it is because some code runs inside `assert` which is not even compiled in release
11:36:39zachcarterthat may be it
11:49:44zachcarterhttp://imgur.com/a/OVg0s
11:49:53zachcarteranything smaller than that is significantly faster
11:50:17zachcarterbut at least it’s working ish :P
11:50:19Tiberiumzachcarter, try with lto :D
11:50:35TiberiumI doubt it can help, but ~maybe~ some speed
11:50:43zachcarterTiberium: there’s a horrible inefficiency in my code atm
11:50:45zachcarterI need to address
11:51:02Tiberiumthere was a nim-benchmark library somewhere
11:51:10zachcarterroom layout looks good
11:51:59zachcarterTiberium the one proc I’m referring to with the bad code in it took 16s to execute alone :P
11:52:00Tiberiumzachcarter, https://github.com/ivankoster/nimbench this can help you maybe
11:52:06Tiberiumzachcarter, ah :)
11:52:27zachcarterit’s a while loop with a nested for loop in it for iterating over a 2d array
11:52:34zachcarterwith a 512x512 map it crawls
11:54:37zachcarteroh btw, I’m building a rougelike library so if anyone has any requests for map generators / algos / data structures let me know
11:54:41zachcarterand I will implement them
11:55:06zachcarterat the very least I’ll be doing spaceship map gen and world map gen
11:55:19zachcarterbut I doubt there’s much of a clamor for the spaceship map gen :P
12:08:03*krux02 joined #nim
12:27:33*chemist69 quit (Ping timeout: 255 seconds)
12:30:13*chemist69 joined #nim
12:45:28demi-dom96: are there any long-term plans for how to handle the nimble package index?
12:48:36*zachcarter quit (Quit: zachcarter)
12:56:24Tiberiumhonestly I would like some official Nimble website like npmjs/pypi/crates.io
12:58:19FromGitter<Varriount> Is there a ".le" site suffix?
12:59:50Tiberiumno it seems
12:59:51euantorTiberium: That is coming. See https://nimble.directory/
13:00:00*yglukhov quit (Read error: Connection reset by peer)
13:00:00euantorIt's a work in progress from federico3
13:00:17euantorhttps://github.com/FedericoCeratto/nim-package-directory
13:00:25Tiberiumalso nimble.com is taken
13:00:34*yglukhov joined #nim
13:01:01euantorEventually the plan is that packages won't be stored in a large JSON file, but instead in a database accessed via a web service (though the lsit will be locally cached as a JSON file like it is now)
13:01:07FromGitter<Varriount> zachcarter: I mentioned this before, so you may have read it already, but a dungeon that's on a ship should have things like engine rooms, medical bays, crew quarters, etc.
13:01:50FromGitter<Varriount> Engines would be near the back of the ship, control rooms in the center, crew quarters to the sides, etc
13:02:06Tiberiumnimble.cc :D
13:02:21federico3Tiberium: feel free to ping me if you have questions or feature requests
13:06:11demi-euantor: is there any reason to keep it as json, that doesn't seem like it will scale very well
13:09:59gokrWell, given the size of the current json file - some quick math seems to indicate that it will be around 3Mb when we hit 10000 packages. I wouldn't worry just yet :)
13:10:11euantorNone really, except readability. The web API will handle searching for packages and such. The local cache would be used should the package directory be offline
13:11:03*Tiberium quit (Remote host closed the connection)
13:11:41*dmi0 joined #nim
13:15:46krux02euantor: do package installations from github repositories still work, when the package directory is offline?
13:16:36demi-krux02: i don't see why they wouldn't if you have the repo path cached locally
13:16:42*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
13:16:58*zachcarter joined #nim
13:17:27krux02ok that's fair
13:17:59krux02and by the way, I would not worry to search through a 3Mb file of json
13:18:23demi-locally, no, but server-side i would
13:18:28krux02as long as the json is not deserialized when parsed, it can be processed very quickly
13:19:08krux02well I would go with the requirement
13:19:21krux02I don't see a massive boom of popularity all of a sudden with Nim
13:19:39krux02programming languages don't haved this explosive popularity
13:19:46krux02so when needed, keep improving
13:20:05krux02and keep things nice for a small community
13:22:17krux02Araq: how do I not break compiler bootstrapping, when I add magics to the compiler?
13:28:53euantorAnd yes, installations from GiHub would still work
13:29:27euantorNimble would only hit the API to find out what packages are available and where to get them from. It would still contact GitHub/Bitbucket/whatever to do the actual download
13:30:06euantor(ideally I'd like to see it support other types of version control like mercurial too, but that's up to dom96 since he'll likely write the code to handle msot of this :P)
13:31:31demi-that shouldn't be too difficult if we aren't using git specific code
13:33:12euantorIf I remember correctly it currently shells out to the git exe
13:35:02demi-well i would expect it to do that regardless the vcs
13:35:25euantorYeah, that's what makes it easy to handle other Git providers and other VCS
13:42:26*yglukhov quit (Remote host closed the connection)
13:44:11demi-ca
13:45:59*gokr quit (Quit: Leaving.)
13:50:01*yglukhov joined #nim
13:50:33krux02I am writing on the compiler and I have the error message: expression '8' has no type (or is ambiguous)
13:50:40*yglukhov quit (Read error: Connection reset by peer)
13:51:10*yglukhov joined #nim
13:52:13krux02in proc magicsAfterOverloadResolution I addad created a handling of mSizeOf
13:53:32krux02I returned my result in form of an integer literal: result = newIntNode(nkIntLit, n.typ.getSize)
13:53:50krux02but that is how I get the error message.
14:01:09*dmi0 quit (Ping timeout: 255 seconds)
14:02:06*couven92 quit (Quit: Disconnecting)
14:02:32*couven92 joined #nim
14:26:02*rauss joined #nim
14:29:47*devted joined #nim
14:41:04*Snircle joined #nim
14:42:20krux02well, implementing a magic seems harder than I thought
14:46:19*libman joined #nim
14:47:51zachcartersweet! got my bfs working
14:47:59zachcarter12 seconds to 0.5556449999999999
14:48:00zachcarter:P
14:56:55Araqkrux02: [Warning] unkown magic 'foo' might crash the compiler
14:57:07Araqin other words, it just works (tm)
15:00:43krux02Araq: I have a new question, I just posted all information on the forum: https://forum.nim-lang.org/t/2905/1#18245
15:01:54krux02zachcarter: bfs?
15:01:58Araq result = newIntNode(nkIntLit, align)
15:01:58Araq result.info = n.info
15:02:10zachcarterbreadth first search
15:02:13Araqresult.typ = n.typ
15:02:19Araq^ that's missing from your code
15:02:32Araqapart from that it seems perfectly fine
15:02:35krux02ok
15:02:38krux02thanks
15:03:40Araqyou can also do defineSymbol "nimhasalignof"
15:03:46Araqwhen defined(nimhasalignof):
15:03:55Araq proc alignOf ... # in system.nim
15:04:10Araqand then no warnings are produced in the bootstrapping process
15:04:27Araqcondsyms.nim is full of these already ;-)
15:04:45Araqif you know why it works this way, you have understood bootstrapping.
15:05:00krux02Araq: thanks a lot, now it works as I expected
15:05:51krux02where should i put the defineSymbol?
15:06:31krux02well I know why I should use it, because I already once broke boottrapping
15:07:12Araqcondsyms.nim?
15:07:29Araqor whereever the other nim* symbols are defined
15:08:45*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
15:11:16krux02well I think at one point, when the bootstrapping C code knows the symbols, those when defined branches can be removed.
15:11:32krux02But thank you, I now put the when defined in system.nim
15:20:04AraqI wouldn't have done it :-)
15:20:30Araqshould work without and the code is less messy, but I will accept either way
15:21:43AraqConversion error: Jekyll::Converters::Scss encountered an error while converting 'jekyll_prototype/assets/css/main.scss':
15:21:43Araq File to import not found or unreadable: variables. on line 1
15:21:43Araqjekyll 3.4.3 | Error: File to import not found or unreadable: variables. on line 1
15:23:41euantoris that for the new website?
15:24:19Araqyup
15:24:23Araqcannot build it
15:24:39Araqeven though I'm on Ruby's chosen OS (TM)
15:25:26euantorI don't even know how Jekyll works out the path to look for variables.scss
15:25:55euantor_variables.scss is at ../../_sass/_variables.scss but I can't see anywhere where it configures that path
15:27:13*Matthias247 joined #nim
15:31:31euantorAh, looks like that's pre-defined in Jekyll, seems strange
15:36:54FromGitter<Bennyelg> No 'nim' binary could be found in PATH:
15:37:03FromGitter<Bennyelg> any help with VS code configuration ?
15:37:17Araqhave a nim binary in PATH?
15:38:06FromGitter<Varriount> @Bennyelg Do you know what the PATH variable is?
15:38:29FromGitter<Bennyelg> My bad I Had /usr/local/bin/nim :D instead of /usr/local/bin
15:39:18FromGitter<Bennyelg> nah still not working :/
15:39:30euantorI forgot how much of a pain Ruby is
15:39:48euantorJust did a fresh install on my Windows machine, and their package manager didn't work out of the box
15:39:51FromGitter<Varriount> Every language has its pain points
15:39:55euantorTurns out I have to follow this: http://guides.rubygems.org/ssl-certificate-update/#installing-using-update-packages
15:40:17*Trustable joined #nim
15:41:18*brson joined #nim
15:42:47*bjz joined #nim
15:46:10*willprice quit (Remote host closed the connection)
15:47:09Araqbennyelg: you need to restart vs code so that it gets the environment changes
15:47:39FromGitter<Bennyelg> I did, But it not changed the PATH :D
15:47:56euantorAraq: When building the jekyll site, are you in the `jekyll_prototype` directory?
15:48:22euantorI got the same error if I did it from the `website/` root but running `jekyll serve` from `website/jekyll_prototype` works
15:49:25Araqah ok, thanks
15:49:59FromGitter<Bennyelg> Anyone can managed to GO- TO DIFINITION with ATOM or vs code?~
15:50:01libmanSpeaking of Ruby, WTF is up with https://github.com/nim-lang/website
15:50:01FromGitter<Bennyelg> :(
15:50:54libmanWhen I saw that, I abandoned my download section revamp draft (for binary packages).
15:51:06demi-dom96: i'm seeing a new problem as of the last couple of days, my jester instance seems to die unexpectedly and i don't think it is from memory usage?
15:52:19euantorlibman: What do you mean "WTF is up" with it?
15:52:44libmanWhy we no eat our own dogfood?
15:53:33FromGitter<Bennyelg> Anyonee?
15:54:19euantorBecause using an existing tool in this case is much much faster
15:54:36libmanBennyelg: F12 in vscode?
15:55:04euantorUsing your own tools makes sense, but reinventing the weel because of NIH syndrome is a waste of effort
15:55:22libmanbah, humbug. I'm not touching that Ruby foo. It would give me cooties.
15:55:53libmanNIH syndrome is how we get good coherent design without dependency bloat.
15:56:41euantorIt's also how we waste time when people are already busy as is
16:01:41dom96demi-: stack trace?
16:02:35demi-don't have one, else i'd be debugging that
16:02:55demi-i switched back to regular GC, because it was a bit better over a longer period of time
16:03:51*gokr joined #nim
16:06:06FromGitter<Bennyelg> Any site for exercise coding nim?
16:06:13FromGitter<TiberiumPY> sadly no :(
16:07:29FromGitter<TiberiumPY> https://www.codingame.com/start ⏎ they emailed to dom96, he answered, and they haven't answered back
16:08:06FromGitter<TiberiumPY> and probably they will use release compiler, not devel one
16:08:07FromGitter<Bennyelg> :/
16:09:40dom96yeah, maybe I should email them again
16:11:12dom96done
16:11:53FromGitter<Bennyelg> could not get nimSuggest in path?
16:12:43*vivus joined #nim
16:13:07FromGitter<TiberiumPY> you know you can win any programming olympiad (even if it has very serious time/memory limits for running code) using Nim
16:13:21FromGitter<TiberiumPY> but you can't choose Nim :(
16:13:34*zachcarter quit (Quit: zachcarter)
16:14:46*zachcarter joined #nim
16:16:04zachcarterhttp://www.exercism.io/languages/nim/launch
16:16:17zachcarterFYI!
16:16:38FromGitter<TiberiumPY> https://github.com/exercism/xnim/issues/13
16:17:33dom96yeah, that would be nice.
16:17:49dom96Please help out with this if you've got time :)
16:17:50FromGitter<TiberiumPY> wow!!!
16:17:52FromGitter<TiberiumPY> someone is doing work
16:17:53FromGitter<TiberiumPY> https://github.com/Codewars/codewars-runner-cli/pull/330
16:18:41dom96cool
16:18:48krux02Now when I try to call offsetOf(MyType, member) the nim compiler complains about member to be unknown, even though in the types system I declared the second argument as ``untyped``
16:19:46krux02dom96: maybe you know it, I implement a procedure in the compiler
16:20:02krux02I have done the magics and the function is now called in the compiler
16:20:08*Sembei quit (Ping timeout: 240 seconds)
16:20:12*nsf quit (Quit: WeeChat 1.7)
16:20:16dom96procedure's can't use 'untyped'
16:21:18krux02well when I declare it as a macro, then the compiler complains like this: #debug typ
16:21:28krux02Error: system module needs 'PNimrodNode'
16:21:57dom96how is sizeof defined?
16:22:19zachcarterso weird just had a photographer taking a bunch of pictures at me at work
16:22:29dom96Although I guess offsetof is more complicated
16:22:39krux02well sizeof is not a problem, because it only has one argument, and that can easily be typechecked
16:23:03dom96Why does it need to be implemented in the compiler? I recall a simple implementation as a template
16:23:04krux02the problem is thet the typechecker can impossibly know about the member
16:23:37krux02Well Araq explicitly suggested, that I should implement this in the compiler
16:24:30krux02https://github.com/nim-lang/Nim/issues/5493
16:28:24krux02sorry I have to leave
16:28:28*krux02 quit (Remote host closed the connection)
16:29:16FromGitter<Bennyelg> how to run nim tests?
16:29:17*chemist69 quit (Ping timeout: 255 seconds)
16:29:23*Trustable quit (Remote host closed the connection)
16:32:22*cspar joined #nim
16:33:55*chemist69 joined #nim
16:36:39FromGitter<TiberiumPY> you're calling some proc
16:36:42FromGitter<TiberiumPY> it returns a string
16:36:49FromGitter<TiberiumPY> if you don't need it, do "discard foo()"
16:37:01FromGitter<Bennyelg> I need this string
16:37:08FromGitter<Bennyelg> I know it's returning string
16:37:10FromGitter<TiberiumPY> let data = foo()
16:37:31FromGitter<Bennyelg> Oh i got the idea, thanks
16:40:14FromGitter<Bennyelg> proc helloworld(name: string): string = ⏎ if name != "": ⏎ ⏎ ```return "Hello,", name, "!"``` ⏎ ... [https://gitter.im/nim-lang/Nim?at=58ed06f0a0e4856242f43d4b]
16:40:32FromGitter<Bennyelg> invalid indentition
16:40:38FromGitter<TiberiumPY> two retunrs?
16:40:42FromGitter<TiberiumPY> ah
16:40:46FromGitter<Bennyelg> no
16:40:48FromGitter<Bennyelg> its 1
16:41:03FromGitter<TiberiumPY> yep, my gitter client doesn't show indentation, will check it in browser
16:41:41FromGitter<TiberiumPY> wait
16:41:54FromGitter<TiberiumPY> you actually have no indentation in your code
16:42:00FromGitter<TiberiumPY> or you've pasted in like that?
16:42:03FromGitter<Bennyelg> I do have :/
16:42:06FromGitter<TiberiumPY> use ```
16:42:30FromGitter<TiberiumPY> `````` [https://gitter.im/nim-lang/Nim?at=58ed077968bee3091f313d27]
16:42:36FromGitter<TiberiumPY> ```this code ⏎ can be ⏎ indented``` [https://gitter.im/nim-lang/Nim?at=58ed077ebdf4acc1124ca0ad]
16:42:50FromGitter<TiberiumPY> simple markdown
16:43:04FromGitter<TiberiumPY> ah, maybe you use tabs?
16:43:38FromGitter<Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=58ed07bcf22385553d2f1ed0]
16:44:50FromGitter<TiberiumPY> well, you can't concat strings like that
16:45:01FromGitter<TiberiumPY> (you can only for echo)
16:45:14FromGitter<Bennyelg> so How I can concate strings ?
16:45:21FromGitter<TiberiumPY> using &
16:45:22FromGitter<Bennyelg> like name + name2 + name3
16:45:31FromGitter<TiberiumPY> return "Hello, " & name & "!"
16:45:38FromGitter<Bennyelg> fantastic thanks.
16:47:03FromGitter<Bennyelg> great now if the compile version is in my path I can import it from another file?
16:47:24FromGitter<TiberiumPY> what?
16:47:26mwbrownMan that looks weird when everything is coming from the gitter bridge
16:47:39FromGitter<TiberiumPY> yeah :( code snippets are
16:47:56FromGitter<Bennyelg> I just created new file
16:48:00FromGitter<Bennyelg> and import helloworld
16:48:05FromGitter<Bennyelg> but I can reach it :|
16:48:09FromGitter<TiberiumPY> ah, you can, but you need to export your proc
16:48:17FromGitter<TiberiumPY> proc helloworld*(something): something =
16:48:26FromGitter<Bennyelg> thanks
16:48:55FromGitter<TiberiumPY> and you don't need to write "helloworld.helloworld" in another file
16:48:59FromGitter<TiberiumPY> just "helloworld()"
16:49:04FromGitter<TiberiumPY> well, you can do it
16:50:01FromGitter<TiberiumPY> yeah, it's hard to start for a few days (there's no as many articles as for python, for example)
16:50:05FromGitter<TiberiumPY> but after that it's easier
16:53:32FromGitter<Bennyelg> Great, thanks. I am just following the http://exercism.io/exercises/nim/
16:53:39FromGitter<Bennyelg> nice Idea for practice
16:54:00FromGitter<TiberiumPY> ehm
16:54:04FromGitter<TiberiumPY> it shows 404 for me
16:54:15FromGitter<Bennyelg> http://exercism.io/
16:55:16FromGitter<TiberiumPY> maybe you're following http://exercism.io/languages/nim/launch ?
16:55:29FromGitter<TiberiumPY> it really shows http://exercism.io/exercises/nim/ 404 for me
16:55:48FromGitter<TiberiumPY> ah
16:55:52FromGitter<TiberiumPY> I undestand now
16:56:14FromGitter<TiberiumPY> go to http://exercism.io/languages/nim/launch, and then choose "Available Exercises" on left
16:59:24*zachcarter quit (Quit: zachcarter)
17:00:23*zachcarter joined #nim
17:04:06*gokr quit (Ping timeout: 252 seconds)
17:15:45*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
17:18:08*brson quit (Ping timeout: 240 seconds)
17:28:27*brson joined #nim
17:32:10FromGitter<Bennyelg> Any nim repl ?
17:32:17FromGitter<Bennyelg> to test on the fly?
17:33:07dom96There is but it's very unstable, best thing to do is have a temporary file that you recompile and run to test things
17:41:25ArrrrThis is what you use for testing https://glot.io/new/nim
17:41:33*yglukhov quit (Remote host closed the connection)
17:41:43ArrrrHowever it is using 0.14
17:43:13*krux02 joined #nim
17:44:06*kafke joined #nim
17:45:38*zachcarter quit (Ping timeout: 240 seconds)
17:45:38*gokr joined #nim
17:47:08arnetheduckdoes anyone understand the test failure in https://ci.appveyor.com/project/Araq/nim/build/748? I changed some code which is clearly not windows-related at all, and yet a windows test fails in an odd way
17:48:31*bozaloshtsh joined #nim
17:48:32*bozaloshtsh quit (Changing host)
17:48:32*bozaloshtsh joined #nim
17:51:30FromGitter<Bennyelg> isUpperAscii(message) not working
17:53:54*gokr quit (Ping timeout: 240 seconds)
17:55:12*gangstacat quit (Quit: Ĝis!)
18:01:50FromGitter<TiberiumPY> it does
18:01:55FromGitter<TiberiumPY> it doesn't work for unicode messages
18:02:06FromGitter<Bennyelg> well I dont see it working :/ for example
18:02:12FromGitter<Bennyelg> "HELLO" return false
18:03:30FromGitter<TiberiumPY> Arrrr: ideone uses 0.16.0
18:05:44FromGitter<Bennyelg> I use 0.16.0
18:05:51FromGitter<TiberiumPY> ah
18:05:52FromGitter<Bennyelg> never mind I wrote a proc
18:05:54FromGitter<TiberiumPY> always use latest
18:06:05FromGitter<Bennyelg> its not the latest?
18:06:08FromGitter<TiberiumPY> no
18:06:11FromGitter<TiberiumPY> latest is from git :)
18:06:17FromGitter<Bennyelg> lol :)
18:06:24FromGitter<TiberiumPY> because there are a lot of fixes going
18:07:01FromGitter<TiberiumPY> https://nim-lang.org/news/e029_version_0_16_0.html ⏎ almost four months old
18:07:10dom96Bennyelg: works for me (on devel though)
18:08:07FromGitter<TiberiumPY> yeah, because tests will fail otherwise
18:12:56FromGitter<Bennyelg> trim string on NIM?
18:15:23FromGitter<TiberiumPY> strip you mean?
18:16:07FromGitter<Bennyelg> yea
18:17:27FromGitter<TiberiumPY> then use strip
18:17:30FromGitter<TiberiumPY> :D
18:17:45FromGitter<TiberiumPY> it's in strutils too
18:17:56FromGitter<Bennyelg> Thanks.
18:18:06FromGitter<TiberiumPY> you can use it like that: ⏎ let result = " asd ".strip() ⏎ or ⏎ let result = strip(" asd ") [https://gitter.im/nim-lang/Nim?at=58ed1de0bdf4acc1124d1b8a]
18:18:13FromGitter<TiberiumPY> you can use any proc like that
18:18:20FromGitter<TiberiumPY> UFCS
18:22:47*yglukhov joined #nim
18:26:24*kafke quit (Read error: Connection reset by peer)
18:26:49*yglukhov quit (Ping timeout: 245 seconds)
18:29:02*kafke joined #nim
18:32:15ArrrrNice, last time i cheked ideone was using a really old build
18:38:01*kafke quit (Ping timeout: 268 seconds)
18:38:04*chemist69 quit (Ping timeout: 245 seconds)
18:42:43*chemist69 joined #nim
18:44:36*yglukhov joined #nim
18:44:58*gangstacat joined #nim
18:45:44*gangstacat quit (Client Quit)
18:46:44*kafke joined #nim
18:51:10*kafke quit (Ping timeout: 240 seconds)
18:52:05*vivus quit (Quit: Leaving)
18:52:08*gangstacat joined #nim
18:57:22dom96I wish someone would write an ideone/glot.io for Nim ... in Nim :)
18:57:23*kafke joined #nim
19:02:26FromGitter<Varriount> dom96: Using Jester?
19:02:38dom96sure?
19:02:39*kafke quit (Ping timeout: 245 seconds)
19:06:54ldleworkHello
19:07:45*Vladar quit (Quit: Leaving)
19:10:26FromGitter<TiberiumPY> the main thing - technology for containers
19:10:55FromGitter<TiberiumPY> you wouldn't execute any code on your server, because it can be malicious
19:11:23FromGitter<TiberiumPY> or you can make this website invite-only, or with manual moderator check
19:14:27*krux02 quit (Remote host closed the connection)
19:14:42*krux02 joined #nim
19:20:40dom96Use playpen
19:20:43dom96everyone's using it
19:21:18dom96I'll even give you access to a shiny Nim server to host it on :)
19:22:14*Sembei joined #nim
19:25:20ldleworkDocker would probably be enough
19:25:29ldleworkIf the server gets pwned you just churn it
19:25:40ldleworkYou can even use ASG to just cycle the server every day
19:26:30*brson quit (Ping timeout: 255 seconds)
19:27:38*brson joined #nim
19:29:28dom96yeah, i'd rather not
19:30:35Xewebassembly backend when?
19:30:58krux02Xe, as soon as you wrote it :P
19:31:00ldleworkdom96: yeah you'd rather not what?
19:31:18dom96Xe: already here via gcc/llvm
19:31:22krux02last time I tried to do webassembly, it had too much friction for my preference
19:31:24dom96ldlework: use docker for this
19:31:28ldleworkdom96: ...why?
19:31:46*Sembei quit (Quit: WeeChat 1.8-dev)
19:31:50dom96because I don't want to churn my server
19:32:10Xedom96: would you be okay if the server was churned for you?
19:32:19ldleworkyeah that's what I was implying
19:32:30*arnetheduck quit (Ping timeout: 240 seconds)
19:32:39krux02I tried of official tutorial for a hello world, and it did not work
19:33:00dom96*shrug* playpen was designed for this
19:33:08FromGitter<TiberiumPY> playpen?
19:33:54ldleworkIt looks like Playpen uses namespaces, cgroups and seccomp
19:33:58FromGitter<TiberiumPY> ah I see now
19:33:58FromGitter<TiberiumPY> https://github.com/thestinger/playpen
19:33:58ldleworkHuh, just like Docker.
19:34:30FromGitter<TiberiumPY> bbbut
19:34:34FromGitter<TiberiumPY> last update was 2 years ago
19:34:44FromGitter<TiberiumPY> 1) 5 years ago :)
19:34:51ldleworkIt looks like it relies on exactly the same kernel services as Docker does, but yeah I'm sure playpen is a lot easier to use compared to docker (not)
19:35:19ldleworkNot everything the Rust people do is the ideal case.
19:35:35*Nobabs27 joined #nim
19:36:44dom96why would the server get pwnd under docker?
19:37:07*Arrrr quit (Quit: Leaving.)
19:37:08ldleworkSame reason anything can get pwned?
19:37:12FromGitter<TiberiumPY> yeah, I'm wondering too
19:37:18ldleworkBecause there's no such thing as real security, even for virtualization.
19:37:28ldleworkOnly costs to the attacker.
19:38:00FromGitter<TiberiumPY> yeah, you wouldn't want to hack an online coding game if you've found a 0day exploit
19:38:01ldleworkLooks like Playpen and Docker are on even ground. Docker might even be better at this point. It has lots of seccomp support and has everything listed on the Playpen README for sure.
19:38:16FromGitter<TiberiumPY> and it's updated a lot
19:38:37ldleworkAnd obviously easier to deploy especially in a multi-user spin-me-up-an-environment scenario
19:40:22ldleworkThough Docker does not have the little feature where you can turn on and off specific syscalls from the commandline
19:40:26ldleworkWhich is admittedly pretty cool
19:40:32ldleworkBut all that's doing is automating seccomp profiles
19:41:04FromGitter<TiberiumPY> or, for example
19:41:07FromGitter<TiberiumPY> codewars uses docker
19:41:08FromGitter<TiberiumPY> https://github.com/Codewars/codewars-runner-cli
19:41:50*gangstacat quit (Quit: Ĝis!)
19:42:15*rokups quit (Quit: Connection closed for inactivity)
19:44:13*gokr joined #nim
19:46:24*gangstacat joined #nim
19:48:13dom96ldlework: maybe you'd be willing to write the online Nim compiler? :)
19:48:55*nsf joined #nim
19:51:20*kafke joined #nim
19:55:14*yglukhov quit (Remote host closed the connection)
19:55:50*yglukhov joined #nim
20:00:18*yglukhov quit (Ping timeout: 240 seconds)
20:00:19dom96guess not
20:01:55ldleworkdom96: I was pooping
20:02:17ldleworkI don't think I'd be willing to write the actual tool, but I would definitely be willing to help deploy it and integrate with Docker
20:02:28ldleworkdom96: I want to port Entitas to Nim
20:02:57ldleworkI suppose the tool would be a good level challenge for TiberiumPY if they were interested
20:03:03ldleworkTake some text, run the compiler, show the output
20:03:42FromGitter<Varriount> ldlework: TMI
20:05:15*Trustable joined #nim
20:06:24dom96Alright. Hopefully somebody else will volunteer
20:06:37dom96It's a pretty fun project in my opinion.
20:07:27ldleworkTiberiumPY what do you think
20:08:04*shashlick quit (Ping timeout: 245 seconds)
20:10:14*shashlick joined #nim
20:14:30FromGitter<TiberiumPY> you're about https://github.com/sschmid/Entitas-CSharp ?
20:14:39ldleworkya
20:14:50ldleworkBut I was asking more about you writing the web compiler thingie
20:19:59FromGitter<TiberiumPY> well, I'm not good at anything in Nim right now :) ⏎ also (shame) I don't know HTML nor CSS nor JS
20:20:19ldleworkTiberiumPY sure but this is such low scope that it shouldn't matter
20:20:41ldleworkalso HTML/CSS/JS are quite simple comparatively speaking
20:23:21*yglukhov joined #nim
20:43:11*Trustable quit (Remote host closed the connection)
20:44:30*chemist69 quit (Ping timeout: 240 seconds)
20:46:17*bjz joined #nim
20:47:25*chemist69 joined #nim
20:47:42*rauss quit (Quit: WeeChat 1.7)
20:48:46*vlad1777d joined #nim
20:50:06*yglukhov quit (Remote host closed the connection)
20:55:37ldleworkVarriount, I'm getting object constructor needs object type for
20:55:47ldleworkdrawRect(sdl2.Rect(x: 10, y: 10, w: 10, h: 10))
20:55:50ldleworkerr
20:55:58ldlework self.app.display.drawRect(sdl2.Rect(x: 10, y: 10, w: 10, h: 10))
20:56:21ldleworkdisplay is a RendererPtr
20:56:33ldleworkthe call right above it works, self.app.display.setDrawColor(255, 0, 0, 255)
20:56:45ldleworkoh maybe it wants a ref
20:57:10ldleworkmm nope
20:58:31ldleworkI'm confounded
21:00:09ldleworkah there we go
21:00:11ldleworkit wanted cints
21:00:17ldleworkjesus chrst that error is bad
21:00:34ldleworkI'm gonna start saying "object constructor needs object type" in my sleep
21:02:02ldleworkAny why when I write a converter from int to cint it doesn't automatically work without the .cint conversations
21:02:06ldleworkconversions*
21:11:43*vivus joined #nim
21:21:05*libman quit (Quit: Connection closed for inactivity)
21:25:22FromGitter<Bennyelg> how do I add char to seq[char]
21:26:00ldleworkBennyelg, https://glot.io/snippets/eoumid845z
21:26:26FromGitter<Bennyelg> Thanks.
21:27:04ldleworkCan someone remind me what is the thing that offers SDL2 / Web Canvas compatibility layer/
21:28:28*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
21:29:31dom96emscripten?
21:29:43ldleworkThat's not really what I mean
21:29:53ldleworkI mean for nim based on the compilation target
21:30:00ldleworks/target/backend
21:31:09FromGitter<Bennyelg> CAST FROM CHARs to String?
21:31:47ldleworkhttps://glot.io/snippets/eoumo68otz
21:32:11*bjz joined #nim
21:32:48FromGitter<Bennyelg> CHARS SET to string.
21:33:11ldleworkdunno why you're speaking in all caps
21:33:22ldleworkbut access a single character in the string with array access
21:33:42*Matthias247 quit (Read error: Connection reset by peer)
21:35:39FromGitter<Bennyelg> i want to convert char set to string
21:36:18couven92I am discussing fork over at #csharp... And it got me thinking: How comfortable is Nim with doing fork()? Are there any caveats?
21:40:00demi-there is the posix module, as well as some functionality in the osproc module
21:41:27couven92so it generally works well? Anyone ever tried to fork sth that communicates with a socket?
21:41:47*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
21:45:18demi-it should work the same way it does in C?
21:47:16couven92ok, thx! :)
21:49:24*bjz joined #nim
21:56:55*krux02 quit (Remote host closed the connection)
21:57:10*krux02 joined #nim
22:04:03*nsf quit (Quit: WeeChat 1.7)
22:08:33*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
22:10:23*bjz joined #nim
22:10:38*Jesin quit (Quit: Leaving)
22:28:31*devted quit (Quit: Sleeping.)
22:28:59*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
22:30:20FromGitter<Varriount> ldlework: You have a converter from int to cint?
22:31:26*zachcarter joined #nim
22:32:17FromGitter<Varriount> couven92: Just be aware that fork() isn't in any way cross-platform
22:33:52couven92@Varriount, yeah I know... As I said, I am actually thinking about doing fork in C# in order to implement user impersonation on POSIX systems. On Windows you'd just call the ImpersonateUser function and you'd be done... :P
22:34:23couven92(Actually I cannot remember what the function is actually called in Win API, but it's something like that)
22:36:07couven92The actual problem being: POSIX has the user access token at the process level, not at thread level like Windows... So for impersonation you either have to switch the user context for the entire process, or you have to fork
22:36:17FromGitter<Varriount> couven92: Does Mono even have fork()?
22:37:09couven92@Varriount I do it using .NET Core! We don't do Mono anymore!!! (Ugh!) But no, you'll have to P/Invoke the fork call
22:39:48ldleworkVarriount yes
22:42:55*bjz joined #nim
22:46:25FromGitter<Varriount> ldlework: And under what conditions is it not working?
22:51:21*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
22:54:43vivushow do I store an array of regexes ?
22:56:07*Jesin joined #nim
23:06:45FromGitter<Varriount> vivus: As an array of strings?
23:07:10FromGitter<Varriount> Or I guess as the Regex type in the nre module
23:07:11vivus@Varriount shouldn't the type be regex and not string ?
23:13:42*devted joined #nim
23:17:49*gokr quit (Ping timeout: 240 seconds)
23:22:00zachcarterIdlework: you around? sorry I missed you last night
23:22:06zachcarter / this morning
23:23:23*kafke quit ()
23:23:44*vlad1777d quit (Remote host closed the connection)
23:28:06zachcarterman I’ve been missing the local history VS code extension all this time
23:28:07zachcarterugh
23:29:09FromGitter<Varriount> *cough* https://josephg.com/blog/electron-is-flash-for-the-desktop/ *cough*
23:29:46FromGitter<Varriount> Though, I admit I don't know if VSCode and Atom use Electron or React Native
23:30:06zachcarterthey use Electron
23:30:11zachcarterI’m pretty sure
23:30:44zachcarterVarriount, what do you use?
23:30:52zachcartersublime text?
23:30:55FromGitter<Varriount> Yes.
23:31:03zachcarterdoes it work well with nim?
23:31:17FromGitter<Varriount> Unfortunately, not as well as VSCode
23:31:25FromGitter<Varriount> It doesn't have IDETools integration.
23:31:39zachcarterso it’s a trade off I guess
23:31:47zachcarternot being chrome vs being more feature rich
23:31:52FromGitter<Varriount> Though, it does have heuristic autocomplete, so I don't feel the lack quite as much.
23:32:03*Jesin quit (Quit: Leaving)
23:32:46zachcarterone of these days I’m going to spend time and get http://kakoune.org/ working well
23:33:53*couven92 quit (Quit: Leaving)
23:35:34*Jesin joined #nim
23:36:30FromGitter<Varriount> One day I'm actually going to learn a keyboard-driven editor.
23:37:02zachcarterI have a decent grasp on vim but kak looks nice
23:37:17ldleworkzachcarter: I was going to propose that we collaborate to port Entitas to Nim
23:37:54zachcarterI don’t have any / much experience working with Entitas, it’s an ECS right?
23:38:17zachcartergoing to read up on it real quick
23:40:27zachcarterwow, already a lot of various ports
23:40:39ldleworkzachcarter: it has a really nice design
23:40:54ldleworkit uses code generation to emit the exact classes and methods for a very natural api and cached implementation
23:41:02ldleworkzachcarter: which is exactly what my ECS does
23:41:08ldleworkbut entitas has some nice features
23:41:34ldleworkThough in Nim we don't need code generation we have macros
23:41:53zachcarterright
23:43:03zachcarterI’m looking at for instance the go port
23:43:11zachcarterdoesn’t look like it has any of the code generation stuff ported
23:46:49ldleworknope
23:47:07ldleworkI'm guessing most of the ports dont
23:48:20zachcarterI wouldn’t be opposed to helping with it, another ECS I saw that I thought was interesting was specs
23:48:35zachcarterhttps://github.com/slide-rs/specs
23:50:27ldleworkgod rust is so ugly
23:50:54ldleworkI have no idea what its doing zachcarter
23:51:01ldleworkw.register::<Position>();
23:51:11ldleworkIs this registering component types at runtime..?
23:51:51zachcarterI believe so
23:54:13zachcarterI have no experience working with it, I’ve just heard / read good things and its parallelism impressed me
23:54:19*devted quit (Quit: Sleeping.)