00:06:48 | * | ieatnerds joined #nim |
00:07:22 | * | user1101 joined #nim |
00:10:57 | * | ieatnerds quit (Ping timeout: 240 seconds) |
00:15:09 | * | Jesin quit (Quit: Leaving) |
00:24:18 | * | Jesin joined #nim |
00:29:06 | * | HYP3RBOR3A_ joined #nim |
00:29:18 | * | HYP3RBOR3A quit (Ping timeout: 256 seconds) |
00:44:53 | * | leorize joined #nim |
00:46:55 | * | leorize quit (Client Quit) |
00:53:28 | * | krux02 quit (Remote host closed the connection) |
00:56:45 | * | user1101 quit (Quit: user1101) |
00:58:46 | * | user1101 joined #nim |
01:49:19 | * | user1101 quit (Ping timeout: 256 seconds) |
02:15:15 | * | dddddd quit (Read error: Connection reset by peer) |
02:21:33 | * | HYP3RBOR3A_ quit (Quit: Leaving) |
02:34:47 | * | user1101 joined #nim |
02:37:07 | * | user1101_ joined #nim |
02:40:55 | * | user1101 quit (Ping timeout: 260 seconds) |
02:40:55 | * | user1101_ is now known as user1101 |
02:55:11 | * | ieatnerds joined #nim |
02:59:01 | * | erratic quit (Ping timeout: 256 seconds) |
02:59:43 | * | endragor joined #nim |
03:11:18 | * | fjvallarino quit (Remote host closed the connection) |
03:11:44 | * | fjvallarino joined #nim |
03:12:56 | * | ieatnerds quit (Ping timeout: 256 seconds) |
03:16:33 | FromDiscord | <awr> is there a list of programming languages that have been implemented in nim anywhere? (besides nim itself) i recall one or two a while back but I don't remember what they were called |
03:16:33 | * | fjvallarino quit (Ping timeout: 264 seconds) |
03:17:23 | FromGitter | <Quelklef> min is one |
03:17:46 | FromGitter | <Quelklef> https://min-lang.org/ |
03:17:49 | FromGitter | <Quelklef> nim is one |
03:17:54 | FromGitter | <Quelklef> https://nim-lang.org/ |
03:17:57 | FromGitter | <Quelklef> There's two! |
03:18:08 | FromGitter | <Quelklef> oh you said besides nim, darn |
03:21:56 | FromGitter | <honewatson> https://github.com/gokr/spry |
03:24:00 | FromGitter | <kayabaNerve> I'm rewriting all my Nim code in min |
03:24:38 | FromGitter | <kayabaNerve> I actually want to make a new programming language |
03:25:27 | FromGitter | <Quelklef> @kayabaNerve what's it gonna offer? |
03:44:51 | FromGitter | <kayabaNerve> @Quelklef It won't |
03:44:55 | FromGitter | <kayabaNerve> I want to; not am |
03:45:07 | FromGitter | <kayabaNerve> And you know NodeJS? |
03:52:04 | * | fjvallarino joined #nim |
03:55:41 | skrylar | spry was written in nim |
03:55:46 | skrylar | i have partial rebol stuff in nim as well |
03:59:15 | * | endragor quit (Remote host closed the connection) |
04:02:28 | * | endragor joined #nim |
04:02:28 | * | endragor quit (Remote host closed the connection) |
04:03:11 | * | endragor joined #nim |
04:03:16 | FromGitter | <reisub0> Hi. Are there any modules for formatting tabular output in a consistent way like tabulate (https://bitbucket.org/astanin/python-tabulate) for Python? |
04:04:11 | * | endragor quit (Remote host closed the connection) |
04:05:30 | FromGitter | <reisub0> Or I presume it'll have to be done with manually defining a custom format specifier in strformat? |
04:11:23 | FromGitter | <gogolxdong> @shalick when you say koch boot for windows is koch.exe boot? |
04:11:41 | FromGitter | <gogolxdong> @shashlick |
04:12:40 | FromGitter | <gogolxdong> didn't find koch.exe , copied from windows release package IIRC. |
04:18:23 | * | endragor joined #nim |
04:23:28 | * | lompik joined #nim |
04:24:26 | * | endragor quit (Remote host closed the connection) |
04:28:14 | FromGitter | <gogolxdong> git clone , cd csource , ./build64.bat , copy koch.exe from windows release , ./koch.exe boot -d:release ,./koch.exe tools |
04:33:10 | * | endragor joined #nim |
04:37:22 | * | erratic joined #nim |
04:37:35 | * | user1101 quit (Ping timeout: 260 seconds) |
04:40:11 | * | user1101 joined #nim |
05:09:02 | * | Vladar joined #nim |
05:09:09 | * | ieatnerds joined #nim |
05:13:08 | * | endragor quit (Remote host closed the connection) |
05:13:38 | * | ieatnerds quit (Ping timeout: 256 seconds) |
05:30:27 | * | nsf joined #nim |
05:32:03 | * | leorize joined #nim |
05:32:47 | * | user1101 quit (Quit: user1101) |
05:34:11 | FromGitter | <Varriount> @reisub0 Unfortunately I don't know of any such modules. |
05:35:25 | FromGitter | <Varriount> @reisub0 Nim does have general string formatting facilities, however the format options don't generally have enough context to do things like align multiple rows of data correctly. |
05:37:05 | * | leorize quit (Quit: Quit) |
05:38:10 | FromGitter | <seruum> is there a "when" test to determine what type of cpu is being used? |
05:38:59 | FromGitter | <reisub0> @Varriount It's fine I made a very hacky thing using osproc to call column :) |
05:39:38 | FromGitter | <Varriount> seruum: I believe so. Let me see. |
05:40:16 | FromGitter | <Varriount> @seruum What are you working on? I can't remember the last time I needed to branch based on processor. |
05:40:48 | FromGitter | <Varriount> @seruum https://github.com/nim-lang/Nim/wiki/Consts-defined-by-the-compiler |
05:43:11 | FromGitter | <seruum> I'm cross compiling to RaspberryPi. I thought it would be easier to set different variables based on which CPU is being compiled against. Would there be an easier, more prominent way to do it? I've been using Nim for about 9 months in hobby mode and hadn't run into this yet... |
05:45:38 | FromGitter | <seruum> @Varriount Looks like maybe "when defined(arm)" |
05:45:49 | FromGitter | <Varriount> @seruum Yep, that's the way to do it. |
05:46:29 | * | miran_ joined #nim |
05:51:58 | FromGitter | <seruum> @Varriount Just for completeness. It works as expected. Thanks |
06:13:42 | * | endragor joined #nim |
06:18:57 | * | endragor quit (Ping timeout: 264 seconds) |
06:30:57 | * | miran_ quit (Ping timeout: 264 seconds) |
06:34:47 | FromGitter | <Varriount> @seruum Are you trying to run on bare-metal, or running on an OS? |
06:35:35 | FromGitter | <seruum> @Varriount I'm running on OS. |
06:52:23 | FromGitter | <alehander42> @Araq how much do you think nim incremental compilation will speed up compilation? e.g. of a bigger project, like aporia or the compiler |
06:53:11 | FromGitter | <alehander42> I imagine for some small changes it can make it ~ instant |
06:57:21 | * | skrylar quit (Remote host closed the connection) |
07:02:44 | FromGitter | <Araq> firstly, not much, factor of 2 maybe. then if we have backend caching, further speedups, then if we have smart dependency tracking, further. and then we might change the AST to a packed representation internally and get unprecedented performance... |
07:03:58 | * | amosbird joined #nim |
07:04:09 | amosbird | hi, what is the best place to use nim ? |
07:04:58 | FromGitter | <Varriount> amosbird: Nim is well suited as a general purpose programming language. |
07:05:24 | amosbird | um, any flagship softwares ? |
07:06:29 | FromGitter | <Varriount> I personally think that (currently, based on the modules and libraries available) it's best suited for general command-line tools, math/cpu-intensive programs, and games. It also does well as a web app language. |
07:06:36 | FromGitter | <Varriount> amosbird: ^ |
07:07:42 | FromGitter | <Varriount> It's a little lower-level than C# with regards to language concepts. |
07:09:55 | * | ieatnerds joined #nim |
07:11:05 | * | ashleyk_ joined #nim |
07:14:14 | amosbird | hmm, I'm still seeking for a specific nim project |
07:14:15 | * | ashleyk quit (Ping timeout: 250 seconds) |
07:14:30 | * | ieatnerds quit (Ping timeout: 260 seconds) |
07:21:43 | FromGitter | <narimiran> amosbird: there are couple of us using it for math/science stuff |
07:23:18 | * | PMunch joined #nim |
07:25:10 | FromGitter | <mratsim> I’m sure @kaushalmodi would love https://min-lang.org/ |
07:26:32 | FromGitter | <mratsim> @amosbird, For Nim in a corporate settings, I suppose this is as advanced as you can get: https://github.com/status-im/nimbus |
07:27:27 | FromGitter | <mratsim> Using Nim for state of the art blockchain implementation (and avoid Go scalability issues, C++ productivity issues and Python production/speed issues) |
07:28:30 | FromGitter | <mratsim> For already in production stuff you can check out Reel Valley on iOS, Android and Facebook: https://play.google.com/store/apps/details?id=com.onsetgame.reelvalley&hl=en_US |
07:35:56 | * | dddddd joined #nim |
07:39:07 | FromGitter | <Varriount> @mratsim Go has scalability issues? I thought that was it's entire spiel, being scalable? |
07:40:02 | FromGitter | <mratsim> Ethereum go implementation is held back by their slow bigint (uint256) that are used everywhere |
07:41:09 | FromGitter | <mratsim> every single transaction in Ethereum would allocate several uint256, and go curently uses a memory pool to deal with that, aka it’s not pretty |
07:41:36 | FromGitter | <Varriount> Why can't Go use... whatever is used by C++/Nim? |
07:42:21 | FromGitter | <mratsim> The most efficient libraries in C++ and Nim uses generics ;) |
07:42:37 | FromGitter | <mratsim> generics/static/template compile-time parameter |
07:44:43 | FromGitter | <mratsim> The way for go would be to use hardcoded types like rust does - https://docs.rs/bigint/4.2.0/bigint/uint/struct.U256.html |
07:47:21 | FromGitter | <mratsim> that’s super redundant though. (Ethereum needs Uint256 a lot and in very rare case Uint12, Uint512 and Uint2048 but only 1 or 2 operations for those. |
07:47:30 | FromGitter | <mratsim> uint128* |
07:49:09 | * | leorize joined #nim |
07:49:28 | * | leorize quit (Client Quit) |
07:54:07 | FromGitter | <Grabli66> Hi! How to take difference between two DateTime? |
07:56:08 | FromGitter | <mratsim> https://nim-lang.org/docs/times.html#-,Time,Time |
07:56:22 | FromGitter | <mratsim> note that the time module was significantly reworked in devel |
07:56:38 | FromGitter | <mratsim> (in an probably incompatible way) |
07:56:40 | FromGitter | <mratsim> a* |
08:00:43 | FromGitter | <gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b3c7eab81816669a42ef3ab] |
08:05:41 | FromGitter | <Grabli66> It works only in devel nim? I don't see proc `-` for two DateTime in nim 0.18. |
08:08:33 | FromGitter | <Grabli66> Ohhh. I need to install nim from devel branch :) |
08:28:54 | FromGitter | <narimiran> @Grabli66 using `choosenim` simplifies this process greatly, and you can easily switch back and forth from stable to devel |
08:29:27 | FromGitter | <Grabli66> @narimiran Yes. I already updated nim with choosenim. |
08:30:34 | FromGitter | <Grabli66> But i have a strange fillings :) Why i can't divide two int64 with / operator? |
08:32:16 | FromGitter | <Grabli66> Ooops. There is `div` operator. |
08:32:53 | * | pwntus quit (Ping timeout: 265 seconds) |
08:32:55 | FromGitter | <Grabli66> Sorry i am almost noob in nim. |
08:41:54 | * | user1101 joined #nim |
08:44:41 | FromGitter | <narimiran> @Grabli66 don't worry, we all were nim-noobs, not so long ago ;) |
08:45:00 | * | user1101 quit (Read error: Connection reset by peer) |
08:45:14 | * | user1101 joined #nim |
08:53:04 | * | user1101 quit (Read error: Connection reset by peer) |
08:53:22 | * | user1101 joined #nim |
08:58:14 | FromGitter | <Grabli66> Is there a documentation for current nim from devel branch? |
08:58:17 | * | user1101 quit (Read error: Connection reset by peer) |
08:58:31 | * | user1101 joined #nim |
08:58:41 | PMunch | Grabli66, Changelog.md |
09:02:32 | * | rosshadden quit (Read error: Connection reset by peer) |
09:02:52 | * | noonien joined #nim |
09:03:23 | * | rosshadden joined #nim |
09:04:27 | * | user1101 quit (Ping timeout: 268 seconds) |
09:05:01 | dom96 | Bah, I need to stop reading GitHub notifications |
09:05:13 | dom96 | Yesterday that's all I did |
09:06:21 | FromGitter | <Vindaar> @Grabli66 besides the changelog, you can just build the documentation from your local source by using `./koch doc` |
09:06:30 | * | user1101 joined #nim |
09:06:48 | FromGitter | <Grabli66> Cool |
09:10:15 | PMunch | Hmm, dynamic loading is tricky.. |
09:10:36 | * | ieatnerds joined #nim |
09:10:44 | PMunch | How does the GC work across dll boundries by the way? If I write both the program and plugin in Nim |
09:11:04 | PMunch | Will the separate codes have their own GC? |
09:11:16 | Araq | no, the GC is in nimrtl.dll and shared |
09:11:29 | Araq | and it's covered by tests |
09:11:37 | PMunch | Ah okay |
09:15:05 | * | endragor joined #nim |
09:15:13 | * | ieatnerds quit (Ping timeout: 248 seconds) |
09:20:01 | * | endragor quit (Ping timeout: 256 seconds) |
09:20:09 | PMunch | Hmm, this is really strange.. I can't call XStringToKeysym in my DLL, it just crashes with read from nil error.. |
09:20:36 | PMunch | Or rather: SIGSEGV: Illegal storage access. (Attempt to read from nil?) |
09:28:00 | FromGitter | <mratsim> @dom96 just go into the github.com, they have a new summary page that works not bad |
09:29:18 | * | user1101 quit (Read error: Connection reset by peer) |
09:29:55 | * | user1101 joined #nim |
09:43:17 | PMunch | I wonder if this issue is because xlib is loaded as a dynlib as well. So my main program loads the plugin, which in turn needs to load the xlib plugin |
09:47:00 | FromGitter | <mratsim> is there a way to update a package installed by nimble? |
09:47:25 | FromGitter | <mratsim> currently I have to uninstall all packages that depends on it and then reinstall everything which is super painful |
09:49:33 | dom96 | nimble install pkg@#head |
09:50:03 | dom96 | or omit the @#head if you just want the latest tagged release |
09:51:20 | dom96 | Ughhhh, travis, whyyyy |
09:51:22 | * | user1101_ joined #nim |
09:51:27 | dom96 | Why won't it start my damn build? :( |
09:51:52 | * | user1101 quit (Read error: Connection reset by peer) |
09:51:52 | * | user1101_ is now known as user1101 |
09:52:44 | PMunch | Ah, that was it. Compiling the DLL with use_pkg_config_static worked |
09:54:19 | Araq | dom96, queued? |
09:54:29 | Araq | use nimbuild instead :-) |
09:56:35 | FromGitter | <mratsim> @dom96 but then you get a lot of versions of the same package in the .nimble folder (head, master and 0.1.0 for example) |
09:58:55 | dom96 | why is that a problem? |
10:06:05 | * | krux02 joined #nim |
10:13:10 | FromGitter | <kaushalmodi> amosbird: Are you the one who I think you are (pinged me on ox-hugo repo a while back)? :) Welcome. |
10:13:15 | dom96 | Seriously. It's just not running my commit. https://github.com/nim-lang/packages/pull/782 |
10:17:53 | FromGitter | <Grabli66> Can i turn on "not nil" for all types in my program? |
10:20:54 | amosbird | kaushalmodi: yeah, nice to see you again :) |
10:22:46 | FromGitter | <kaushalmodi> @mratsim (About min lang) Nah, I glanced at it a while back, but it seems too minimal for my taste. It has some learning curve for folks like me who haven't done "stack programming?" before. I love RPN in math (`calc-mode` in Emacs!), but cannot visualize that for coding. It looks like Lisp in the beginning, but after scanning few snippets, it sure didn't feel like one based on my experience with Emacs Lisp. |
10:23:35 | FromGitter | <mratsim> @dom96 it’s a problem because I want to be sure of the one I’m working on when I do “nimble test" |
10:25:03 | dom96 | mratsim: specify it in your Nimble file: requires "pkg#head" |
10:25:46 | dom96 | We will get lock files eventually to properly fix this issue |
10:27:15 | FromGitter | <mratsim> This main issue is that there is no simple way to do `nimble update package` |
10:31:39 | FromGitter | <kaushalmodi> amosbird: Regarding your question about use of Nim, I can see it being used to write CLI apps. I am learning it so that I can replace Bash and Python scripts with Nim. I'm also interested in its FFI feature, so that the .so objects created by compiling Nim can be used with other languages that interface with C. |
10:32:20 | amosbird | kaushalmodi: great. I'm also seeking a language to replace all my scripts |
10:32:41 | FromGitter | <kaushalmodi> Here's a little toy project/script: https://github.com/kaushalmodi/noxhugo |
10:32:45 | FromGitter | <kaushalmodi> :) |
10:41:30 | FromGitter | <kaushalmodi> amosbird: You can check out my notes on Nim here: Org mode (https://gitlab.com/kaushalmodi/kaushalmodi.gitlab.io/raw/master/content-org/notes/nim.org) | HTML (https://scripter.co/notes/nim/). |
10:41:40 | amosbird | cool! |
10:51:24 | dom96 | mratsim: please make issues for these things |
10:51:53 | dom96 | but look through the existing issues, there is likely already an issue for this |
10:52:09 | dom96 | Feel free to bump it with "I need this **now**" :) |
10:53:41 | FromGitter | <kaushalmodi> dom96: Yes, I had requested an update switch for nimble too, a little while back. |
10:54:25 | dom96 | https://github.com/nim-lang/nimble/issues/169 |
10:55:24 | * | elrood joined #nim |
10:56:36 | FromGitter | <mratsim> I need it yesterday ;) |
10:58:02 | * | leru joined #nim |
11:10:23 | * | nasusiro joined #nim |
11:11:23 | * | ieatnerds joined #nim |
11:15:27 | * | ieatnerds quit (Ping timeout: 240 seconds) |
11:18:57 | * | yglukhov[i] joined #nim |
11:25:18 | FromGitter | <Grabli66> It eats 25% of CPU. Why? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b3cae9d9b82c6701ba17f5d] |
11:26:01 | dom96 | because you've got an infinite loop that's printing a hell of a lot of "GOOD" |
11:26:40 | dom96 | although hrm, you've got that sleep in there |
11:26:46 | FromGitter | <Grabli66> What's why i added sleepAsync(1000) to sleep for a 1 second on each iteration |
11:27:03 | dom96 | oh, I know why. Because you've got no sockets operations |
11:27:23 | dom96 | so the async event loop just busy loops until the sleep timer finishes |
11:27:49 | FromGitter | <Grabli66> Great. How i can fix that? |
11:28:01 | dom96 | perform some socket operations |
11:28:18 | dom96 | you're creating a really small example, you'd never do that in a real application |
11:28:47 | FromGitter | <Grabli66> And if i have no socket operation? |
11:28:49 | dom96 | if you don't need async sockets then stop using {.async.} and use os.sleep() |
11:28:58 | FromGitter | <Grabli66> Ok |
11:29:42 | FromGitter | <Grabli66> It works :) |
11:43:48 | FromGitter | <mratsim> on a side note, I really hate games that use 100% of the CPU in the welcome screen, I’m pretty sure that’s sloppy coding with a while true loop. |
11:44:14 | Yardanico | I didn't encounter any game like that in like 2-3 years |
11:46:24 | * | endragor joined #nim |
11:46:41 | FromGitter | <mratsim> SolForge and Eternal Card Game are like that |
11:48:40 | FromGitter | <Grabli66> How i can take total milliseconds(seconds and other) from Duration? There is proc milliseconds, but it returns not total data. |
11:50:57 | * | endragor quit (Ping timeout: 240 seconds) |
11:53:57 | * | user1101 quit (Quit: user1101) |
11:55:00 | * | leru quit (Quit: Leaving) |
11:59:03 | FromGitter | <Quelklef> @kayabaNerve What's it (theoretically) gonna offer? |
11:59:16 | FromGitter | <Quelklef> and no I don't know Node, not really. I know of it |
12:00:07 | FromGitter | <tim-st> How can I get the async example working? https://nim-lang.org/docs/httpclient.html#retrieving-a-website |
12:00:43 | FromGitter | <tim-st> (with required imports etc) |
12:04:57 | * | nc-x joined #nim |
12:05:04 | nc-x | @tim-st |
12:05:13 | nc-x | import httpclient |
12:05:34 | nc-x | proc abc() {.async.} = |
12:05:38 | nc-x | # put code here |
12:06:19 | nc-x | I think |
12:07:54 | Yardanico | also import asyncdispatch |
12:14:14 | * | find0x90 joined #nim |
12:17:38 | * | nc-x quit (Quit: Page closed) |
12:21:58 | * | find0x90 quit (Quit: find0x90) |
12:28:41 | * | mjanssen left #nim (#nim) |
12:29:34 | FromGitter | <tim-st> thanks, seems to work, can I add async results in a loop to a list without problems? |
12:29:40 | FromGitter | <tim-st> besides sort order |
12:30:39 | Yardanico | well, async is still single-threaded |
12:40:47 | * | yglukhov_ joined #nim |
12:43:59 | * | yglukhov[i] quit (Ping timeout: 268 seconds) |
12:44:57 | * | Vladar quit (Quit: Leaving) |
12:56:53 | * | dddddd quit (Ping timeout: 276 seconds) |
12:57:49 | * | dddddd joined #nim |
12:57:52 | * | find0x90 joined #nim |
12:59:13 | * | find0x90 quit (Client Quit) |
13:01:44 | * | Vladar joined #nim |
13:06:51 | FromGitter | <narimiran> @dom96 see what python's core team thinks about the `:=` introduction: https://www.mail-archive.com/[email protected]/msg05324.html |
13:10:39 | * | dddddd quit (Ping timeout: 256 seconds) |
13:11:37 | * | dddddd joined #nim |
13:11:52 | * | libracious joined #nim |
13:12:05 | * | ieatnerds joined #nim |
13:12:42 | FromGitter | <Quelklef> ```code paste, see link``` ⏎ ⏎ Ooh, that's smooth [https://gitter.im/nim-lang/Nim?at=5b3cc7ca3c5abf52b63b4464] |
13:13:21 | FromGitter | <Yardanico> you can do the same with Nim |
13:13:30 | FromGitter | <Yardanico> even simpler :D |
13:13:38 | FromGitter | <Quelklef> Nim has assignment expressions? |
13:14:09 | FromGitter | <Quelklef> `stuff = [[y := f(x), x/y] for x in range(5)]` is also really nice... It seems a little unpythonic, but damn do I want it |
13:16:08 | dom96 | narimiran: why is it accepted then? |
13:19:56 | FromGitter | <narimiran> @dom96 i have no idea. (notice the date (two months ago), maybe things/opinions have changed recently?) |
13:19:57 | * | ieatnerds quit (Ping timeout: 240 seconds) |
13:23:44 | FromGitter | <mratsim> @Quelklef you can probably use a template for that I don’t think you can use `:=` though ⏎ ⏎ ```template `===`(x, y: untyped): untyped {.dirty.}= ⏎ let x = y ⏎ x``` ⏎ ⏎ (untested) [https://gitter.im/nim-lang/Nim?at=5b3cca607b811a6d63cef168] |
13:23:45 | * | krux02 quit (Ping timeout: 260 seconds) |
13:28:38 | FromGitter | <Quelklef> I think it'd work with ⏎ ⏎ ```template `===`(x, y: untyped): untyped = ⏎ block: ⏎ x = y ⏎ x``` ⏎ ⏎ for assignment; I doubt declaration is possible this way [https://gitter.im/nim-lang/Nim?at=5b3ccb86a99e1e52b715710d] |
13:29:22 | FromGitter | <Quelklef> without a macro, anyway |
13:30:11 | FromGitter | <Araq> := works just fine |
13:31:17 | FromGitter | <narimiran> @Araq yeah, it works, but it is one of the stupidest additions to python, IM(NSH)O |
13:31:27 | FromGitter | <Quelklef> Not so... humble? |
13:31:32 | FromGitter | <narimiran> yup |
13:31:36 | FromGitter | <Araq> no, it works in Nim. |
13:31:53 | Yardanico | @Araq you mean `:=` as operator name? |
13:31:57 | FromGitter | <Araq> template `:=`(a, b: untyped): untyped = ⏎ let a = b ⏎ a |
13:33:05 | FromGitter | <Quelklef> ....... huh |
13:33:10 | * | Vladar quit (Remote host closed the connection) |
13:33:40 | FromGitter | <Yardanico> @Araq well it won't work in cases like this one (in Python): ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b3cccb37b811a6d63cef7ec] |
13:33:44 | FromGitter | <Quelklef> ... it's becoming a `nnkStmtList` without being wrapped by a `nnkBlock` ..? |
13:33:47 | FromGitter | <narimiran> `:=` in python will raise so many questions and introduce, otherwise avoidable, bugs |
13:34:06 | FromGitter | <Yardanico> but yeah, it doesn't have any real advantages (only slightly less lines of code) |
13:34:07 | * | fjvallarino quit (Remote host closed the connection) |
13:34:17 | * | fjvallarino joined #nim |
13:34:32 | FromGitter | <Quelklef> @Yardanico Not true, the PEP outlines some efficiency advantages due to encouraging certain coding styles |
13:34:59 | FromGitter | <mratsim> `:=` will introduce less bugs than C reuse of `=` |
13:35:23 | FromGitter | <Quelklef> a la ```python ⏎ if m := re.match(regex, text): ⏎ ⏎ ```groups = re.match(regex, text).groups()``` [https://gitter.im/nim-lang/Nim?at=5b3ccd1bf16644066118fce2] |
13:36:08 | * | krux02 joined #nim |
13:36:25 | FromGitter | <Quelklef> I think I'm leaning towards liking the `->` syntax better because then the actual value gets read first |
13:36:27 | FromGitter | <Quelklef> compare the above to |
13:36:42 | FromGitter | <Quelklef> ```if re.match(regex, text) -> m: ⏎ groups = m.groups()``` [https://gitter.im/nim-lang/Nim?at=5b3ccd699b82c6701ba1d351] |
13:36:44 | FromGitter | <Araq> if (let x = re.match(); x.didMatch): |
13:37:29 | FromGitter | <Quelklef> @Araq I mean sure, in NIm |
13:37:48 | FromGitter | <mratsim> in Rust as well |
13:38:18 | FromGitter | <Quelklef> ya but what Nim/Rust can('t) do seems irrelevant to a Python change |
13:38:25 | FromGitter | <Araq> := is totally wrong for efficiency. for efficiency you need to weak the stmt/expr split |
13:38:40 | FromGitter | <Araq> not introduce more special cases for exprs. |
13:39:11 | FromGitter | <Araq> but thb I don't expect any kind of decent analysis in Python-land. |
13:39:37 | FromGitter | <mratsim> if people care about efficiency they wouldn’t use Python. |
13:39:38 | FromGitter | <Quelklef> ouch |
13:39:53 | FromGitter | <narimiran> @Quelklef your example with `->` could be implemented with the current `as` |
13:39:56 | FromGitter | <Quelklef> oops ouch @ araq not mratsim |
13:40:03 | FromGitter | <Araq> they still think you cannot have multiline lambdas in an indentation based language, after all... |
13:40:36 | FromGitter | <narimiran> like you have `with open('myfile') as f:`, you could analogously have `re.match(regex, text) as m` |
13:40:36 | FromGitter | <Quelklef> IIRC, Guido has stated that he knows multiline lambdas are possible but feels it's Unpythonic |
13:41:25 | FromGitter | <Quelklef> @narimiran `with re.match(regex, test) as m:`? |
13:42:15 | FromGitter | <mratsim> `:=` is unpythonic as it gets ;) |
13:43:13 | FromGitter | <narimiran> ```if re.match(regex, text) as m: ⏎ groups = m.groups()``` [https://gitter.im/nim-lang/Nim?at=5b3ccef1e534eb69a5c77c8e] |
13:43:14 | FromGitter | <Quelklef> @narimiran `with re.match("a", "a") as m: print(m.groups())` just doesn't work and `if re.match("a", "a") as m: print(m.groups())` is a SyntaxError, so I'm not sure what you're talking about |
13:43:33 | FromGitter | <Quelklef> syntax error on 3.6.3 |
13:43:38 | FromGitter | <narimiran> of course it is syntax error, just as using `:=`should be :D |
13:43:50 | FromGitter | <Quelklef> Wait, are you talking hypothetically |
13:43:59 | FromGitter | <narimiran> i'm just saying that would be more readable than the `:=` |
13:44:07 | FromGitter | <Quelklef> Oh. Yeah, I totally agree |
13:46:24 | FromGitter | <Araq> yup |
13:46:32 | FromGitter | <mratsim> what is that lol: https://github.com/nim-lang/nits |
13:48:13 | * | endragor joined #nim |
13:48:52 | * | ieatnerds joined #nim |
13:52:27 | * | endragor quit (Ping timeout: 240 seconds) |
13:58:14 | * | user1101 joined #nim |
13:59:03 | Abnegation | I'll try to learn nim for a third time. |
14:00:57 | FromGitter | <Quelklef> Abnegation: Do it! Nim is fantastic! Good luck! |
14:01:04 | FromGitter | <Quelklef> we're here if you need us! |
14:03:04 | * | ieatnerds quit (Quit: Lost terminal) |
14:04:35 | Abnegation | I believe you, I'm incredibly seduced by it, but last time I found too many concepts to be overwhelming. And I'm kinda a "low" level programmer, old dog that has problems learning new tricks. |
14:05:01 | FromGitter | <Quelklef> Yeah I also found it overwhelming at first |
14:05:09 | Abnegation | main issue last time was that I wanted to delete python from my environment, but now I have added that I'm working with python too too much, which makes me really really really want to take it out of my workflows. |
14:05:58 | FromGitter | <Quelklef> ah if you were trying to replace an existing project from the get-go i can see the difficulty |
14:06:00 | Abnegation | by low I mean, I'm the kind of person that has to check over assembler its compilation code. |
14:06:06 | Abnegation | :P |
14:06:13 | FromGitter | <Quelklef> oh my |
14:06:19 | * | leorize joined #nim |
14:07:30 | Abnegation | I'm particularly interested in arraymancer |
14:07:50 | * | PMunch quit (Quit: Leaving) |
14:08:36 | FromGitter | <Quelklef> oh I hadn't seen that yet |
14:08:58 | FromGitter | <narimiran> Abnegation: @mratsim is very helpful!! don't hesitate to ask him if/when you don't understand something arraymancer-related |
14:09:06 | FromGitter | <Quelklef> haha this is bringing me back to when I tried to learn J |
14:09:56 | FromGitter | <narimiran> btw, i've learnt nim by trying to replace things i've done in python |
14:10:14 | Yardanico | I did that too |
14:10:22 | FromGitter | <Vindaar> same here :) |
14:10:24 | FromGitter | <Quelklef> i found nim looking for a "typed python" |
14:10:28 | Yardanico | reimplemented a bot for social network in Nim |
14:10:44 | Yardanico | (i learned a lot from it, even macros and temlates) |
14:10:47 | Yardanico | *templates |
14:11:02 | FromGitter | <Quelklef> really? |
14:11:06 | Yardanico | yes |
14:11:12 | FromGitter | <Quelklef> Huh. That's kinda surprising. Cool tho |
14:11:23 | Yardanico | of course that's a bit too high-level, but still |
14:11:41 | Yardanico | (I mean a bot for social network is a bit too high-level) |
14:12:44 | FromGitter | <Quelklef> man the Nim AST continues to surprise me |
14:13:14 | FromGitter | <Quelklef> `import a as b` is `importStmt(infix(ident("as"), ident("a"), ident("b")))` |
14:13:48 | FromGitter | <Quelklef> that is, it's represented as an "infix", which is the same thing as an infix call `@[1] & @[2]` |
14:14:28 | FromGitter | <Quelklef> is this kind of thing typical? I'd have expected it be something like `importStmt(module_name, module_alias)` |
14:14:47 | FromGitter | <Quelklef> I think I've asked about this before but it still confounds me a little |
14:16:36 | * | yglukhov_ quit (Read error: Connection reset by peer) |
14:17:08 | * | yglukhov[i] joined #nim |
14:18:48 | Abnegation | one of my problems is that I program a lot in C, not even modern C++, I usually am a little bit uncomfortable handling too many abstractions and sintax sugar. Ultimately I prefer to have total control over how the abstractions behave. |
14:19:27 | FromGitter | <Quelklef> What do you mean total control, exactly? |
14:19:38 | FromGitter | <Quelklef> i.e. you know 100% what's happening at every step? |
14:22:15 | Abnegation | hmno, not to that extent, "total control" is an hyperbole, after all I'm not writing machine code by hand, but when I read auto in c++ I shriek. |
14:22:33 | Abnegation | something that happened with python this week |
14:22:50 | Abnegation | I'm implementing a CNN in tensorflow |
14:23:08 | * | geocar quit (Quit: Connection closed for inactivity) |
14:23:36 | Abnegation | at some point I had to do an operation over 20k numbers, I knew what operation was specifically. |
14:23:39 | Abnegation | I know which data I had |
14:23:46 | Abnegation | but there were so many layers of abstraction that it simply was not possible to do it in a performant manner. |
14:24:42 | Abnegation | me -> python -> tensorflow -> eigen -> cuda -> [my data] |
14:24:42 | Abnegation | it got to a point where something really easy became extremely cumbersome, I didn't even knew what to do. |
14:25:49 | FromGitter | <Quelklef> ah gee |
14:26:25 | FromGitter | <Quelklef> do these things not expose any way for you to handle data directly?? |
14:27:52 | Abnegation | to some extent, at worst you can recompile tensorflow adding your function, or if you're in linux (I'm not) you can compile an extension. Both things are less trivial than one would want them to be. |
14:28:20 | Abnegation | Anyway, I'll try nim again. I hope this time I can break through. |
14:30:00 | FromGitter | <Quelklef> yeah |
14:30:20 | FromGitter | <Quelklef> that doesn't really sound like something that can be totally solved with language design tho |
14:30:24 | FromGitter | <Quelklef> so hopefully arraymancer is nicer =) |
14:30:48 | * | SenasOzys joined #nim |
14:31:14 | FromGitter | <mratsim> well tensorflow is an ergonomic mess |
14:31:40 | * | SenasOzys quit (Remote host closed the connection) |
14:32:01 | * | SenasOzys joined #nim |
14:32:07 | * | mitai joined #nim |
14:34:55 | FromGitter | <mratsim> On arraymancer, iterating over a Tensor with an arbitrary operation is straightforward with apply_inline/map_inine https://github.com/mratsim/Arraymancer/blob/master/src/tensor/higher_order_applymap.nim#L24 |
14:34:56 | Abnegation | it can to some extent, a more flexible language that has no-nonsense features, will make the environment less poluted with abstractions that don't do useful stuff, which will in turn be an incentive for useful libraries to not rely so much on nonsense either. |
14:35:44 | Abnegation | oh wait, I'm talking with the developer :U |
14:35:51 | FromGitter | <mratsim> for Cuda I have C++ kernels and I pass a C++ functor to it: https://github.com/mratsim/Arraymancer/blob/master/src/tensor/private/incl_higher_order_cuda.nim#L33 |
14:36:04 | FromGitter | <Quelklef> yeah, I've found that my Nim code magically tends to be less confusing than that in other languages |
14:36:10 | FromGitter | <mratsim> https://github.com/mratsim/Arraymancer/blob/master/src/tensor/private/incl_kernels_cuda.nim#L55 |
14:36:12 | FromGitter | <Quelklef> but still can't 100% it |
14:36:51 | * | leorize quit (Ping timeout: 240 seconds) |
14:37:03 | FromGitter | <mratsim> I can’t wait to be able to use loop fusion in Arraymancer though: https://github.com/numforge/loop-fusion |
14:37:57 | Abnegation | what is this? |
14:38:56 | FromGitter | <mratsim> for loop on a variadic number of containers |
14:39:22 | FromGitter | <mratsim> it avoids lots of temporaries if you want to do a + b * c * sin(d) for example |
14:40:01 | FromGitter | <mratsim> obviously parallelized via OpenMP ;) |
14:41:08 | FromGitter | <mratsim> If you want a total control example in Nim, you can see my fallback Blas implementation where I need to allocate on the heap but I don’t want to deal with the GC: https://github.com/mratsim/Arraymancer/blob/master/src/tensor/fallback/blas_l3_gemm_data_structure.nim and I need to control alignment carefully - https://github.com/mratsim/Arraymancer/blob/master/src/tensor/backend/memory_optimization_hints.nim#L33 |
14:45:37 | Abnegation | I'll probably need to fully understand nim sintax before understanding this in full. |
14:46:02 | FromGitter | <mratsim> I tend to create new syntax while coding in Nim :P |
14:46:15 | Yardanico | actually nim has pretty simple syntax (I would say) |
14:46:27 | Yardanico | even some things like "%" are called "mod" in nim for readability |
14:47:40 | FromGitter | <mratsim> I think Nim is probably easer coming from C than from Python. |
14:50:21 | * | yglukhov[i] quit (Ping timeout: 240 seconds) |
14:57:06 | * | yglukhov[i] joined #nim |
14:58:25 | * | miran_ joined #nim |
15:02:10 | FromGitter | <krux02> I think so, too. But yet it is confusing when you never wrote any python. |
15:04:29 | * | leorize joined #nim |
15:11:43 | * | donzx joined #nim |
15:14:18 | * | donlzx quit (Ping timeout: 256 seconds) |
15:30:58 | * | leorize quit (Read error: Connection reset by peer) |
15:31:58 | * | leorize joined #nim |
15:46:13 | * | thomasross quit (Remote host closed the connection) |
15:46:36 | * | thomasross joined #nim |
15:49:45 | * | endragor joined #nim |
15:52:01 | * | fjvallarino quit (Remote host closed the connection) |
15:54:32 | * | endragor quit (Ping timeout: 268 seconds) |
16:05:59 | * | Trustable joined #nim |
16:07:15 | * | SenasOzys quit (Ping timeout: 256 seconds) |
16:10:01 | CodeVance | Quelklef its common and I think its better for it. if it wasn't considered an infix statement it would be a call/command statement. I think the reasoning behind this design is that you can take the inner part of the import ast and put it just about anywhere else and it would work there (given that the "as" infix was defined |
16:11:13 | CodeVance | mratsim, i like := I think its pythonic. |
16:11:30 | FromGitter | <Quelklef> @CodeVance: "If it wasn't considered an infix statement it would be a call/command statement" or it could be a part of the `importStmt` or something. |
16:11:57 | FromGitter | <Quelklef> @CodeVance: "I think the reasoning ... defined" but that seems strange, doesn't it? It's not conceptually an infix operator or a function call, it's a part of an import. |
16:12:39 | FromGitter | <Quelklef> I see the point you're making, but I can't really accept it. Do you have a good example where this kind of thing comes into play? |
16:12:53 | CodeVance | it is an infix inside a import |
16:13:14 | CodeVance | the import logic only has to check if its an infix or a ident |
16:13:42 | CodeVance | identdefs are used for type decleration, parameters, var statements |
16:13:51 | CodeVance | identdefs name: type = value |
16:13:56 | FromGitter | <Quelklef> nono i get that |
16:14:04 | FromGitter | <Quelklef> ok, better question |
16:14:21 | FromGitter | <Quelklef> why NOT instead have the `as` aliasing be a part of `importStmt` |
16:14:29 | FromGitter | <Quelklef> I suppose it would make parsing more complicated |
16:14:49 | CodeVance | if it wasn't an infix it would be a command statement |
16:14:57 | FromGitter | <Quelklef> ?? |
16:15:05 | FromGitter | <Quelklef> I don't think we're communicating well, lol |
16:15:20 | CodeVance | if you want to reverse the import to render it then you need to know in what format it was given |
16:15:48 | CodeVance | importStmt(infix(as, bla, bla)) == import bla as bla |
16:15:55 | CodeVance | bla from bla |
16:16:00 | CodeVance | bla expect bla |
16:16:17 | FromGitter | <Quelklef> ok |
16:16:21 | FromGitter | <Quelklef> compared to |
16:16:32 | CodeVance | the from infix won't work though |
16:16:33 | FromGitter | <Quelklef> let's use the use-case `import macros as m` |
16:16:52 | FromGitter | <Quelklef> ill call my hypothetical node `importStmt2` |
16:16:58 | CodeVance | importstmtas(module,folder) |
16:17:04 | FromGitter | <Quelklef> ? |
16:17:22 | CodeVance | importstmtalias(macros, m) |
16:17:34 | CodeVance | then you'd have to have AST for all the variations |
16:17:42 | FromGitter | <Quelklef> No |
16:17:44 | FromGitter | <Quelklef> just one |
16:17:51 | FromGitter | <Quelklef> if no alias, m is an emptyNode |
16:18:59 | CodeVance | you can also do this in nim `import nimgame2/[nimgame, types, renderer] |
16:20:04 | FromGitter | <Quelklef> then make importStmt be importStmt(module, alias, sublist) |
16:20:06 | CodeVance | the AST is actually generated as follows `nnkImportStmt.newTree(nnkInfix.newTree("as".ident, "module".ident, "alias".ident))` |
16:20:16 | FromGitter | <Quelklef> Yeah I know |
16:20:40 | CodeVance | you can . make a proc |
16:20:54 | CodeVance | newImportStmt(module, alias):NimNode= |
16:21:22 | FromGitter | <Quelklef> I... What would that do |
16:21:36 | FromGitter | <Quelklef> we're talking about keeping the syntax the same and changing the ASt |
16:21:42 | FromGitter | <Quelklef> making a macro would not do that |
16:22:14 | FromGitter | <Quelklef> hahaha over here talking about nim, I went back to a Python project, and promptly wrote `proc` |
16:22:36 | CodeVance | I don't see the harm of having the infix defined explicitly |
16:22:48 | FromGitter | <Quelklef> It's just kinda weird to me |
16:23:19 | FromGitter | <Quelklef> I can't point to any direct hindrances it causes, and I'm not trying to |
16:23:22 | CodeVance | I think its more changable |
16:23:27 | FromGitter | <Quelklef> huh |
16:23:48 | FromGitter | <Quelklef> in my eyes it's less flexible because the AST becomes more about the syntax than the represented semantics |
16:24:00 | CodeVance | Its more flexable |
16:24:16 | FromGitter | <Quelklef> thanks for the assertion |
16:24:26 | CodeVance | I'm debating the value of it |
16:24:30 | FromGitter | <krux02> how would you want the import ast? |
16:24:43 | CodeVance | I can see that it would be nicer to have the infix automatically inserted and taken out |
16:25:22 | FromGitter | <Quelklef> @krux02 my impulse would be to have an `importStmt` for which `import A as B` is `importStmt(A, B)` and `import A` is `importStmt(A, empty)` for example |
16:25:41 | FromGitter | <krux02> well the syntax with the as infix operator means that the language needs to special case ``as`` as an operator like `and` etc. |
16:26:01 | CodeVance | For macros I think the current way is most flexable. Remember that the compiler probably parses the statement into something like you mentioned. |
16:26:25 | CodeVance | there's nnkBla `macros.nim` and nkBla `internal/compiler` |
16:27:30 | CodeVance | quelklef its my hope that you can do the following in future nim versions `import nimgame/[nimgame,draw as drawmodule] |
16:28:06 | FromGitter | <krux02> why is the import statement so important? |
16:28:13 | CodeVance | isn't isnot an infix too? |
16:28:14 | FromGitter | <Quelklef> It's not, it's just for example |
16:28:17 | FromGitter | <krux02> you type it litterally once and then stop dealing with it |
16:28:20 | FromGitter | <Quelklef> @krux02 |
16:28:22 | CodeVance | I thought it was a simple template |
16:29:14 | FromGitter | <krux02> to be honest I am happy with the java import statement. |
16:29:52 | FromGitter | <krux02> well ok that one is bad because without IDE it's actually horrible |
16:29:52 | FromGitter | <Quelklef> hahaha you are an appreciative person |
16:30:05 | FromGitter | <krux02> but the idea is that you don't deal with it much |
16:30:32 | * | fjvallarino joined #nim |
16:33:27 | * | miran_ quit (Ping timeout: 240 seconds) |
16:44:50 | * | leorize quit (Ping timeout: 245 seconds) |
16:52:08 | * | donzx quit (Remote host closed the connection) |
16:53:44 | * | leorize joined #nim |
17:02:13 | * | mitai quit (Ping timeout: 256 seconds) |
17:03:50 | * | Trustable quit (Remote host closed the connection) |
17:19:45 | FromGitter | <Araq> you would all be the first screaming INCONSISTENCY when 'a as b' would produce an infix node (which it does) and 'import a as b' wouldn't. |
17:21:35 | dom96 | I wouldn't :P |
17:25:05 | FromGitter | <Araq> the AST reflecting the syntax is an advantage and when the AST derivates from the syntax it becomes much more arbitrary |
17:25:59 | FromGitter | <Araq> see nnkProcDef for a terrible design. (But then I don't really know how to do it better) |
17:31:06 | * | SenasOzys joined #nim |
17:35:18 | * | ipjk joined #nim |
17:44:47 | FromGitter | <Quelklef> @Araq I believe that the AST reflecting syntax has advantages, but I'm having trouble seeing them, and that's what I'm asking |
17:45:00 | FromGitter | <Quelklef> Besides easier parsing |
17:45:05 | * | find0x90 joined #nim |
17:46:00 | FromGitter | <Quelklef> I looked at nnkProcDef. What makes it particularly bad? |
17:47:19 | FromGitter | <Araq> magic numbers. |
17:47:45 | FromGitter | <Araq> name is at position 0 then params is at 1, ah no because there can be a pattern, |
17:48:13 | FromGitter | <Quelklef> ah |
17:48:15 | FromGitter | <Araq> so pattern is 1, parameters is 2, return type is part of parameters, but pragmas are at 3 |
17:48:24 | FromGitter | <Araq> and then body is at 4. |
17:48:30 | FromGitter | <Araq> and I probably got it wrong :P |
17:48:33 | FromGitter | <Quelklef> Isn't it similar for other things? |
17:48:45 | FromGitter | <Quelklef> there's one im thinking of, gimme a se |
17:48:51 | FromGitter | <Araq> it's the same for all "routines" (iterators, methods, etc) |
17:48:58 | * | yglukhov[i] quit (Ping timeout: 264 seconds) |
17:49:02 | FromGitter | <Araq> so it's not that bad. but still. |
17:49:56 | FromGitter | <Quelklef> `nnkIdentDefs` seems to have a similar issue. I want to do `var x = 2`; okay, `x` at 0, then `2` at 1--wait, no, there may be a type |
17:50:02 | FromGitter | <Quelklef> or a similar form |
17:50:32 | FromGitter | <Araq> see. and yet you want the same mess for nnkImportStmt. |
17:50:35 | FromGitter | <Quelklef> But I suppose type is not nearly as arcane as patterns |
17:50:41 | FromGitter | <Quelklef> ahhhhhhh |
17:51:30 | FromGitter | <Quelklef> well, IMO, it would be nice to have a property-based AST rather than having positional children (this may actually be a terrible idea) |
17:51:34 | FromGitter | <Quelklef> but I see what you mean |
17:51:52 | FromGitter | <Quelklef> having the AST similar to the syntax makes it easy to conceptualize about what the AST should look like for some code, and vice-versa |
17:51:53 | FromGitter | <Quelklef> ? |
17:53:05 | FromGitter | <Araq> a property based AST sounds like repeating HTML's mistake. |
17:53:25 | FromGitter | <Araq> where sometimes it's an attribute and sometimes it's a child node. |
17:53:47 | * | find0x90 quit (Ping timeout: 256 seconds) |
17:53:47 | FromGitter | <Araq> with all the downsides that it brings for recursive traversal. |
17:53:58 | FromGitter | <Quelklef> yeah, but there would be no child nodes. just properties that are lists of nodes |
17:54:02 | * | find0x90_ joined #nim |
17:55:15 | FromGitter | <Araq> that only means you transform n[i] to n.kids[i] and the downsides remain. |
17:56:11 | FromGitter | <Quelklef> a la `proc fA, B, C (x, y, z)` -> `procDef{typeParams=[ident(A), ident(B), ident(C)], formalParams=[ident(x), ident(y), ident(z)]}` type thing |
17:56:32 | FromGitter | <Araq> well we have accessors for that. |
17:57:07 | FromGitter | <Quelklef> What do you mean? |
17:57:23 | FromGitter | <Quelklef> Also, real quick, is "having the AST similar ... and vice-versa" from above an accurate understanding? |
17:57:29 | FromGitter | <Araq> proc macros.name # retrieve the name of a nnkProcDef |
17:57:46 | FromGitter | <Araq> sure. |
17:59:04 | FromGitter | <Quelklef> but the issue you pointed out is in creation as well as retrieval |
17:59:12 | FromGitter | <Quelklef> oh I guess there's probably a `.name=` as well |
18:00:19 | FromGitter | <Quelklef> hm, but .name is an exception because it applies to all nodes |
18:01:35 | FromGitter | <Araq> it was just an example. |
18:02:10 | FromGitter | <Araq> positions are superior because you can iterate over the whole AST pretty easily then and properties can be layered on top of it. |
18:02:36 | FromGitter | <Araq> and that's exactly what Nim does. |
18:02:58 | FromGitter | <Quelklef> But within that you're usually looking for specific contexts/patterns, right? |
18:03:08 | FromGitter | <Quelklef> Wait. "properties can be layered on top of it" can you elaborate a little |
18:03:23 | FromGitter | <Araq> as I said, accessors like getPragmas |
18:03:57 | * | cryptocat1094 joined #nim |
18:04:04 | FromGitter | <Quelklef> and `.name=`? (getPragmas is not showing up in the stdlib) |
18:04:23 | FromGitter | <Araq> in macros it's called `pragmas=` iirc |
18:04:31 | FromGitter | <Araq> and `pragmas` |
18:04:45 | FromGitter | <Araq> but why does it matter. I'm talking about the concept. |
18:05:26 | FromGitter | <Quelklef> Because I'm not understanding and perhaps a concrete example would help :P |
18:06:14 | * | yglukhov[i] joined #nim |
18:06:17 | * | noonien quit (Quit: Connection closed for inactivity) |
18:06:30 | FromGitter | <Quelklef> OK I see `pragma` and `pragma=` |
18:06:40 | FromGitter | <krux02> well yea that is an issue, but the magic numbers can't go away either. |
18:06:52 | FromGitter | <Araq> Nim's AST is inspired by Lisp, Lisp has no "property" based AST either. |
18:06:56 | FromGitter | <Quelklef> But I don't quite understand how this is "layering" in a sense; it's just setting a positional attribute |
18:08:00 | FromGitter | <Quelklef> That's true, but Lisp is also dynamically typed and all that jazz |
18:08:06 | FromGitter | <Araq> (this is a (tree) (from a more civilized age)) |
18:08:23 | FromGitter | <krux02> I mean there are templates to access indexed members by name |
18:08:33 | * | leorize quit (Ping timeout: 248 seconds) |
18:08:34 | FromGitter | <Araq> <html this"is">a pretty crappy</tree> |
18:09:45 | FromGitter | <krux02> yea html was thought more for rather text heavy documents so that a closing tag can give you a bit more context on what you need to look for when you search for the opening tag |
18:10:00 | FromGitter | <Quelklef> @krux02 true, but in general in macros the ast seems to be created lisp-style |
18:10:05 | FromGitter | <Araq> not the point. |
18:10:34 | FromGitter | <Araq> HTML is the property based tree you argue for and harder to work with. ymmv. |
18:10:54 | FromGitter | <Quelklef> Well, not quite |
18:11:44 | * | fjvallarino quit (Remote host closed the connection) |
18:11:52 | * | fjvallarino joined #nim |
18:12:01 | FromGitter | <Quelklef> In HTML, the children of tags are almost always allowed to be "more content" |
18:12:22 | FromGitter | <krux02> what do you think about. ``procNode[propName]`` where propName is a predefined enum |
18:13:04 | FromGitter | <krux02> I don't really like the templates, because they are, yea. I don't know I avoid them |
18:13:11 | FromGitter | <Quelklef> but in languages, what we're looking for is much more domain-restricted. `nnkProcDef[2]` should always be generic params, it can't just be whatever |
18:13:25 | * | endragor joined #nim |
18:14:09 | FromGitter | <Quelklef> @krux02, depends on the scope. Does propName include node-specific stuff, or node-insensitive properties |
18:14:40 | FromGitter | <Quelklef> i.e. `someProcDef[formalParams]` would be cool |
18:15:32 | FromGitter | <krux02> @Quelklef well I would like it, too. |
18:15:40 | * | ipjk quit (Quit: Leaving) |
18:15:55 | FromGitter | <Quelklef> What are your thoughts on what Araq has said, then? |
18:16:29 | FromGitter | <krux02> @Quelklef I am rather new to the conversation, so what exactly are you referring to? |
18:17:37 | * | endragor quit (Ping timeout: 248 seconds) |
18:18:27 | FromGitter | <krux02> if you mean "positions are superior because you can iterate over the whole AST pretty easily then and properties can be layered on top of it. ⏎ and that's exactly what Nim does." then yes I do agree. |
18:18:51 | FromGitter | <Quelklef> Sure, can you help me understand that, then? |
18:18:59 | FromGitter | <Quelklef> There are two parts there, the iteration and the properties |
18:19:00 | FromGitter | <krux02> I have the ast pattern matcher right now, and it would be nice if there was a system to integrate properties to it, too. |
18:19:09 | FromGitter | <krux02> at the moment I can only match on position. |
18:19:23 | FromGitter | <Quelklef> I haven't seen the pattern matcher |
18:19:36 | FromGitter | <krux02> So I need a property system that is in some form instrospectable also from my pattern matching macros. |
18:19:52 | FromGitter | <krux02> the templates to access the members of the Nodes don't really do it. |
18:20:19 | FromGitter | <krux02> https://github.com/krux02/ast-pattern-matching |
18:20:57 | FromGitter | <Quelklef> Ah, that's cool! |
18:21:18 | FromGitter | <Quelklef> But wait |
18:21:27 | FromGitter | <Quelklef> I want to understand the statement from Araq from before |
18:21:39 | FromGitter | <Quelklef> I don't know what "properties can be layered on top of it" means exactl |
18:23:14 | FromGitter | <krux02> it means exactly that you can implement ``someProcDef[formalParams] = whatever`` just by overloading the `[]=` operator with the right types |
18:23:45 | FromGitter | <krux02> the `[]=` operator would then use the positions internally. |
18:23:58 | FromGitter | <krux02> so you have properties layered on top of positions. |
18:24:13 | FromGitter | <Quelklef> ohhh shit |
18:24:19 | FromGitter | <Quelklef> I totally misunderstood what "properties" meant |
18:24:35 | FromGitter | <krux02> np |
18:24:45 | FromGitter | <Quelklef> Ok, then the other one is iteration |
18:25:00 | * | find0x90_ quit (Quit: find0x90_) |
18:25:29 | FromGitter | <Quelklef> As we look over the AST, we're never going to be doing position-based manipulation, right? |
18:25:29 | FromGitter | <krux02> what do you mean? |
18:25:49 | * | leorize joined #nim |
18:26:05 | FromGitter | <Quelklef> It's never, "swap the 0th and 1st argument to the node", it's "find a node in a certain context and swap its 0th and 1st argument, which both represent certain concepts" |
18:26:19 | FromGitter | <Quelklef> I'm *assuming*. I don't write compilers. Correct me if I'm wrong |
18:26:23 | FromGitter | <krux02> we are doing position based manipulation. nnkSomeKind.newTree(a,b,c,d) a tree is created position based. |
18:26:27 | FromGitter | <Quelklef> right |
18:26:44 | * | find0x90 joined #nim |
18:26:46 | FromGitter | <krux02> the order of a,b,c,d does matter |
18:26:58 | FromGitter | <krux02> most of the tree is created position based |
18:27:03 | FromGitter | <Quelklef> right no i got that |
18:27:15 | * | nsf quit (Quit: WeeChat 2.1) |
18:27:19 | FromGitter | <Quelklef> just what exactly is meant by "positions are superior because you can iterate over the whole AST pretty easily" |
18:27:34 | FromGitter | <krux02> it is just for proc defs and some other nodes that positions are kind of bad, because they need a lot of emtpy nodes. |
18:27:50 | FromGitter | <krux02> those are sparse nodes if you want to call it that way. |
18:27:55 | FromGitter | <Quelklef> sure |
18:29:44 | FromGitter | <Quelklef> but still, what's meant by the above |
18:33:09 | FromGitter | <krux02> ah that one. yea just look at pretty printers |
18:33:18 | FromGitter | <krux02> like the treeRepr |
18:33:34 | FromGitter | <krux02> @Quelklef you can just write a recursive function |
18:33:44 | FromGitter | <krux02> and iterate over all children |
18:35:35 | FromGitter | <Quelklef> hmmm |
18:36:42 | FromGitter | <Quelklef> you could iterate over properties, but I can see how it would be more complicated |
18:37:36 | FromGitter | <Quelklef> IDK, I'm not convinced but if in a year or two I see the light I'll come back and tell Araq he's totally right and I was not |
18:38:29 | * | HYP3RBOR3A joined #nim |
18:39:02 | * | miran_ joined #nim |
18:39:13 | FromGitter | <krux02> well from the position you can infer the property tag |
18:39:22 | * | HYP3RBOR3A quit (Remote host closed the connection) |
18:39:39 | FromGitter | <Quelklef> yeah, the two formulations are kinda equivalent at some level |
18:40:02 | * | mitai joined #nim |
18:40:11 | FromGitter | <krux02> not equivalent |
18:40:52 | FromGitter | <Quelklef> i mean in the sense that they could wrap each other and provide identical functionality |
18:43:24 | FromGitter | <krux02> yea but the overhead in implementing and how it is stored on the computer is significant |
18:44:41 | FromGitter | <Quelklef> I wonder if you could abstract a near-zero attributes-based API on top of positions |
18:44:49 | FromGitter | <Quelklef> I bet |
19:09:39 | * | krux02 quit (Read error: Connection reset by peer) |
19:13:47 | * | yglukhov[i] quit (Ping timeout: 265 seconds) |
19:14:25 | * | krux02 joined #nim |
19:23:46 | * | mitai quit (Ping timeout: 264 seconds) |
19:27:26 | * | NimBot joined #nim |
19:36:53 | * | yglukhov[i] joined #nim |
19:37:03 | CodeVance | concepts |
19:37:18 | CodeVance | I was thinking of making a concepts interface for macros.nim |
19:53:12 | FromGitter | <krux02> @Araq I know you want to remove static[T] from the language. I personally think it is very valuable. But I think some of it's use cases can be replaced by a macro. |
19:54:44 | FromGitter | <krux02> I think for the optimization usage, e.g. "I want this function to be optimized with this value" it can very easily replaced by a macro that does this. But there is still the other use case where a macro has a paremeter that should not be a NimNode, but actuall a value like a string or an integer that is known at compile time. |
19:55:52 | FromGitter | <krux02> but here the semchecker can simply remove the static[T] |
19:58:55 | FromGitter | <krux02> so ``marco foobar(arg: MyType, str: static[string])`` would be like ``proc foobar(arg: NimNode; str: string)`` in the macro body and ``proc foobar(arg: MyType; str: static[string])`` inside of it. |
19:59:37 | * | find0x90 quit (Quit: find0x90) |
19:59:46 | FromGitter | <krux02> well the static[string] is still there. |
19:59:50 | FromGitter | <krux02> I don't know |
20:02:39 | CodeVance | How to build the docs from source? |
20:02:57 | * | miran_ is now known as miran |
20:03:32 | miran | nim doc myfile.nim |
20:03:32 | Yardanico | CodeVance, ./koch web |
20:03:38 | Yardanico | ah, for your file |
20:04:02 | CodeVance | No the nim-lang |
20:04:08 | CodeVance | koch web makes rst |
20:04:11 | CodeVance | I want html |
20:04:30 | Yardanico | well ./koch web makes everything |
20:04:33 | CodeVance | nvm I see it working now |
20:04:35 | Yardanico | and .html versions too |
20:04:36 | CodeVance | Thanks |
20:04:40 | CodeVance | XD |
20:04:49 | CodeVance | +1 +1 |
20:06:52 | * | PMunch joined #nim |
20:07:42 | CodeVance | I want to change the documentation output html |
20:08:56 | CodeVance | oh I see it goes to web folder |
20:09:09 | CodeVance | web/0.18.1 |
20:11:26 | shashlick | araq: why are testament tests only compiled and not run by default? why do you need to specify an action for them? |
20:11:36 | * | ofelas quit (Quit: shutdown -h now) |
20:15:25 | Araq | shashlick, legacy, let's change it |
20:15:43 | Araq | but what would the output be? nothing but return code 0 ? |
20:16:52 | Araq | krux02: IMO generics should be replaced by macros and I have some vaporware ideas of how to do that |
20:17:02 | Araq | but it's beyond our v1 goals. |
20:20:26 | ldlework | oh jesus christ |
20:21:20 | Yardanico | how would that work? 0_0 |
20:21:35 | Yardanico | proc myproc(a: T) {.generic: T.} ? :D |
20:21:53 | CodeVance | generics are fancy macros |
20:22:00 | CodeVance | aren't they |
20:22:18 | ldlework | "things a compiler does" = "macros" |
20:22:19 | CodeVance | generic T:proc myproc(a:T) |
20:22:46 | CodeVance | "saves typing" = macros |
20:24:13 | shashlick | araq: i'll change tissue to add the action: run by default |
20:25:06 | krux02 | Araq: how about replacing the type system entirely by macros |
20:25:23 | Araq | shashlick, no please, patch testament instead |
20:25:27 | Araq | it comes up again and again. |
20:25:40 | Araq | and that's always an indication it's wrong. |
20:25:56 | Araq | krux02, yup. :-) |
20:26:12 | Araq | Yardanico, not the way you outline. |
20:26:48 | nasusiro | Araq, I wanted to ask you: is there a way to pass a series of arguments that could be saved upon first run in a file associated with the run .nim file? For instance, let's say I have a foo.nim file and want --threads:on to be saved in foo.nims. Can't we have a way to get any number of nim arguments passed in a .nims file by default? |
20:27:43 | FromGitter | <Varriount> Araq: Regarding that pegs.nim PR, the new functionality seems more suited for a tokenizer/lexer, rather than an AST parser. |
20:28:18 | Yardanico | nasusiro, nim.cfg |
20:28:29 | Yardanico | or in filename.nims |
20:28:32 | nasusiro | Yardanico: that's not what I asked |
20:28:38 | Yardanico | what do you want then? |
20:28:39 | FromGitter | <Varriount> I tried my hand at using it to implement a toy shell language, and there are certain behaviors that make it hard. |
20:28:47 | Yardanico | you want autosave? |
20:28:55 | Yardanico | i don't really see any advantages in that |
20:29:57 | nasusiro | Yardanico: imagine this scenario. I have the following command arguments: nim c -o:bin/foo --threads:on --any-flag-you-can-imagine:a-value-here src/foo.nim |
20:30:34 | cryptocat1094 | Generics -> Templates -> Macros? |
20:30:41 | nasusiro | instead of going manually and creating my src/foo.nims with my arguments, I would like to run this command just once and save it or better say generate a foo.nims for me upon initial run |
20:30:50 | CodeVance | nasusiro. Open the file then save the values? |
20:31:00 | Yardanico | nasusiro, just copy+paste this into nim.cfg |
20:31:01 | Yardanico | done |
20:31:15 | * | yglukhov[i] quit (Remote host closed the connection) |
20:31:19 | Yardanico | (without `nim` and filename of course) |
20:31:35 | nasusiro | Yardanico: I haven't used nim.cfg before. Can you provide an example? |
20:31:52 | nasusiro | should I copy my existing /etc/nim.cfg or just a new one? |
20:31:55 | Yardanico | nasusiro, just write your flags in nim.cfg and place it in the same folder as your .nim file |
20:32:00 | Yardanico | or in the place in PATH |
20:32:11 | CodeVance | nim/cfg/nim.cfg for global cfg |
20:32:20 | dom96 | echo "-o:bin/foo --threads:on --any-flag-you-can-imagine:a-value-here" > nim.cfg |
20:32:46 | nasusiro | dom96: oh that's much better. should I place it in my project's root or under src sub-directory? |
20:32:53 | shashlick | araq: okay, i'll set action: run as default, and add an action: norun as an option for those that don't specify |
20:32:58 | dom96 | (actually, might need to replace spaces with newlines) |
20:33:09 | dom96 | nasusiro: wherever your source code is |
20:33:19 | dom96 | `nim.cfg` will apply to all your source code |
20:33:20 | nasusiro | dom96: yeah, newlines will be better |
20:33:24 | nasusiro | awesome |
20:33:29 | dom96 | `file.nim.cfg` will only apply to `file.nim` |
20:33:49 | nasusiro | dom96: so file.nim.cfg and file.nims are synonymous in this case? |
20:34:01 | dom96 | sorta |
20:34:12 | dom96 | .nims is nimscript |
20:34:19 | nasusiro | yeah, I meant behavior-speaking |
20:35:46 | * | lompik quit (Ping timeout: 264 seconds) |
20:35:49 | Yardanico | dom96, .cfg support newlines :) |
20:35:54 | Yardanico | supports* |
20:36:05 | dom96 | Yardanico: I know? |
20:36:10 | Yardanico | I mean you can type without them |
20:36:34 | dom96 | You mean you don't need newlines? but can use spaces? |
20:36:50 | Yardanico | yeah, you can use spaces in .cfg |
20:38:34 | nasusiro | dom96: is it possible to have nim.cfg and make it run successfully with some kind of tweaks? |
20:38:51 | nasusiro | *to have it in project's root directory |
20:39:08 | dom96 | Don't think so |
20:39:41 | * | miran quit (Ping timeout: 276 seconds) |
20:40:29 | nasusiro | bummer... |
20:40:59 | Yardanico | nasusiro, usually you would use nimble-compliant project structure anyway |
20:41:28 | nasusiro | I'm still learning, so I don't yet know what nimble is all about. |
20:42:34 | Araq | shashlick, yeah please. thank you! |
20:42:40 | Yardanico | it's a package manager for Nim |
20:42:49 | Yardanico | (not the only one actually) |
20:45:32 | nasusiro | Yardanico: nice. slowly-slowly and I will feel right at home with Nim |
20:46:39 | * | mitai joined #nim |
20:47:49 | Araq | Yardanico, huh? not the only one? |
20:48:10 | Yardanico | Araq, what about https://github.com/Araq/nawabs ? :P |
20:50:18 | Araq | that's not a package manager :P |
20:50:32 | * | cryptocat1094 quit (Quit: later) |
20:50:38 | Araq | and doesn't compile anymore, sadly. |
20:50:45 | * | icebattle joined #nim |
20:50:48 | Araq | but not hard to revive. |
20:51:01 | * | PMunch quit (Quit: leaving) |
20:51:19 | Araq | anyhow, as long as nobody agrees with me on nawabs, I don't work on it as I currently have no need for it. |
20:51:43 | Araq | and in an ideal world, Nimble would steal more of its features. |
20:53:00 | * | arecaceae quit (Read error: Connection reset by peer) |
20:53:24 | * | arecaceae joined #nim |
20:59:29 | nasusiro | Araq: are you going to continue on your AST investigation to figure out what is considered slow upon compilation? I find compilers and language design a fascinating topic. One day I will understand them eventually lol |
21:03:46 | FromGitter | <kayabaNerve> @Quelklef ⏎ Node has a web server lib called Express. It has something called Middleware. Every web request goes through the middleware, which can respond, end, or modify the request... ⏎ ⏎ That's the whole language. [https://gitter.im/nim-lang/Nim?at=5b3d3632a99e1e52b7168d8f] |
21:03:57 | FromGitter | <kayabaNerve> Middleware: The Language |
21:04:15 | FromGitter | <kayabaNerve> Made for Microservices, APIs, Web Servers... |
21:05:48 | CodeVance | middleware isn't a language righT? |
21:06:05 | FromGitter | <kayabaNerve> Directly connecting a HTML thingy to an SQL database? ⏎ ⏎ IDK. Something. |
21:06:24 | Yardanico | CodeVance, it's not |
21:06:32 | FromGitter | <kayabaNerve> No. It's a thing. Like classes. I'm saying I want to make a language BUILT to be middleware. |
21:06:59 | FromGitter | <kayabaNerve> The whole language designed for it. |
21:07:11 | CodeVance | dsl? |
21:07:26 | nasusiro | that's what is known as Intermediate Representation, IR for short |
21:07:26 | CodeVance | build for performance? |
21:07:31 | FromGitter | <kayabaNerve> No, I have cable internet at this point. Who doesn't? |
21:07:50 | FromGitter | <Quelklef> DSL --> domain-specific language |
21:08:07 | FromGitter | <Quelklef> but, why |
21:08:13 | Yardanico | middleware is not a language neither a IR |
21:08:32 | Yardanico | middleware it's just a layer of software |
21:08:38 | Yardanico | https://en.wikipedia.org/wiki/Middleware |
21:08:57 | * | dom96 is still wondering how to best implement middleware for Jester |
21:09:23 | FromGitter | <krux02> @kayabaNerve well Nim is definitively a language that you can use to built middleware |
21:09:39 | FromGitter | <krux02> mut to be honest I don't know what you really want. |
21:09:40 | FromGitter | <kayabaNerve> That's not the whole point of this lol |
21:09:55 | Araq | dom96, you add a bunch of proc vars that can be overriden |
21:10:04 | FromGitter | <krux02> and also middleware is kind of a loose term |
21:10:07 | Yardanico | Araq, what if there's more than one middleware? |
21:10:14 | FromGitter | <krux02> it sits in the middle, of what? can be anything |
21:10:20 | dom96 | It all adds cruft and slow-downs :( |
21:10:38 | dom96 | I'm really annoyed that the HTTP spec wants all HTTP servers to reply with a damn `Date` header |
21:10:52 | * | user1101 quit (Quit: user1101) |
21:10:53 | dom96 | so the tech empower benchmarks require it and I have to pollute httpbeast with this crap |
21:10:57 | FromGitter | <kayabaNerve> I'm saying that I want to build a language. That language would be designed to be middleware. Why build an online store when you can hook up an Express server to a Lexer to manage auth to MySQL directly... |
21:11:03 | nasusiro | Yardanico: well, in my mind for some reason I have associated middleware with intermediate language when I'm referring to languages. I guess I'm wrong after all... |
21:11:17 | FromGitter | <kayabaNerve> dom96: Seq of procs? Clean? Simple? A pain but a way? |
21:11:32 | FromGitter | <kayabaNerve> *Express as in the NodeJS lib but really just any web server.... |
21:11:39 | Araq | Yardanico, ok ok, a seq of proc vars then. |
21:11:54 | FromGitter | <kayabaNerve> I just said that :( |
21:11:54 | * | yglukhov[i] joined #nim |
21:11:55 | dom96 | In fact, I already have a seq of procs for Jester IIRC |
21:12:00 | FromGitter | <kayabaNerve> Araq stole my idea |
21:12:16 | dom96 | Maybe I already have middleware support and don't even know it :P |
21:12:22 | FromGitter | <kayabaNerve> I think we're evolving past writing libs and programs. Now we're connecting existing pieces... |
21:12:41 | Araq | dom96, if you do it right it doesn't slow it down much |
21:12:56 | Araq | it's just another easy to predict branch |
21:13:03 | FromGitter | <kayabaNerve> Not actually making this language ofc. Just commenting if I made a language... |
21:13:06 | Araq | that is, if you don't attach any middleware :P |
21:13:12 | dom96 | Jester slows down by more than 50% in my tests so far |
21:13:32 | FromGitter | <kayabaNerve> dom96: Look at Express for usage inspiration. Just saying. Express does it really nicely |
21:13:35 | dom96 | and as far as I can tell it's because of the extra async calls |
21:14:10 | FromGitter | <kayabaNerve> The entire thing is middleware. It has GET/POST functions to declare routes. They just make freaking middleware for you.. |
21:14:56 | Araq | shhhht, don't tell anybody that every protocol automatically supports "middleware" |
21:15:25 | dom96 | Yeah, I think middleware is in Jester |
21:15:25 | dom96 | yay |
21:15:26 | FromGitter | <kayabaNerve> var in, out ⏎ for i in middleware ⏎ ....middleware(in, out) |
21:15:34 | Araq | it's the nature of message passing that you can introduce a node in between |
21:15:39 | FromGitter | <kayabaNerve> ... That's all Middleware is. |
21:15:51 | krux02 | People who write programs in the future can put together everything because everything is already built. It just needs to be put together. And then they need to analyze all the crap that is in the middle and remove it to actually make it usable. And spend more time on removing stuff from the pipeline that if they would heve required when they would have written everything from scratch. Just because the frameworks will be super complex by then |
21:16:13 | FromGitter | <kayabaNerve> That's why I want to build a language built around message passing and intermediaries... I won't though. Just commenting. |
21:16:38 | krux02 | minus the advantage that wen you write something that already exists. You would learn all the nitty details that it needs to actually write software. |
21:16:49 | FromGitter | <kayabaNerve> It'd best be used with C++ or Nim. Built the services in Nim as independent apps. Connect with my thingy. |
21:17:03 | FromGitter | <kayabaNerve> krux02: Do you use MySQL? |
21:17:11 | Araq | krux02, why do I need to think of CSS now... :P |
21:17:13 | krux02 | kayabaNerve: have you ever heared about linux pipes? |
21:17:25 | FromGitter | <kayabaNerve> Yeah. |
21:17:32 | FromGitter | <kayabaNerve> They're amazing. |
21:17:44 | krux02 | kayabaNerve: No I don't, but that is because I don't collect user data. |
21:18:11 | FromGitter | <kayabaNerve> It's illogical to rewrite every single thing is my point |
21:18:50 | FromGitter | <kayabaNerve> MySQL is likely to be better than any DB you can build. It'd take a while to build anything close. |
21:19:29 | krux02 | when I look at SQL tables, it doesn't look very different than several csv files + a query language |
21:19:45 | FromGitter | <kayabaNerve> Plus several optimizations and a binary format? |
21:20:03 | FromGitter | <kayabaNerve> Plus mass usage and a bugless query language? |
21:20:10 | Araq | yeah, don't reinvent DBs badly. |
21:20:16 | Araq | DBs rule. |
21:20:16 | * | tiorock joined #nim |
21:20:17 | * | tiorock quit (Changing host) |
21:20:17 | * | tiorock joined #nim |
21:20:17 | * | rockcavera is now known as Guest87184 |
21:20:17 | * | Guest87184 quit (Killed (orwell.freenode.net (Nickname regained by services))) |
21:20:17 | * | tiorock is now known as rockcavera |
21:20:36 | krux02 | are you sure about bugless? |
21:20:37 | Araq | (and compilers do too) |
21:20:41 | Abnegation | People who write programs in the future can put together everything because everything is already built. It just needs to be put together. And then they need to analyze all the crap that is in the middle and remove it to actually make it usable. And spend more time on removing stuff from the pipeline that if they would heve required when they would have written everything from scratch. Just because the frameworks will be |
21:20:42 | Abnegation | super complex by then |
21:20:43 | Abnegation | I feel that's the status now, except people don't realize they need to delete half of their code. :P |
21:21:54 | FromGitter | <kayabaNerve> Ngl. The Cryptocurrency I'm working on? I didn't write a single cryptographic part. SHA512/Lyra2 lib? MIT. Elliptic Curve keys? Used the one from BTC. ⏎ ⏎ It'd take weeks to reproduce and in the case of the keys, I can't mess up. At all. It's not just faster and easier to use an existing lib; it's prudent and safe. |
21:22:04 | krux02 | isn't mongodb the hip thing people use today? |
21:22:13 | Abnegation | People get surprised when I tell them "yeah, that library is slow, at most use it for prototyping, for example our team implemented the matrix multiplication for our main loop removing the code from the library and we go faster, like 20x faster" |
21:22:20 | FromGitter | <kayabaNerve> Why are you using Nim? Won't you understand coding better if you write Binary to the CPU with a magnetized needle? |
21:22:31 | * | yglukhov_ joined #nim |
21:22:37 | Abnegation | "but, but that library is made by super rocket surgery physicists... do you have the gall to say your team is better than them?" |
21:22:51 | FromGitter | <kayabaNerve> In the case of keys, you can't mess up at all. |
21:23:10 | FromGitter | <kayabaNerve> Or most cryptographic encryption/operations |
21:23:17 | FromGitter | <kayabaNerve> Especially when bundled with money |
21:23:23 | FromGitter | <kayabaNerve> In a system you can't control |
21:23:24 | FromGitter | <kayabaNerve> Etc etc |
21:23:30 | krux02 | super rocket surgery physicists... are not necessarily good programmers |
21:23:40 | FromGitter | <kayabaNerve> I'm not saying stop writing parts. I'm not saying it's not good to. I'm saying you don't have to anymore, and a lot of the time, it's not beneficial to. |
21:24:04 | FromGitter | <kayabaNerve> We're at a point we can stop writing existing programs, and instead write microservices, and then lexers in between them to filter data. |
21:24:07 | krux02 | especially scientists often don't really care for performance. They need the program often only once |
21:24:13 | dom96 | When you think about it from the perspective of engineering, taking off-the-shelf components makes sense. |
21:24:32 | FromGitter | <kayabaNerve> I fully support knowing Nim. If I made the lang though, I'd support writing standalone apps with it, and making your entire application via connecting mine. |
21:25:01 | Araq | you're all right. there are systems that definitely should be used instead of reinvented badly. |
21:25:02 | FromGitter | <kayabaNerve> @krux02 You do need fast implementations so it's 1 week to get results, not 1 year. Especially when you have to run it over and over again. |
21:25:05 | * | yglukhov[i] quit (Ping timeout: 240 seconds) |
21:25:11 | Araq | and there are systems that don't add much value. |
21:25:11 | dom96 | It's all about balance, Apple might reinvent the touch screen, but they won't reinvent the wifi antenna inside their iPhones |
21:25:18 | Araq | and systems that add negative value. |
21:25:50 | FromGitter | <kayabaNerve> dom96: First we removed the headphone jack. Now there's no 802.11 WiFi antenna. |
21:25:58 | FromGitter | <kayabaNerve> Smaller. Slimmer. Twice the price. |
21:26:02 | Araq | and CSS needs to be reinvented. quickly. |
21:26:06 | Araq | :-) |
21:26:21 | krux02 | the web needs to be reinvented |
21:26:26 | krux02 | irc needs to be reinvented |
21:26:30 | krux02 | the problem is the people |
21:26:32 | Abnegation | There are two reasons as to why you need to rewrite stuff: |
21:26:32 | Abnegation | 1)The moment you don't need to rewrite stuff, is the moment you don't need to truly program. Programming will not look anything like it looks now when you don't need to rewrite stuff. We're not there yet, be scared though, learning algorithms will get there in our generation I'm sure. |
21:26:33 | Abnegation | 2)Many people don't find "abstract, handy powerful, modern devices to program faster" to actually be faster in any sense, not in performance not in implementation. When I have to deal with python code I spend 10x more time than I spend in C code. Maybe that's because I'm old(or I feel old) and I can't learn new tricks easily, but that doesn't make the fact go away. |
21:26:40 | FromGitter | <kayabaNerve> Not this god damn IRC debate again |
21:26:43 | dom96 | kayabaNerve: Perfect. |
21:26:55 | krux02 | just because there is something better. The old is still there and often it just results in a community split. |
21:27:10 | FromGitter | <kayabaNerve> it has been reinvented. So many times. People don't build a protocol though, in most cases. They build an app. See Gitter, Because of that, people do see it as a reinvention |
21:27:14 | dom96 | kayabaNerve: Can't wait to buy a $100 dongle to connect my phone to Ethernet |
21:27:21 | FromGitter | <kayabaNerve> I won't comment on XMPP but what about Matrix? |
21:27:40 | Yardanico | Let's not start this debate as you said :) |
21:27:40 | krux02 | I want a world where it doesn't matter in what language a library has been written. |
21:27:44 | Yardanico | that's more for #nim-offtopic |
21:27:52 | FromGitter | <kayabaNerve> To compensate, and improve, we've now come out with Apple Wifi. It's a day to day service that costs $10 a day, when you can get high speed WiFi at any of our Apple stores, including the one in your house*! ⏎ ⏎ *Our new terms and conditions sign over all your property and your life. |
21:28:03 | FromGitter | <kayabaNerve> krux02: That's why microservices exist. |
21:28:23 | FromGitter | <kayabaNerve> MySQL is language independent *ignoring the query language it uses for an API |
21:28:26 | Yardanico | http://3wifi.stascorp.com/stat |
21:28:30 | Yardanico | oh sorry, wrong window |
21:28:32 | krux02 | microservices isn't that this thing that adds network latency to library calls? |
21:28:45 | Abnegation | Also, there's such a thing as becoming so cluttered that optimization is not anymore feasible. A program that needs to run fast can't without question (games) can't rely too much on too much already written code. Specially around its main loop. |
21:28:48 | FromGitter | <kayabaNerve> Well tbh MySQL isn't micro |
21:28:49 | Araq | LOL |
21:29:17 | Araq | "microservices isn't that this thing that adds network latency to library calls?" hilarious |
21:29:33 | FromGitter | <kayabaNerve> And yeah, they CAN add lag :P I'm not saying it's a perfect idea. I'm saying if I made a language, and I want to but won't, that's the design. |
21:29:50 | FromGitter | <kayabaNerve> Also, they're generally on a local system. People already use MySQL. People used scripted languages. |
21:29:57 | FromGitter | <kayabaNerve> People already use web APIs. |
21:29:58 | Abnegation | You know, I always thought that but I needed someone to articulate it for me. |
21:30:36 | FromGitter | <kayabaNerve> And compartmentalization is a balance. There has to be not too much or too little. |
21:31:00 | FromGitter | <kayabaNerve> And this language would need a standard lib that isn't independent services but either callable compiled or optimized script |
21:31:05 | FromGitter | <kayabaNerve> But anyways |
21:31:23 | FromGitter | <kayabaNerve> Araq: This channel used to be for something... I want to say... Min? https://min-lang.org |
21:31:28 | FromGitter | <kayabaNerve> Something like that |
21:33:42 | dom96 | TIL you can start discussions with teams on GitHub https://github.com/orgs/nim-lang/teams/core |
21:34:28 | FromGitter | <kayabaNerve> dom96: Should I use Nim for a web server? |
21:34:31 | FromGitter | <kayabaNerve> Actual question |
21:34:54 | FromGitter | <kayabaNerve> Not as an oddity or to show support. A production level server. ⏎ ⏎ Ignoring the whole 0.18.1/pre-1.0 thing |
21:35:04 | krux02 | kayabaNerve: That is not the question that dom96 can caltually answer |
21:35:33 | FromGitter | <kayabaNerve> Doesn't he work on these? |
21:35:41 | krux02 | yes he does |
21:35:45 | dom96 | I can't? |
21:35:52 | dom96 | Too bad |
21:35:55 | FromGitter | <kayabaNerve> So... |
21:36:03 | dom96 | Sorry kayabaNerve, I can't answer the question :( |
21:36:04 | FromGitter | <kayabaNerve> I'm not asking for a completely UNBIASED opinion |
21:36:10 | FromGitter | <kayabaNerve> I'm asking for an educated one lol |
21:36:29 | FromGitter | <kayabaNerve> Oh well dom96. You tried. I appreciated it. |
21:36:42 | Abnegation | People use php for web programming. So, I don't see no reason to not use anything for web programming :3 |
21:36:55 | dom96 | My answer should be obvious though :) |
21:37:05 | krux02 | what I mean is. You should ask what you need for a web server and dom96 can tell you about if it is possible when when he used it how the experience was |
21:37:34 | krux02 | but in the end you still need to decide if you want to write the webserver in Nim or Not. |
21:37:35 | FromGitter | <kayabaNerve> LOL Abnegation |
21:37:35 | FromDiscord | <exelotl> Abnegation: that's an interesting point. I'm interning at a games studio currently and we are having performance issues in our mobile pixel art games, and I really suspect it's cause we're using JS over a native wrapper with dozens of plugins |
21:38:01 | FromDiscord | <exelotl> and our engine makes some small decisions which I think must really add up (e.g. creating lots of throwaway object literals) |
21:38:32 | Abnegation | I would need to know more details, the team I work in is extremely oriented to performance so I can give you some points to some extents. |
21:38:50 | Abnegation | is an inhouse engine? |
21:38:54 | death916 | i cant imagine thats very performant to use js in that capacity |
21:39:11 | dom96 | oh no, the geoip API my snake game uses is returning 403's and breaking it :( |
21:39:27 | dom96 | Too. Many. Projects. |
21:39:52 | FromGitter | <kayabaNerve> dom96: I have various uses for a web server. ⏎ https://digispend.io //Bankrupt. ⏎ https://github.com/kayabaNerve/Payment-Processor <- About to launch. ⏎ A service I'm working on for handling insurance quotes. [https://gitter.im/nim-lang/Nim?at=5b3d3ea77e23133ecb3231ab] |
21:40:11 | dom96 | kayabaNerve: Do it. |
21:40:19 | Abnegation | the easiest tip for performance is to deal with allocation once. At most once per level. Don't create stuff, reutilize it (reutilize bullets, reutilize enemies, reutilize tiles). |
21:40:34 | krux02 | dom96, it helps to have all projects joined into a single project so that when you break one thing you instantly get feedback |
21:40:41 | dom96 | I've built so much stuff using Nim now. It's all running steadily in productions for years. |
21:40:41 | FromGitter | <kayabaNerve> I am a fan of middleware for not allowing unauthorized requests (I do a lot of things that require a login). So how is the Middleware support? |
21:41:03 | dom96 | I'm almost finished releasing a brand new Jester version |
21:41:08 | dom96 | With a bunch new features |
21:41:10 | shashlick | araq: how come -> https://github.com/nim-lang/Nim/issues/5626#issuecomment-402562950 |
21:41:17 | dom96 | and which runs on httpbeast |
21:41:29 | FromGitter | <kayabaNerve> And I probably should just try it out. The Nim website is on a Nim server, right? Is the forum too? |
21:41:39 | dom96 | The Nim website is static HTML |
21:41:42 | dom96 | the forum is 100% nim |
21:41:55 | FromGitter | <kayabaNerve> What server is behind the website? |
21:42:02 | FromGitter | <kayabaNerve> You can have a Nim static server... |
21:42:31 | FromGitter | <kayabaNerve> Or is it... nGinx :O |
21:42:43 | dom96 | nginx |
21:42:53 | FromGitter | <kayabaNerve> I hate nGinx expect as a SSL front/subdomain handler. Ngl. |
21:42:57 | dom96 | nimforum is: nginx <-> httpbeast <-> jester |
21:43:01 | dom96 | With karax on the frontend |
21:43:05 | FromGitter | <kayabaNerve> Got it |
21:43:26 | FromGitter | <kayabaNerve> So am I looking at Jester + Karax or... |
21:44:01 | FromDiscord | <exelotl> Abnegation: yeah indeed, I think like, beyond that point, even though we're pooling our entities, using hashgrids for collisions, etc, the engine just encourages waste in a bunch of ways. E.g. 2D Vector class makes it easier to create a new vector than modify an old one |
21:45:07 | nasusiro | dom96: has anyone built a web server with Nim or not yet? |
21:45:30 | Abnegation | Hrrm, can't talk that much deeper if you're already doing optimization, that being said it's sounds weird for a pixel game in this day and age to go slow. |
21:45:54 | Abnegation | are you using webgl for drawing I hope. |
21:46:08 | krux02 | Abnegation, for a snake game? |
21:46:18 | krux02 | are you crazy |
21:46:39 | krux02 | for that game even I would do a canvan object and draw rectangles |
21:46:43 | FromGitter | <kayabaNerve> nasusiro: dom96 |
21:46:46 | FromDiscord | <exelotl> haha no, it's not about the snake game x) |
21:47:08 | FromGitter | <kayabaNerve> krux02: Agreed. I think dom made a Nim Snake game with multiplayer... something something talk/conference |
21:47:11 | Abnegation | wait... how is it a snake game going slow then? |
21:47:27 | FromGitter | <kayabaNerve> http://picheta.me/snake/. |
21:47:36 | krux02 | I don't know. I thought you were talking about that |
21:47:40 | FromDiscord | <exelotl> omg the convos are getting mixed up xD |
21:48:33 | FromDiscord | <exelotl> no our games have a lot more action than a snake game. We're using CocoonJS which has a hardware accelerated implementation of the 2D Canvas API |
21:49:31 | Abnegation | Sorry, I'll shut up a little :) if you have any questions exelotl feel free dm me, though I'll not be able to help much on js and frameworks. |
21:50:38 | FromDiscord | <exelotl> haha yeah it's cool, I'm not so much looking for help, just thought you made an interesting point on how layers of 3rd party code can add up to make a project slow |
21:50:44 | krux02 | I have some experience with pixel games and performance. I don't recommend OpenGL to do a pixel game, especially not when the game has lot's of particles and the OpenGL that is used is OpenGL 1.5 or something. |
21:51:02 | krux02 | it just too much work to use OpenGL the fast way for a pixel game. |
21:51:25 | krux02 | and when you do the slow way (one draw call per object) then it really becomes very slow. |
21:51:55 | krux02 | I had an at least 10 times performance boost when I changed from OpenGL rendering to software rendering on my Laptop. |
21:52:03 | FromDiscord | <exelotl> that's actually one area where I think SDL2 really messed up |
21:52:15 | FromDiscord | <exelotl> they made this lovely simple hardware accelerated 2D rendering API |
21:52:30 | krux02 | yes sdl2 messed it up there |
21:52:33 | FromDiscord | <exelotl> then they forgot to add sprite batching as a thing that you can do, at all |
21:52:49 | krux02 | simply because small sprites in pixel graphics are faster to render in software than the overhed that is produced whet it is rendered on the GPU |
21:53:09 | krux02 | exelotl: I thought the same |
21:53:36 | Abnegation | That depends on the type of particles, and I would say people overestimate a little bit how much work should be put into making opengl work. That being said you most probably want some hardware accelerated graphics in your framework at least. |
21:53:37 | Abnegation | I would be quite skeptical of the framework implementation you're using if it goes faster on software. |
21:54:06 | krux02 | it wasn't a framework it was just tiles rendering with the sdl2 api |
21:54:23 | krux02 | and there you can change software and hardware rendering |
21:54:30 | krux02 | and I really used low resolution |
21:55:17 | krux02 | btw I was always sad with the rendering performance of SDL |
21:55:39 | krux02 | at least on my Linux machines |
21:55:47 | krux02 | but probably I was just using it incorrectly |
21:56:21 | krux02 | before I used SDL1 I used blitzBasic on Windows. And even though it was interpreted, the drawing routines were pretty fast. |
21:56:39 | krux02 | doing a pixel game in that environment was really a great experience. |
21:56:56 | FromDiscord | <exelotl> I think SDL-gpu seems to fix all the gripes I have with 2D in SDL2. I'll use it in my next desktop game project thing for sure. |
21:57:18 | krux02 | everything was just functions and data. No framework, no callbacks, no classes, no inheritance, no complexity |
21:57:52 | krux02 | but I really like the SDL events |
21:58:09 | krux02 | especially in Nim with the events iterator :P |
21:59:16 | FromDiscord | <exelotl> oh is that a thing? I've yet to try it |
21:59:29 | * | yglukhov_ quit (Remote host closed the connection) |
21:59:46 | krux02 | well it is just ``for e in events():`` |
22:00:51 | FromDiscord | <exelotl> ah right |
22:01:20 | FromDiscord | <exelotl> so you still have to do `match e.kind` or whatever |
22:02:14 | krux02 | yes |
22:02:31 | krux02 | but you don't need a while loop |
22:02:52 | FromDiscord | <exelotl> ah that's nice |
22:03:38 | * | leorize quit (Ping timeout: 276 seconds) |
22:05:33 | FromGitter | <kayabaNerve> Araq: Have you seen Elm? |
22:05:45 | Araq | yeah. |
22:05:58 | Araq | https://forum.nim-lang.org/t/4006 |
22:06:07 | dom96 | This is the state of our developer world: https://twitter.com/samccone/status/1014341689253613569 |
22:06:29 | dom96 | Better profile those programs that pack all your Node crap into a single JS file! |
22:10:18 | * | leorize joined #nim |
22:12:52 | Araq | Error: system module needs 'PNimrodNode' |
22:12:52 | Araq | FAILURE |
22:12:52 | Araq | Command exited with code 1 |
22:13:03 | Araq | it's one of those days ... :-/ |
22:25:22 | dom96 | Time for sleep :) |
22:25:31 | krux02 | good night |
22:28:02 | krux02 | today I made an experiment. I plugged in my headphones in the microphone jack and spoke into the headphones. |
22:28:11 | krux02 | the result: it works |
22:28:34 | krux02 | so whenever you need a microphone, you can just use a headphone and speak into it. |
22:36:13 | * | Jesin quit (Quit: Leaving) |
22:38:12 | FromDiscord | <exelotl> amazing |
22:40:53 | * | nasusiro quit (Quit: Quitting for now...) |
23:19:05 | * | Sembei joined #nim |
23:28:19 | shashlick | feedback appreciated: https://github.com/nim-lang/Nim/issues/5626#issuecomment-402571433 |
23:41:58 | * | Sembei quit (Ping timeout: 268 seconds) |
23:48:45 | shashlick | krux02: i used that trick two decades ago on one of my songs, didn't have a microphone back then |
23:49:21 | shashlick | Good memories 😊 |