<< 26-02-2017 >>

00:00:09federico3thanks krux02
00:00:36AraqYou cannot blame escape for doing exactly what the documentation says, sorry, that's just silly
00:01:03krux02well, the documentation say "many different common syntaxes"
00:01:11Araqand when you grow it new parameters, 'unescape' too needs to support that and it also needs to be documented and tested
00:01:17krux02in my opinion that implies C code
00:01:28krux02that is common enough for a language that emits C code
00:02:00krux02It should mention what it actually can, and what it can't
00:02:42krux02when the proc would be called shellEscape, I would not have used it
00:03:14Araqthere you go, I improved the docs.
00:03:16krux02same with the toUpper, that is now called toUpperAscii
00:03:35krux02ok
00:04:29Araqyeah, toUpperAscii is also annoying me
00:04:53krux02I can understand it
00:05:28Araqpointless change and verbose. I don't use toUpper for Unicode, that's wrong
00:05:42krux02but it is a better solution than letting people think it would work on non-ascii
00:06:01Araqyou need a cmpAssumeGerman instead or something
00:07:39krux02I understand that you don't like it, but that name really prevents bugs introduces by people who don't study the specification of everything before they start using things
00:07:57krux02It clearly states it's limitations
00:08:18krux02and nowadays strings are unicode by default, ASCII is a limitation
00:08:36Araqyeah we should have called it, escapeButNotValidForC, got it :P
00:09:51Araqunicode.toUpper vs strutils.toUpper doesn't prevent bugs IMO, unicode.toUpper is in itself a bug
00:09:57krux02where did you use escape?
00:10:17cheatfatekrux02, ascii is encoding not a limitation... also what unicode is default utf-8, utf-16, utf-32, utf-64?
00:10:26*nsf quit (Quit: WeeChat 1.7)
00:10:45krux02well, you could also have renamed the modlue strutils to asciistrutils
00:11:07krux02utf8 is default
00:11:10krux02it's even here
00:11:10Araqhe, I like that
00:11:13krux02üöä
00:11:22cheatfatewindows disagree with you utf-32 is default for windows
00:11:24Araqtoo bad strutils is everywhere
00:11:55federico3(please let's not do the python2/python3 unicode mess again)
00:14:58krux02Araq: well sed ftw
00:23:07zachcarterthe commercial texturepacker program stores its project files as xml, definitely won’t be doing that
00:38:36*Nobabs27 joined #nim
00:41:29zachcartero/ Nobabs27 welcome back
00:41:42zachcarterI tried to answer you last night but you left before I had a chance
00:41:58Nobabs27haha thanks
00:42:05Nobabs27cool, what was it?
00:42:12zachcartertbh I don’t remember
00:42:20zachcarterI don’t even remember the question
00:42:25Nobabs27sec ill copy and paste
00:42:25zachcarterlet me go look back at the logs
00:42:28zachcarterokay
00:42:30Nobabs27 how would I use if lots of times? Like in if whatever == "ok" || whatever == "okay"
00:42:34Nobabs27or even better test for the same var?
00:42:37zachcarterah yes
00:42:41zachcartera case statement I think
00:43:00Nobabs27hm, k then
00:43:02zachcarterlet me link you to the docu on it
00:43:06Nobabs27kk
00:43:17zachcarterhttps://nim-lang.org/docs/tut1.html#control-flow-statements-case-statement
00:43:28zachcarterif that’s not going to handle your use case let me know
00:43:49Nobabs27ok, ty again lol
00:43:49zachcarterbut it’s more efficient than a bunch of if-elses
00:43:54Nobabs27yeah
00:43:58zachcarterin programming it’s generally the way to handle that kind of scenario
00:44:04zachcarterin some languages they’re referred to as switch statements
00:44:12zachcarternp
00:52:32*themagician_g quit ()
00:53:28PMunchHmm, Araq I'm trying to use libui. But how is one supposed to get values out of a Radiobox?
00:53:40*brson quit (Ping timeout: 268 seconds)
00:53:41PMunchIt doesn't have a way to set an onupdate function
00:54:15zachcarterthink he went to sleep
00:54:22zachcarternot 100% sure though
00:54:23PMunchOh, okay
00:54:46zachcarterPMunch, not to deter you from using libui but did you see my nuklear bindings?
00:55:09zachcarterI’ve been using the library in a little test project I’m building for my game engine and so far it’s going swimmingly
00:55:09PMunchNo
00:55:15zachcarterone sec let me link you
00:55:23PMunchWhat's the benefits of Nuklear?
00:55:28zachcarterhttps://github.com/zacharycarter/nuklear-nim
00:55:44zachcarterIt’s a C immediate mode GUI library that supports whatever backend you want it to
00:55:47PMunchAh, oh right
00:55:50zachcartergraphics backend
00:55:55PMunchI remember looking at it
00:55:55zachcarternot sure what your use case is though
00:56:12PMunchWould be nice for games, but I want libui for it's native look
00:56:29zachcartergotcha
00:56:49zachcarterthere’s nim-x too
00:56:59zachcarterbut I don’t think it looks very native atm
00:57:13PMunchI know, I've considered that as well
00:57:23zachcarter:) done your homework
00:57:25PMunchMy choice was pretty much between WxWidgets and libui
00:57:56zachcarteryeah I don’t know what the state of the libui stuff is… I know Araq invested time in it but I’ve also seen him rail against it
00:58:08zachcarterhow’s it working for you?
00:58:14zachcarterbesides the radio button thing?
00:58:24PMunchIt's really nice actually
00:58:35PMunchWrote a macro for it so I can create GUIs more intuitively
00:58:53PMunchhttp://ix.io/nMz
00:58:57PMunchThat's a code snippet
00:59:06PMunchgenui: is the macro
00:59:13zachcarterthat is nice
00:59:22PMunchIt transforms the DSL below into code that creates a UI
00:59:31zachcarterright
00:59:55PMunchArguments in () is passed to the functions creator, and arguments in [] is passed to the add function when it's added to it's parent
01:00:50PMunchYou can use the syntax <identifier>%Widget to create a var <identifier> = widget statement in the resulting code so you can easily use them later and you can use %<identifier> to add a widget stored in a variable
01:00:58zachcarternot sure I get that last bit completely
01:01:05zachcarterso what does Button(“Button”) do exactly
01:01:11zachcarteradds a button to the vertical box
01:01:24zachcarteror whatever parent widget is specified
01:01:36zachcarterbut why the “Button” arg
01:01:43PMunchButton("Button") turns into "let tmp2020232 = newButton("Button"); add(parent,tmp2020232)"
01:01:58PMunch"Button" is just the text displayed on the button :)
01:01:59zachcarteroh the button is named button okay
01:02:06zachcartercool :D
01:02:13PMunchButton("This is a button")
01:02:14zachcarteryeah it’s much nicer than my code atm
01:02:26PMunchThat would create a Button which said "This is a button"
01:02:36zachcarterright
01:02:37zachcarterhttps://gist.github.com/zacharycarter/bf5a640fe52c6fe2ed85c95775b10d1f
01:02:43zachcarterthat’s the code for my filebrowser
01:02:44PMunchIf you need a reference to the button later you could do mybutton%Button("This is a button")
01:03:01PMunchAnd that would make mybutton a var of type Button which can be used later in your cade
01:03:23zachcarterright
01:03:25PMunchYou can see this be used in the getRadioBox function where it does result%RadioButtons
01:03:38PMunchThat assign RadioButtons to the result variable
01:03:51zachcarterah result yeah
01:03:52zachcarterokay
01:03:53PMunchAnd later in main it is added into the tree with %rb
01:04:11PMunchAfter, of course, the call var rb = getRadioBox()
01:04:22zachcarteryeah just saw that
01:04:23zachcarternice
01:04:28zachcartervery cool little DSL
01:04:32PMunchThanks :)
01:04:44PMunchIt's one of those things which have always annoyed me with GUIs
01:05:12zachcarteryeah I hate writing them
01:05:30PMunchThe code to create them never looks good and it's filled with cryptic variable names since the programmer can't be bothered to create actual names for things that will never be used.
01:05:37zachcarterright
01:06:19PMunchOne of the most annoying parts of writing the macro was actually going back and forth with Araqs "controllgallery" example and porting the old GUI code over
01:06:54PMunchJust recreating that simple GUI was hard since it's a mess of random variables and UI functions (as all UI code is)
01:07:07zachcarteryeah
01:07:17zachcarterimediate mode simplifies some of this stuff a little bit but not much
01:07:25zachcarterless state to maintain
01:07:33PMunchOh yeah, that's for sure
01:07:34zachcarterbut still a lot of state when you’re building something complex
01:07:42PMunchThe FileBrowser looks nice by the way :)
01:07:46zachcarterthank you :)
01:08:23zachcartercurrently I’m building a little texture packer app to test out nuklear with my game endgine
01:08:25zachcarterengine*
01:08:37zachcartersince I’ll need a way to pack sprites for my game anyway
01:08:38PMunchOh nice
01:08:58zachcarterwhat are you building?
01:09:00PMunchI have some Nim code to grab textures from a TexturePacker texture atlas
01:09:11PMunchThe kind used by LibGdx
01:09:21PMunchSupports all kinds of rotations, animations etc.
01:09:31zachcarternice :) Yeah I”m going to rip a lot of code from the libgdx texture packer I imagine
01:09:44zachcarterfor max rect and bin packing etc
01:10:10PMunchCurrently I'm not building anything in particular. I've got a game on the back burner but right now I'm just writing this UI thing for it's own sake
01:10:13zachcarteralot of my engine is inspried by libgdx
01:10:19zachcarterah okay nice
01:10:24PMunchLibGDX is nice
01:10:27zachcarterit is
01:10:38zachcarterhere’s some example code from a little 2d test of my engine :
01:11:17zachcarterhttps://gist.github.com/zacharycarter/3523bbcf04185d86546238244b9a4ad3
01:11:23PMunchI wrote a little "game library" not an engine per say. It tries to be as versatile as possible
01:11:33*def-pri-pub quit (Ping timeout: 260 seconds)
01:12:04zachcarteris it on github?
01:12:22PMunchUhm, an early version is
01:12:25PMunchHold on
01:12:51*def-pri-pub joined #nim
01:13:59PMunchhttps://github.com/PMunch/SDLGamelib
01:14:02PMunchThat seems to be it
01:14:12PMunchIt uses SDL as it's rendering frontend
01:14:36zachcartercool
01:14:49zachcarterI’m using https://github.com/bkaradzic/bgfx
01:14:57zachcarterfor rendering
01:15:04PMunchhttps://github.com/PMunch/nim-sdl-template
01:15:14PMunchThat's the reason why it's using SDL
01:15:20PMunchIt was started from that project
01:15:34zachcarterah okay yeah I’ve seen that project before
01:15:35PMunchCross platform Nim on Android, iOS, and desktop
01:15:41zachcarterright
01:15:47PMunchAnd it all runs on SDL
01:15:56zachcarteryeah I’m using glfw3 for my windowing code
01:16:21PMunchIf you look in the src folder of the nim-sdl-template you can see the gamelib
01:16:24PMunchBut an older version
01:16:58zachcarterso one thing about the SDL renderer which is a reason I wanted to avoid it
01:17:02krux02PMunch: do you know that SDL has big performance problems when you use the rendering primitives?
01:17:11zachcarterit doesn’t do draw batching
01:17:27PMunchkrux02, no I didn't
01:17:32PMunchAny articles on it?
01:17:41zachcarterone sec
01:17:42krux02no I just looked at the code
01:17:51zachcarterhttp://gamedev.stackexchange.com/questions/70876/sdl2-sprite-batching-and-texture-atlases
01:17:53krux02It draws everything directly
01:18:11krux02every call is a draw call on the GPU
01:18:21zachcarterwhoops sorry that’s a bad link
01:18:36PMunchOoh, that's not good
01:18:37krux02I actually did a benchmark on my laptop (bad GPU)
01:19:00krux02and there I had a performance increase with a factor of at least 10, when I did software rendering
01:19:22zachcarterthat’s why if you want performance out of SDL2 you have to use raw opengl
01:19:22krux02All I did was a simple tile rendering, with one draw call per tile
01:19:26zachcarterand write your own drawing code
01:20:10krux02sdl for drawing is only feasible, when you have big surfaces you draw from
01:20:17PMunchHmm, I'll have to look into this
01:20:22krux02when you have many small pieces, it is very slow
01:20:33krux02you can't really do particles
01:20:34PMunchAh, so if you use texture atlases then you are fine?
01:20:36zachcarterPMunch that’s why libraries like - https://github.com/grimfang4/sdl-gpu exist
01:20:44zachcarterno unfortunately not
01:20:54zachcarterso PMunch here’s an example of a sprite batch I wrote
01:21:14zachcarterhttps://gist.github.com/zacharycarter/2b8d8f3a997ac08ef7d576dc15f8b031
01:21:20zachcarterit’s a bit complicated with all the bgfx calls
01:21:25krux02if sdl would have support for a batch renderer, then texture atlas would be the way to go
01:21:42krux02but there is no method for "render this list of rectangles"
01:21:46zachcarterbut the important thing to note is it stores vertices and doesn’t submit a draw call until a certain number of vertices are held in memory
01:21:56zachcarterOR the texture that needs to be rendered changes
01:22:03zachcarterand when that happens the batch is flushed and a draw call is submitted
01:22:09krux02you have to do a loop, and that is slow
01:22:10PMunchhttp://gamedev.stackexchange.com/questions/70876/sdl2-sprite-batching-and-texture-atlases
01:22:15zachcarterSDL doesn’t do anything like this under the hood
01:22:21*ludocode quit (Read error: Connection reset by peer)
01:22:49PMunchWell according to that SDL will wait with your copy commands until you want to present the result so you would get benefits from texture packing..
01:22:57PMunchIs the poster there wrong?
01:23:03krux02yes that's exactly the command it lacks
01:23:11krux02I was also looking for something like that
01:23:31PMunchBut look at the top answer
01:23:41zachcarteryeah he says in it
01:23:47zachcarterSDL2 certainly could offer something similar to XNA's SpriteBatch. You can already do that today on your own, though, so it's hardly necessary for SDL2 to do it in order for you to obtain the best performance.
01:24:10zachcarterxna / libgdx / whatever framework has a sprite batch
01:24:48krux02I took a look at the opengl implementation, I did not see any batching
01:25:10zachcarterthere’s definitely not krux02
01:25:50zachcarterhttps://www.reddit.com/r/gamedev/comments/3y1va8/sdl2_c_tile_map_most_efficient_way_to_render_lots/
01:25:52zachcarterfirst answer there
01:26:07krux02It is not that I don't like SDL, I really do like SDL and I use it for all of my projects, but there are features in it, that are rather useless, and should be avoided
01:26:14krux02the 2D rendering api is one of them
01:26:23zachcarterIt’s fine for certain things
01:26:24PMunchHmm
01:26:39zachcarterbut again there’s a reason projects like - https://github.com/grimfang4/sdl-gpu exist
01:26:49krux02the software surface blitting is good to create a texture atlas, but rendering should be done in OpenGl
01:26:49PMunchYeah
01:26:52zachcarterPMunch : even listed in the features there is sprite batching
01:28:07PMunchThanks for making me aware of this. I'll certainly have to run some benchmarks
01:28:28zachcarterI tried to wrap sdl-gpu and failed, before I knew a lot about wrapping C libraries
01:28:35zachcarterI could give it another go if desired PMunch
01:28:48PMunchIt would be helpful to have it certainly
01:28:59PMunchBoth for me and others who wants to use SDL in Nim
01:29:10zachcarteralright next weekend I’m probably writing a “How to wrap C libraries with Nim” so maybe i’ll use that as an example project
01:30:46zachcarterassuming I can get it wrapped this time, but I think I should be able to
01:30:53krux02I just created an issue for nim regarding C library wrappers
01:31:02zachcarteroh yeah?
01:31:05krux02https://github.com/nim-lang/Nim/issues/5437
01:32:17zachcarterthat would be awsome
01:32:29PMunchIs there a guide on how to make a wrapper "nimian"? If not there should be
01:33:30zachcarterprobably not
01:33:38zachcarterI’ve only really come across one or two guides about wrapping libraries with nim
01:33:44zachcarterneither were great
01:34:04PMunchI watched this talk: https://www.youtube.com/watch?v=wf-BqAjZb8M&t=1417s recently
01:34:28PMunchIt's about what PEP-8 (Python style good) does to how you think about "good code"
01:35:14PMunchAt ~23.37 he shows an example of how the above code (which was Python from a Java wrapper) could be done much more Pythonic
01:35:29PMunchBut it required either a change in the library, or a thin wrapper.
01:35:53zachcarteryeah I think that might be guide # 2
01:36:03zachcarterafter I finish writing the first guide
01:36:04PMunchAnd I think this is something that Nim should keep in mind as well. Simply converting a C library to be usable in Nim might not be good enough
01:36:24PMunchIt should also include things to make it more "nimian"
01:36:26zachcarterit’s true you can always make the bindings more idiomatic for the language you’re binding to
01:36:33PMunchExactly
01:36:46zachcarterbut first we need a guide about how to bind :D
01:36:52PMunchHaha, that's true :)
01:36:57zachcarterbecause the one that exists right now on the internet is pretty awful
01:37:10zachcarterit basically is a summary of the docu on #if C2NIM
01:37:22libmanNuklear is lightweight, permissively licensed, and has no dependencies.
01:37:27krux02I think there are two levels that are very important
01:37:40krux02The first level is the thinnest wrapper possible
01:37:44krux02no conversion
01:37:58PMunchOh yeah, for performance
01:38:00krux02but all data from the C library and function calls should be available
01:38:12krux02then there should be something that is a bit more in the style of Nim
01:38:12zachcarterlibman: ?
01:38:18PMunchI've seen a lot of the Nim libraries diving things up with raw<lib> and lib
01:38:33PMunchlibui is an example
01:38:48krux02and the outer wrapper should not export any cint, c... types at all
01:39:01PMunchIt has rawui which is basically just casting and such, then you have ui which makes in all pretty and Nim-like
01:39:15krux02I remember, that I once have written A go wrapper, and the library returned a char*
01:39:28krux02I just opened up the string header, und put the pointer in
01:39:32krux02I did not do a conversion
01:39:34krux02and it worked
01:39:47krux02that's both, thin, and ideomatic
01:40:01krux02the garbage collector also did not have a broblem with it
01:40:28zachcarternice
01:40:33zachcarterI gotta run, be back later
01:40:51krux02The problem is, that would not pe possible in Nim, because in Nim a string is the data directly followed after the size/capacity pair
01:41:03libmanThat was re PMunch "What's the benefits of Nuklear?"
01:41:07krux02so there is no field, where I can write the pointer to
01:41:55zachcarteroh gotcha
01:42:51*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
01:46:22PMunchkrux02, well the reason I think is UTF-8
01:46:29PMunchCan't use null-terminated strings with it
01:46:42PMunchlibman, haha that was ages ago
01:46:48PMunchzachcarter, told me
01:46:56PMunchWhat the benefits were :)
01:46:59PMunchBut thanks anyways
01:47:27krux02null-terminated strings just work fine with utf-8
01:50:25PMunchOh, you're right
01:50:31PMunchI thought that was the reason..
01:50:55PMunchI guess it's to make strings more secure then
01:51:05PMunchAnd to much easier be able to get a len out of it
01:53:18krux02Well the reason is probably just performance
01:53:42krux02when you have the size and the capacity stored with the actual string data, the string itself can be implemented with just a pointer
01:54:51krux02java also has a design, where the string has data and size stored together, and then the string is always referenced
01:55:15krux02but nim strings are different, they are mutable with copy semantics, like c++ strings
01:55:36krux02so I am not sure if these things actually make a difference
01:56:39*brson joined #nim
01:57:54PMunchHmm
02:29:33*Matthias247 quit (Read error: Connection reset by peer)
02:30:59*chemist69 quit (Disconnected by services)
02:31:03*chemist69_ joined #nim
02:33:39*bjz joined #nim
03:02:51*jmkr joined #nim
03:43:36*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
03:45:33*rauce quit (Ping timeout: 260 seconds)
03:52:57*rauce joined #nim
04:09:57Nobabs27Using paramStr(), else does not trigger when no args are given?
04:17:05*dddddd quit (Remote host closed the connection)
04:22:59*bjz joined #nim
04:30:31zachcarterNobabs27 - let me take a look
04:32:34*Snircle_ joined #nim
04:32:45zachcarterhow are you calling paramstr when no args are given Nobabs? Don’t you have to specify an index?
04:32:55zachcarterNobabs27 *
04:34:24*chemist69_ quit (Ping timeout: 240 seconds)
04:34:24*Snircle quit (Ping timeout: 240 seconds)
04:39:11*chemist69 joined #nim
04:43:45Nobabs27k sec
04:44:04Nobabs27case paramStr(1)
04:44:37Nobabs27actually
04:44:57zachcarterif I don’t provide an args and I do case paramStr(1) I get an error
04:45:08zachcarterindex out of bounds
04:45:14zachcarterwhich makes sense…
04:45:21Nobabs27yeah
04:45:22Nobabs27that
04:45:52zachcarterso the reason for that is because argument 0 I believe is the application name or working directory or something
04:46:00zachcarterlet me find out which
04:46:06Nobabs27ok
04:46:18Nobabs27why does it care what those are?
04:46:35zachcarterit’s the current binary name being executed
04:46:41Nobabs27ok
04:46:46Nobabs27in this case ./test
04:46:55zachcarterright
04:47:08zachcarterit will probably fully resolve the path ./
04:47:22zachcarterbut anywho it doesn’t care it just plops that in as the first argument in case you care
04:47:39Nobabs27how do I stop it from plopping it? xD
04:47:45zachcarteryou as the user of that function always know that the name of the executable will be at argument 0
04:47:48zachcarteryou can’t just ignore it
04:47:54zachcarterare you trying to iterate over command line arguments?
04:47:59zachcarterwhat exactly are you trying to do?
04:48:18Nobabs27have it print something more sane
04:48:28Nobabs27like "you didn't type anything, please do"
04:48:39Nobabs27or "no args"
04:48:46zachcarterlet me write something up for you real quick
04:48:57Nobabs27gg ty
04:50:17zachcarterjust fyi there is a great Nim library for parsing command line arguments
04:50:27Nobabs27name?
04:50:30zachcarterhttps://github.com/docopt/docopt.nim
04:54:09zachcarterimport parseopt2
04:54:10zachcarterproc writeHelp() =
04:54:12zachcarter echo "help"
04:54:13zachcarterproc writeVersion() =
04:54:15zachcarter echo "version"
04:54:16zachcartervar
04:54:18zachcarter filename = ""
04:54:19zachcarterfor kind, key, val in getopt():
04:54:21zachcarter case kind
04:54:22zachcarter of cmdArgument:
04:54:24zachcarter filename = key
04:54:25zachcarter of cmdLongOption, cmdShortOption:
04:54:27zachcarter case key
04:54:28zachcarter of "help", "h": writeHelp()
04:54:30zachcarter of "version", "v": writeVersion()
04:54:31zachcarter else:
04:54:33zachcarter echo "not understood"
04:54:34zachcarter of cmdEnd: assert(false) # cannot happen
04:54:36zachcarterif filename == "":
04:54:37zachcarter # no filename has been given, so we show the help:
04:54:38zachcarter writeHelp()
04:54:39zachcarterwhoops sorry
04:54:40zachcarterI meant to past a link to a gist not that haha
04:54:54zachcarterhttps://gist.github.com/zacharycarter/5bd1a7b411316bc30bff2749ad7b9535 Nobabs27
04:55:12Nobabs27lol
04:55:51zachcarterdocopt is a lot nicer than that code
04:56:14zachcarterif you can use docopt I’d highly reccomend it - it allows you to specify the specification for your command line interface via documentation
04:57:10Nobabs27yeah looks cool ill give it a try
04:57:53Nobabs27except now I need to get nimble to work xD
04:58:46Nobabs27ok nice that was simple (yaourt -S --noconfirm nimble)
04:59:33zachcarter:)
05:02:17Nobabs27difference between parseopt2 vs docopt ?
05:03:01zachcarterparseopt2 is a core nim library
05:03:15zachcarterdocopt is a library someone wrote that is similar to a popular python library docopt
05:03:25zachcarterparseopt2 isn’t even a library it’s a module
05:03:34zachcarterhttps://nim-lang.org/docs/parseopt2.html
05:03:50zachcarterdocopt is much more feature rich
05:11:31*bjz_ joined #nim
05:13:54*bjz quit (Ping timeout: 268 seconds)
05:24:33*r4vi_ joined #nim
05:27:55*stisa1 joined #nim
05:28:56Nobabs27maybe the simplest thing would be to just handle the exception?
05:29:36zachcarteryou could do that
05:30:05*krux02 quit (Quit: Leaving)
05:30:29*bbl_ joined #nim
05:30:55*libman quit (Quit: Connection closed for inactivity)
05:33:29*stisa quit (Ping timeout: 252 seconds)
05:33:29*r4vi quit (Ping timeout: 252 seconds)
05:33:30*bbl quit (Ping timeout: 252 seconds)
05:34:00*r4vi_ is now known as r4vi
05:37:56Nobabs27how bad of an idea is it to assume the reason for an IndexError?
05:37:59Nobabs27ie:
05:38:05Nobabs27except IndexError: echo "args pls"
05:40:25*bjz joined #nim
05:40:44*bjz_ quit (Ping timeout: 240 seconds)
05:42:16zachcarterI mean it depends on the intended user and purpose of your program
05:42:52zachcarterif it’s a simple program meant to be used by someone familiar with how the program functions, then it’s probably fine
05:55:42*rauce quit (Ping timeout: 240 seconds)
06:02:28Nobabs27ok
06:04:58*brson quit (Ping timeout: 240 seconds)
06:08:55*Nobabs27 quit (Quit: Leaving)
06:13:15*rauce joined #nim
06:34:24*PMunch quit (Quit: leaving)
06:36:56*nsf joined #nim
06:43:26*chemist69 quit (Ping timeout: 255 seconds)
06:45:52*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
06:46:11*chemist69 joined #nim
06:47:33*def-pri-pub quit (Quit: leaving)
07:00:42zachcartermy file browser is showing all sorts of system and hidden files but eff it
07:00:46zachcarteruser beware
07:14:18*eizua joined #nim
08:22:34*bjz joined #nim
08:26:43*yglukhov joined #nim
08:31:14*yglukhov quit (Ping timeout: 268 seconds)
08:57:46FromGitter<Varriount> zachcarter: :3
08:57:59zachcartero/ varriount
08:58:19zachcarterfeeling any better?
09:02:32*yglukhov joined #nim
09:18:34*themagician joined #nim
09:23:32*Arrrr joined #nim
09:29:12*Vladar joined #nim
09:38:27*stisa1 is now known as stisa
09:41:24*chemist69 quit (Ping timeout: 240 seconds)
09:41:26*rokups joined #nim
09:42:18*chemist69 joined #nim
10:11:23*ftsf joined #nim
10:14:26*Matthias247 joined #nim
10:24:02*dom96 quit (Changing host)
10:24:02*dom96 joined #nim
10:33:03*zachcarter quit (Quit: zachcarter)
10:50:19*bjz_ joined #nim
10:52:39*bjz quit (Ping timeout: 260 seconds)
11:33:07rokupsis there any way to dump PNode/PSym/PType in a compiler? something like dumpTree in macros module
11:38:31dom96debug
11:41:03dom96It would be great if these were changed to reflect the macros module
11:41:28*yglukhov quit (Remote host closed the connection)
11:43:05*bjz joined #nim
11:43:24*bjz_ quit (Ping timeout: 240 seconds)
11:47:40*Trustable joined #nim
11:48:49*yglukhov joined #nim
11:53:04*yglukhov quit (Ping timeout: 240 seconds)
11:54:45Araqrokups read this please: https://nim-lang.org/docs/intern.html#debugging-the-compiler
12:02:20*yglukhov joined #nim
12:03:32*dddddd joined #nim
12:10:09*djellemah quit (Ping timeout: 268 seconds)
12:13:43*Pisuke joined #nim
12:15:29*MyMind quit (Ping timeout: 240 seconds)
12:25:43*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
12:35:17*yglukhov quit (Remote host closed the connection)
12:44:29*abeaumont joined #nim
12:53:05*djellemah joined #nim
13:12:15*krux02 joined #nim
13:22:21*shashlick quit (Ping timeout: 260 seconds)
13:22:44*shashlick joined #nim
13:44:57*zachcarter joined #nim
13:48:40zachcartero/ morning
13:59:36nivhello
13:59:40dom96hi
13:59:54nivquick question: https://gist.github.com/niv/7a93426f89ed7e50159c5e7bf2bea388 create as wiki page [y/n]?
14:00:27*yglukhov joined #nim
14:01:22dom96y
14:04:14demi-goddamn, i go to make a simple windowing system using termbox and now i'm contemplating writing a layout system so that it can be resized properly
14:04:49nivhttps://github.com/nim-lang/Nim/wiki/Run-nim-source-files-like-scripts-(with-tcc-and-binfmt_misc)
14:05:01niv*throws it over the wall and runs away*
14:10:08federico3niv: I guess you want to avoid the limitations of nimscript?
14:11:44*djellemah quit (Ping timeout: 240 seconds)
14:11:47nivit was honestly just an experiment because i got fed up by long compilation times, so i looked into tcc, and that's the result
14:12:36nivbinfmt_misc is pretty cool though
14:15:28*dddddd quit (Remote host closed the connection)
14:18:40zachcarterwhat’s the best thing to map cstrings to in nim?
14:19:48federico3niv: a nims script could write out a temporary .nim file using https://github.com/FedericoCeratto/nim-morelogging/blob/master/tests/testutils.nim#L73 and then compile and run it. A solution looking for a problem. :)
14:19:51zachcarterI’m looking at example C code like - https://github.com/vurtun/nuklear/blob/master/demo/overview.c#L473
14:20:50zachcarterIf I just use strings in Nim I’m not sure how to do things like - https://github.com/vurtun/nuklear/blob/master/demo/overview.c#L483
14:21:19zachcarterI’ve been using sequences of chars but I’m not sure if that’s right either, doubtful
14:22:50*eizua quit (Remote host closed the connection)
14:25:05*djellemah joined #nim
14:25:10dom96map them to strings
14:25:33zachcarteralright so when I do that
14:25:36dom96What are you unsure of?
14:25:43dom96`&text_len[0]`?
14:26:02zachcarterI get that that’s a pointer to an index in the string right
14:26:14dom96well, that seems to be an array of ints actually
14:26:21dom96but &text[0] is a pointer to the first char
14:26:25dom96In Nim: addr text[0]
14:26:33zachcarterright okay
14:26:42dom96(and 'text' can be either a cstring or a string in this case)
14:27:17zachcarterokay, I guess what’s confusing me is when I examine the value of a string like text at runtime when I think its value should be set to something, it’s echoing as an empty string
14:27:24zachcarteri’m probalby not doing something right with nuklear
14:28:04zachcarterI’ll play around with the api he offers more, thank you dom96
14:28:18dom96try using repr
14:28:34zachcarteryeah I was
14:29:46zachcarteroh weird if I echo the length of the string first
14:29:52zachcarterI actually get the string back
14:30:49zachcarternevermind, I must have been doing something wrong it’s working as expected now thanks again dom96
14:30:55dom96np
14:36:25demi-is there any way to do inverse ranges? like i can iterate from 0->5 using `0..5` but can i go in the opposite direction?
14:39:12*Matthias247 quit (Read error: Connection reset by peer)
14:39:26dom96demi-: countdown()
14:39:28*PMunch joined #nim
14:41:22zachcarterthis is curious...
14:42:14zachcarterhttps://gist.github.com/zacharycarter/984311590ca397fa39bc63f2a2fd51cd
14:42:53zachcarterI wonder why it echos t and then the correct value test
14:43:37demi-thank you dom96
14:43:55zachcarterI updated the gist with what happens when I use repr as well
14:45:24*abeaumont quit (Ping timeout: 240 seconds)
14:45:33*Jesin quit (Ping timeout: 268 seconds)
14:49:37*Jesin joined #nim
14:59:27PMunchHmm, I'm wondering. LibUI should really be ported to Nim shouldn't it?
14:59:42PMunchIf the goal is to use it as Nims default graphical framework that is
15:01:24zachcarterI think that’s what nimx is an attempt at
15:01:28zachcarterI mean not a port of libui
15:01:34zachcarterbut to be a pure nim gui framework
15:01:49PMunchOh yeah, but it does it's own thing
15:02:09PMunchLibUI is basically just a thin wrapper around Gtk, win32, and cocoa
15:02:19zachcarterhrm
15:02:23zachcarterdo you really want to write that :/
15:02:23PMunchSo when you ask for a Checkbox it basically just does the right call
15:02:38PMunchHaha, not really :P
15:02:45zachcarterI personally cannot stand writing native windowing / gui code
15:03:01dom96Might be fun if you keep it simple :)
15:03:12dom96But maybe I'm the only one that finds these kinds of things fun
15:03:16zachcarteruntil you start having to write objective-c
15:03:18PMunchWell, since we have binding for at least gtk and win32 it should be a pretty simple (albeit a bit boring) conversion job
15:03:48zachcarterlook at this hell
15:04:06zachcarterhttps://github.com/yglukhov/nimx/blob/master/nimx/private/windows/appkit_window.nim
15:04:57PMunchhttps://github.com/andlabs/libui/blob/master/unix/combobox.c
15:04:59zachcarterI guess if you’re familiar with obj-c and cocoa it won’t be so bad
15:05:09PMunchThat's the thing though
15:05:22PMunchWith the existing bindings it should be fairly trivial to convert
15:05:33PMunchAs you can see libui is pretty basic
15:05:36zachcarteryeah
15:06:40zachcarterdom96: can you think of a reason off the top of your head my strings would be echoing the correct value when echod individually but when concatened, or reprd that’s not the case
15:07:00zachcarterwhen reprd they repr like the address to an empty string
15:08:33demi-zachcarter: you do realize that AppKit and NSWindow have been around for like 30 years?
15:08:55demi-and have changed platforms a couple of times
15:09:45zachcarterI wasn’t demi-
15:10:09demi-it is an extremely complicated UI platform
15:11:19zachcarterfrom my limited experience with it I’d agree
15:13:08krux02time makes things more complicated
15:13:32krux02especially when people don't know whot to focus on, then they start to develop unnecessary full
15:15:48krux02zachcarter: about the strings, when you concatenate them, you concatenate the content literally, including 0-bytes
15:16:03zachcarterah so I need to trim first?
15:16:10dom96yeah, the \0 bytes are most likely to be problematic
15:16:15krux02that shouldn't destroy a string, but let's the printed version look a bit different than expected
15:16:28zachcarterahh this makes sense okay thank you
15:16:31krux02trim removes whitespace
15:16:32dom96If the C function gives you the length it wrote to the string then you can write: str.setLen(len)
15:16:49dom96to "trim" it :)
15:16:56zachcarterhaha okay cool thanks
15:18:35zachcarterworked perfectly thank you guys so much
15:20:39*yglukhov quit (Remote host closed the connection)
15:21:04*rauss joined #nim
15:22:55*yglukhov joined #nim
15:42:46*PMunch quit (Quit: leaving)
15:46:23*LeNsTR|away is now known as lenstr
15:46:51zachcarterhrm it doesn’t seem like there’s a way to write comments to a config file using - https://nim-lang.org/docs/parsecfg.html#next,CfgParser
15:47:00zachcarterunless I’m missing something
15:47:19zachcarterdoes that mean I’ll have to open the file once to write comments then open it again to make the https://nim-lang.org/docs/parsecfg.html#writeConfig,Config,string call?
15:48:56zachcarterI guess I can do dict.setSectionKey("","#","test")
15:49:03zachcarternot ideal but it works
15:50:17demi-one thing that bugs me about the parsecfg module is that there is no iterator for sections names
15:51:05demi-it can do that but only if you sequentially parse the file, but there doesn't seem to be one for accessing the section names outside of that context.
15:51:30zachcarterhrm
15:51:44zachcarterthat does seem not so great
15:52:02zachcartermaybe I’d be better served storing config in that yaml project you guys linked me to the other day
15:56:59*rauss quit (Quit: WeeChat 1.7)
15:58:45dom96PRs welcome for improvements to the parse* modules. In fact, this setSectionKey and similar should not be in the parsecfg module but in a 'cfg' module.
15:59:03dom96The parseopt module could also use a similar improvement to its interface
15:59:10dom96via a 'opt' or 'cmdopt' or whatever module
16:01:05zachcarterokay question then
16:01:45zachcarterwriteconfig is obviously the method all file IO should go through in terms of writing to the cfg file
16:02:07zachcarterand the table format it expects is [section, key, value]
16:02:38zachcarterwould the best way to do comments then be when the section is ! or # or ; assume comment?
16:02:51zachcarterand then add that to the docu explicitly stating that?
16:03:02zachcarteror allow some other method for specifying comments
16:03:40dom96I would probably go with some other method for specifying comments
16:03:56dom96But I'm not familiar with the details of how this config writing stuff works in parsecfg
16:04:19zachcarterthe problem is avoid unnecessary I/O
16:05:07zachcarterthere’s really only one method to write config atm and that’s this method - https://github.com/nim-lang/Nim/blob/master/lib/pure/parsecfg.nim#L485
16:05:40zachcarterif I were to introduce a proc like writecomment I’d have to re-open the file I believe right?
16:06:00demi-what is the justification for writing a comment?
16:06:16zachcarterbecause config files allow for them?
16:06:27zachcarterif I’m producing an automated config file I don’t want anyone touching
16:06:42demi-I think that you should just serialize it as a normal file then
16:06:43zachcarterI’d like to be able to warn readers of that
16:07:25Arrrr+1
16:08:09zachcarterhmm
16:08:50zachcarterwhat exactly do you mean when you say normal file?
16:09:22zachcarterlike a non cfg file?
16:09:35demi-like, use regular file IO methods to write out the file without using the cfg module
16:09:42zachcarterah I see what you’re saying
16:10:06zachcarteryeah it’s not a huge deal to do so
16:10:48demi-the point of comments are to be seen by the end-user, not by the system, there wouldn't be a proper way to represent them in code when they get taken in when the cfg gets parsed.
16:11:28zachcarteryeah I think that’s why the parser just ignores them
16:11:32zachcarterwhich is fine
16:12:02zachcarterI mean if parsecfg is just for parsing cfg files I understand not wanting a bunch of write methods in there, and I get that the one write method that exists is essentially just serializing a table
16:12:09zachcarterusing the I/O operations available in system
16:12:28zachcarterI was essentially just looking for a convenience method
16:18:11dom96I would say that there should be a `$` to get the string representation of the config
16:18:20dom96then you can easily add your comments
16:23:38*brson joined #nim
16:25:38*yglukhov quit (Remote host closed the connection)
16:29:40demi-is there a nim-lang package for ubuntu that is part of apt-get?
16:38:40FromGitter<Jeff-Ciesielski> IIRC, you can just `apt-get install nim`
16:39:08nivubuntu has nim, but its "a bit" old (0.12)
16:39:54demi-yeah my ubuntu apparently doesn't have a package for that
16:40:18federico3Xenial has .12, Yakkety .13 and Zesty .16
16:40:31dom96ooh, zesty has .16? wow
16:40:32nivi guess im on xenial then
16:40:50federico3dom96: it's pulling my packages from Debian Sid
16:41:01dom96federico3: awesome, does it include Nimble as well?
16:41:11federico3yep
16:41:20nivis there a ppa you can link in without adding unstable to apt?
16:41:59federico3niv: you can add unstable and pin it at lower priority or just grab the file from any mirror
16:42:15demi-i have no idea how to do that
16:42:16nivi could do that, i guess.
16:42:24federico3niv: like the wgets in https://github.com/nim-lang/Nim/wiki/BuildServices
16:42:29nivgrabbing manually divests me of receiving updates though
16:43:15demi-my alternative here is giving myself a crash course in docker
16:43:29nivomg, docker. good luck
16:43:32federico3urgh
16:43:52nivdocker is great natively, but forget about it on osx or windows
16:46:08federico3or in production or on a slightly older system...
16:46:13*libman joined #nim
16:46:13Calinouhow about providing the Nim tools as AppImage? :)
16:46:17Calinouis that doable?
16:46:37Calinouso you can acquire the latest version from binaries, and use it on any distro
16:46:45federico3ooh appimage supports firejail, very nice
16:47:53Calinouyes, it also supports delta updates, GPG2-signing
16:48:24CalinouAppImage depends only on libfuse, no dependency on init system (Flatpak used to depend on systemd, now it's no the longer the case, but it still requires a runtime)
16:48:42Calinouthey're compressed (gzip by default, if I'm not mistaken), and use SquashFS, so they're fast to open
16:48:50Calinoulastly, they can have desktop integration (optional)
16:49:06federico3for some values of "fast" :)
16:49:15Calinouand if you want to "install" them system wide, just move and rename the AppImage to /usr/local/bin or somewhere else in your PATH
16:49:48nivhow would you handle a nim distro as an appimage though? you'd need nim and nimble at the very least, and probably others
16:49:58Calinouniv: several AppImages, I figure
16:50:12federico3and make all the libs available to the compiler and other tools
16:50:14Calinouwe can supply a .zip containing appimages of nim, nimble, and an install script
16:50:29Calinouyes, handling libraries will be harder
16:50:33nivso nimble would have to open up the nim appimage to get at stdlib, i suppose
16:50:52Calinoudo note that AppImages are read-only
16:51:04nivim not so sure this is an advantage over just shipping a tarball
16:51:12federico3hence it's not going to be that fast
16:51:12nivbut im old and grumpy, so dont listen to me
16:51:31dom96What is this new fangled AppImage you speak of? :)
16:51:44Calinouhi dom96 :) it's this: http://appimage.org/
16:51:54nivyeah. get of my grass. also, 0.16.1 please with the nimble bin=@[] fix
16:52:21federico3yes please!
16:52:24dom96Awesome. But seems more aimed at GUI apps.
16:52:44dom96I've got a basic version of choosenim working now.
16:52:44nivi want to build nimble packages that export binaries but it just doesnt work yet :)
16:52:55dom96That should make management of different Nim versions much easier for us all
16:52:55federico3snap and flatpak might not have the limitation of 1pkg <-> 1 executable
16:53:12dom96I wonder whether I should go as far as downloading the C compiler for Windows users.
16:53:35nivdom96: maybe bundling a mingw/gcc zip might not be a terrible idea?
16:53:49dom96niv: I want a single exe
16:53:56dom96That downloads whatever is needed
16:54:18niv99% of windows users (at least in my experience) cant be bothered to go grab mingw and some end up grabbing the wrong package and then they dont set up PATH properly and nothing works and they just throw their hands up
16:54:28dom96choosenim 0.16.0 # downloads Nim 0.16.0, bootstraps and creates a proxy exe in ~/.nimble/bin/{nim, nimble, nimgrep, nimsuggest}
16:54:37Calinoudom96: nice, so it's a bit like rustup?
16:54:45dom96yeah, it's exactly like rustup :)
16:54:48CalinouI approve having a toolchain chooser, it can be pretty handy for handling different versions
16:54:51nivthats a good idea, dom96
16:54:59*Sentreen quit (Ping timeout: 255 seconds)
16:55:16nivon windows, it should be able to grab mingw/tcc transparently for you and make it work
16:55:18dom96I want to make Nim installation as easy as copying a single command into your terminal
16:55:21dom96On all OS'
16:55:30nivsounds great
16:55:31dom96So I guess it should grab MINGW for the user too D:
16:55:55dom96Windows will be a PITA, I can already sense it.
16:55:58nivyeah. a bundled gcc 5.x will do well and isnt too big. it doesnt need to be system-wide
16:56:07Calinouwhy not GCC 6.x? mingw-w64 has that
16:56:11Calinou(also has 64-bit GCC, I believe)
16:56:11nivor that.
16:56:28Calinoumingw-w64 uses SourceForge for its downloads, so we may need to mirror them somewhere else
16:56:33nivor tcc, although its a pain with linking from what i heard, at least on windows
16:56:36Calinouother than that, the toolchains are quite up-to-date
16:56:46dom96The nim site already hosts mingw
16:57:01nivcould choosenim not bundle a dedicated zip without going through the mingw installer?
16:57:04dom96I'll just need to repackage it into a .tar.gz :)
16:57:28Calinoutalking about https://sourceforge.net/projects/mingw-w64/ by the way
16:57:29niva quick option for people to get started. if they want to customise they can always install mingw/vcc/whatever themselves
16:57:35euantor@dom96 since you're here, any chance you can edit this topic to fix the link? It's missing the HTTP: https://forum.nim-lang.org/t/2819
16:58:15dom96euantor: sure, done
16:58:25euantorNice one, thanks
16:59:20dom96Yeah, I might even not bother checking if the user has their own MINGW (for now at least)
16:59:25dom96It will just lead to problems
16:59:41stisaniv: about tcc, is it the one in the git repo of nim, in the `tinyc` folder?
17:00:00federico3dom96: have you looked into flatpak?
17:00:08nivdom96: nim could default to a config.nim that points to a package-local gcc install by default, and the user can then go and edit it to point elsewhere if they wanted to
17:00:50dom96federico3: nope, what is it?
17:00:58nivstisa: sorry, i dont know. i just tried it out on linux to compile nim apps because clang was about twice as slow. i googled if i could ship a more streamlined package for the project im working on (embed tcc) but looks like tcc cant link some libs
17:01:04federico3dom96: http://flatpak.org/
17:01:17federico3a superset of what appImage does
17:01:18CalinouFlatpak tries to solve a problem similar to AppImage, but it has a different approach
17:01:29Calinouit requires a runtime, doesn't run on very old distros though
17:02:06dom96oh dear, I hope we won't end up with two different incompatible appimage-like solutions
17:08:21*Sentreen joined #nim
17:09:35*onionhammer quit (Quit: WeeChat 1.0.1)
17:15:47*onionhammer joined #nim
17:17:11euantorAnd there's also Canonical's snap format
17:17:37euantorhttps://xkcd.com/927/ - relevant XKCD
17:20:55federico3I'll point out that CircleCI stores and serves build artifacts over HTTPS
17:21:41FromGitter<zetashift> Getting a 'Hint: [Link] ⏎ Error: unhandled exception: Access is denied. ⏎ [OSError]' when trying to run first block of code of https://hookrace.net/blog/writing-a-2d-platform-game-in-nim-with-sdl2/
17:22:08FromGitter<zetashift> any ideas how i can fix this? windows 10 64bit
17:24:36FromGitter<zetashift> ah seems I'm having this error even on a simple hello world
17:39:26Calinoudom96: we already have incompatible solutions :(
17:39:31Calinouit was bound to happen
17:42:04*brson quit (Ping timeout: 240 seconds)
17:52:06*yglukhov joined #nim
18:02:24*yglukhov quit (Remote host closed the connection)
18:03:20krux02zetashift: can you greate a pastbin/ix.io/gist with the code you have?
18:06:28*rauss joined #nim
18:09:44FromGitter<zetashift> I fixed it, reinstalled nim with seemed to work
18:10:27*Matthias247 joined #nim
18:13:53*yglukhov joined #nim
18:18:55*yglukhov quit (Ping timeout: 268 seconds)
18:32:27zachcarterso I have a C callback I’m getting nill access errors inside and I ran lldb and saw that I crashing during some GC calls, and of course I forgot to call setupForeignThreadGc() inside the callback
18:32:33zachcarterbut even with that call I’m still getting nill errors
18:33:28zachcarterhttps://gist.github.com/zacharycarter/362411d0570226739053578b5008e76f
18:33:45zachcarteris there something else I’m forgetting to do
18:43:38Araqzachcarter: sounds like you misuse the C callback to "share" two different GC heaps or rather have cross-threads refs etc
18:43:59zachcarterhrm okay
18:44:16zachcarterthank you Araq I’ll investigate further
18:52:26*chemist69 quit (Ping timeout: 255 seconds)
18:57:04*chemist69 joined #nim
19:01:31*dddddd joined #nim
19:01:40*djellemah_ joined #nim
19:02:11*rokups quit (Quit: Connection closed for inactivity)
19:05:10subsetparkHuh. Who can think of why my version of the Nim compiler doesn't implement Deque.len?
19:07:39*yglukhov joined #nim
19:07:56subsetparkOh never mind! Sometimes I forget I need to import modules everywhere I call procs on their objects, even if I don't refer to the types or initializers
19:19:35zachcarterhrm I have no idea how to avoid this misuse of the C callback Araq - I am accessing memory outside of the callback but I’m not sure how to control which GC heap it was allocated on or how to avoid cross thread refs here
19:20:02zachcarterI’ll try to create a much simpler example and see if I get the same kind of behavior
19:20:58Araqwhy does the C library impose some threading scheme onto your code? that's bad design
19:22:19zachcarterit’s a good question
19:22:27*smt_ joined #nim
19:22:28*smt quit (Ping timeout: 240 seconds)
19:22:28zachcarterI’m going to see if it’s actually glfw causing the problem
19:24:32*synshroud quit (Quit: ZNC 1.6.4 - http://znc.in)
19:25:36*smt_ is now known as smt
19:28:54zachcarteryeah it’s definitely a problem with nuklear
19:35:18*synshroud joined #nim
19:36:46zachcarteror bgfx
19:42:28*rauss quit (Quit: WeeChat 1.7)
19:51:08*bjz joined #nim
19:54:45*raiz joined #nim
19:56:19*Nobabs27 joined #nim
19:57:36*Salewski joined #nim
19:58:27Salewskiconst MININT16 = -32768'i16 # generated by gobject introspection
19:58:31Salewskih5.nim(557, 19) Error: number 32768'i16 out of valid range
19:59:00SalewskiIs that an issue that should be reported?
20:05:48SalewskiOf course no problem for me, I may drop that const or replace by G_MININT16* = 0x8000'i16 an done by c2nim
20:06:08Araqit's not a bug. the minus is not part of the number literal
20:06:31Araqit's - (32768'i16) and that is indeed an invalid int16
20:06:41SalewskiI know, but people may type it in in that way.
20:07:10Araqpeople can be expected to learn the programming language they use
20:07:38Araqit's not a Nim specific issue anyway
20:07:52Araqplenty of other languages work this way too.
20:08:05SalewskiOK.
20:08:39Araqbtw G_MININT16 shouldn't be part of your wrapper IMO
20:09:09SalewskiYes I agree.
20:09:09Araqthat's an artifact of old C missing a limits.h file
20:10:32SalewskiI really only asked because other people may wonder if they try to define their own min int32 or min int64.
20:10:56Araqlow(int16)
20:11:01dom96who was it that managed to embed a DLL into a Nim app and then load it before the app started?
20:11:20SalewskiBye.
20:11:26Araqbye
20:11:34*Salewski left #nim (#nim)
20:16:04*def-pri-pub joined #nim
20:28:21*yglukhov quit (Remote host closed the connection)
20:32:37*yglukhov joined #nim
20:35:05*byte512 quit (Remote host closed the connection)
20:47:52*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
20:56:11*djellemah quit (Ping timeout: 255 seconds)
21:13:03*bjz joined #nim
21:25:52FromGitter<Varriount> zachcarter: Any solution to your threading problem?
21:27:03*Arrrr quit (Quit: Leaving.)
21:32:50*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
21:55:40*Kingsquee joined #nim
22:02:28*ofelas quit (Remote host closed the connection)
22:02:47*ofelas joined #nim
22:02:50*Vladar quit (Quit: Leaving)
22:08:28*kunev quit (Ping timeout: 240 seconds)
22:10:09*kunev joined #nim
22:15:44*def-pri-pub quit (Ping timeout: 260 seconds)
22:21:27*yglukhov quit (Remote host closed the connection)
22:22:09*PMunch joined #nim
22:24:50*yglukhov joined #nim
22:27:52*Trustable quit (Remote host closed the connection)
22:29:17*yglukhov quit (Ping timeout: 260 seconds)
22:29:20*def-pri-pub joined #nim
22:37:32*nsf quit (Quit: WeeChat 1.7)
22:46:38*abeaumont joined #nim
22:47:50PMunchCan I get a reference to an object in Nim?
22:48:13PMunchSay I have an object, and I want to create ie. a structure that points to those objects
22:48:37zachcarterHey Varriount: I did figure it out thank you for asking. I was copying a string to a member of an object and that string was getting GC’d that was my issue
22:48:51zachcarterPMunch - addr(object)
22:49:04zachcarterunless I’m not understanding what you’re asking
22:49:44PMunchIsn't addr just an untraced pointer
22:50:58*ofelas quit (Remote host closed the connection)
22:51:15*ofelas joined #nim
22:51:41zachcarterah okay I missed the object part sorry
22:52:17zachcarterlet foo: ref Bar = new(Bar)
22:52:45zachcartertype
22:52:56zachcarter FooRef* = ref Foo
22:53:27zachcarterlet foobar = FooRef(bar: “foo”)
22:54:18zachcarteror you can just declare the entire object as a ref object
22:54:22zachcartertype
22:54:30zachcarter Foo* = ref object
22:54:40zachcarter bar*: int
22:55:29zachcarterthat’s the only way I know of to declare reference types in nim
22:56:51zachcartermaybe you’re asking about this - https://forum.nim-lang.org/t/322
23:01:24*chemist69 quit (Ping timeout: 240 seconds)
23:04:38*ftsf_ joined #nim
23:05:17*themagician quit ()
23:09:27PMunchAh right
23:09:30PMunchThat makes sense..
23:15:28*ofelas quit (Remote host closed the connection)
23:15:52*ofelas joined #nim
23:25:58*ofelas quit (Remote host closed the connection)
23:26:21*ofelas joined #nim
23:28:36*chemist69 joined #nim
23:38:24AraqPMunch: thank you for your ui PR :-)
23:38:33PMunchNo problem :)
23:38:36Araqhaven't yet had a chance to review it
23:38:43PMunchIt's a pretty trivial one
23:39:02PMunchDoesn't fix the build issues unfortunately
23:39:32PMunchMostly minor changes for consistency
23:40:16PMunchUnfortunately I find that libui is a bit too limited
23:40:27PMunchIt doesn't even have a scrolling container :S
23:40:46PMunchAnd no way to for example get a selection from an entry, or set the cursor position, etc.
23:40:54PMunchhttps://github.com/PMunch/ui/blob/master/examples/genuiusg.nim
23:41:00PMunchBut I created that ^
23:41:16PMunchCurrently writing the equivalent for wxWidgets
23:44:17Araqwhat's the point of the % ?
23:44:30PMunchIt's twofold
23:45:12PMunch"identifier%Widget" creates a "var identifier = Widget()" statement, and just "%identifier" adds a widget stored in a variable
23:45:36PMunchFor example on line 23 you can see the RadioButton widget is assigned to the result variable
23:45:53PMunchAt line 57 the box variable is created and assigned to VerticalBox
23:46:29PMunchAnd on line 83 the RadioButtons that was returned from the proc is added to the widget tree
23:47:24PMunchLines 69-71 assigns a couple more variables that was previously declared to be referred to in the update proc
23:48:03PMunchAnd on line 94 you can see the box variable being used to add the entire hierarchy to the window
23:49:33*arnetheduck quit (Ping timeout: 260 seconds)
23:51:28*ofelas quit (Remote host closed the connection)
23:51:50*ofelas joined #nim