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:08 | FromGitter | <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:08 | FromGitter | ... [https://gitter.im/nim-lang/Nim?at=5a0f84ec540c78242d1973ee] |
00:57:36 | * | rbrt quit (Quit: Oíche mhaith) |
01:11:06 | FromGitter | <kayabaNerve> Also, how do you check two bools in an if statement? && isn't recognized |
01:13:33 | FromGitter | <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:16 | FromGitter | <Varriount> @kayabaNerve How are you doing? |
03:21:59 | * | xkapastel quit (Quit: Connection closed for inactivity) |
03:22:45 | skrylar | hmm. 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:09 | FromGitter | <kayabaNerve> @Varriount Good. You? |
03:49:47 | FromGitter | <Varriount> @kayabaNerve Wondering if I have the energy to do "a month of Nim documentation" in December. |
03:50:20 | FromGitter | <Varriount> Also, currently wrestling with deploying an application on Linux |
03:51:43 | FromGitter | <kayabaNerve> A: No. |
03:51:46 | FromGitter | <kayabaNerve> Oh. What app? |
03:52:42 | FromGitter | <Varriount> It's an in-house python application. |
03:53:21 | FromGitter | <kayabaNerve> Ah. |
03:53:30 | FromGitter | <kayabaNerve> I have a suggestion: ⏎ Delete it. ⏎ Redo it in Nim. |
03:53:58 | FromGitter | <Varriount> I would, if it didn't depend on the AWS API |
03:55:34 | FromGitter | <kayabaNerve> Solution: write a Nim aws module |
03:55:45 | FromGitter | <kayabaNerve> :p |
03:56:02 | FromGitter | <Varriount> I've plans for one, but it's no small task. |
03:56:03 | FromGitter | <kayabaNerve> I almost have my camera up in my game |
03:56:19 | FromGitter | <Varriount> What are you using to draw the graphics? |
03:56:21 | FromGitter | <kayabaNerve> Tell me when you get one running. I'll be interested |
03:56:25 | FromGitter | <kayabaNerve> SFML |
03:56:50 | FromGitter | <kayabaNerve> So I have to do the 3D data structures and 2D conversion myself |
03:57:13 | FromGitter | <kayabaNerve> (should it be drawn, what scale, where) |
03:57:21 | FromGitter | <kayabaNerve> I hate directions D: |
04:04:58 | FromGitter | <Varriount> @zacharycarter Might be able to help |
04:05:11 | FromGitter | <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:56 | mr_yogurt | Is 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:34 | skrylar | i don't think we have __dict__, although i don't see why we couldn't |
04:31:26 | mr_yogurt | skrylar: 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:28 | FromGitter | <Varriount> mr_yogurt: What are you aiming to achieve? |
04:35:12 | mr_yogurt | Varriount: just that, programmatically generate some dumb wrappers for functions |
04:35:32 | FromGitter | <Varriount> Any reason why these wrapper's can't be generated along with the functions? |
04:36:06 | mr_yogurt | i'm not in control of the module i'm trying to wrap, if that's what you're saying |
04:36:14 | FromGitter | <Varriount> Ah. Hm. |
04:36:59 | * | endragor quit (Remote host closed the connection) |
04:37:24 | FromGitter | <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:25 | FromGitter | <Varriount> https://nim-lang.org/docs/macros.html#parseStmt,string |
04:38:57 | FromGitter | <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:21 | FromGitter | <Varriount> What do you think? |
04:39:43 | mr_yogurt | sounds like it could work, i'd have to try it |
04:40:15 | FromGitter | <Varriount> mr_yogurt: I've done something similar before, generating procedures based off of a JSON file. |
04:40:37 | FromGitter | <Varriount> The trick in that instance was to make liberal use of macros.quote to generate the procedures. |
04:41:56 | FromGitter | <Varriount> mr_yogurt: Let me know if you need help. |
04:42:49 | mr_yogurt | Varriount: i might since i just discovered nim like 3 days ago (loving it so far. 9/10 best language) |
04:43:18 | FromGitter | <Varriount> mr_yogurt: What module are you trying to wrap? |
04:44:24 | mr_yogurt | Varriount: 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:09 | mr_yogurt | dumb reason but it's also an excuse to learn how to do fancy-schmancy metaprogramming |
04:45:39 | FromGitter | <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:10 | FromGitter | <Varriount> Just a warning: the compiler will complain if both the wrapper module and the wrapped module are imported without qualifiers. |
04:47:52 | FromGitter | <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:37 | bkerin | is 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:49 | mr_yogurt | yeah 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:35 | FromGitter | <Varriount> mr_yogurt: You can use `export` for the pass-through |
04:49:52 | mr_yogurt | Varriount: oh cool. thanks |
04:50:07 | FromGitter | <Varriount> bkerin: Look at the strfmt module on Nimble, or the strutils module in the standard library |
04:52:54 | mr_yogurt | Is the current no-compile-time FFI restriction due to implementation difficulties or is there another reason? |
04:53:44 | FromGitter | <Varriount> implementation difficulties |
04:53:52 | FromGitter | <Varriount> mr_yogurt: What do you need the FFI for? |
04:53:58 | mr_yogurt | i don't, just curious |
04:55:21 | FromGitter | <Varriount> mr_yogurt: An easier start might be to create a macro that wraps a single procedure based on an input name. |
04:56:05 | skrylar | some people have the idea that wrappers shouldn't do anything special in order to minimize the difference |
04:56:05 | FromGitter | <Varriount> Like, `generate_wrapper(some_sdl_function_name)` |
04:56:13 | skrylar | it can take longer to ex. update a 'smart' wrapper |
04:56:46 | skrylar | Some people apparently also hate exceptions in nim, not sure what to do about that |
04:57:25 | mr_yogurt | skrylar: 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:36 | skrylar | they hate exceptions in general |
04:58:26 | mr_yogurt | oh so just normal weird people |
04:58:33 | skrylar | I haven't looked in to doing exceptions in firebird |
04:59:00 | skrylar | It certainly could be done, i'd have to bother qqtop to ask about that |
04:59:06 | mr_yogurt | firebird? |
04:59:35 | skrylar | i wrote a wrapper for a (fairly mature) embeddable sql database |
04:59:59 | skrylar | mr_yogurt, https://github.com/Skrylar/firebird |
05:00:45 | skrylar | They 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:38 | skrylar | I do miss Lisp's idea of exception handlers |
05:03:12 | mr_yogurt | i didn't get deep enough into lisp to know what it's idea of exception handlers was |
05:03:17 | mr_yogurt | what exactly is special about it? |
05:04:06 | skrylar | well 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:26 | skrylar | whereas 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:41 | skrylar | to which the error throwing code can say "your choices are panic, retry, etc" |
05:04:56 | skrylar | so its like instead of throwing to a handler, it runs a callack |
05:04:58 | skrylar | *callback |
05:05:34 | mr_yogurt | oh that's fancy |
05:05:52 | skrylar | you 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:01 | skrylar | its just like "on_error" in node or something |
05:06:05 | skrylar | well not 'just' like but similar to |
05:06:32 | skrylar | the 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:03 | skrylar | non-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:21 | skrylar | versus return codes, where "discard somecall" is all it takes |
05:08:03 | skrylar | i don't know if we have a (macro-expand) equivalent in nim |
05:08:25 | skrylar | that'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:21 | FromGitter | <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:22 | skrylar | Varriount: 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:53 | mr_yogurt | What do you guys recommend for editing nim? |
05:20:29 | FromGitter | <Varriount> VSCode has the most actively maintained extension, however there is syntax highlighting and other basic support for most common editors. |
05:20:32 | FromGitter | <Varriount> I use Sublime Text |
05:22:04 | mr_yogurt | No IDE support yet? |
05:22:33 | bkerin | my_yogurt: vim has support |
05:22:58 | bkerin | mr_yogurt: though I had to hack vim.nim a bit to make it work with latest nim |
05:23:19 | FromGitter | <Varriount> mr_yogurt: What do you classify as an IDE? |
05:24:38 | mr_yogurt | Varriount: eclipse, pycharm, visual studio: IDEs. VSCode, Notepad++, vim: not IDEs. |
05:27:25 | FromGitter | <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:05 | mr_yogurt | i dunno if eclipse is really java specific anymore |
05:29:25 | mr_yogurt | although if you're writing c/c++ on windows you probably should use VS |
05:29:25 | FromGitter | <Varriount> I didn't think it was used anymore. IntelliJ seems to be sucking the life out of the other Java IDEs |
05:29:34 | skrylar | vimacs :p |
05:29:43 | mr_yogurt | skrylar: you mean spacemacs? |
05:29:45 | FromGitter | <Varriount> Bleh, VS. I've had better functionality from Sublime Text, thank you very much. |
05:29:54 | FromGitter | <Varriount> At least Sublime Text has decent autocomplete. |
05:29:58 | skrylar | mr_yogurt, eh. i use a custom .emacs with evil-mode. |
05:30:40 | mr_yogurt | Varriount: 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:51 | FromGitter | <Varriount> It just nags you. |
05:31:14 | skrylar | i paid for sublime 1 |
05:31:20 | * | smeady_ joined #nim |
05:31:23 | skrylar | i wouldn't pay for it now that jon has turned in to a zombie |
05:31:25 | FromGitter | <Varriount> I'm the maintainer of the plugin for Sublime Text, however I haven't had much time to update the plugin. |
05:31:35 | mr_yogurt | like winrar? |
05:31:47 | FromGitter | <Varriount> So it has some odd behavior now and then |
05:32:07 | skrylar | am a little curious about nimsuggest. may have to see if i can get that to cooperate without making emacs slow |
05:33:10 | skrylar | well 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:53 | FromGitter | <Varriount> As much as I appreciate the effort put into Nimsuggest, it needs to be redesigned. |
05:35:10 | FromGitter | <Varriount> Especially the protocol. |
05:36:35 | mr_yogurt | OT, 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:11 | skrylar | See, Sublime costs money and ey didn't even give us a proper GUI for that |
05:37:22 | skrylar | Yes 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:23 | FromGitter | <Varriount> skrylar: You can change the color scheme in Sublime... |
05:38:37 | FromGitter | <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:26 | FromGitter | <Varriount> mr_yogurt: ctrl+shift+p , then type in "color" and press enter |
05:40:04 | mr_yogurt | Varriount: oh i figured it out, i was just referring to the default being a dark scheme |
05:40:59 | skrylar | a lot of developers eyes are less strained with dark colors |
05:41:23 | skrylar | it 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:46 | skrylar | https://www.dropbox.com/s/p7vu32jdemfz2fy/firebird3.pdf?dl=0 a whopping 17 pages now @_@ |
05:42:47 | FromGitter | <Varriount> skrylar: We need to get you an award - "Most documented Nim library" |
05:43:52 | mr_yogurt | also "Nim documentation with best typesetting" |
05:44:25 | mr_yogurt | i don't think i've seen documentation done in latex before but i already love it |
05:44:57 | FromGitter | <Varriount> I'd still rather use something like restructured text or asciidoc |
05:48:43 | FromGitter | <Varriount> skrylar: what do you mean by variadic arguments? |
05:50:22 | mr_yogurt | Varriount: variadic functions are functions that can take multiple numbers of arguments |
05:50:59 | FromGitter | <Varriount> Yes, but does he mean varargs, openarray, or the importc variadic arguments |
05:51:07 | mr_yogurt | oh then i have no idea |
05:51:50 | FromGitter | <kayabaNerve> I implemented rendering |
05:51:53 | FromGitter | <kayabaNerve> It's broken |
05:51:58 | FromGitter | <kayabaNerve> The life of a programmer lol |
05:52:05 | FromGitter | <Varriount> @kayabaNerve Great! Have you updated your Repo? |
05:52:12 | FromGitter | <Varriount> I can test on Windows. |
05:52:24 | FromGitter | <kayabaNerve> Just did |
05:52:27 | FromGitter | <kayabaNerve> It compiles |
05:52:37 | FromGitter | <kayabaNerve> The issue is the math in the generateFOV functon |
05:52:53 | FromGitter | <kayabaNerve> It's causing Clyde to barely move and disappear off the screen from being in the middle |
05:52:58 | FromGitter | <kayabaNerve> Clyde is the orange ghost I test with |
05:53:21 | FromGitter | <kayabaNerve> I have to figure out a proper way to handle directions, and possibly 'normalize' the code |
05:53:43 | FromGitter | <kayabaNerve> IE go from xyz based on sphere center to xy based on player center |
05:53:59 | FromGitter | <kayabaNerve> I'm also tired as hell as it's midnight :P |
05:54:19 | FromGitter | <Varriount> It's 1 in the morning here. |
05:54:24 | FromGitter | <kayabaNerve> Ah |
05:54:27 | FromGitter | <kayabaNerve> Go to bed |
05:56:14 | FromGitter | <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:32 | FromGitter | <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:49 | FromGitter | <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:15 | skrylar | mr_yogurt, Varriount: it was texinfo, but theres a [la]tex/pdf output |
06:16:28 | skrylar | also the importc varargs seems to only like cstrings |
06:16:37 | mr_yogurt | skrylar: either way it looks great |
06:16:42 | skrylar | when i tried one of the weird functions that is two ints and a string, nim complained |
06:20:10 | skrylar | nfltk is going to get docs like that at some point |
06:20:22 | skrylar | although fltk is decently documented upstream so it wasn't a priority |
06:21:45 | skrylar | have no interest in this immgui stuff tho |
06:22:32 | skrylar | i 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:54 | skrylar | what would be neat, though unlikely to happen, is to maybe combine nimsuggest and info |
06:26:26 | skrylar | ex. 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:10 | skrylar | probably with some manual nim code you could convert docbook to a docset for dash/zeal/etc as well |
06:36:15 | skrylar | Varriount: 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:31 | FromGitter | <Varriount> mr_yogurt: Need any help? |
06:47:47 | FromGitter | <Varriount> skrylar: Cobweb? |
06:48:27 | * | endragor quit (Ping timeout: 240 seconds) |
06:49:48 | skrylar | varriount: 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:23 | skrylar | ex 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:38 | skrylar | so you can have things like cobweb.add(focused_document_editable): result(focused_document): !focused_document.readonly |
06:55:11 | FromGitter | <Varriount> Sounds like something Lisp would do well with. |
06:55:27 | skrylar | probably just a few closures and macros in nim |
06:55:33 | skrylar | the code for toposort isn't that complex |
06:55:58 | skrylar | It's sort of the inverse of functional reactive programming, but meh |
06:56:25 | skrylar | FRP is more like this.enabled = proc(): !something.readonly and that gets executed every time you check |
06:57:31 | skrylar | they tried to make a gui library named 'cello' which was built on 'cells' but i think its stuck in the ether now |
06:59:00 | skrylar | hmm. there might be issues knowing variable types in the dynamci version. bleh |
06:59:21 | skrylar | if 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:24 | FromGitter | <Varriount> I looked at some lisp code today. Quite pretty, but also hard to understand at a glance. |
07:13:34 | mr_yogurt | Varriount: 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:00 | FromGitter | <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:29 | FromGitter | <mratsim> will do |
08:12:24 | FromGitter | <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:29 | FromGitter | <mratsim> will do tomorrow. I’m knee deep into an IronMan 24h Machine Learning competition to forecast car traffic right now. |
08:15:39 | FromGitter | <alehander42> wow sounds intriguing :D good luck |
08:16:30 | FromGitter | <alehander42> btw for newcomers in ML (like me) are there similar sites with datasets/little competitions (sooomething like project euler for ml)? |
08:17:41 | FromGitter | <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:18 | FromGitter | <mratsim> https://www.kaggle.com/competitions |
08:27:57 | * | dexterk joined #nim |
08:31:29 | * | JappleAck joined #nim |
08:31:56 | FromGitter | <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:00 | miran | @alehander42 - if you're just starting: mueller's "introduction to machine learning with python" |
08:34:30 | * | endragor joined #nim |
08:34:36 | miran | if you want something tougher - rashka's "python machine learning" |
08:35:34 | miran | statistics in general - free book http://www-bcf.usc.edu/~gareth/ISL/ |
08:35:53 | FromGitter | <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:55 | miran | and tougher variant, also free https://web.stanford.edu/~hastie/ElemStatLearn/ |
08:37:22 | FromGitter | <mratsim> Scikit-learn documentation and examples are also excellent, example: http://scikit-learn.org/stable/tutorial/machine_learning_map/index.html |
08:38:00 | FromGitter | <alehander42> agh, I hate videos, I always dreamed to convert them automatically to some browseable text+gif format :D |
08:38:17 | FromGitter | <alehander42> but I admit they've been helpful with maths |
08:39:15 | FromGitter | <alehander42> thanks miran, I'll take a look at them |
08:40:08 | FromGitter | <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:15 | FromGitter | <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:44 | FromGitter | <mratsim> That’s like doing variant of the Nim compiler to learn Nim :P |
08:41:15 | FromGitter | <mratsim> or smelting a knife to learn how to cook |
08:41:59 | FromGitter | <mratsim> (got to focus, see you in a few hours) |
08:42:05 | miran | @alehander42 if you want to learn by implementing what's going on behind the scenes - consider andrew ng's coursera course |
08:44:06 | FromGitter | <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:57 | FromGitter | <alehander42> yeah I've heard a lot of good stuff about ng course, does it contain enough of the math basis? |
08:45:57 | miran | if 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:25 | FromGitter | <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:53 | FromGitter | <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:20 | salewski | I have just fixed gintro package for latest compiler version, that was easy. |
09:32:54 | salewski | But now I have also tested the ned editor, and that gives me this new error for latest compiler: |
09:33:04 | salewski | ned.nim(78, 12) Error: type mismatch: got ((type NimEdAppWindow, GType, int, string)) |
09:33:13 | salewski | but expected one of: |
09:33:43 | salewski | macro gDefineTypeExtended(tn, t, tp, f, c: static[string]): stmt |
09:33:54 | salewski | template gDefineTypeExtended(tn, tp, f: expr; c: string) |
09:34:28 | salewski | Can someone guess what may have changed in the compiler recently for macro processing? |
09:35:30 | salewski | I 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:16 | Araq | change the 'expr' to 'typed' |
09:39:18 | salewski | Oh, I thought that expr was only deprecated... |
09:40:55 | salewski | For gintro and oldgtk3 package I have already replaced stmt and expr with new typed and untyped, |
09:41:12 | salewski | for for ngtk3 and ned I was too lazy. |
09:47:21 | Araq | 'expr' is 'untyped' but I think your overload set is illformed |
09:47:32 | Araq | hence I suggested 'typed' |
09:47:54 | * | dddddd quit (Remote host closed the connection) |
09:48:29 | Araq | and 'tn' should probably be 'typeDesc' |
09:49:16 | Araq | not 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:18 | salewski | Thanks for your explanation Araq! |
10:08:36 | * | Vladar joined #nim |
10:11:10 | Araq | what's the FP name for "deepMap"? |
10:16:00 | FromGitter | <Varriount> What's a deep map? |
10:17:10 | * | xkapastel quit (Quit: Connection closed for inactivity) |
10:17:35 | Araq | I'm thinking about the new asArray macro and it's easy to do better |
10:17:42 | Araq | but not to come up with a name for it :P |
10:19:27 | * | marenz__ joined #nim |
10:21:41 | FromGitter | <Varriount> What improvements does this version have? |
10:22:35 | Araq | it also works for tuples, sets, nested tuples of arrays of sets, etc |
10:22:47 | dom96 | asType? |
10:22:56 | dom96 | please don't generalise it too much |
10:23:17 | Araq | currently it's mapLits |
10:23:44 | Araq | mapLits([[2, 3], [1, 4]], float) |
10:23:53 | Araq | mapLits([[2, 3], [1, 4]], `$`) |
10:24:28 | Araq | mapLits([(4, 'y', 6), (1, 'x', 3)], `$`) |
10:24:54 | Araq | every *literal* is annotated with the second argument |
10:25:35 | Araq | that's not ambiguous but sometimes you need the nesting and sometimes you don't |
10:25:55 | dom96 | Honestly, I don't think it's worth thinking about this. |
10:25:58 | dom96 | Just merge asArray |
10:26:10 | Araq | so I'm thinking about an optional third parameter nesting=false |
10:26:21 | Araq | asArray is too narrow |
10:26:33 | dom96 | asArray should be available anyway, even if you implement this |
10:26:37 | Araq | then somebody adds an asTuple "for consistency" |
10:26:47 | Araq | and asSet |
10:26:49 | Araq | asSeq |
10:26:57 | Araq | etc, I'm fighting the bloat here |
10:27:17 | Araq | that you'll happily accept for consistency or because Python has it |
10:28:04 | Araq | besides, sequtils is about 'map' and 'filter' etc, not about 'asT' whatever that means |
10:29:23 | Araq | in fact, I already wrote something very similar for karax |
10:29:35 | Araq | and it would be nice to cover this properly |
10:29:38 | dom96 | alright, but I prefer `mapLiterals` then |
10:30:07 | dom96 | alternatively: asType(array[int], [1,2,3,4]) |
10:30:16 | FromGitter | <Varriount> The problem is, `1` and `[1, 2, ...]` are both seen as literals. |
10:30:23 | dom96 | oh, but then I'd need to specify the size bleh |
10:30:32 | dom96 | yeah, that's true |
10:30:36 | dom96 | This gets confusing quickly |
10:31:04 | Araq | Varriount: that's not an atomic literal though |
10:31:25 | dom96 | You could specify kindsToTransform={nnkIntLiteral, nnkFloatLiteral,...} |
10:31:38 | dom96 | as a parameter to this for greater control |
10:31:52 | Araq | but then it is too generalized :P |
10:31:57 | dom96 | lol |
10:32:01 | FromGitter | <Varriount> ... @Araq I was going to say, it's to bad Nim doesn't formally classify values things as atoms. |
10:32:11 | FromGitter | <Varriount> *too |
10:32:31 | FromGitter | <mratsim> @Araq “deepMap” is probably map of map. (flatmap would remove a nesting level) |
10:33:46 | Araq | varriount: we can say a 'lit' in Nim speak is an atomic literal |
10:33:50 | Araq | :P |
10:34:12 | FromGitter | <Varriount> The most accurate term would be "atomMap", however "atom" is such a rare term in programming these days. |
10:34:32 | Araq | no that's also wrong, identifiers are atoms too |
10:35:08 | Araq | but mapAtoms is a nice name |
10:36:25 | FromGitter | <alehander42> mapLiterals sounds reasonable |
10:36:26 | FromGitter | <Varriount> "mapAtomicLits" - Precise, but wordy |
10:36:43 | FromGitter | <alehander42> but aren't e.g. `@[2]` literals too |
10:37:33 | FromGitter | <Varriount> @alehander42 I already mentioned that. |
10:38:29 | FromGitter | <Varriount> The classification is whether a literal is atomic (indivisible) or not (divisible) |
10:38:45 | FromGitter | <alehander42> sorry |
10:39:55 | * | couven92 joined #nim |
10:40:07 | Araq | hi couven92 read the logs |
10:40:24 | couven92 | Good morning, okay, will do :) |
10:41:30 | FromGitter | <Varriount> @alehander42 it's fine. I just don't want is going in circles |
10:42:59 | FromGitter | <alehander42> flatLitMap ? |
10:43:28 | FromGitter | <alehander42> it's not about all atoms(no identifiers) and it flattens compound literals |
10:49:49 | couven92 | Araq, sorry I had a lot to read... I went away early yesterday and was on a christmas party... :P |
10:50:08 | couven92 | The ideas about asArray are interesting... |
10:50:23 | couven92 | I agree that it is somewhat misplaced in sequtils, but well... |
10:51:17 | couven92 | But when we had targetType as untyped insetad of typedesc, we actually got that apply a function on all values in the array... |
10:53:06 | couven92 | But 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:37 | FromGitter | <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:59 | Araq | I voted. |
12:18:44 | * | couven92 joined #nim |
12:20:31 | salewski | Araq, 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:43 | salewski | But now it compiles again. |
12:21:19 | Araq | that's just tuples at work |
12:21:34 | Araq | echo (1, 2, 3) # echo the *tuple* |
12:21:37 | * | Snircle joined #nim |
12:21:50 | Araq | echo(1, 2, 3) # echo the 3 arguments |
12:22:07 | Araq | echo (1) # echo the argument that was pointlessly wrapped in () |
12:22:15 | dom96 | I voted for two things because why not :) |
12:22:33 | Araq | omg, why do you say, because singleton tuple constructors don't exist. |
12:24:16 | Araq | and that was another breaking change, that is still missing in the changelog, I think |
12:25:16 | Araq | but I missed the (( )) in the error message too ;-) |
12:25:37 | FromGitter | <data-man> Thanks! Nimocracy in action. |
12:26:44 | * | salewski quit (Quit: WeeChat 1.9.1) |
12:31:04 | FromGitter | <couven92> forEach could maybe also be viable name for the extended asArray? |
12:31:20 | federico3 | data-man: are you sure about adding an env variable? Perhaps at some point tests could parse a configution file |
12:33:07 | FromGitter | <data-man> @federico3: Or cmd-line parameters? |
12:34:28 | federico3 | most likely both |
12:37:29 | FromGitter | <data-man> @Araq: What do you think about exporting a system/timers/getTicks ()? |
12:38:18 | Araq | I need to do that, it is used often enough to suggest I got the API right |
12:43:54 | FromGitter | <data-man> And about adding rdtsc for C-backend? |
12:45:59 | Araq | seems unreliable |
12:46:04 | Araq | ugh, Nim |
12:46:19 | Araq | when the documentation is a page and the implementation 5 lines... |
12:47:12 | Araq | and 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:58 | Araq | because if I don't I got to read pamphlets about my "attitude" and helpful links ala "write documentation, mmmkay?" |
12:48:57 | FromGitter | <couven92> :D |
12:49:10 | FromGitter | <couven92> The pain is real Araq? |
12:53:19 | Araq | I used the name 'mapLiterals' btw |
12:55:10 | FromGitter | <couven92> What are we doing about my asArray? |
12:55:21 | * | SenasOzys_ quit (Read error: Connection reset by peer) |
12:55:32 | FromGitter | <couven92> Are you replacing or extending? |
12:55:40 | * | SenasOzys_ joined #nim |
12:56:33 | * | nsf joined #nim |
12:59:52 | Araq | replace it with something better |
13:00:08 | FromGitter | <couven92> Me? |
13:01:13 | FromGitter | <couven92> Okay, I can do that... though I don't know about the nesting... |
13:02:33 | FromGitter | <couven92> Or actually, for nesting, how about doing an overload that accepts an array of conversions, one per nesting level? |
13:05:42 | FromGitter | <couven92> I like mapLiterals or mapLit as a name |
13:06:04 | FromGitter | <couven92> Plural! |
13:06:32 | FromGitter | <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:02 | Araq | er, I just finished this feature for you |
13:08:06 | Araq | you don't need to do anything |
13:08:14 | FromGitter | <couven92> :D |
13:08:19 | * | endragor quit (Remote host closed the connection) |
13:10:55 | * | endragor joined #nim |
13:15:45 | Araq | ugh, now I have this crazy history of couven92 in devel |
13:15:50 | Araq | oh well... |
13:16:13 | FromGitter | <couven92> :D |
13:16:52 | FromGitter | <couven92> You didn't sqash merge? |
13:17:07 | FromGitter | <couven92> Ah, wait you just edited directly? |
13:20:20 | Araq | yeah -.- |
13:21:38 | FromGitter | <couven92> Yours looks great! :) |
13:21:47 | FromGitter | <couven92> Sorry about the history |
13:22:28 | Araq | yeah, it's a nice feature now :-) |
13:23:26 | FromGitter | <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:00 | Araq | usually I sqash the history |
13:24:45 | FromGitter | <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:50 | Araq | and now that I've completed it I know it's wrong still :-) |
13:26:15 | * | endragor joined #nim |
13:26:18 | FromGitter | <couven92> mapLiterals |
13:26:30 | Araq | yeah, it's still misdesigned lol |
13:26:32 | FromGitter | <couven92> What's wrong now? |
13:27:34 | Araq | when do I want to apply 'op' to both integers and strings? ok, maybe for JSON |
13:27:50 | Araq | but mapIntLits and mapStrLits seem to be more useful now |
13:28:50 | FromGitter | <couven92> Let it be an undocumented feature and hope nobody's ever crazy enough to do it? |
13:29:17 | Araq | and the order is wrong, the 'op' needs to come first then I can pass a whole body as the AST to transform |
13:29:32 | Araq | but then the name 'map' is wrong ... argh |
13:29:48 | FromGitter | <couven92> convert? |
13:30:08 | Araq | yeah |
13:30:22 | Araq | convertIntLits(`$`): |
13:30:27 | * | endragor quit (Ping timeout: 240 seconds) |
13:30:30 | Araq | echo 1, 2, 3, (4, 5) |
13:30:53 | Araq | convertIntLits(uint, [1, 2, 3]) |
13:31:40 | * | yglukhov quit (Remote host closed the connection) |
13:31:49 | Araq | convertLits(`%`, [1, 2, 3]) # similar to json's %* |
13:32:08 | FromGitter | <couven92> I still think having a general implementation is better than overloads for each literal type |
13:32:17 | Araq | but I'm leaving it as it is now |
13:32:32 | Araq | mapLiterals fits sequtils. |
13:33:01 | FromGitter | <couven92> Okay |
13:39:13 | FromGitter | <couven92> Araq, this means I can merge devel into strutils and make the Rune arrays in unicode nice, right? |
13:39:49 | Araq | this should be 2 separate PRs |
13:39:57 | FromGitter | <couven92> ? |
13:40:17 | Araq | one PR for strutils |
13:40:23 | Araq | one PR to improve unicode.nim |
13:42:59 | * | yglukhov joined #nim |
13:48:15 | FromGitter | <couven92> Yeah, my current PR is for getting stuff into Unicode, you want a new one that removes stuff from strutils? |
13:50:46 | Araq | no, what's there to remove? |
13:51:01 | Araq | it needs a deprecation path at least |
13:51:39 | FromGitter | <couven92> Okay then we don't need a new PR, do we? |
13:55:00 | Araq | no |
14:01:56 | * | nsf quit (Quit: WeeChat 1.9.1) |
14:04:25 | planetis[m] | Hey, shouldn't the last statement compile? https://gist.github.com/konqoro/dcff1590457867db5bc9f4717260efb6 |
14:05:37 | planetis[m] | I will just add overloads after all I'm just wondering |
14:09:38 | Araq | are arguments after varargs even documented? |
14:10:04 | Araq | looks like an undocumented feature to me :P (even though I'm aware of it) |
14:11:00 | planetis[m] | no I saw a test |
14:11:03 | planetis[m] | one sec |
14:11:12 | * | yglukhov quit (Remote host closed the connection) |
14:11:18 | planetis[m] | https://github.com/nim-lang/Nim/blob/000b8afd26fa16684a116d9afe798ea94df9c270/tests/overload/tparams_after_varargs.nim |
14:12:13 | planetis[m] | anyway overloading works even better |
14:13:02 | Araq | ok, well, I don't know how hard it is to make default parameters work in the position |
14:13:08 | Araq | could be hard, could be trivial |
14:13:57 | planetis[m] | probably doesn't worth it :p |
14:14:25 | * | JappleAck quit (Ping timeout: 248 seconds) |
14:14:58 | planetis[m] | the C code I was trying to port was using all kinds of ugly stuff with '...' in the parameter list |
14:15:52 | planetis[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:35 | FromGitter | <couven92> Tell that to printf |
14:20:18 | FromGitter | <couven92> Or scanf, or some of the other ...f candidates we all love in C! :P |
14:20:55 | planetis[m] | thank god i never had to use them.. I started programming in nim |
14:21:40 | * | SenasOzys_ joined #nim |
14:23:43 | planetis[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:07 | Araq | I 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:33 | FromGitter | <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:30 | Araq | maybe the organization of the material is bad for newcomers |
14:37:43 | FromGitter | <alehander42> I think it's mostly that some older modules with functions from the stdlib have no examples or descriptions |
14:37:58 | Araq | yeah the old cruft... |
14:38:00 | FromGitter | <alehander42> I even had the idea to autogenerate examples with nim-quickcheck for some modles |
14:38:42 | FromGitter | <alehander42> and to prettify them a bit to be sure they make sense |
14:39:12 | Araq | my favourite docgen feature would be a robotic arm that claps you on the head |
14:39:30 | Araq | when you haven't read something :P |
14:39:40 | FromGitter | <couven92> :D |
14:40:05 | FromGitter | <alehander42> :D |
14:40:10 | FromGitter | <couven92> It would be nice if the examples in the doc comment could be checked though |
14:40:25 | FromGitter | <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:59 | FromGitter | <couven92> I mean, I often duplicate the example code at the end for stdlib testing, but that is duplication... |
14:41:14 | FromGitter | <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:19 | FromGitter | <alehander42> example |
14:42:58 | Araq | yeah but runnable tests in documentation comments are a bit weird |
14:43:17 | Araq | you lose the syntax highlighting and auto-completion features |
14:43:22 | Araq | maybe we need |
14:43:25 | Araq | tests: |
14:43:26 | Araq | ... |
14:43:43 | Araq | that the documentation generator considers too |
14:44:11 | Araq | it could easily look into the proc bodies |
14:44:30 | FromGitter | <couven92> Hmm... maybe a pragma-macro... that searches for a test block, adds that as a doc comment |
14:44:54 | FromGitter | <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:07 | FromGitter | <couven92> Sure |
14:45:31 | Araq | well it is somewhat mitigated by Nim since we have the playground and lots of freestanding functions/procs |
14:46:10 | Araq | but then every implementation artifact is part of the non-existing spec |
14:46:38 | Araq | "/foo/" / "/bar" produces "/foo/bar", got it |
14:47:20 | Araq | plus I suppose people prefer to read examples rather than tinkering on their own :P |
14:48:37 | FromGitter | <alehander42> yeah that's also true :D |
14:50:09 | Araq | we need a spreadsheet-like thing |
14:50:24 | Araq | a page with examples you can run and also edit and run |
14:50:56 | FromGitter | <data-man> @Araq: Maybe in HelpMessage also to use copyrightYear? (and put this const to common module)? (PR#6581) |
14:51:30 | Araq | or maybe just a "run me" button under every example that delegates to Nim's playground |
14:52:39 | hohlerde | wohooooo, got my nim t-shirst yesterday |
14:53:38 | Araq | executableExample: |
14:54:11 | Araq | "a" & "abc" == "aabc" |
14:54:23 | Araq | 2 + 4 == 6 |
14:54:23 | FromGitter | <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:57 | FromGitter | <alehander42> would it be checked on each compile? that would be cool solution for a bit of the "outdated comments" thing |
14:56:00 | Araq | well 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:37 | Araq | this 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:27 | Araq | hohlerde: no, that's something different |
15:00:41 | hohlerde | full example is here: https://privatebin.tarakis.de/?b78f0690062bf75d#fNMWd02NePyqfEc1LyJ6/KHrsqYbja2NmjZAv5CbIZM= |
15:00:42 | Araq | alehander42: it would be checked by testament or maybe some new 'nim test' command. I don't want every compile to check these. |
15:00:58 | hohlerde | I'll create an issue then |
15:04:25 | Araq | ok thanks |
15:09:19 | * | xmonader quit (Ping timeout: 248 seconds) |
15:14:10 | FromGitter | <alehander42> ok |
15:17:46 | hohlerde | issue 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:26 | FromGitter | <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:51 | dom96 | alehander42: where? :o |
16:49:12 | * | TjYoco joined #nim |
16:51:30 | * | nsf quit (Quit: WeeChat 1.9.1) |
17:14:10 | livcd | I 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:39 | laas | hi |
17:19:43 | laas | I have a question |
17:20:10 | laas | Do sequences really use signed ints as indices? |
17:20:15 | laas | or am I doing something wrong? |
17:28:01 | * | vlad1777d_ quit (Ping timeout: 248 seconds) |
17:35:36 | * | jsgrant_ joined #nim |
17:36:15 | FromGitter | <mratsim> they do |
17:37:04 | laas | huh |
17:37:09 | laas | that's pretty weird IMO |
17:37:14 | laas | is there any specific reason? |
17:38:09 | FromGitter | <mratsim> why is it weird? |
17:38:38 | * | jsgrant quit (Ping timeout: 268 seconds) |
17:40:28 | federico3 | laas: yet if you use negative values it does not walk backwards :( |
17:43:11 | * | sz0 joined #nim |
17:45:19 | laas | it's weird because you wouldn't ever have negative indices |
17:45:30 | laas | what even happens if you do? |
17:45:33 | laas | does it just err? |
17:49:45 | * | xkapastel joined #nim |
17:50:23 | * | couven92 quit (Ping timeout: 248 seconds) |
17:54:22 | TjYoco | laas, maybe its leftover from arrays cause you can do stuff like this: https://pastebin.com/gyG26q5C |
17:59:37 | TjYoco | idk 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:54 | TjYoco | throw not through |
18:00:40 | * | dddddd joined #nim |
18:13:06 | laas | yeah and that makes sense for arrays |
18:13:20 | laas | but it makes no sense that things like `seq.len` return an int |
18:13:53 | * | PMunch quit (Quit: leaving) |
18:14:20 | laas | now, it wouldn't be *that* big of a problem, if automatic conversion happened from a subrange to a superrange |
18:14:40 | laas | int 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:50 | planetis[m] | well most procedures that work on seqs accept Natural as parameter which is a subrange |
18:27:04 | planetis[m] | why you think its a problem in the first hand? |
18:31:59 | Araq | laas: on the contrary, it makes perfect sense to return an int |
18:32:08 | Araq | var x = s.len |
18:32:13 | Araq | while x >= 0: |
18:32:23 | Araq | dec x |
18:32:24 | Araq | ... |
18:33:30 | laas | didn't think of that one |
18:34:25 | laas | question then: |
18:34:30 | laas | how come uint32 isn't a subrange of int? |
18:34:50 | FromGitter | <Varriount> laas: What do you mean? |
18:35:05 | FromGitter | <Varriount> A subtype? |
18:35:18 | laas | from my (little) understanding of nim, you can pass Natural to anything expecting int, right? |
18:35:24 | laas | but you can't pass uint32 to anything expected int |
18:35:29 | laas | expecting* |
18:35:36 | laas | oh well, it makes sense I suppose |
18:35:43 | laas | it's not guaranteed to be 64-bit or more on all platforms |
18:36:07 | Araq | uint can hold values that int can't |
18:36:27 | Araq | every greater than 2^31 - 1 |
18:36:33 | Araq | *everything |
18:36:34 | laas | yeah, but in my case int is 64-bit, so uint32 is well within that |
18:36:44 | laas | but then again, that's my case |
18:37:04 | Araq | it's unrealistic to assume a 64bit CPU in general |
18:37:17 | laas | it is, on windows |
18:37:33 | FromGitter | <Varriount> I think a more precise question would be "why can't a uint32 be transparently converged to an int64 |
18:37:42 | laas | yes that is what I mean |
18:37:49 | laas | but it's pretty obvious now that I think about it |
18:38:10 | laas | another question though: does anyone know what I'm supposed to use instead of emit in the macros module? |
18:38:14 | laas | It's deprecated now |
18:38:44 | Araq | I haven't used this emit in my entire life |
18:39:05 | FromGitter | <Varriount> What does it do? |
18:39:08 | Araq | deal with trees, not with strings |
18:39:31 | * | nsf joined #nim |
18:39:35 | laas | yeah I realise just using a macro is probably better in this case.... |
18:39:47 | laas | I'm just trying to defer all indexing of a type to another |
18:39:54 | laas | e.g. `x.y` -> `x.z.y` |
18:40:15 | laas | so I just used emit, since it was the simplest for me to learn |
18:43:04 | FromGitter | <Varriount> I prefer quote |
18:45:22 | * | JappleAck quit (Ping timeout: 260 seconds) |
18:48:08 | Araq | laas: how do you do this defering? |
18:48:19 | Araq | maybe there is a trick I don't know yet ... :-) |
18:51:12 | * | jsgrant__ joined #nim |
18:51:28 | laas | it's quite simple actually |
18:51:38 | * | tj_yoco joined #nim |
18:52:30 | laas | template `.`(new_fn: NewFunction, field: string):untyped = |
18:52:32 | laas | emit("new_fn.Function." & field) |
18:53:31 | * | jsgrant_ quit (Ping timeout: 240 seconds) |
18:55:01 | FromGitter | <alehander42> is there any "Nim for Python programmers" resource or something ? |
18:55:01 | Araq | overloading of the dot, ok |
18:55:09 | * | TjYoco quit (Ping timeout: 246 seconds) |
18:55:45 | planetis[m] | @alehander42 https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers |
18:57:02 | tj_yoco | couldn'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:40 | FromGitter | <alehander42> :D |
18:59:53 | tj_yoco | How do you model a type so json modules `to` macro handles JArrays? |
19:00:00 | FromGitter | <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:44 | Araq | def foo(self): ... |
19:03:46 | Araq | becomes |
19:03:59 | Araq | proc foo(self: ref/var T) = ... ? |
19:04:16 | Araq | note the indentation level difference, lol |
19:05:08 | FromGitter | <alehander42> tj_yoco: what's JArray ? |
19:05:18 | laas | wouldn't `auto` be more appropiate here instead of T? |
19:05:20 | FromGitter | <alehander42> Araq: :D that's easy, I don't like inheritance more |
19:06:39 | tj_yoco | I 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:25 | tj_yoco | but 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:04 | Araq | instead of array[1, RealWData] use seq[RealWData] |
19:11:55 | tj_yoco | nevermind, silly mistake. Actually had to make the WeatherData.weather a seq[Weather], and get rid of RealWData. |
19:13:51 | tj_yoco | oh 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:32 | mr_yogurt | how do i get a function's signature in a macro? |
20:00:31 | Araq | via getType() or getImpl() but it often indicates a flawed design |
20:14:58 | * | yglukhov joined #nim |
20:18:45 | federico3 | any 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:21 | Araq | nimble install zip -y |
20:29:21 | Araq | could not import: X509_check_host |
20:29:38 | Araq | you build nimble with your better SSL support and it fails :-) |
20:33:04 | federico3 | I 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:32 | Araq | but 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:08 | federico3 | and yet ./bin/nimble install -y zip --verbose fails with an error around the section names in the package info file |
20:50:40 | salewski | Can we use wget in nimble files? Or may that be not available for mac and windows? |
20:53:21 | salewski | Because 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:59 | salewski | exec("wget 'https://raw.githubusercontent.com/StefanSalewski/oldgtk3/master/oldgtk3/gobject.nim' -O gobject.nim") |
20:54:15 | salewski | works fine for Linux. |
20:55:06 | * | yglukhov quit (Remote host closed the connection) |
20:55:27 | Araq | salewski: can you use git instead? |
20:56:00 | salewski | Yes, I can use git clone of course. |
20:56:18 | Araq | there is also "nimgrab" but I guess not many people have that in their PATH |
20:56:18 | salewski | But that generates a lot of traffic. |
20:56:46 | salewski | I did a google search for cloning single files from github, and thw |
20:56:57 | Araq | if 'wget' fails, try nimgrab instead |
20:57:03 | salewski | I did a google search for cloning single files from github, and the wget command is one solution. |
20:57:07 | Araq | Windows users should have nimgrab |
20:58:07 | salewski | I saw that curl can be used also for getting single files from github. |
20:58:31 | salewski | OK, I will test nimgrab -- have never heard about it before. |
20:58:59 | salewski | Will test, bye. |
21:06:09 | * | claudiuinberlin quit (Ping timeout: 248 seconds) |
21:16:54 | salewski | I 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:38 | salewski | I think I will try exec(wget) and fall back to full git clone if an exeption is raised. |
21:18:45 | salewski | Bye. |
21:18:53 | * | Trustable quit (Remote host closed the connection) |
21:24:10 | * | yglukhov joined #nim |
21:28:53 | salewski | Of 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:12 | salewski | But these 3 files would be only needed for bootstrap/install gintro package. And working with copies of files is not really nice, |
21:30:36 | salewski | one may update one location, and forget to copy it to other places. |
21:31:01 | bkerin | is there a way, in a template, given a string argument, to turn it into an identifier in the emitted code? |
21:35:46 | salewski | bkerin, you may see manual section templates, first example. template declareInt may be what you want. |
21:36:17 | Araq | ohh I broke tests, yay |
21:37:34 | Araq | salewski: $nim/tools/nimgrab.nim |
21:40:31 | salewski | Thanks. |
21:47:39 | * | miran quit (Ping timeout: 258 seconds) |
21:47:41 | * | PMunch joined #nim |
21:52:16 | FromGitter | <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:17 | salewski | kayabaNerve, do you want an array of ints, of floats, of strings... |
21:58:57 | * | yglukhov quit (Remote host closed the connection) |
21:59:31 | FromGitter | <kayabaNerve> Ints |
22:00:01 | * | kunev quit (Ping timeout: 248 seconds) |
22:00:07 | FromGitter | <kayabaNerve> I mean, I'll load it as a JSON object, regular array, comma delimited file... |
22:01:30 | * | kunev joined #nim |
22:05:02 | salewski | I 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:01 | bkerin | salewski: 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:38 | FromGitter | <kayabaNerve> So basically, I have to write my own thingy? |
22:07:00 | FromGitter | <kayabaNerve> https://nim-lang.org/docs/parsecsv.html |
22:07:03 | FromGitter | <kayabaNerve> NVM then :D |
22:07:05 | Araq | marshal.nim makes it a one liner |
22:07:14 | Araq | json.nim too |
22:07:17 | FromGitter | <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:47 | salewski | nimgrab seems not to support ssl |
22:20:50 | salewski | nimgrab 'https://raw.githubusercontent.com/StefanSalewski/oldgtk3/master/oldgtk3/gir.nim' gir.nim |
22:21:09 | salewski | Error: unhandled exception: SSL support is not available. Cannot connect over SSL. [HttpRequestError] |
22:22:13 | salewski | So 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:15 | Araq | compile it with -d:ssl ? |
22:22:33 | salewski | Ah yes, thanks. |
22:22:35 | * | astronavt joined #nim |
22:22:44 | * | mr_yogurt quit (Ping timeout: 260 seconds) |
22:24:27 | salewski | And it works great Araq! |
22:24:40 | Araq | it's what our installer uses |
22:24:50 | Araq | so I hope it does work... lol |
22:25:25 | salewski | Bye. |
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:25 | laas | what does !"some string" mean? |
22:30:31 | laas | I see it used in macros a lo |
22:30:33 | laas | t |
22:30:42 | Araq | converts a string into an identifier |
22:31:05 | Araq | but it should be deprecated |
22:31:27 | * | endragor quit (Ping timeout: 248 seconds) |
22:31:32 | Araq | with extended raw string literals it's not required anymore |
22:32:39 | laas | into an identifier? |
22:32:42 | laas | why would that be needed? |
22:33:23 | * | couven92 joined #nim |
22:34:42 | Araq | because in |
22:34:47 | Araq | let foo = "abc" |
22:34:53 | Araq | "abc" is a string literal |
22:34:57 | Araq | foo is an identifier |
22:35:00 | Araq | let is a keyword |
22:35:33 | Araq | for 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:36 | laas | question: how do I use getAst with a template that takes an `untyped` block parameter? |
22:43:00 | skrylar | fairly certain templates are not used for ast hacking, you may need a macro |
22:43:33 | bkerin | laas: yo uwould use getAst(someTemplate()) in your macro |
22:43:42 | laas | but how would I pass the block parameter? |
22:43:49 | bkerin | Araq: i give up I can't figure out how to produce an ID in a template |
22:43:58 | laas | I can't put do inside the parentheses or to the right of them |
22:44:03 | laas | both produce a syntax error |
22:44:13 | laas | skrylar: that is true but in this case I'm using a template to generate a macro |
22:45:05 | Araq | skrylar: getAst + template is in fact even the suggested way to construct ASTs |
22:45:49 | skrylar | really? i just used empty macros for that |
22:45:54 | bkerin | laas: i'm not sure generating macros from templates makes sense |
22:45:59 | Araq | skrylar: yup |
22:46:29 | skrylar | bkerin, 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:00 | skrylar | ex. 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:52 | bkerin | skrylar: I dont follow you |
22:49:48 | Araq | laas: getAst really works only with untyped templates, kind of since it doesn't perform overloading resolution |
22:51:12 | laas | btw, question |
22:51:14 | Araq | laas: depending on your needs it may be impossible with a template |
22:51:19 | laas | why is dot operator deprecated? |
22:51:22 | laas | is there a replacement? |
22:51:29 | laas | seems like an odd thing to do |
22:51:44 | Araq | it's .deprecated unless you use .experimental iirc |
22:51:53 | laas | does it not work properly? |
22:52:04 | Araq | I am not sure |
22:52:28 | skrylar | its a useful operator but seems to confuse some people as to what it does |
22:52:44 | Araq | I'm about to give it a real test :P |
22:52:59 | laas | oh really? |
22:53:01 | skrylar | was thinking of trying it out in cobweb, although that might be awkward |
22:53:04 | laas | I thought it's pretty obvious |
22:53:08 | skrylar | cobweb[someval] = foo is just as good |
22:53:08 | laas | dot operator, you overload the dot |
22:53:27 | Araq | the dot is already quite ambiguous in Nim |
22:53:38 | skrylar | although i realized i have to use the jsonnode type or such for the variable binding, yay more type boxing .). |
22:53:43 | skrylar | *._. |
22:54:40 | Araq | overloading 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:13 | Araq | what? "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) |