<< 18-11-2017 >>

00:17:27*yglukhov quit (Remote host closed the connection)
00:17:59*yglukhov joined #nim
00:19:19*endragor joined #nim
00:21:38*arnetheduck joined #nim
00:21:57*yglukhov quit (Ping timeout: 240 seconds)
00:23:29*endragor quit (Ping timeout: 248 seconds)
00:30:29*ipjk joined #nim
00:41:59*xkapastel quit (Quit: Connection closed for inactivity)
00:52:50*Jesin quit (Quit: Leaving)
00:54:25*ipjk quit (Quit: Leaving)
00:55:08FromGitter<kayabaNerve> Are there any 2.5D game frameworks available for Nim? ⏎ ⏎ This PacMan game I'm making has a 3D internal system/uses keyboard/mouse yet renders with 2D sprites. Some others may find it useful if there isn't an alternative already. ⏎ ⏎ Someone would find it useful anyways, I bet, just the question of is it worth me making it a proper library versus just keeping it in a game.
00:55:08FromGitter... [https://gitter.im/nim-lang/Nim?at=5a0f84ec540c78242d1973ee]
00:57:36*rbrt quit (Quit: Oíche mhaith)
01:11:06FromGitter<kayabaNerve> Also, how do you check two bools in an if statement? && isn't recognized
01:13:33FromGitter<kayabaNerve> It's and... I'm an idiot.
01:13:45*xkapastel joined #nim
01:17:33*Chuang-Tzu quit (Quit: Leaving)
01:19:33*zolk3ri quit (Quit: leaving)
01:27:50*yglukhov joined #nim
01:29:48*def-pri-pub joined #nim
01:32:23*yglukhov quit (Ping timeout: 255 seconds)
01:47:41*dexterk quit (Ping timeout: 255 seconds)
01:51:05*Ven joined #nim
01:51:29*Ven is now known as Guest76184
01:55:13*Guest76184 quit (Ping timeout: 248 seconds)
02:03:17*def-pri-pub quit (Quit: Leaving.)
02:31:22*yglukhov joined #nim
02:36:44*yglukhov quit (Ping timeout: 255 seconds)
02:41:43*skrylar joined #nim
02:51:37*Ven joined #nim
02:52:00*Ven is now known as Guest5943
02:58:35*chemist69_ quit (Ping timeout: 250 seconds)
03:06:47*vlad1777d_ quit (Ping timeout: 260 seconds)
03:08:27*Guest5943 quit (Ping timeout: 240 seconds)
03:12:18*chemist69 joined #nim
03:13:18*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
03:14:31*endragor joined #nim
03:21:16FromGitter<Varriount> @kayabaNerve How are you doing?
03:21:59*xkapastel quit (Quit: Connection closed for inactivity)
03:22:45skrylarhmm. there are some API calls left for firebird that are not wrapped, but there are no more API examples to cover them
03:42:19*yglukhov joined #nim
03:43:03*mr_yogurt joined #nim
03:47:45*yglukhov quit (Ping timeout: 248 seconds)
03:49:09FromGitter<kayabaNerve> @Varriount Good. You?
03:49:47FromGitter<Varriount> @kayabaNerve Wondering if I have the energy to do "a month of Nim documentation" in December.
03:50:20FromGitter<Varriount> Also, currently wrestling with deploying an application on Linux
03:51:43FromGitter<kayabaNerve> A: No.
03:51:46FromGitter<kayabaNerve> Oh. What app?
03:52:42FromGitter<Varriount> It's an in-house python application.
03:53:21FromGitter<kayabaNerve> Ah.
03:53:30FromGitter<kayabaNerve> I have a suggestion: ⏎ Delete it. ⏎ Redo it in Nim.
03:53:58FromGitter<Varriount> I would, if it didn't depend on the AWS API
03:55:34FromGitter<kayabaNerve> Solution: write a Nim aws module
03:55:45FromGitter<kayabaNerve> :p
03:56:02FromGitter<Varriount> I've plans for one, but it's no small task.
03:56:03FromGitter<kayabaNerve> I almost have my camera up in my game
03:56:19FromGitter<Varriount> What are you using to draw the graphics?
03:56:21FromGitter<kayabaNerve> Tell me when you get one running. I'll be interested
03:56:25FromGitter<kayabaNerve> SFML
03:56:50FromGitter<kayabaNerve> So I have to do the 3D data structures and 2D conversion myself
03:57:13FromGitter<kayabaNerve> (should it be drawn, what scale, where)
03:57:21FromGitter<kayabaNerve> I hate directions D:
04:04:58FromGitter<Varriount> @zacharycarter Might be able to help
04:05:11FromGitter<Varriount> He's done game engines for Nim.
04:11:10*dddddd quit (Remote host closed the connection)
04:17:25*def-pri-pub joined #nim
04:19:01*earenndil joined #nim
04:20:58*earenndil quit (Client Quit)
04:21:17*yglukhov joined #nim
04:25:35*yglukhov quit (Ping timeout: 248 seconds)
04:25:56mr_yogurtIs there a way to get information about what functions a module exposes at compile time? (maybe something like python's .__dict__ , although considering the differences between the languages it probably won't be that similar)
04:28:34skrylari don't think we have __dict__, although i don't see why we couldn't
04:31:26mr_yogurtskrylar: so if i wanted to programmatically generate dumb wrappers for all functions in a module based on type information there wouldn't be a way to do that?
04:33:28FromGitter<Varriount> mr_yogurt: What are you aiming to achieve?
04:35:12mr_yogurtVarriount: just that, programmatically generate some dumb wrappers for functions
04:35:32FromGitter<Varriount> Any reason why these wrapper's can't be generated along with the functions?
04:36:06mr_yogurti'm not in control of the module i'm trying to wrap, if that's what you're saying
04:36:14FromGitter<Varriount> Ah. Hm.
04:36:59*endragor quit (Remote host closed the connection)
04:37:24FromGitter<Varriount> mr_yogurt: The closest thing you could do is use staticRead to read in the module, then use macros.parseStmt to parse the entire file
04:37:25FromGitter<Varriount> https://nim-lang.org/docs/macros.html#parseStmt,string
04:38:57FromGitter<Varriount> In a macro, you could do this, scan the top level statements of the module, and generate procedures based off of that.
04:39:21FromGitter<Varriount> What do you think?
04:39:43mr_yogurtsounds like it could work, i'd have to try it
04:40:15FromGitter<Varriount> mr_yogurt: I've done something similar before, generating procedures based off of a JSON file.
04:40:37FromGitter<Varriount> The trick in that instance was to make liberal use of macros.quote to generate the procedures.
04:41:56FromGitter<Varriount> mr_yogurt: Let me know if you need help.
04:42:49mr_yogurtVarriount: i might since i just discovered nim like 3 days ago (loving it so far. 9/10 best language)
04:43:18FromGitter<Varriount> mr_yogurt: What module are you trying to wrap?
04:44:24mr_yogurtVarriount: i have this pet peeve for wrappers of C libraries (SDL in this case) that don't convert error flags to exceptions, so i'm wrapping a wrapper
04:45:09mr_yogurtdumb reason but it's also an excuse to learn how to do fancy-schmancy metaprogramming
04:45:39FromGitter<Varriount> Hm. The problem with that is that you need to identify what an error code is, vs a return value.
04:47:01*bkerin joined #nim
04:47:10FromGitter<Varriount> Just a warning: the compiler will complain if both the wrapper module and the wrapped module are imported without qualifiers.
04:47:52FromGitter<Varriount> Eg, I do `import sdl, sdl_wrapper`, and try to call one of the wrapped procedures without prefixing it with 'sdl' or 'sdl_wrapper'
04:48:37bkerinis there some way to interpolate vals into strings "string with $some_var" or something or is "string with " & $some_var the only way
04:48:49mr_yogurtyeah i know about that, i'll probably just wrap every function so you don't need both and make the ones that don't *need* wrapping just pass-through
04:49:35FromGitter<Varriount> mr_yogurt: You can use `export` for the pass-through
04:49:52mr_yogurtVarriount: oh cool. thanks
04:50:07FromGitter<Varriount> bkerin: Look at the strfmt module on Nimble, or the strutils module in the standard library
04:52:54mr_yogurtIs the current no-compile-time FFI restriction due to implementation difficulties or is there another reason?
04:53:44FromGitter<Varriount> implementation difficulties
04:53:52FromGitter<Varriount> mr_yogurt: What do you need the FFI for?
04:53:58mr_yogurti don't, just curious
04:55:21FromGitter<Varriount> mr_yogurt: An easier start might be to create a macro that wraps a single procedure based on an input name.
04:56:05skrylarsome people have the idea that wrappers shouldn't do anything special in order to minimize the difference
04:56:05FromGitter<Varriount> Like, `generate_wrapper(some_sdl_function_name)`
04:56:13skrylarit can take longer to ex. update a 'smart' wrapper
04:56:46skrylarSome people apparently also hate exceptions in nim, not sure what to do about that
04:57:25mr_yogurtskrylar: as in, there are nim users who hate exceptions (maybe like the go people) or some people hate nim's exception handling specifically?
04:57:36skrylarthey hate exceptions in general
04:58:26mr_yogurtoh so just normal weird people
04:58:33skrylarI haven't looked in to doing exceptions in firebird
04:59:00skrylarIt certainly could be done, i'd have to bother qqtop to ask about that
04:59:06mr_yogurtfirebird?
04:59:35skrylari wrote a wrapper for a (fairly mature) embeddable sql database
04:59:59skrylarmr_yogurt, https://github.com/Skrylar/firebird
05:00:45skrylarThey do this really derp thing where you have to hold an array of status codes, then they just write errors in to those, and return the most important error number from the function
05:02:38skrylarI do miss Lisp's idea of exception handlers
05:03:12mr_yogurti didn't get deep enough into lisp to know what it's idea of exception handlers was
05:03:17mr_yogurtwhat exactly is special about it?
05:04:06skrylarwell in the case of ex. firebird, say a call fails. in nim i have to just catch the exception and handle failure, afaik i can't say "not a big deal, go back to doing the routine"
05:04:25*earenndil joined #nim
05:04:26skrylarwhereas in lisp you can say "on an error, run this form. the form gets the error, a list of restarts, and can choose to invoke a "restart")
05:04:41skrylarto which the error throwing code can say "your choices are panic, retry, etc"
05:04:56skrylarso its like instead of throwing to a handler, it runs a callack
05:04:58skrylar*callback
05:05:34mr_yogurtoh that's fancy
05:05:52skrylaryou can do it that way with closures in nim, but it's not as far as i know a thing you're meant to do
05:06:01skrylarits just like "on_error" in node or something
05:06:05skrylarwell not 'just' like but similar to
05:06:32skrylarthe idea is that not all exceptions are fatal, and also the REPL can present that same list of restarts to the programmer if ey's just playing with code that broke
05:07:03skrylarnon-fatal exceptions in a try/catch world involve having to nest the call with its own try/catch and it starts clogging up whitespace
05:07:21skrylarversus return codes, where "discard somecall" is all it takes
05:08:03skrylari don't know if we have a (macro-expand) equivalent in nim
05:08:25skrylarthat's a handy thing when metaprogramming, since you can write macros that operate on fully-expanded code (ex. after macros that code itself uses)
05:13:21FromGitter<Varriount> skrylar: what about a macro `ignore_exception(stmt_to_execute, bool_expression)` and similar?
05:14:41*SenasOzys quit (Ping timeout: 255 seconds)
05:15:56*SenasOzys joined #nim
05:17:22skrylarVarriount: Dunno. I don't know anyone who is doing database code in nim to ask what they'd like to see
05:19:07*xkapastel joined #nim
05:19:53mr_yogurtWhat do you guys recommend for editing nim?
05:20:29FromGitter<Varriount> VSCode has the most actively maintained extension, however there is syntax highlighting and other basic support for most common editors.
05:20:32FromGitter<Varriount> I use Sublime Text
05:22:04mr_yogurtNo IDE support yet?
05:22:33bkerinmy_yogurt: vim has support
05:22:58bkerinmr_yogurt: though I had to hack vim.nim a bit to make it work with latest nim
05:23:19FromGitter<Varriount> mr_yogurt: What do you classify as an IDE?
05:24:38mr_yogurtVarriount: eclipse, pycharm, visual studio: IDEs. VSCode, Notepad++, vim: not IDEs.
05:27:25FromGitter<Varriount> mor_yogurt: The problem with those is that they are rather language specific. I know that there are alternate language packs for some (such as python extensions for eclipse), however it's generally more trouble than its worth.
05:28:05mr_yogurti dunno if eclipse is really java specific anymore
05:29:25mr_yogurtalthough if you're writing c/c++ on windows you probably should use VS
05:29:25FromGitter<Varriount> I didn't think it was used anymore. IntelliJ seems to be sucking the life out of the other Java IDEs
05:29:34skrylarvimacs :p
05:29:43mr_yogurtskrylar: you mean spacemacs?
05:29:45FromGitter<Varriount> Bleh, VS. I've had better functionality from Sublime Text, thank you very much.
05:29:54FromGitter<Varriount> At least Sublime Text has decent autocomplete.
05:29:58skrylarmr_yogurt, eh. i use a custom .emacs with evil-mode.
05:30:40mr_yogurtVarriount: i need to look into sublime text. it seems like it's pretty popular, but i'm a cheap fucker who doesn't want to pay $80 for a good editor
05:30:51FromGitter<Varriount> It just nags you.
05:31:14skrylari paid for sublime 1
05:31:20*smeady_ joined #nim
05:31:23skrylari wouldn't pay for it now that jon has turned in to a zombie
05:31:25FromGitter<Varriount> I'm the maintainer of the plugin for Sublime Text, however I haven't had much time to update the plugin.
05:31:35mr_yogurtlike winrar?
05:31:47FromGitter<Varriount> So it has some odd behavior now and then
05:32:07skrylaram a little curious about nimsuggest. may have to see if i can get that to cooperate without making emacs slow
05:33:10skrylarwell the nimized firebird manual is as good as i can make it for now
05:33:55*def-pri-pub quit (Quit: Leaving.)
05:34:23*bkerin quit (Ping timeout: 248 seconds)
05:34:53FromGitter<Varriount> As much as I appreciate the effort put into Nimsuggest, it needs to be redesigned.
05:35:10FromGitter<Varriount> Especially the protocol.
05:36:35mr_yogurtOT, but am i the only one who likes light color schemes? all my coworkers use dark schemes and now sublime text is trying to force one onto me
05:37:11skrylarSee, Sublime costs money and ey didn't even give us a proper GUI for that
05:37:22skrylarYes you can put it in ex. solarized-light, but you need to edit a text file
05:37:53*skrylar tolerates emacs being archaic about elisp for basic things like color because its an OS where the concept of color can be redefined to some strange moon rune equivalent
05:38:23FromGitter<Varriount> skrylar: You can change the color scheme in Sublime...
05:38:37FromGitter<Varriount> You don't need to edit a text file either.
05:39:22*smeady_ quit (Quit: Textual IRC Client: www.textualapp.com)
05:39:26FromGitter<Varriount> mr_yogurt: ctrl+shift+p , then type in "color" and press enter
05:40:04mr_yogurtVarriount: oh i figured it out, i was just referring to the default being a dark scheme
05:40:59skrylara lot of developers eyes are less strained with dark colors
05:41:23skrylarit depends on how well lit your room is, how fancy your monitor is, etc, but cheaper monitors and poor lights: dark is usually preferred
05:41:46skrylarhttps://www.dropbox.com/s/p7vu32jdemfz2fy/firebird3.pdf?dl=0 a whopping 17 pages now @_@
05:42:47FromGitter<Varriount> skrylar: We need to get you an award - "Most documented Nim library"
05:43:52mr_yogurtalso "Nim documentation with best typesetting"
05:44:25mr_yogurti don't think i've seen documentation done in latex before but i already love it
05:44:57FromGitter<Varriount> I'd still rather use something like restructured text or asciidoc
05:48:43FromGitter<Varriount> skrylar: what do you mean by variadic arguments?
05:50:22mr_yogurtVarriount: variadic functions are functions that can take multiple numbers of arguments
05:50:59FromGitter<Varriount> Yes, but does he mean varargs, openarray, or the importc variadic arguments
05:51:07mr_yogurtoh then i have no idea
05:51:50FromGitter<kayabaNerve> I implemented rendering
05:51:53FromGitter<kayabaNerve> It's broken
05:51:58FromGitter<kayabaNerve> The life of a programmer lol
05:52:05FromGitter<Varriount> @kayabaNerve Great! Have you updated your Repo?
05:52:12FromGitter<Varriount> I can test on Windows.
05:52:24FromGitter<kayabaNerve> Just did
05:52:27FromGitter<kayabaNerve> It compiles
05:52:37FromGitter<kayabaNerve> The issue is the math in the generateFOV functon
05:52:53FromGitter<kayabaNerve> It's causing Clyde to barely move and disappear off the screen from being in the middle
05:52:58FromGitter<kayabaNerve> Clyde is the orange ghost I test with
05:53:21FromGitter<kayabaNerve> I have to figure out a proper way to handle directions, and possibly 'normalize' the code
05:53:43FromGitter<kayabaNerve> IE go from xyz based on sphere center to xy based on player center
05:53:59FromGitter<kayabaNerve> I'm also tired as hell as it's midnight :P
05:54:19FromGitter<Varriount> It's 1 in the morning here.
05:54:24FromGitter<kayabaNerve> Ah
05:54:27FromGitter<kayabaNerve> Go to bed
05:56:14FromGitter<kayabaNerve> Code has a decent amount of comments. Basically, ghost files are not used, player has the player object and handles mouse. Main just handles the loop which goes: ⏎ Check mouse ⏎ Handle keyboard ⏎ Update position ⏎ Check teleport ... [https://gitter.im/nim-lang/Nim?at=5a0fcb7e2837ee51069a23e2]
05:57:32FromGitter<kayabaNerve> Scene is the main file for drawing ⏎ FOV is the problem child ⏎ Common is just universal functions/types ⏎ Degrees is math I added in to handle degrees, it's used by player ⏎ Map is also ignored for now [https://gitter.im/nim-lang/Nim?at=5a0fcbcc982ea2653f93cff4]
05:57:49FromGitter<kayabaNerve> Feel free to look at it if you have time :P I'm off to sleep. GN
05:58:25*SenasOzys_ joined #nim
05:59:42*SenasOzys quit (Read error: Connection reset by peer)
06:11:40*SenasOzys_ quit (Ping timeout: 268 seconds)
06:16:15skrylarmr_yogurt, Varriount: it was texinfo, but theres a [la]tex/pdf output
06:16:28skrylaralso the importc varargs seems to only like cstrings
06:16:37mr_yogurtskrylar: either way it looks great
06:16:42skrylarwhen i tried one of the weird functions that is two ints and a string, nim complained
06:20:10skrylarnfltk is going to get docs like that at some point
06:20:22skrylaralthough fltk is decently documented upstream so it wasn't a priority
06:21:45skrylarhave no interest in this immgui stuff tho
06:22:32skrylari think between a dsl (something like genui probably?), miglayout and cobweb, that should probably cover most of the gui pain
06:25:50*endragor joined #nim
06:25:54skrylarwhat would be neat, though unlikely to happen, is to maybe combine nimsuggest and info
06:26:26skrylarex. have nimsuggest find out the module a given function belongs to at point, then consult a table of module->info files, and pop open the docs inside emacs for that proc
06:27:10skrylarprobably with some manual nim code you could convert docbook to a docset for dash/zeal/etc as well
06:36:15skrylarVarriount: if you find the docs suck in some way, feel free to open an issue on github. the texi files are in the repo, and bad docs are something i do consider a bug :p
06:37:07*nsf joined #nim
06:41:33*endragor quit (Remote host closed the connection)
06:44:22*endragor joined #nim
06:47:31FromGitter<Varriount> mr_yogurt: Need any help?
06:47:47FromGitter<Varriount> skrylar: Cobweb?
06:48:27*endragor quit (Ping timeout: 240 seconds)
06:49:48skrylarvarriount: i talked about that the other day, and linked some gists. its basically lisp's 'cells' project. or a thing where you put variables and it tries to work out a DAG for dataflow updates
06:51:23skrylarex you put in some values from a database as inependent variables, then add listeners for when some value is updated, and it triggers them, but there can also be dependent variables, where it takes in some vars and outputs a new one
06:52:38skrylarso you can have things like cobweb.add(focused_document_editable): result(focused_document): !focused_document.readonly
06:55:11FromGitter<Varriount> Sounds like something Lisp would do well with.
06:55:27skrylarprobably just a few closures and macros in nim
06:55:33skrylarthe code for toposort isn't that complex
06:55:58skrylarIt's sort of the inverse of functional reactive programming, but meh
06:56:25skrylarFRP is more like this.enabled = proc(): !something.readonly and that gets executed every time you check
06:57:31skrylarthey tried to make a gui library named 'cello' which was built on 'cells' but i think its stuck in the ether now
06:59:00skrylarhmm. there might be issues knowing variable types in the dynamci version. bleh
06:59:21skrylarif its all done as a single macro block, no problem. but then you have to define all of your connector logic in one spot (some might not consider this bad?)
07:03:21*skrylar quit (Remote host closed the connection)
07:09:24FromGitter<Varriount> I looked at some lisp code today. Quite pretty, but also hard to understand at a glance.
07:13:34mr_yogurtVarriount: can i make some suggestions for the plugin?
07:18:03*miran joined #nim
07:18:58*obadz quit (Ping timeout: 264 seconds)
07:21:41*obadz joined #nim
07:29:32*miran quit (Quit: Konversation terminated!)
07:54:44*yglukhov joined #nim
07:58:57*yglukhov quit (Ping timeout: 248 seconds)
08:10:00FromGitter<alehander42> @mratsim well, maybe if you map one new issue for each subsection in the place of the current several, and open them it would be best (I think it's inevitable to have a lot of issues, so I hope people use search/filters anyway)
08:10:29FromGitter<mratsim> will do
08:12:24FromGitter<alehander42> especially if we have some descriptions of what can be done in the near future, they can be useful for people that would like to contribute with something(help wanted etc)
08:12:36*miran joined #nim
08:14:29FromGitter<mratsim> will do tomorrow. I’m knee deep into an IronMan 24h Machine Learning competition to forecast car traffic right now.
08:15:39FromGitter<alehander42> wow sounds intriguing :D good luck
08:16:30FromGitter<alehander42> btw for newcomers in ML (like me) are there similar sites with datasets/little competitions (sooomething like project euler for ml)?
08:17:41FromGitter<mratsim> Yes Kaggle, that’s how I learned. Titanic is the hello world of ML and Digit Recognizer is the hello world of Computer Vision/Deep Learning
08:18:18FromGitter<mratsim> https://www.kaggle.com/competitions
08:27:57*dexterk joined #nim
08:31:29*JappleAck joined #nim
08:31:56FromGitter<alehander42> woah perfect! do you also recommend certain books/courses ?
08:32:11*endragor joined #nim
08:33:53*endragor quit (Remote host closed the connection)
08:34:00miran@alehander42 - if you're just starting: mueller's "introduction to machine learning with python"
08:34:30*endragor joined #nim
08:34:36miranif you want something tougher - rashka's "python machine learning"
08:35:34miranstatistics in general - free book http://www-bcf.usc.edu/~gareth/ISL/
08:35:53FromGitter<mratsim> Personally, I just looked into the “kernels” produced by other people, and imitate, copy, search through Google. For Deep learning, many devs like the fast.ai videos/mooc: http://www.fast.ai/
08:35:55miranand tougher variant, also free https://web.stanford.edu/~hastie/ElemStatLearn/
08:37:22FromGitter<mratsim> Scikit-learn documentation and examples are also excellent, example: http://scikit-learn.org/stable/tutorial/machine_learning_map/index.html
08:38:00FromGitter<alehander42> agh, I hate videos, I always dreamed to convert them automatically to some browseable text+gif format :D
08:38:17FromGitter<alehander42> but I admit they've been helpful with maths
08:39:15FromGitter<alehander42> thanks miran, I'll take a look at them
08:40:08FromGitter<alehander42> the kernels idea seems nice, my initial idea was to create some very basic variants of ml tools/libs and learn from their implementation
08:40:15FromGitter<mratsim> I don’t like videos that’s why I only browse through the kernels, but fast.ai is targeted at developers so I guess that’s a big plus. You can check my own Kaggle tutorial repo as well https://github.com/mratsim/MachineLearning_Kaggle from when i learned 1 year ago
08:40:44FromGitter<mratsim> That’s like doing variant of the Nim compiler to learn Nim :P
08:41:15FromGitter<mratsim> or smelting a knife to learn how to cook
08:41:59FromGitter<mratsim> (got to focus, see you in a few hours)
08:42:05miran@alehander42 if you want to learn by implementing what's going on behind the scenes - consider andrew ng's coursera course
08:44:06FromGitter<alehander42> :D well that's how I got into compilers, I tried to translate Python to C++ in 12 grade and when I look now back at its code *holy shit ew*
08:44:57FromGitter<alehander42> yeah I've heard a lot of good stuff about ng course, does it contain enough of the math basis?
08:45:57miranif you know some linear algebra, that's a plus. but from what i can remember, i think he explains some basic stuff too
08:47:25FromGitter<alehander42> cool
08:53:39*mr_yogurt quit (Ping timeout: 260 seconds)
09:01:26*miran quit (Quit: Konversation terminated!)
09:04:13*yglukhov joined #nim
09:08:35*yglukhov quit (Ping timeout: 240 seconds)
09:09:53FromGitter<Varriount> mr_yogurt: You can, however I make no proMises to implement anything. I haven't had the time or inclination to update the plugin, between school and work
09:11:40*claudiuinberlin joined #nim
09:18:00*yglukhov joined #nim
09:18:55*vlad1777d_ joined #nim
09:19:50*dddddd joined #nim
09:22:23*yglukhov quit (Remote host closed the connection)
09:22:27*JappleAck quit (Ping timeout: 240 seconds)
09:28:37*jjido joined #nim
09:31:12*salewski joined #nim
09:32:20salewskiI have just fixed gintro package for latest compiler version, that was easy.
09:32:54salewskiBut now I have also tested the ned editor, and that gives me this new error for latest compiler:
09:33:04salewskined.nim(78, 12) Error: type mismatch: got ((type NimEdAppWindow, GType, int, string))
09:33:13salewskibut expected one of:
09:33:43salewskimacro gDefineTypeExtended(tn, t, tp, f, c: static[string]): stmt
09:33:54salewskitemplate gDefineTypeExtended(tn, tp, f: expr; c: string)
09:34:28salewskiCan someone guess what may have changed in the compiler recently for macro processing?
09:35:30salewskiI have no idea from the compiler message, so I can only modify the macros arbitrary hoping it may work at some point.
09:35:44*yglukhov joined #nim
09:36:05*JappleAck joined #nim
09:37:16Araqchange the 'expr' to 'typed'
09:39:18salewskiOh, I thought that expr was only deprecated...
09:40:55salewskiFor gintro and oldgtk3 package I have already replaced stmt and expr with new typed and untyped,
09:41:12salewskifor for ngtk3 and ned I was too lazy.
09:47:21Araq'expr' is 'untyped' but I think your overload set is illformed
09:47:32Araqhence I suggested 'typed'
09:47:54*dddddd quit (Remote host closed the connection)
09:48:29Araqand 'tn' should probably be 'typeDesc'
09:49:16Araqnot sure why it worked before but types are not values! when you have a generic type variable 'T' typedesc does NOT match, nor should it.
09:50:56*nsf quit (Quit: WeeChat 1.9.1)
09:51:18salewskiThanks for your explanation Araq!
10:08:36*Vladar joined #nim
10:11:10Araqwhat's the FP name for "deepMap"?
10:16:00FromGitter<Varriount> What's a deep map?
10:17:10*xkapastel quit (Quit: Connection closed for inactivity)
10:17:35AraqI'm thinking about the new asArray macro and it's easy to do better
10:17:42Araqbut not to come up with a name for it :P
10:19:27*marenz__ joined #nim
10:21:41FromGitter<Varriount> What improvements does this version have?
10:22:35Araqit also works for tuples, sets, nested tuples of arrays of sets, etc
10:22:47dom96asType?
10:22:56dom96please don't generalise it too much
10:23:17Araqcurrently it's mapLits
10:23:44AraqmapLits([[2, 3], [1, 4]], float)
10:23:53AraqmapLits([[2, 3], [1, 4]], `$`)
10:24:28AraqmapLits([(4, 'y', 6), (1, 'x', 3)], `$`)
10:24:54Araqevery *literal* is annotated with the second argument
10:25:35Araqthat's not ambiguous but sometimes you need the nesting and sometimes you don't
10:25:55dom96Honestly, I don't think it's worth thinking about this.
10:25:58dom96Just merge asArray
10:26:10Araqso I'm thinking about an optional third parameter nesting=false
10:26:21AraqasArray is too narrow
10:26:33dom96asArray should be available anyway, even if you implement this
10:26:37Araqthen somebody adds an asTuple "for consistency"
10:26:47Araqand asSet
10:26:49AraqasSeq
10:26:57Araqetc, I'm fighting the bloat here
10:27:17Araqthat you'll happily accept for consistency or because Python has it
10:28:04Araqbesides, sequtils is about 'map' and 'filter' etc, not about 'asT' whatever that means
10:29:23Araqin fact, I already wrote something very similar for karax
10:29:35Araqand it would be nice to cover this properly
10:29:38dom96alright, but I prefer `mapLiterals` then
10:30:07dom96alternatively: asType(array[int], [1,2,3,4])
10:30:16FromGitter<Varriount> The problem is, `1` and `[1, 2, ...]` are both seen as literals.
10:30:23dom96oh, but then I'd need to specify the size bleh
10:30:32dom96yeah, that's true
10:30:36dom96This gets confusing quickly
10:31:04AraqVarriount: that's not an atomic literal though
10:31:25dom96You could specify kindsToTransform={nnkIntLiteral, nnkFloatLiteral,...}
10:31:38dom96as a parameter to this for greater control
10:31:52Araqbut then it is too generalized :P
10:31:57dom96lol
10:32:01FromGitter<Varriount> ... @Araq I was going to say, it's to bad Nim doesn't formally classify values things as atoms.
10:32:11FromGitter<Varriount> *too
10:32:31FromGitter<mratsim> @Araq “deepMap” is probably map of map. (flatmap would remove a nesting level)
10:33:46Araqvarriount: we can say a 'lit' in Nim speak is an atomic literal
10:33:50Araq:P
10:34:12FromGitter<Varriount> The most accurate term would be "atomMap", however "atom" is such a rare term in programming these days.
10:34:32Araqno that's also wrong, identifiers are atoms too
10:35:08Araqbut mapAtoms is a nice name
10:36:25FromGitter<alehander42> mapLiterals sounds reasonable
10:36:26FromGitter<Varriount> "mapAtomicLits" - Precise, but wordy
10:36:43FromGitter<alehander42> but aren't e.g. `@[2]` literals too
10:37:33FromGitter<Varriount> @alehander42 I already mentioned that.
10:38:29FromGitter<Varriount> The classification is whether a literal is atomic (indivisible) or not (divisible)
10:38:45FromGitter<alehander42> sorry
10:39:55*couven92 joined #nim
10:40:07Araqhi couven92 read the logs
10:40:24couven92Good morning, okay, will do :)
10:41:30FromGitter<Varriount> @alehander42 it's fine. I just don't want is going in circles
10:42:59FromGitter<alehander42> flatLitMap ?
10:43:28FromGitter<alehander42> it's not about all atoms(no identifiers) and it flattens compound literals
10:49:49couven92Araq, sorry I had a lot to read... I went away early yesterday and was on a christmas party... :P
10:50:08couven92The ideas about asArray are interesting...
10:50:23couven92I agree that it is somewhat misplaced in sequtils, but well...
10:51:17couven92But when we had targetType as untyped insetad of typedesc, we actually got that apply a function on all values in the array...
10:53:06couven92But what about this for tuples: get asArray to accept any Tree, instead of just a Bracket Expression, and apply the targetType conversion on each node in that tree... Then we'd also get tuples for that
11:02:38*SenasOzys_ joined #nim
11:02:48*Ven joined #nim
11:03:12*Ven is now known as Guest51756
11:25:06*Guest51756 is now known as Ven``
11:37:11*Ven`` quit (Ping timeout: 255 seconds)
11:42:23*couven92 quit (Ping timeout: 248 seconds)
11:58:05*jjido quit (Ping timeout: 250 seconds)
12:15:37FromGitter<data-man> Hi, Nimmunity!© (I hope this is not offensive word) ⏎ Vote, please (or add your own version): https://github.com/nim-lang/Nim/pull/6601#issuecomment-345438415
12:17:59AraqI voted.
12:18:44*couven92 joined #nim
12:20:31salewskiAraq, your hint for using typeDesc helped. But additional there was a problem with one space too much, see https://github.com/nim-lang/Nim/issues/6776
12:20:43salewskiBut now it compiles again.
12:21:19Araqthat's just tuples at work
12:21:34Araqecho (1, 2, 3) # echo the *tuple*
12:21:37*Snircle joined #nim
12:21:50Araqecho(1, 2, 3) # echo the 3 arguments
12:22:07Araqecho (1) # echo the argument that was pointlessly wrapped in ()
12:22:15dom96I voted for two things because why not :)
12:22:33Araqomg, why do you say, because singleton tuple constructors don't exist.
12:24:16Araqand that was another breaking change, that is still missing in the changelog, I think
12:25:16Araqbut I missed the (( )) in the error message too ;-)
12:25:37FromGitter<data-man> Thanks! Nimocracy in action. 
12:26:44*salewski quit (Quit: WeeChat 1.9.1)
12:31:04FromGitter<couven92> forEach could maybe also be viable name for the extended asArray?
12:31:20federico3data-man: are you sure about adding an env variable? Perhaps at some point tests could parse a configution file
12:33:07FromGitter<data-man> @federico3: Or cmd-line parameters?
12:34:28federico3most likely both
12:37:29FromGitter<data-man> @Araq: What do you think about exporting a system/timers/getTicks ()?
12:38:18AraqI need to do that, it is used often enough to suggest I got the API right
12:43:54FromGitter<data-man> And about adding rdtsc for C-backend?
12:45:59Araqseems unreliable
12:46:04Araqugh, Nim
12:46:19Araqwhen the documentation is a page and the implementation 5 lines...
12:47:12Araqand the documentation that I write now needs to assume that you don't know Nim, cannot navigate through a website and couldn't be bothered to read any kind of tutorial
12:47:58Araqbecause if I don't I got to read pamphlets about my "attitude" and helpful links ala "write documentation, mmmkay?"
12:48:57FromGitter<couven92> :D
12:49:10FromGitter<couven92> The pain is real Araq?
12:53:19AraqI used the name 'mapLiterals' btw
12:55:10FromGitter<couven92> What are we doing about my asArray?
12:55:21*SenasOzys_ quit (Read error: Connection reset by peer)
12:55:32FromGitter<couven92> Are you replacing or extending?
12:55:40*SenasOzys_ joined #nim
12:56:33*nsf joined #nim
12:59:52Araqreplace it with something better
13:00:08FromGitter<couven92> Me?
13:01:13FromGitter<couven92> Okay, I can do that... though I don't know about the nesting...
13:02:33FromGitter<couven92> Or actually, for nesting, how about doing an overload that accepts an array of conversions, one per nesting level?
13:05:42FromGitter<couven92> I like mapLiterals or mapLit as a name
13:06:04FromGitter<couven92> Plural!
13:06:32FromGitter<couven92> Araq, idea of where to put it?
13:07:21*endragor quit (Remote host closed the connection)
13:07:54*endragor joined #nim
13:08:02Araqer, I just finished this feature for you
13:08:06Araqyou don't need to do anything
13:08:14FromGitter<couven92> :D
13:08:19*endragor quit (Remote host closed the connection)
13:10:55*endragor joined #nim
13:15:45Araqugh, now I have this crazy history of couven92 in devel
13:15:50Araqoh well...
13:16:13FromGitter<couven92> :D
13:16:52FromGitter<couven92> You didn't sqash merge?
13:17:07FromGitter<couven92> Ah, wait you just edited directly?
13:20:20Araqyeah -.-
13:21:38FromGitter<couven92> Yours looks great! :)
13:21:47FromGitter<couven92> Sorry about the history
13:22:28Araqyeah, it's a nice feature now :-)
13:23:26FromGitter<couven92> Maybe I should experiment less inside a PR, but that is actually the easiest way to get intelligent people to comment on my less sane ideas and bad coding habits! :P
13:24:00Araqusually I sqash the history
13:24:45FromGitter<couven92> Yeah, that is the best way to do it in something as large as Nim
13:25:43*endragor quit (Remote host closed the connection)
13:25:50Araqand now that I've completed it I know it's wrong still :-)
13:26:15*endragor joined #nim
13:26:18FromGitter<couven92> mapLiterals
13:26:30Araqyeah, it's still misdesigned lol
13:26:32FromGitter<couven92> What's wrong now?
13:27:34Araqwhen do I want to apply 'op' to both integers and strings? ok, maybe for JSON
13:27:50Araqbut mapIntLits and mapStrLits seem to be more useful now
13:28:50FromGitter<couven92> Let it be an undocumented feature and hope nobody's ever crazy enough to do it?
13:29:17Araqand the order is wrong, the 'op' needs to come first then I can pass a whole body as the AST to transform
13:29:32Araqbut then the name 'map' is wrong ... argh
13:29:48FromGitter<couven92> convert?
13:30:08Araqyeah
13:30:22AraqconvertIntLits(`$`):
13:30:27*endragor quit (Ping timeout: 240 seconds)
13:30:30Araq echo 1, 2, 3, (4, 5)
13:30:53AraqconvertIntLits(uint, [1, 2, 3])
13:31:40*yglukhov quit (Remote host closed the connection)
13:31:49AraqconvertLits(`%`, [1, 2, 3]) # similar to json's %*
13:32:08FromGitter<couven92> I still think having a general implementation is better than overloads for each literal type
13:32:17Araqbut I'm leaving it as it is now
13:32:32AraqmapLiterals fits sequtils.
13:33:01FromGitter<couven92> Okay
13:39:13FromGitter<couven92> Araq, this means I can merge devel into strutils and make the Rune arrays in unicode nice, right?
13:39:49Araqthis should be 2 separate PRs
13:39:57FromGitter<couven92> ?
13:40:17Araqone PR for strutils
13:40:23Araqone PR to improve unicode.nim
13:42:59*yglukhov joined #nim
13:48:15FromGitter<couven92> Yeah, my current PR is for getting stuff into Unicode, you want a new one that removes stuff from strutils?
13:50:46Araqno, what's there to remove?
13:51:01Araqit needs a deprecation path at least
13:51:39FromGitter<couven92> Okay then we don't need a new PR, do we?
13:55:00Araqno
14:01:56*nsf quit (Quit: WeeChat 1.9.1)
14:04:25planetis[m]Hey, shouldn't the last statement compile? https://gist.github.com/konqoro/dcff1590457867db5bc9f4717260efb6
14:05:37planetis[m]I will just add overloads after all I'm just wondering
14:09:38Araqare arguments after varargs even documented?
14:10:04Araqlooks like an undocumented feature to me :P (even though I'm aware of it)
14:11:00planetis[m]no I saw a test
14:11:03planetis[m]one sec
14:11:12*yglukhov quit (Remote host closed the connection)
14:11:18planetis[m]https://github.com/nim-lang/Nim/blob/000b8afd26fa16684a116d9afe798ea94df9c270/tests/overload/tparams_after_varargs.nim
14:12:13planetis[m]anyway overloading works even better
14:13:02Araqok, well, I don't know how hard it is to make default parameters work in the position
14:13:08Araqcould be hard, could be trivial
14:13:57planetis[m]probably doesn't worth it :p
14:14:25*JappleAck quit (Ping timeout: 248 seconds)
14:14:58planetis[m]the C code I was trying to port was using all kinds of ugly stuff with '...' in the parameter list
14:15:52planetis[m]what happened to common sense xD
14:19:28*SenasOzys_ quit (Read error: Connection reset by peer)
14:19:30*SenasOzys__ joined #nim
14:19:35FromGitter<couven92> Tell that to printf
14:20:18FromGitter<couven92> Or scanf, or some of the other ...f candidates we all love in C! :P
14:20:55planetis[m]thank god i never had to use them.. I started programming in nim
14:21:40*SenasOzys_ joined #nim
14:23:43planetis[m]did you guys got the hacktomberfest T-shirts?
14:24:27*SenasOzys__ quit (Ping timeout: 240 seconds)
14:27:50*Trustable joined #nim
14:33:07AraqI still think Nim's docs are better than Python's. am I that weird? new procs are getting examples, they have effect and exception annotations not to mention type declarations
14:36:33FromGitter<couven92> Araq, if you're weird, then I'd have to say that I am weird as well... because I have the same misgivings about the python docs
14:37:30Araqmaybe the organization of the material is bad for newcomers
14:37:43FromGitter<alehander42> I think it's mostly that some older modules with functions from the stdlib have no examples or descriptions
14:37:58Araqyeah the old cruft...
14:38:00FromGitter<alehander42> I even had the idea to autogenerate examples with nim-quickcheck for some modles
14:38:42FromGitter<alehander42> and to prettify them a bit to be sure they make sense
14:39:12Araqmy favourite docgen feature would be a robotic arm that claps you on the head
14:39:30Araqwhen you haven't read something :P
14:39:40FromGitter<couven92> :D
14:40:05FromGitter<alehander42> :D
14:40:10FromGitter<couven92> It would be nice if the examples in the doc comment could be checked though
14:40:25FromGitter<alehander42> or a robotic voice that repeats docs silently while you sleep and runs tests on spare visual cortexts in your lucid dreams
14:40:59FromGitter<couven92> I mean, I often duplicate the example code at the end for stdlib testing, but that is duplication...
14:41:14FromGitter<alehander42> another idea I had was to write a script which automatically looks for uses of a function on github and links it as
14:41:19FromGitter<alehander42> example
14:42:58Araqyeah but runnable tests in documentation comments are a bit weird
14:43:17Araqyou lose the syntax highlighting and auto-completion features
14:43:22Araqmaybe we need
14:43:25Araqtests:
14:43:26Araq ...
14:43:43Araqthat the documentation generator considers too
14:44:11Araqit could easily look into the proc bodies
14:44:30FromGitter<couven92> Hmm... maybe a pragma-macro... that searches for a test block, adds that as a doc comment
14:44:54FromGitter<alehander42> but I think the problem is just many people are lazy to write tests/examples so for user libs/modules some kind of example inferrence would be cool
14:45:07FromGitter<couven92> Sure
14:45:31Araqwell it is somewhat mitigated by Nim since we have the playground and lots of freestanding functions/procs
14:46:10Araqbut then every implementation artifact is part of the non-existing spec
14:46:38Araq"/foo/" / "/bar" produces "/foo/bar", got it
14:47:20Araqplus I suppose people prefer to read examples rather than tinkering on their own :P
14:48:37FromGitter<alehander42> yeah that's also true :D
14:50:09Araqwe need a spreadsheet-like thing
14:50:24Araqa page with examples you can run and also edit and run
14:50:56FromGitter<data-man> @Araq: Maybe in HelpMessage also to use copyrightYear? (and put this const to common module)? (PR#6581)
14:51:30Araqor maybe just a "run me" button under every example that delegates to Nim's playground
14:52:39hohlerdewohooooo, got my nim t-shirst yesterday
14:53:38AraqexecutableExample:
14:54:11Araq "a" & "abc" == "aabc"
14:54:23Araq 2 + 4 == 6
14:54:23FromGitter<couven92> Araq, currently I can only see doing the test-block being done with a module level macro... that way a test-block could be detected, test code with when isMainModule and a doc comment with a code block....
14:55:57FromGitter<alehander42> would it be checked on each compile? that would be cool solution for a bit of the "outdated comments" thing
14:56:00Araqwell it's pretty easy to do 'executableExample', 'nim doc' extracts it 'nim c' ignores it and 'testament' extracts it differently, puts it in a test environment that imports the module
14:56:37Araqthis way we also ensure nobody forgot any export markers :P
14:56:45*hohlerde sent a long message: hohlerde_2017-11-18_14:56:44.txt <https://matrix.org/_matrix/media/v1/download/matrix.org/QNEhoPCHchiGDAwybDSGrozK>
14:58:29*xmonader joined #nim
14:59:27Araqhohlerde: no, that's something different
15:00:41hohlerdefull example is here: https://privatebin.tarakis.de/?b78f0690062bf75d#fNMWd02NePyqfEc1LyJ6/KHrsqYbja2NmjZAv5CbIZM=
15:00:42Araqalehander42: it would be checked by testament or maybe some new 'nim test' command. I don't want every compile to check these.
15:00:58hohlerdeI'll create an issue then
15:04:25Araqok thanks
15:09:19*xmonader quit (Ping timeout: 248 seconds)
15:14:10FromGitter<alehander42> ok
15:17:46hohlerdeissue added: https://github.com/nim-lang/Nim/issues/6777
15:22:35*nsf joined #nim
15:45:00*dexterk quit (Remote host closed the connection)
15:45:24*dexterk joined #nim
15:46:55*yglukhov joined #nim
15:53:16*miran joined #nim
16:06:28*PMunch joined #nim
16:15:45*Trustable quit (Remote host closed the connection)
16:37:26FromGitter<alehander42> i can't believe people still cite tiobe in discussions
16:38:58*lurker joined #nim
16:43:28*TjYoco joined #nim
16:45:28*TjYoco quit (Client Quit)
16:46:39*TjYoco joined #nim
16:46:53*TjYoco quit (Client Quit)
16:48:51dom96alehander42: where? :o
16:49:12*TjYoco joined #nim
16:51:30*nsf quit (Quit: WeeChat 1.9.1)
17:14:10livcdI just realized I really hate package managers. Every ecosystem has its own and you need to keep an eye on updating & upgrading it. Whenever your OS/some libs / or whatever updates they all break in various ways. And when you do not use each one every day you need to fix it in order to be able to install/uninstall a single thing. And for that you need to fix that goddamn pkg manager
17:19:19*laas joined #nim
17:19:39laashi
17:19:43laasI have a question
17:20:10laasDo sequences really use signed ints as indices?
17:20:15laasor am I doing something wrong?
17:28:01*vlad1777d_ quit (Ping timeout: 248 seconds)
17:35:36*jsgrant_ joined #nim
17:36:15FromGitter<mratsim> they do
17:37:04laashuh
17:37:09laasthat's pretty weird IMO
17:37:14laasis there any specific reason?
17:38:09FromGitter<mratsim> why is it weird?
17:38:38*jsgrant quit (Ping timeout: 268 seconds)
17:40:28federico3laas: yet if you use negative values it does not walk backwards :(
17:43:11*sz0 joined #nim
17:45:19laasit's weird because you wouldn't ever have negative indices
17:45:30laaswhat even happens if you do?
17:45:33laasdoes it just err?
17:49:45*xkapastel joined #nim
17:50:23*couven92 quit (Ping timeout: 248 seconds)
17:54:22TjYocolaas, maybe its leftover from arrays cause you can do stuff like this: https://pastebin.com/gyG26q5C
17:59:37TjYocoidk if this is an issue but array[-2.. -1, T] requires that space or it will through an error. I remember ".."s being changed recently
17:59:54TjYocothrow not through
18:00:40*dddddd joined #nim
18:13:06laasyeah and that makes sense for arrays
18:13:20laasbut it makes no sense that things like `seq.len` return an int
18:13:53*PMunch quit (Quit: leaving)
18:14:20laasnow, it wouldn't be *that* big of a problem, if automatic conversion happened from a subrange to a superrange
18:14:40laasint won't convert to uint64 automatically
18:15:03*PMunch joined #nim
18:15:54*PMunch quit (Remote host closed the connection)
18:17:53*PMunch joined #nim
18:25:53*JappleAck joined #nim
18:26:50planetis[m]well most procedures that work on seqs accept Natural as parameter which is a subrange
18:27:04planetis[m]why you think its a problem in the first hand?
18:31:59Araqlaas: on the contrary, it makes perfect sense to return an int
18:32:08Araqvar x = s.len
18:32:13Araqwhile x >= 0:
18:32:23Araq dec x
18:32:24Araq ...
18:33:30laasdidn't think of that one
18:34:25laasquestion then:
18:34:30laashow come uint32 isn't a subrange of int?
18:34:50FromGitter<Varriount> laas: What do you mean?
18:35:05FromGitter<Varriount> A subtype?
18:35:18laasfrom my (little) understanding of nim, you can pass Natural to anything expecting int, right?
18:35:24laasbut you can't pass uint32 to anything expected int
18:35:29laasexpecting*
18:35:36laasoh well, it makes sense I suppose
18:35:43laasit's not guaranteed to be 64-bit or more on all platforms
18:36:07Araquint can hold values that int can't
18:36:27Araqevery greater than 2^31 - 1
18:36:33Araq*everything
18:36:34laasyeah, but in my case int is 64-bit, so uint32 is well within that
18:36:44laasbut then again, that's my case
18:37:04Araqit's unrealistic to assume a 64bit CPU in general
18:37:17laasit is, on windows
18:37:33FromGitter<Varriount> I think a more precise question would be "why can't a uint32 be transparently converged to an int64
18:37:42laasyes that is what I mean
18:37:49laasbut it's pretty obvious now that I think about it
18:38:10laasanother question though: does anyone know what I'm supposed to use instead of emit in the macros module?
18:38:14laasIt's deprecated now
18:38:44AraqI haven't used this emit in my entire life
18:39:05FromGitter<Varriount> What does it do?
18:39:08Araqdeal with trees, not with strings
18:39:31*nsf joined #nim
18:39:35laasyeah I realise just using a macro is probably better in this case....
18:39:47laasI'm just trying to defer all indexing of a type to another
18:39:54laase.g. `x.y` -> `x.z.y`
18:40:15laasso I just used emit, since it was the simplest for me to learn
18:43:04FromGitter<Varriount> I prefer quote
18:45:22*JappleAck quit (Ping timeout: 260 seconds)
18:48:08Araqlaas: how do you do this defering?
18:48:19Araqmaybe there is a trick I don't know yet ... :-)
18:51:12*jsgrant__ joined #nim
18:51:28laasit's quite simple actually
18:51:38*tj_yoco joined #nim
18:52:30laastemplate `.`(new_fn: NewFunction, field: string):untyped =
18:52:32laas emit("new_fn.Function." & field)
18:53:31*jsgrant_ quit (Ping timeout: 240 seconds)
18:55:01FromGitter<alehander42> is there any "Nim for Python programmers" resource or something ?
18:55:01Araqoverloading of the dot, ok
18:55:09*TjYoco quit (Ping timeout: 246 seconds)
18:55:45planetis[m]@alehander42 https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers
18:57:02tj_yococouldn't hope for a better answer on that one lol
18:57:25*couven92 joined #nim
18:57:31*Jesin joined #nim
18:58:36*JappleAck joined #nim
18:58:40FromGitter<alehander42> :D
18:59:53tj_yocoHow do you model a type so json modules `to` macro handles JArrays?
19:00:00FromGitter<alehander42> I don't really like using "classic" oop in Nim and I wonder how to explain the alternatives succinctly to a Python programmer
19:03:44Araq def foo(self): ...
19:03:46Araqbecomes
19:03:59Araqproc foo(self: ref/var T) = ... ?
19:04:16Araqnote the indentation level difference, lol
19:05:08FromGitter<alehander42> tj_yoco: what's JArray ?
19:05:18laaswouldn't `auto` be more appropiate here instead of T?
19:05:20FromGitter<alehander42> Araq: :D that's easy, I don't like inheritance more
19:06:39tj_yocoI have this: https://pastebin.com/MxKSGha1 and its modelled to this: http://samples.openweathermap.org/data/2.5/forecast?zip=94040&appid=b1b15e88fa797225412429c1c50c122a1
19:07:25tj_yocobut the `to` macro doesn't like the weather object containing a JArray and it just looks weird. I get `Incorrect JSON kind. Wanted '{JObject}' in 'jsonData["list"][i402076]["weather"]' but got 'JArray'. [JsonKindError]`
19:11:04Araqinstead of array[1, RealWData] use seq[RealWData]
19:11:55tj_yoconevermind, silly mistake. Actually had to make the WeatherData.weather a seq[Weather], and get rid of RealWData.
19:13:51tj_yocooh man, they have a parameter named `3h` that's annoying
19:18:50*yglukhov quit (Remote host closed the connection)
19:21:30*mr_yogurt joined #nim
19:26:06*vlad1777d_ joined #nim
19:29:15*yglukhov joined #nim
19:33:57*yglukhov quit (Ping timeout: 268 seconds)
19:34:31*couven92 quit (Ping timeout: 240 seconds)
19:35:03*Vladar quit (Quit: Leaving)
19:37:44*Trustable joined #nim
19:43:22*astronavt joined #nim
19:48:15*marenz__ quit (Ping timeout: 248 seconds)
19:53:32mr_yogurthow do i get a function's signature in a macro?
20:00:31Araqvia getType() or getImpl() but it often indicates a flawed design
20:14:58*yglukhov joined #nim
20:18:45federico3any hint on https://travis-ci.org/nim-lang/Nim/jobs/301687323 ?
20:20:04*astronavt quit (Quit: Leaving...)
20:26:20*Jesin quit (Quit: Leaving)
20:26:48*Snircle_ joined #nim
20:28:11*Snircle quit (Ping timeout: 240 seconds)
20:29:21Araq nimble install zip -y
20:29:21Araqcould not import: X509_check_host
20:29:38Araqyou build nimble with your better SSL support and it fails :-)
20:33:04federico3I can see the failing import - looks like a SSL function name but I'm not making changes to nimble or its build process
20:35:22*tj_yoco quit (Quit: Leaving)
20:36:04*PMunch quit (Quit: leaving)
20:40:32Araqbut nimble uses SSL
20:41:07*Jesin joined #nim
20:42:23*yglukhov quit (Remote host closed the connection)
20:44:07*xet7 quit (Quit: Leaving)
20:44:28*xet7 joined #nim
20:48:27*salewski joined #nim
20:49:08federico3and yet ./bin/nimble install -y zip --verbose fails with an error around the section names in the package info file
20:50:40salewskiCan we use wget in nimble files? Or may that be not available for mac and windows?
20:53:21salewskiBecause I would like to use oldgtk3 to bootstrap ginto, but I want not to clone full oldgtk3 wich user does not need later.
20:53:40*yglukhov joined #nim
20:53:59salewskiexec("wget 'https://raw.githubusercontent.com/StefanSalewski/oldgtk3/master/oldgtk3/gobject.nim' -O gobject.nim")
20:54:15salewskiworks fine for Linux.
20:55:06*yglukhov quit (Remote host closed the connection)
20:55:27Araqsalewski: can you use git instead?
20:56:00salewskiYes, I can use git clone of course.
20:56:18Araqthere is also "nimgrab" but I guess not many people have that in their PATH
20:56:18salewskiBut that generates a lot of traffic.
20:56:46salewskiI did a google search for cloning single files from github, and thw
20:56:57Araqif 'wget' fails, try nimgrab instead
20:57:03salewskiI did a google search for cloning single files from github, and the wget command is one solution.
20:57:07AraqWindows users should have nimgrab
20:58:07salewskiI saw that curl can be used also for getting single files from github.
20:58:31salewskiOK, I will test nimgrab -- have never heard about it before.
20:58:59salewskiWill test, bye.
21:06:09*claudiuinberlin quit (Ping timeout: 248 seconds)
21:16:54salewskiI can not see nimgrab on Linux at all, and can not find info about it with Google. And testing without a windows box is not easy.
21:17:38salewskiI think I will try exec(wget) and fall back to full git clone if an exeption is raised.
21:18:45salewskiBye.
21:18:53*Trustable quit (Remote host closed the connection)
21:24:10*yglukhov joined #nim
21:28:53salewskiOf course I could also provide copies of the 3 files gobject.nim, glib.nim and gir.nim of package oldgtk3 in package gintro.
21:29:58*bkerin joined #nim
21:30:12salewskiBut these 3 files would be only needed for bootstrap/install gintro package. And working with copies of files is not really nice,
21:30:36salewskione may update one location, and forget to copy it to other places.
21:31:01bkerinis there a way, in a template, given a string argument, to turn it into an identifier in the emitted code?
21:35:46salewskibkerin, you may see manual section templates, first example. template declareInt may be what you want.
21:36:17Araqohh I broke tests, yay
21:37:34Araqsalewski: $nim/tools/nimgrab.nim
21:40:31salewskiThanks.
21:47:39*miran quit (Ping timeout: 258 seconds)
21:47:41*PMunch joined #nim
21:52:16FromGitter<kayabaNerve> Is there a library for loading an array from a text file?
21:55:20*yglukhov quit (Read error: Connection reset by peer)
21:55:59*yglukhov joined #nim
21:58:17salewskikayabaNerve, do you want an array of ints, of floats, of strings...
21:58:57*yglukhov quit (Remote host closed the connection)
21:59:31FromGitter<kayabaNerve> Ints
22:00:01*kunev quit (Ping timeout: 248 seconds)
22:00:07FromGitter<kayabaNerve> I mean, I'll load it as a JSON object, regular array, comma delimited file...
22:01:30*kunev joined #nim
22:05:02salewskiI think there are many ways to do it. You may use modules streams of course. But there may be better ways, there was a forum thread about fast CVS processing recently.
22:06:01bkerinsalewski: I tried that one, but `` constructors maybe need untyped? Also I notice that the {.inject.} pragram in that example doesn't seem documented
22:06:38FromGitter<kayabaNerve> So basically, I have to write my own thingy?
22:07:00FromGitter<kayabaNerve> https://nim-lang.org/docs/parsecsv.html
22:07:03FromGitter<kayabaNerve> NVM then :D
22:07:05Araqmarshal.nim makes it a one liner
22:07:14Araqjson.nim too
22:07:17FromGitter<kayabaNerve> Looking it up now Araq
22:09:58*lurker quit (Quit: Leaving)
22:16:38*fvs joined #nim
22:17:20*Veladus joined #nim
22:18:16*MJCaley quit (Quit: MJCaley)
22:19:25*fvs left #nim (#nim)
22:20:21*fvs joined #nim
22:20:47salewskinimgrab seems not to support ssl
22:20:50salewskinimgrab 'https://raw.githubusercontent.com/StefanSalewski/oldgtk3/master/oldgtk3/gir.nim' gir.nim
22:21:09salewskiError: unhandled exception: SSL support is not available. Cannot connect over SSL. [HttpRequestError]
22:22:13salewskiSo I will fall back to full git clone when wget is not available. Should be not a big issue, as most people should have wget.
22:22:15Araqcompile it with -d:ssl ?
22:22:33salewskiAh yes, thanks.
22:22:35*astronavt joined #nim
22:22:44*mr_yogurt quit (Ping timeout: 260 seconds)
22:24:27salewskiAnd it works great Araq!
22:24:40Araqit's what our installer uses
22:24:50Araqso I hope it does work... lol
22:25:25salewskiBye.
22:25:28*salewski quit (Quit: WeeChat 1.9.1)
22:25:56*Veladus quit (Quit: Page closed)
22:27:16*endragor joined #nim
22:30:25laaswhat does !"some string" mean?
22:30:31laasI see it used in macros a lo
22:30:33laast
22:30:42Araqconverts a string into an identifier
22:31:05Araqbut it should be deprecated
22:31:27*endragor quit (Ping timeout: 248 seconds)
22:31:32Araqwith extended raw string literals it's not required anymore
22:32:39laasinto an identifier?
22:32:42laaswhy would that be needed?
22:33:23*couven92 joined #nim
22:34:42Araqbecause in
22:34:47Araqlet foo = "abc"
22:34:53Araq"abc" is a string literal
22:34:57Araqfoo is an identifier
22:35:00Araqlet is a keyword
22:35:33Araqfor identifier generation you need to convert the identifier to a string, do your concats, and convert it back to an identifier
22:39:51*skrylar joined #nim
22:41:36laasquestion: how do I use getAst with a template that takes an `untyped` block parameter?
22:43:00skrylarfairly certain templates are not used for ast hacking, you may need a macro
22:43:33bkerinlaas: yo uwould use getAst(someTemplate()) in your macro
22:43:42laasbut how would I pass the block parameter?
22:43:49bkerinAraq: i give up I can't figure out how to produce an ID in a template
22:43:58laasI can't put do inside the parentheses or to the right of them
22:44:03laasboth produce a syntax error
22:44:13laasskrylar: that is true but in this case I'm using a template to generate a macro
22:45:05Araqskrylar: getAst + template is in fact even the suggested way to construct ASTs
22:45:49skrylarreally? i just used empty macros for that
22:45:54bkerinlaas: i'm not sure generating macros from templates makes sense
22:45:59Araqskrylar: yup
22:46:29skrylarbkerin, it can if you want to change one or two things about an otherwise vanilla AST, like the form of a math function
22:47:00skrylarex. in my tensor code there is a generic "value += a `op` b" and that structure is the same but a template/macro is used to generate the various forms
22:48:52bkerinskrylar: I dont follow you
22:49:48Araqlaas: getAst really works only with untyped templates, kind of since it doesn't perform overloading resolution
22:51:12laasbtw, question
22:51:14Araqlaas: depending on your needs it may be impossible with a template
22:51:19laaswhy is dot operator deprecated?
22:51:22laasis there a replacement?
22:51:29laasseems like an odd thing to do
22:51:44Araqit's .deprecated unless you use .experimental iirc
22:51:53laasdoes it not work properly?
22:52:04AraqI am not sure
22:52:28skrylarits a useful operator but seems to confuse some people as to what it does
22:52:44AraqI'm about to give it a real test :P
22:52:59laasoh really?
22:53:01skrylarwas thinking of trying it out in cobweb, although that might be awkward
22:53:04laasI thought it's pretty obvious
22:53:08skrylarcobweb[someval] = foo is just as good
22:53:08laasdot operator, you overload the dot
22:53:27Araqthe dot is already quite ambiguous in Nim
22:53:38skrylaralthough i realized i have to use the jsonnode type or such for the variable binding, yay more type boxing .).
22:53:43skrylar*._.
22:54:40Araqoverloading it is super dangerous
23:00:23*bkerin quit (Quit: "Man who go to bed with sex on mind wake up with solution in hand.")
23:24:13Araqwhat? "Man who go to bed with sex on mind wake up with solution in hand." ?
23:28:16*JappleAck quit (Quit: Leaving)
23:31:44*sz0 quit (Quit: Connection closed for inactivity)
23:41:32*marenz__ joined #nim
23:42:22*vlad1777d_ quit (Remote host closed the connection)
23:44:29*vlad1777d joined #nim
23:56:32*marenz__ quit (Ping timeout: 255 seconds)