<< 21-07-2017 >>

00:00:16*Nimbecile joined #nim
00:26:56*Nimbecile left #nim (#nim)
00:30:36*leafiest joined #nim
00:30:48*leafiest left #nim ("WeeChat 0.4.2")
00:31:31*jinshil joined #nim
00:47:23*Nikky quit (Quit: WeeChat 1.9)
00:47:34*Nikky joined #nim
00:48:08*user0 quit (Read error: Connection reset by peer)
00:49:11*Nikky quit (Remote host closed the connection)
00:49:40*Nikky joined #nim
00:51:39*user0 joined #nim
01:03:17*yingjun_ joined #nim
01:04:17*yingjun_ quit (Remote host closed the connection)
01:05:58*yingjun_ joined #nim
01:30:24*jinshil quit (Ping timeout: 260 seconds)
01:33:16user0Hi, I was trying to read an int from the stdin, echo stdin.readLine.int says that it's got TaintedString
01:36:41user0> parseInt
01:36:43user0Got it
01:36:45user0nvm
01:40:46*chemist69_ quit (Ping timeout: 246 seconds)
01:52:48*vlad1777d quit (Ping timeout: 260 seconds)
01:55:07*chemist69 joined #nim
02:25:35*rauss joined #nim
02:29:19FromGitter<Varriount> user0: need help?
02:30:55*endragor joined #nim
03:04:15*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
03:17:57user0Nah, I got it.
03:18:49user0Though I am wondering how I could read a string from stdin, store the sorted string in a variable.
03:19:27user0like stdin.readln.splitWhitespace.map(x => x.sort)
03:20:39yingjun_hello
03:20:45yingjun_I have a question
03:21:02yingjun_is dynamic dispatch like virtual function in C++?
03:30:13*pilne quit (Quit: Quitting!)
03:46:23yingjun_hello?
03:46:33yingjun_is my understanding correct?
04:01:15*yingjun_ quit (Remote host closed the connection)
04:01:35*yingjun_ joined #nim
04:03:07*yingjun_ quit (Remote host closed the connection)
04:06:34*yingjun_ joined #nim
04:11:49*jinshil joined #nim
04:28:57*yingjun_ quit (Remote host closed the connection)
04:29:06*yingjun_ joined #nim
04:30:04*yingjun_ quit (Remote host closed the connection)
04:35:00*yingjun_ joined #nim
04:35:01*yingjun_ quit (Remote host closed the connection)
04:35:33*yingjun_ joined #nim
04:36:38*SusWombat joined #nim
04:39:57*yingjun_ quit (Ping timeout: 240 seconds)
04:45:03*dddddd quit (Remote host closed the connection)
04:48:07*yingjun_ joined #nim
05:03:16*andrzejk_ joined #nim
05:06:17subsetparkthe beginnings of a useful little application - https://github.com/subsetpark/untitled-shell-history-application
05:51:52*andrzejk_ quit (Quit: Textual IRC Client: www.textualapp.com)
05:53:20*rauss quit (Quit: WeeChat 1.9)
05:54:28FromGitter<mratsim> @yingjun_ Most people in the Nim community are in Europe and the US currently so hard to reach at 3AM GMT. The more correct thing is that C++ virtual functions are an implementation of dynamic dispatch
05:55:04FromGitter<mratsim> Nim’s method are also an implementation, and the eagerly waited VTable/vtref another
05:57:35yingjun_I see
05:57:35yingjun_thank you!
06:08:01*yingjun_ quit (Ping timeout: 248 seconds)
06:08:29*yingjun_ joined #nim
06:18:14*skrylar joined #nim
06:19:25skrylarbibbly bobbles.
06:30:23*skrylar quit (Quit: My iMac has gone to sleep. ZZZzzz…)
06:30:48*nsf joined #nim
06:36:55*tdc joined #nim
06:44:41yingjun_hello
06:44:50yingjun_I have a question again
06:44:58yingjun_please see:
06:45:20yingjun_method eval(e: PExpr): int =
06:45:21yingjun_ # override this base method
06:45:21yingjun_ quit "to override!"
06:46:07yingjun_how do we know which class the method eval() is binded?
06:47:44FromGitter<andreaferretti> it is not clear what you are asking
06:47:50FromGitter<andreaferretti> there are no classes in nim
06:48:27FromGitter<andreaferretti> and the (currently existing) dynamic dispatch does not use a vtable attached to a class
06:49:52FromGitter<andreaferretti> maybe I can help more if you add some more detail about what is not clear
06:52:18*tdc quit (Remote host closed the connection)
07:08:47*couven92 joined #nim
07:15:42*yglukhov joined #nim
07:17:10*yglukhov_ joined #nim
07:17:10*yglukhov quit (Read error: Connection reset by peer)
07:19:43*yglukhov_ quit (Remote host closed the connection)
07:19:58*yglukhov joined #nim
07:22:28FromGitter<mratsim> @yingjun_ Nim’s method are not bound to any class: https://nim-lang.org/docs/tut2.html#object-oriented-programming-methods
07:25:50yingjun_I see, Thank you!
07:26:32FromGitter<mratsim> If you need OO-like polymorphism check “object variant”. By the way most of the time you can use proc instead of method (static dispatch instead of dynamic dispatch)
07:27:57FromGitter<mratsim> Here is an (old) example: http://goran.krampe.se/2014/10/31/nim-and-oo-part-ii/
07:36:13FromGitter<Varriount> Object variants work especially well for things like abstract syntax trees, where all the variants are known ahead of time.
07:38:23*skrylar joined #nim
07:51:21*yingjun_ quit (Remote host closed the connection)
07:55:19*yingjun_ joined #nim
08:13:35*xet7 quit (Remote host closed the connection)
08:16:30*dom96|w joined #nim
08:29:41yingjun_hello
08:29:49yingjun_I have another question
08:29:56yingjun_Please see: proc complexProc() {.raises: [IOError, ArithmeticError].} =
08:29:56Zevvkeep them coming :)
08:30:36yingjun_besides IOError, there are some other exceptions in complexProc()
08:31:11yingjun_such as ValueError, OverflowError
08:31:23yingjun_however, the code can still be compiled
08:32:51yingjun_what do you say?
08:39:11yingjun_hello?
08:42:57FromGitter<stisa> Maybe the exception you have in `raises` are parent of the others? Not sure, never really used exception tracking, sorry
08:43:48euantorI'd guess that OverflowError einherits from ArithmeticError
08:44:17euantorAnd in fact it does: https://nim-lang.org/docs/manual.html#exception-handling-exception-hierarchy
08:44:28*Vladar joined #nim
08:44:42euantorNot entirely sure why it doesn't complain about ValueError though
09:01:11cremWhat was that website to search nim packages? And why it's so hard to google. :-\
09:05:35*jinshil quit (Quit: Good-bye!)
09:09:36euantorhttps://nimble.directory/ is one, but it seems to be down right now - paging federico3
09:09:40FromGitter<andreaferretti> nimsim.co
09:09:43FromGitter<andreaferretti> sorry
09:09:45FromGitter<andreaferretti> nimsim.co
09:09:48FromGitter<andreaferretti> sorry
09:09:51FromGitter<andreaferretti> nimism.co
09:09:55FromGitter<andreaferretti> :-D
09:10:01euantorYeah, nimism was the other one from yesterday
09:10:20cremYes I meant minism
09:10:23cremminism
09:10:28yingjun_I see
09:10:28cremhard to type!
09:10:31yingjun_thank you
09:11:02cremThanks for reminding, bookmarked it.
09:11:21yingjun_what will the pragma {.raises[...].} help to?
09:20:43euantoryingjun_: It's usually inferred by the compiler, the only reason to manually write it is for yourself to track exceptions
09:21:53yingjun_why do I track exceptions?
09:23:10euantorSo that when you write code you know which exceptions you need to catch
09:24:00yingjun_I see
09:24:28yingjun_thank you
09:37:13*SusWombat quit (Remote host closed the connection)
10:09:29*skrylar quit (Quit: My iMac has gone to sleep. ZZZzzz…)
10:12:58*dankrad quit (Ping timeout: 260 seconds)
10:14:00*skrylar joined #nim
10:14:43*dankrad joined #nim
10:33:36*yingjun_ quit (Remote host closed the connection)
10:39:27*couven92 quit (Ping timeout: 240 seconds)
10:40:48*yingjun joined #nim
10:57:17*ShalokShalom joined #nim
10:58:20*vlad1777d joined #nim
11:09:41*yingjun quit (Remote host closed the connection)
11:18:24*BitPuffin|osx joined #nim
11:20:57*dankrad quit (Ping timeout: 240 seconds)
11:21:32FromGitter<zacharycarter> multiple materials + models working
11:21:33FromGitter<zacharycarter> (https://files.gitter.im/nim-lang/Nim/gOcj/Screen-Shot-2017-07-21-at-7.21.13-AM.png)
11:28:46*dankrad joined #nim
11:29:39*dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…)
11:30:00*ShalokShalom_ joined #nim
11:30:04*ShalokShalom quit (Ping timeout: 260 seconds)
11:39:30FromGitter<zacharycarter> next up: skeletal animation 
11:47:56skrylarzacharycarter hardware or soft skinning?
11:48:31skrylarWell. I've been told compute shaders are handy when it comes to getting the GPU to calculate things that aren't explicitly pixels. Although I think there may not be a benefit to doing skeletons with those
11:49:05skrylarfrom my limited experience it looks like skeletal animation is pretty simple if you're already getting keyframe data from stuff like assimp
11:49:55skrylari ported the easing library to nim if that helps with animation https://github.com/Skrylar/skEasing
11:50:00FromGitter<zacharycarter> ooo
11:50:11FromGitter<zacharycarter> this will definitely help
11:50:15FromGitter<zacharycarter> and I will definitely be using it, thank you
11:50:48FromGitter<zacharycarter> and you're right assimp makes skeletal animation simpler to implement, but it's still somewhat difficult
11:51:11FromGitter<zacharycarter> and it's easy to get math incorrect and end up with wild results
11:51:37skrylarafaik you have to pick the max bones to support, then adjust the vertex shader to move based on motion*weight for each bone. Rustles my jimmies at how it sounds like the gpu gets to do a lot of pointless math on the extra unused bones, but seems how its done
11:52:03FromGitter<zacharycarter> yeah
11:52:08FromGitter<zacharycarter> skeletal animation often feels like this http://i.imgur.com/hIrGq7l.mp4
11:52:15FromGitter<zacharycarter> once you implement and press play
11:52:36skrylarreminds me
11:52:43skrylari did that port because i wanted a coreanimation clone :X
11:52:49skrylarwell technically tween.lua clone, but same difference
11:53:28skrylarthink araq abandoned libui because it wasn't helpful for nimedit; i sorta picked it up, haven't finished yet though
11:53:52FromGitter<zacharycarter> ooo
11:54:06FromGitter<zacharycarter> is it going to be better than niui? or whatever
11:54:13skrylarnever used niui
11:54:39FromGitter<zacharycarter> sorry I meant https://github.com/trustable-code/NiGui/
11:54:43skrylarits not my unfinished syl lib from go though :<
11:54:51skrylarwas fond of that
11:55:03skrylar"turn the UI in to a scene graph, let the OS deal with whatever you just tried to do means"
11:55:29skrylaryou just had 'buttons' and if you put those on a menu, it became a menu. or a submenu. no "i am a TMenu give me special API calls" bs
11:55:45FromGitter<zacharycarter> right
11:55:47FromGitter<zacharycarter> that does sound nice
11:56:01skrylaryes. and functional options are also nice.
11:56:13skrylarthose can be done in nim i discovered, at the cost of extra []'s
11:57:25skrylarbut no. bottlecap is just libui with some sugar templates.
11:57:47FromGitter<zacharycarter> gotcha
11:58:05FromGitter<mratsim> @skrylar in skEasing, why use T: float32|float64 and not SomeReal?
11:58:21skrylaris somereal a type or do you mean why did i not just alias and use that
11:58:28FromGitter<zacharycarter> somereal is a type
11:58:36FromGitter<zacharycarter> https://nim-lang.org/docs/system.html#SomeReal
11:58:39skrylari guess i need to re-read the spec.
11:58:56skrylaroh. module system.
11:59:00skrylari never bothered to read that one
11:59:34skrylarput an issue up about it (or don't; i wrote it down either way)
12:00:00FromGitter<mratsim> lol
12:01:31*dom96|w joined #nim
12:01:55skrylartween.lua looks to be easy as long as one doesn't mind seq abuse
12:02:33skrylarthey use that with LOVE2D. it just has an update function where you feed it a timestep and it just goes down the line moving animators. which are basically just closures. so.
12:03:08*Snircle joined #nim
12:04:24*Vladar quit (Quit: Leaving)
12:05:37*Guest15762 quit (Ping timeout: 255 seconds)
12:06:19*dddddd joined #nim
12:08:41*myp joined #nim
12:10:20*yingjun joined #nim
12:12:50*vlad1777d quit (Ping timeout: 240 seconds)
12:14:35*yingjun quit (Ping timeout: 240 seconds)
12:22:07*couven92 joined #nim
12:26:04*vlad1777d joined #nim
12:33:48*xet7 joined #nim
12:47:35*myp quit (Ping timeout: 240 seconds)
12:50:58*myp joined #nim
12:51:51*planhths joined #nim
12:51:51*ShalokShalom_ is now known as ShalokShalom
12:55:13ZevvI'm trying to do a literal port of some C code to Nim, but the C makes a lot of use of walking through strings by passing and incrementing char * pointers.
12:55:40ZevvI'm not sure what would be easier: I can pass around tuples of the original string and an offset, or use cstrings
12:56:01ZevvI guess using cstrings when not interfacing with C is frowned upon in Nimland?
12:56:50flyxis there even a `[]` for cstrings?
12:57:32Zevvthere is
12:57:34Zevvand an inc()
12:57:40Zevvwhich does the p++
12:59:24flyxinteresting. can't find it in system
13:00:27Zevvhmm let me check, I might be talking bogus. That's what c2nim generates for me when doing a cold port of the code, but I haven't actually tried to build that yet
13:01:32flyxperhaps it's so much magic that it doesn't even have a proc def in system
13:01:45couven92Uhm, `./koch boot -d:release` fails on Raspberry Pi running Raspbian
13:01:53Zevvyou're right: that doesn't even work
13:01:54couven92CC: compiler_nim
13:01:54couven92Error: invocation of external compiler program failed. Cannot allocate memory 12
13:01:54couven92FAILURE
13:06:56euantorcouven92: I think I've seen that reported before and I believe the recommendation is to build the C sources on another machine and then compile them on the Pi
13:07:02euantorCould be completely wrong though
13:07:15euantorI'm sure it used to be on the Nim wiki, but I can't find it now
13:07:37couven92euantor, yeah either way, I'm logging an issue :P
13:07:52couven92https://github.com/nim-lang/Nim/issues/6130
13:08:05euantorFair enough, I'm trying to dig up the comment I found about it in the past
13:11:00couven92euantor, but you're right, obviously I had to compile nim from csources first before I could create and run koch. Compiling Nim from csources works great
13:11:47Zevvcouven92: If you have a lot of patience, adding swap can probably help you out
13:12:08euantorAh, perhaps it's there I'm getting mixed up. I found a couple of mentions of building it on a Pi running Arch, so I wonder if Raspbian is using more memory out of the box by running a UI
13:12:59couven92hmm... might be... okay... The csources version is fine anyways, right? I was building vanilla v0.17.0 anyways
13:14:41skrylarZevv it depends on what your goal is
13:15:06skrylarif you just want it running on nim, you can implement the same ptr uint8 type logic, and then have sugar functions which access the memory of arrays and seqs
13:15:20skrylaryou can ultimately get addresses of seq and array values so the ptr magic versions "will" work
13:16:38skrylarif you're doing code with start/stop pointers, you can always put in a when debug: check index in the pointer version
13:16:50skrylarto maintain the indexing safeties of those types
13:17:17Zevvyeah, I was considering that, but I think I'll just use array indexing instead and benefit of the available sanity checks
13:17:50skrylarwell, it's you paying the debugging costs and not me 8)
13:17:57Zevv:)
13:25:33*yuken joined #nim
13:25:36yukenwell then https://i.imgur.com/di5DQWc.png
14:08:49*Jesin quit (Quit: Leaving)
14:11:48*Jesin joined #nim
14:12:23*rauss joined #nim
14:12:39*yingjun joined #nim
14:15:55*endragor quit (Remote host closed the connection)
14:17:25*yingjun quit (Ping timeout: 268 seconds)
14:22:05*BitPuffin|osx quit (Ping timeout: 240 seconds)
14:29:29*endragor joined #nim
14:31:05*user0 quit (Quit: user0)
14:32:28*user0 joined #nim
14:33:05*ShalokShalom quit (Ping timeout: 240 seconds)
14:33:29*ShalokShalom joined #nim
14:34:22*endragor quit (Ping timeout: 276 seconds)
14:45:15*jsgrant quit (Read error: Connection reset by peer)
15:06:57FromGitter<zacharycarter> yuken: looks like a problem with the package yu're trying to use
15:06:58*dankrad quit (Ping timeout: 255 seconds)
15:07:00FromGitter<zacharycarter> you're*
15:07:22yukenYeah, I know what the issue is - I just can't fix it because I've never used nim or the libraries
15:07:24*PMunch joined #nim
15:07:36yukenat least I think I know*. it's trying to set a variable to an unknown class/object, right?
15:07:53FromGitter<zacharycarter> yeah something is being referred to - SF_INSTRUMENT, that hasn't been defined
15:07:58FromGitter<zacharycarter> somewhere in the code
15:08:19yukenI know where it isn't defined too and where it should have been, sndfile
15:08:20*Trustable joined #nim
15:08:24yukenI just can't fix it because I have no clue how that works lol
15:08:37*dankrad joined #nim
15:08:38FromGitter<zacharycarter> I believe @ftsf wrote that library
15:08:42FromGitter<zacharycarter> he may be able to offer some guidance
15:08:51FromGitter<zacharycarter> welcome to Nim btw, it's a lovely language
15:09:08yukenFromGitter, I actually don't use Nim, though I'm interested in it... the syntax seems relatively similar to my old language, it even uses proc too lol
15:09:09FromGitteryuken, I'm a bot, *bleep, bloop*. I relay messages between here and https://gitter.im/nim-lang/Nim
15:09:14yukenoh
15:09:18yukenoh I meant zacharycarter oopsie.
15:09:21FromGitter<zacharycarter> what language are you coming from?
15:09:49yukenBYOND.
15:10:12FromGitter<zacharycarter> ah a byondr! you're quite a rare breed :P
15:10:41yukenHere's an example or two, https://gist.github.com/anonymous/1bfd2b91cdb3ceb4df36b24150cf9d59 & https://gist.github.com/anonymous/a2bbdc8b038909383e620c0032f39cc6
15:10:49yukenzacharycarter, you've used it before? :o
15:10:58FromGitter<zacharycarter> I've heard about it when researching certain games
15:11:05FromGitter<zacharycarter> and been to the website / read about it
15:11:10yukenIt's decent, but has too mnay problems right now.
15:11:17cremhttp://rosettacode.org/wiki/Function_definition doesn't even have byond. What is it. :-\
15:11:17yukenCan't compile to binaries directly for example.
15:11:23FromGitter<zacharycarter> well Nim is much more of a programming language
15:11:24yukenhttps://secure.byond.com
15:11:35yukenzacharycarter, I realise that bit :p. But, SDL2 and such exist for it
15:11:35FromGitter<zacharycarter> vs BYOND which I believe is more of a scripting language?
15:11:38yukenso I doubt it'd be hard.
15:11:47yukenBYOND is a scripting language for its engine, DreamSeeker, yeah.
15:11:50FromGitter<zacharycarter> yuken: if your'e interested in gamedev, here's my current project
15:11:55yukenCan't be used for general purpose.
15:11:59FromGitter<zacharycarter> https://github.com/zacharycarter/zengine
15:12:09yukenoh my, 3D :o
15:12:12FromGitter<zacharycarter> http://fragworks.io/ was my last Nim project which has been put on indefinite hiatus
15:12:31yukenI have a video of my game back before I scrapped it because uh
15:12:37yukenwell, in the previous build... 300 calls for regex, per tick
15:12:38yukenper mob.
15:12:43FromGitter<zacharycarter> ouch
15:12:52yukenhttps://www.youtube.com/watch?v=RJfnUScp7Yk
15:13:26FromGitter<zacharycarter> quite cool
15:13:31FromGitter<zacharycarter> using sdl2 as the renderer I take it?
15:13:52FromGitter<zacharycarter> oo was this multiplayer?
15:14:03yukenI'm not sure what BYOND uses other than its own engine
15:14:07yukenDirectX based though.
15:14:13FromGitter<zacharycarter> gotcha
15:14:21yukenzacharycarter, yep. Multiplayer arena sidescroller with 3 teams.
15:14:27yukenTechnically, probably, an illegal game because it uses the Naruto IP ;)
15:14:27FromGitter<zacharycarter> very cool
15:14:38FromGitter<zacharycarter> meh graphics are hard
15:14:56FromGitter<zacharycarter> Nim isn't really a game programming language, it's much lower level than that
15:15:14yukenI realise that bit.
15:15:16FromGitter<zacharycarter> but you can build games with it certainly
15:15:21yukenIt's the same idea as any other programming languages like C++
15:15:25FromGitter<zacharycarter> exactly
15:15:28yukennot designed for games, just anything you want
15:15:29PMunchzacharycarter, what?
15:15:37PMunchOh okay
15:15:49FromGitter<zacharycarter> I mean it's not directly geared towards creating games PMunch
15:16:04FromGitter<zacharycarter> but I think we're all on the same page ;P
15:16:11yukenhttps://github.com/YukenK/HunterNin - you can look through tyhe atrocity that is my game there
15:16:14yuken.dm files are code ;o
15:16:52FromGitter<zacharycarter> yuken: I hope to have my engine in a usable state in the next month or so
15:17:28FromGitter<zacharycarter> I need to get 3d skeletal animation working (I'll tackle that next week) and then add some API hooks but it's already pretty far along
15:17:46FromGitter<zacharycarter> if you're looking for a Nim project to play around with for games there are a few either WIP or already usable
15:17:57FromGitter<zacharycarter> https://github.com/ftsf/nico is one
15:18:06FromGitter<zacharycarter> I think PMunch has created one as well
15:18:47FromGitter<zacharycarter> @ftsf is probably the most avid game developer that uses Nim, and he just recently launched at title with his engine on steam / won a ludum dare with one of his entries
15:20:11*PMunch quit (Ping timeout: 258 seconds)
15:20:12yukenzacharycarter, I might check out the game engine when it's finished then :p. I'm looking to make 2D games right now, though.
15:20:51FromGitter<zacharycarter> yuken: my engine will support / already supports 2d and 3d
15:21:09yuken:o
15:21:26yukenalso with the code in my github, some of the issues might also be my own ability
15:21:30yukenI'm not that great at things ;p
15:21:54FromGitter<zacharycarter> folks in here will gladly review code assuming it's Nim :P
15:22:19FromGitter<zacharycarter> there's a decent article floating around the webz about building a 2d game in SDL2 using Nim
15:22:20FromGitter<zacharycarter> one second
15:22:23yukenI've only been... seriously programming for a few months - programming as in learning the ideas that apply to most languages
15:22:27FromGitter<zacharycarter> https://hookrace.net/blog/writing-a-2d-platform-game-in-nim-with-sdl2/
15:22:37yukenin fact
15:22:42FromGitter<zacharycarter> well what you've created is pretty impressive for only having been at it a few months
15:22:43yukenI only recently learned what typecasting was x-x
15:22:56FromGitter<zacharycarter> not sure how you survived :P
15:23:04yukenwell, in BYOND, uh
15:23:23yukenyou can use :, which is: "This is the runtime search operator. It is used to access a property of a var that is not explicitly prototyped."
15:23:34yukenI used that in my previous game until I realised how terrible it was.
15:24:00FromGitter<zacharycarter> yeah I'd strongly recommend learning a lower level programming language
15:24:09FromGitter<zacharycarter> I have a good book recommendation too
15:24:11FromGitter<zacharycarter> if you're interested
15:24:18federico3anybody using Nim on AVR/atmega/arduino?
15:24:30yukenzacharycarter, sure I'll bookmark it :p.
15:24:36FromGitter<zacharycarter> https://learncodethehardway.org/c/
15:24:48yukenRust and C are systems languages, is Nim the same or no?
15:25:05FromGitter<zacharycarter> yes it is
15:25:16FromGitter<zacharycarter> Nim compiles down to C and then invokes the native compiler on the system
15:25:20yuken:o nice
15:25:24yukenexplains why I needed a C compiler on Windows.
15:25:27FromGitter<zacharycarter> it can also compile to JavaScript, C++, Objective-C, etc
15:25:35FromGitter<zacharycarter> yup!
15:25:54yukenJavaScript o-o? Does that mean I could run it in a browser?
15:25:59*PMunch joined #nim
15:26:20PMunchSorry, my network got disconnected..
15:26:33PMunchBut yeah zachary, I think we're on the same page :P
15:27:20PMunchyuken, yup
15:27:50PMunchhttps://github.com/dom96/snake
15:27:54yukenOne of the other issues with BYOND is that every single thing is server-side
15:27:59PMunchThere's an example for you ^
15:28:08yukenmeaning that even _input_ is server-side
15:28:28FromGitter<zacharycarter> yuken: weird
15:28:41yukenIt was designed for text-based MUDs back in 1998~
15:28:51yukenand kind've evolved into a 2D sprite-based engine
15:29:41FromGitter<zacharycarter> yuken: I made this with Nim
15:29:49FromGitter<zacharycarter> https://play.nim-lang.org/
15:29:52FromGitter<zacharycarter> front-end and back-end
15:30:24FromGitter<zacharycarter> it uses some other technologies as well, such as docker, but the point is, yes you can build web apps with Nim
15:30:26yukenThat's nice, I wanted my game to be able to run in a browser without needing plugins.
15:30:32yukenNim seems real nice so far then.
15:30:44yukenWithout being too hard to learn, it's similar enough to BYOND that it doesn't seem too difficult.
15:30:49FromGitter<zacharycarter> Nim can also leverage emscripten / web assembly
15:31:10FromGitter<zacharycarter> Rust is too similar / becoming too similar to C++ for my tastes
15:31:29FromGitter<zacharycarter> Nim for me offers that sweet spot of productivity, performance, and lack of friction
15:32:12FromGitter<zacharycarter> @dom96 : did you read / see yesterday I got Nim running on AWS lambda?
15:32:55yukenWell, Nim seems good so far. Gonna have to learn it once I finish with this game.
15:33:07yukenOr maybe just switch over, right now my game has all base mechanics and 6 characters, so it isn't too far in
15:33:18yuken(there is supposed to be a total of 150+ characters, hence the not-so-far-in ;))
15:33:42FromGitter<zacharycarter> so yuken: this is a thing you may not care about but when you switch to Nim and start doing game programming you will quickly hit a bridge
15:33:58yukengo on
15:34:03FromGitter<zacharycarter> and you'll have to navigate the hardware performant optimized rendering vs what sdl2 offers
15:34:11FromGitter<zacharycarter> issue
15:34:25*smt quit (Ping timeout: 248 seconds)
15:34:28yukenHm. Hopefully it won't be too bad, as I'm just using 2D sprites without any sort of particles and such.
15:34:43FromGitter<zacharycarter> it probably will not be and if that's the case then sdl2 might be all you need
15:34:50yukenStuff that, by looks, you could run on a 486 if you made it properly.
15:35:08FromGitter<zacharycarter> I'd just be aware that sdl2's renderer is not optimized
15:35:16FromGitter<zacharycarter> that's why projects like mine exist
15:35:24FromGitter<zacharycarter> and of course doesn't offer any sort of 3d
15:35:33yukenImage of the game, https://i.imgur.com/VEzI9u2.png
15:35:37PMunchzacharycarter, one of the things that really annoys me about sdl2..
15:35:48yukenzacharycarter, well I'll have to look into it. I might even make a DOS build of my game if that's possible ;)
15:36:23FromGitter<zacharycarter> PMunch: yup but what can you do? it's kind of a black hole - 3d I mean - so I understand the design decisions made by the sdl2 team
15:36:43PMunchOh, I meant the renderer thing
15:36:45FromGitter<zacharycarter> yuken: cool! I'm not sure about DOS but if there's a way to cross compile to it and toolchains available I'm sure it's possible
15:36:48*dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…)
15:37:02FromGitter<zacharycarter> PMunch: oh right that too, yes but also writing an optimized 2d renderer can be difficult as well
15:37:09yukenWell, if it can compile to C, and I don't use any libraries that require a modern OS
15:37:12yukenI don't think it'd be too hard.
15:37:20yukenI'm not even going to use music really, just MIDIs.
15:37:49FromGitter<zacharycarter> man you should probably just use https://github.com/zacharycarter/blt-nim :P
15:37:52FromGitter<zacharycarter> go totally terminal
15:38:04yukennah, need muh sprites
15:38:15FromGitter<zacharycarter> although even that leverages sdl2 / opengl
15:38:18yukenI doubt a 2D action sidescroller would work that well in a terminal! :p
15:38:28PMunchyuken, you should check out my SDLgamelib as well :)
15:38:40PMunchOffers a slightly different approach to game programming
15:38:46PMunchhttps://pastebin.com/tFr2wHsc
15:39:08yukenBYOND is Windows only (insanely easy to run in WINE, I can do it on my 10 year old Core 2 Duo mobile), Nim should have no real problems under Linux & macOS correct? I see zacharycarter uses (ew) macOS ;p.
15:39:36FromGitter<zacharycarter> I do use osx
15:39:45PMunchI'm running linux yuken, no trouble here
15:39:56yukenwell that's pretty much all my questions I can think of then.
15:40:00FromGitter<zacharycarter> you have to cross compile to hit different targets but yes Nim can run on whatever OS you choose
15:40:07FromGitter<zacharycarter> I've gotten game engines running on android with Nim
15:40:29PMunchI'm trying to make a seq and an array share their data. I've got seq -> array working with the above, but I was wondering, what happens if the seq goes out of scope and gets garbage collected?
15:40:32FromGitter<zacharycarter> I <3 osx I still claim it has the best developer experience
15:40:34yukenoooh, what about ARM compatibility? Iunno if you meant Android ARM or Android x86
15:40:46FromGitter<zacharycarter> I was targetting arm32
15:41:09yukenso I could even get my game running on a Raspberry Pi or similar board too
15:41:11yukenthat's lovely.
15:41:14FromGitter<zacharycarter> yup
15:41:15PMunchyuken, yeah I've also run sdl2 games with my gamelib on Android
15:41:20PMunchAndroid ARM that si
15:42:35yukenHow do sprites/spritesheets work in Nim? here's uh, what my sprites look like right now: https://i.imgur.com/FWVtKEq.png
15:42:39yukenwell
15:42:41yukenSDL2/similar
15:42:49FromGitter<zacharycarter> you code them yourself
15:43:36FromGitter<zacharycarter> I believe that one article I linked earlier about sdl2 / Nim deals with spritesheets
15:43:48yuken<3
15:43:52FromGitter<zacharycarter> but again, non optimized, just leveraging the sdl2 renderer
15:45:14PMunchyuken, I've got support for the spritesheets that TexturePacker generates for LibGDX in SDLgamelib :)
15:45:31PMunchWith rotation, animations, and ninepatch images.
15:45:49FromGitter<zacharycarter> ooo ninepatch support is nice
15:46:40FromGitter<zacharycarter> PMunch, maybe I can eventually convince you to write something like your library on top of zengine
15:46:47FromGitter<zacharycarter> zengine is analogous to raylib
15:47:26FromGitter<zacharycarter> but I don't see it getting into high level concepts like sprite sheets etc
15:47:33FromGitter<zacharycarter> maybe if I get super ambitious
15:48:30FromGitter<zacharycarter> I'd rather focus on low level plumbing code and expand the engine's capabiilites
15:50:28*dddddd quit (Ping timeout: 260 seconds)
15:53:44FromGitter<zacharycarter> Araq: you said Karax wasn't optimized yet or you were working on optimizing the library? How's that going? I'm talking about creating some type of prototype for a project at work using it, then doing a talk on it
15:53:53FromGitter<zacharycarter> talking to a co-worker*
15:54:19FromGitter<zacharycarter> Go is possibly entering our toolchain and I figure why not Nim
15:56:42Araqzacharycarter devel branch of karax is optimized against a real world application, not sure about its benchmark results
15:57:06Araqbut it should be fast enough for anything you throw at it, I think
15:57:08*planhths quit (Ping timeout: 240 seconds)
15:57:46FromGitter<zacharycarter> are there any ambitions for building a flux based state management lib around it?
15:58:00FromGitter<zacharycarter> or any type of state management library?
15:58:16Araqwe want to add "reactive" lists etc
15:58:25Araqnot sure how these compare to flux
15:58:43PMunchzacharycarter, I was thinking about decoupling gamelib from SDL to allow this. As it is a library it already tries to force as few things as possible. For example the animations type is not only for sprites but can be used for anything that has a frame structure.
15:58:56FromGitter<zacharycarter> flux gives you essentially a data store that is immutable beyond certain components touching it
15:59:16FromGitter<zacharycarter> so it comes with the concept of mutators or reducers which touch the store
15:59:28FromGitter<zacharycarter> those are fed by actions in most architecures
16:00:07FromGitter<zacharycarter> I guess a view layer isn't enough for most people, they require hand holding in maintaining application state
16:00:27FromGitter<zacharycarter> Araq: https://facebook.github.io/flux/
16:03:44FromGitter<zacharycarter> PMunch: interesting... I need to check out your library and then maybe we can put our heads together and figure out how to integrate it with zengine
16:04:03*dddddd joined #nim
16:04:03FromGitter<zacharycarter> zengine currently lacks support for 2d animation but I plan on remedying that soon
16:04:05Araqmeh, I cannot watch these hipsters talking
16:04:31PMunchAraq, better if I show you my implementation of persistent vectors in Nim?
16:04:34FromGitter<zacharycarter> :P
16:05:02FromGitter<zacharycarter> Araq: I know it burns you but there is a lot of hype around these immutable data store architectures for front-end frameworks
16:05:10Araqas soon as I hear "business logic" I stop listening
16:05:16FromGitter<zacharycarter> lol
16:05:40PMunchI actually have a question about those. I tried to get a seq and an array to share data. But are seqs implemented as flexible struct arrays?
16:05:43FromGitter<zacharycarter> I just think people are going to look at Karax and perceive a view layer with nothing else behind it
16:05:57FromGitter<zacharycarter> and then throw it in the bucket with MarkoJS etc
16:07:07FromGitter<zacharycarter> also things like server side rendering / pre rendering come into play
16:07:22FromGitter<zacharycarter> when folks are hunting for their golden front end solution
16:07:32AraqI don't care about "people", "people" use JS for everything, fail to see any problems with it and enjoy GoT
16:07:38*ShalokShalom quit (Ping timeout: 255 seconds)
16:08:50PMunchHaha
16:09:15PMunchSpeaking of immutability zacharycarter: https://github.com/PMunch/nim-persistent-vector
16:09:31yglukhovhey guys, introducing https://github.com/yglukhov/cassandra
16:09:37PMunchClojures persistent (immutable) vectors in Nim :)
16:09:37AraqPMunch: a seq is a struct {len, cap: int; data: <variably sized array>}
16:09:55FromGitter<zacharycarter> yuri: Nice!
16:10:08FromGitter<zacharycarter> Araq: yeah but people will also buy / use your shit :P
16:10:28PMunchAnd data is not a pointer but a flexible array thing?
16:10:35Araqexactly
16:10:53FromGitter<zacharycarter> yglukhov: what do I need to do to come work for you :P
16:10:53Araqactually a seq is a *pointer* to this struct
16:11:06FromGitter<zacharycarter> seems like you're just constantly pumping out useful Nim projects
16:11:43yglukhovzacharycarter: mind for relocation? ;)
16:11:52AraqPMunch: can you name it "persistent seq" instead. a vector is something like (1, 1, 2)
16:11:57FromGitter<zacharycarter> Nope! in fact I'm working on selling my house haha
16:12:11PMunchAraq, damn. Then I can't optimise away the cap and len fields when my structures are of their max size
16:13:12AraqI wrote a persistent/immutable BTree. to insert 100 entries, it needs to replicate the root node 100 times. ridiculous crap.
16:13:20PMunchAraq, hmm that would make more sense. It's named after the Clojure structure.. And currently it's more like a stack, only add and delete in one end (but can update anywhere).
16:13:30yglukhovzacharycarter: we might be seeking for badass game engine architects/gurus
16:13:43yglukhovsounds fun?
16:13:59FromGitter<zacharycarter> sounds very fun
16:14:01PMunchAraq, the root node obviously needs to be copied. Which is why it's kept lean.
16:14:17FromGitter<zacharycarter> if you end up hiring for those positions, please toss me a link to the advert yglukhov
16:15:07yglukhovzacharycarter: deal
16:15:26FromGitter<zacharycarter> :)
16:16:11AraqPMunch: it's stupid ;-)
16:16:35PMunchI tried yesterday and was able to have 1_000_000 vectors ranging in size from 0-1_000_000 elements (generated by starting with an empty vector and adding to it in a loop). Took four seconds and about 400MB of RAM, in comparison the same time/memory was achieved when using only 15_000 seqs of sizes 0-15_000 (and they were just allocated, not actually filled with data).
16:16:52PMunchSo they are great for things like infinite undos
16:17:25PMunchPlus immutability is awesome for asynchronous stuff.
16:18:29*yglukhov quit (Remote host closed the connection)
16:18:34Araqfor undos they don't help that much (I might want to undo larger batches of work) and for everything else I don't see their advantages
16:19:04*yglukhov joined #nim
16:20:00PMunchWhat do you mean they don't help that much?
16:21:54*rdsome joined #nim
16:21:58*rdsome left #nim (#nim)
16:22:56*yglukhov_ joined #nim
16:23:22*yglukhov quit (Ping timeout: 260 seconds)
16:23:30*ShalokShalom joined #nim
16:23:38PMunchOh by the way. Boarding a plane soon so might leave abruptly but looking at the vector.nim code is "high" supposed to be removed?
16:23:51PMunchThat gives me weird errors..
16:25:51*PMunch quit (Quit: leaving)
16:27:08*yglukhov_ quit (Ping timeout: 240 seconds)
16:29:45*ShalokShalom quit (Quit: No Ping reply in 180 seconds.)
16:30:55*ShalokShalom joined #nim
16:36:43*jsgrant joined #nim
16:37:34*endragor joined #nim
16:38:34*endragor quit (Remote host closed the connection)
16:48:49*ShalokShalom quit (Quit: No Ping reply in 180 seconds.)
16:50:57*ShalokShalom joined #nim
16:52:46TrustableI have a problem: All my Nim programs compile to "shared library" instead of executable files. I use Manjaro. I blame the latest system update.
16:55:25*vlad1777d quit (Remote host closed the connection)
16:56:37*ShalokShalom quit (Ping timeout: 260 seconds)
16:58:35*ShalokShalom joined #nim
17:02:22*endragor joined #nim
17:11:58*yglukhov joined #nim
17:15:42FromGitter<Varriount> Trustable: O_o
17:16:52*yglukhov quit (Ping timeout: 276 seconds)
17:19:57*dankrad quit (Ping timeout: 268 seconds)
17:20:14*dankrad joined #nim
17:21:16*v17d joined #nim
17:21:30*xet7 quit (Remote host closed the connection)
17:25:02*xet7 joined #nim
17:28:23*yglukhov joined #nim
17:31:07*endragor quit (Remote host closed the connection)
17:38:29*endragor joined #nim
17:39:15ZevvMy post just disappeared from the Nim forum. Still searchable, but the post itself gives a 404
17:39:22ZevvDid I violate some kind of policy?
17:43:27FromGitter<Varriount> Zevv: Are you a new user? It might be that your post requires approval first.
17:43:34FromGitter<Varriount> What's your question?
17:45:17ZevvI was asking if there are any alternatives for re/nre that have no external dependencies
17:45:32Zevvand if not, that I would consider porting Lua pattern matching to Nim
17:46:20Zevv(if this was not done already, that is)
17:50:13*Vladar joined #nim
17:50:26*Trustable quit (Remote host closed the connection)
17:50:58*v17d quit (Remote host closed the connection)
17:54:12AraqZevv: we have a pegs.nim module
17:54:31Zevvyes, I found that one. But it's a bit cumbersome for quicky regexes
17:54:32Araq2) you were in moderation, so once you logged out, the post "disappeared"
17:54:40ZevvAraq: that explains, thanks!
17:54:51AraqI made you a "user", so now everybody can read it
17:54:58Zevv\o/
17:57:13ZevvI'm pretty impressed by Nim from what I saw up to now, so porting the Lua pattern matcher seems like a nice project to get started
17:58:32Araqpegs.nim is based on Lua's patterns
17:59:12Araqit's unclear what you gain by reimplementing it
17:59:21Araqif the API sucks, improve the API
18:04:06*endragor quit (Remote host closed the connection)
18:14:26*yglukhov quit (Remote host closed the connection)
18:14:54*endragor joined #nim
18:15:34*yingjun joined #nim
18:18:41Zevvis it based on lua patterns, or on lpeg
18:18:48Zevvbecause that's two completely differnt beasts
18:18:51Zevvbut I'll look into that
18:19:47FromGitter<ephja> PEGs, lPEG :p
18:19:57*yingjun quit (Ping timeout: 240 seconds)
18:20:33Zevvyeah indeed
18:20:54Zevvthe good thing about the native lua patterns is that it's just compact and simple, but does the job most of the times
18:21:08Zevvthe whole impelemntation is less then 500 LOC
18:22:41*endragor quit (Remote host closed the connection)
18:24:59*endragor joined #nim
18:35:02*endragor quit (Remote host closed the connection)
18:36:02FromGitter<cyberlis> guys, nim has `varargs`. it is like `*args` in python. I want list of named args, like python `*kwargs`
18:36:15FromGitter<cyberlis> Does nim have this?
18:36:37FromGitter<cyberlis> or i have to implement it myself with `macro`
18:37:49dom96Nim doesn't have this
18:38:02FromGitter<cyberlis> thank you
18:39:46Araqyou can indeed access the named parameters in a macro
18:50:20*Nimbecile joined #nim
18:50:45*Nimbecile left #nim (#nim)
18:58:50*Matthias247 joined #nim
19:00:51AraqZevv: well be my guest and write a 500 line implementation :-)
19:01:07Araqoriginally the Nim version was tiny too iirc and then it grew features
19:28:28*yglukhov joined #nim
19:39:17*v17d joined #nim
19:45:04*v17d quit (Ping timeout: 255 seconds)
19:50:05*xet7 quit (Ping timeout: 240 seconds)
19:53:21*Vladar quit (Quit: Leaving)
19:54:38*xet7 joined #nim
19:57:21*v17d joined #nim
20:04:28*flashmozzg left #nim (#nim)
20:07:45*jsgrant_ joined #nim
20:07:56*jsgrant quit (Ping timeout: 246 seconds)
20:08:01*ShalokShalom quit (Ping timeout: 248 seconds)
20:26:34FromGitter<mratsim> @Zevv, when you say pattern matching I’m always thinking about Rust/Haskell-like pattern matching, not regex. (Pattern matching like: https://github.com/andreaferretti/patty)
20:38:46FromGitter<cyberlis> > **<Araq>** you can indeed access the named parameters in a macro ⏎ Can anyone make an example of this? it is hard to find mocros code example for nim :(
20:41:19*rauss quit (Quit: WeeChat 1.9)
20:51:35dom96yeah, example would be nice. I'm not even entirely sure how to achieve this.
20:56:11FromGitter<mratsim> @zacharycarter @yuken so much drama around learn C the hard way - http://hentenaar.com/dont-learn-c-the-wrong-way
21:04:24Araqthe node kind is nnkExprEqExpr, iterate over the args in the macro and look for this node kind, it's possible to figure this out on your own if you use 'echo repr n' which is what every macro tutorial shows
21:05:41FromGitter<cyberlis> can you give a link to this tutorial. I will make it myself because it is interesting task
21:05:43*xet7 quit (Quit: Leaving)
21:11:19*rauss joined #nim
21:15:57Araqhttps://nim-lang.org/docs/tut2.html#macros
21:18:18*jsgrant joined #nim
21:18:29dom96How would this macro work?
21:18:36dom96macroCall(foo=42, bar=12)?
21:19:19*jsgrant_ quit (Ping timeout: 276 seconds)
21:23:37*yglukhov quit (Remote host closed the connection)
21:28:56AraqI don't understand the question
21:29:19dom96nvm, maybe it's a silly question, i'm tired.
21:29:20Araqit works how you want it to work the macro specifies the transformation
21:30:23Araqhtmlgen maps keywords args to HTML attributes, for instance
21:33:10FromGitter<cyberlis> I want make it like this: ⏎ ⏎ ```macro `@`(body: untyped): untyped = ⏎ result = newStmtList() ⏎ echo lispRepr(body)``` ⏎ ⏎ but after compilataion i only get ... [https://gitter.im/nim-lang/Nim?at=5972731676a757f808342196]
21:34:28Araqmacro `@`(args: varargs[untyped]): untyped
21:35:44Araqbut @ is a bad choice because that's already in system.nim
21:36:36FromGitter<cyberlis> ok, i understood
21:55:59FromGitter<cyberlis> One more question
21:56:20FromGitter<cyberlis> can i get a function deffenition in macro
22:06:17*ShalokShalom joined #nim
22:11:16AraqgetBody() but it's usually a sign that you're doing it wrong
22:11:37Araqthe proc might not have a body (imported from C/DLL or forward declared)
22:12:40*ShalokShalom quit (Ping timeout: 260 seconds)
22:18:41*yingjun joined #nim
22:23:05*yingjun quit (Ping timeout: 240 seconds)
22:33:11user0Is there any uniq() function that returns the unique values in a sequence?
22:34:21user0 > deduplicate
22:34:27user0got it, nvm
22:38:48*arnetheduck quit (Ping timeout: 255 seconds)
22:42:02user0How does one declare a sequence of tuple that contains a string and an int?
22:42:30user0like let arr: seq[(string, int)] ?
22:43:31user0> let counts = new seq[(string, int)]
22:43:33user0Got it
22:43:36user0nvm
22:44:20FromGitter<cyberlis> > **<Araq>** getBody() but it's usually a sign that you're doing it wrong ⏎ i meant proc Head. Not a proc Body
22:44:52FromGitter<cyberlis> user have to define `kwargs` in his function
22:45:07FromGitter<cyberlis> it have to be `Table`
22:46:24FromGitter<cyberlis> It can be table of string, string or string, int. I want get this defenition to initTable in macro
22:51:23*nsf quit (Quit: WeeChat 1.9)
22:59:14*ShalokShalom joined #nim
23:09:22*ShalokShalom quit (Ping timeout: 255 seconds)
23:17:35user0Anyone here?
23:18:03user0How can I dereference a key?
23:20:29user0an object*
23:39:44FromGitter<cyberlis> anObject[]
23:39:55FromGitter<cyberlis> `[]` - dereference
23:43:55*PMunch joined #nim
23:46:07PMunchHmm, just made genui for gtk2 as well (the bindings in nimble)
23:49:55PMunchBut I'm not sure if my current approach of making pull requests to the toolkit in question is the right one..
23:50:12PMunchMaybe they should be distributed separately
23:51:00PMunchI just went that route when the wxWidgets bindings proved to need some changes for it to work properly.