<< 04-07-2018 >>

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:33FromDiscord<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:23FromGitter<Quelklef> min is one
03:17:46FromGitter<Quelklef> https://min-lang.org/
03:17:49FromGitter<Quelklef> nim is one
03:17:54FromGitter<Quelklef> https://nim-lang.org/
03:17:57FromGitter<Quelklef> There's two!
03:18:08FromGitter<Quelklef> oh you said besides nim, darn
03:21:56FromGitter<honewatson> https://github.com/gokr/spry
03:24:00FromGitter<kayabaNerve> I'm rewriting all my Nim code in min
03:24:38FromGitter<kayabaNerve> I actually want to make a new programming language
03:25:27FromGitter<Quelklef> @kayabaNerve what's it gonna offer?
03:44:51FromGitter<kayabaNerve> @Quelklef It won't
03:44:55FromGitter<kayabaNerve> I want to; not am
03:45:07FromGitter<kayabaNerve> And you know NodeJS?
03:52:04*fjvallarino joined #nim
03:55:41skrylarspry was written in nim
03:55:46skrylari 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:16FromGitter<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:30FromGitter<reisub0> Or I presume it'll have to be done with manually defining a custom format specifier in strformat?
04:11:23FromGitter<gogolxdong> @shalick when you say koch boot for windows is koch.exe boot?
04:11:41FromGitter<gogolxdong> @shashlick
04:12:40FromGitter<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:14FromGitter<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:11FromGitter<Varriount> @reisub0 Unfortunately I don't know of any such modules.
05:35:25FromGitter<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:10FromGitter<seruum> is there a "when" test to determine what type of cpu is being used?
05:38:59FromGitter<reisub0> @Varriount It's fine I made a very hacky thing using osproc to call column :)
05:39:38FromGitter<Varriount> seruum: I believe so. Let me see.
05:40:16FromGitter<Varriount> @seruum What are you working on? I can't remember the last time I needed to branch based on processor.
05:40:48FromGitter<Varriount> @seruum https://github.com/nim-lang/Nim/wiki/Consts-defined-by-the-compiler
05:43:11FromGitter<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:38FromGitter<seruum> @Varriount Looks like maybe "when defined(arm)"
05:45:49FromGitter<Varriount> @seruum Yep, that's the way to do it.
05:46:29*miran_ joined #nim
05:51:58FromGitter<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:47FromGitter<Varriount> @seruum Are you trying to run on bare-metal, or running on an OS?
06:35:35FromGitter<seruum> @Varriount I'm running on OS.
06:52:23FromGitter<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:11FromGitter<alehander42> I imagine for some small changes it can make it ~ instant
06:57:21*skrylar quit (Remote host closed the connection)
07:02:44FromGitter<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:09amosbirdhi, what is the best place to use nim ?
07:04:58FromGitter<Varriount> amosbird: Nim is well suited as a general purpose programming language.
07:05:24amosbirdum, any flagship softwares ?
07:06:29FromGitter<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:36FromGitter<Varriount> amosbird: ^
07:07:42FromGitter<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:14amosbirdhmm, 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:43FromGitter<narimiran> amosbird: there are couple of us using it for math/science stuff
07:23:18*PMunch joined #nim
07:25:10FromGitter<mratsim> I’m sure @kaushalmodi would love https://min-lang.org/
07:26:32FromGitter<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:27FromGitter<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:30FromGitter<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:07FromGitter<Varriount> @mratsim Go has scalability issues? I thought that was it's entire spiel, being scalable?
07:40:02FromGitter<mratsim> Ethereum go implementation is held back by their slow bigint (uint256) that are used everywhere
07:41:09FromGitter<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:36FromGitter<Varriount> Why can't Go use... whatever is used by C++/Nim?
07:42:21FromGitter<mratsim> The most efficient libraries in C++ and Nim uses generics ;)
07:42:37FromGitter<mratsim> generics/static/template compile-time parameter
07:44:43FromGitter<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:21FromGitter<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:30FromGitter<mratsim> uint128*
07:49:09*leorize joined #nim
07:49:28*leorize quit (Client Quit)
07:54:07FromGitter<Grabli66> Hi! How to take difference between two DateTime?
07:56:08FromGitter<mratsim> https://nim-lang.org/docs/times.html#-,Time,Time
07:56:22FromGitter<mratsim> note that the time module was significantly reworked in devel
07:56:38FromGitter<mratsim> (in an probably incompatible way)
07:56:40FromGitter<mratsim> a*
08:00:43FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b3c7eab81816669a42ef3ab]
08:05:41FromGitter<Grabli66> It works only in devel nim? I don't see proc `-` for two DateTime in nim 0.18.
08:08:33FromGitter<Grabli66> Ohhh. I need to install nim from devel branch :)
08:28:54FromGitter<narimiran> @Grabli66 using `choosenim` simplifies this process greatly, and you can easily switch back and forth from stable to devel
08:29:27FromGitter<Grabli66> @narimiran Yes. I already updated nim with choosenim.
08:30:34FromGitter<Grabli66> But i have a strange fillings :) Why i can't divide two int64 with / operator?
08:32:16FromGitter<Grabli66> Ooops. There is `div` operator.
08:32:53*pwntus quit (Ping timeout: 265 seconds)
08:32:55FromGitter<Grabli66> Sorry i am almost noob in nim.
08:41:54*user1101 joined #nim
08:44:41FromGitter<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:14FromGitter<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:41PMunchGrabli66, 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:01dom96Bah, I need to stop reading GitHub notifications
09:05:13dom96Yesterday that's all I did
09:06:21FromGitter<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:48FromGitter<Grabli66> Cool
09:10:15PMunchHmm, dynamic loading is tricky..
09:10:36*ieatnerds joined #nim
09:10:44PMunchHow does the GC work across dll boundries by the way? If I write both the program and plugin in Nim
09:11:04PMunchWill the separate codes have their own GC?
09:11:16Araqno, the GC is in nimrtl.dll and shared
09:11:29Araqand it's covered by tests
09:11:37PMunchAh 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:09PMunchHmm, this is really strange.. I can't call XStringToKeysym in my DLL, it just crashes with read from nil error..
09:20:36PMunchOr rather: SIGSEGV: Illegal storage access. (Attempt to read from nil?)
09:28:00FromGitter<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:17PMunchI 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:00FromGitter<mratsim> is there a way to update a package installed by nimble?
09:47:25FromGitter<mratsim> currently I have to uninstall all packages that depends on it and then reinstall everything which is super painful
09:49:33dom96nimble install pkg@#head
09:50:03dom96or omit the @#head if you just want the latest tagged release
09:51:20dom96Ughhhh, travis, whyyyy
09:51:22*user1101_ joined #nim
09:51:27dom96Why 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:44PMunchAh, that was it. Compiling the DLL with use_pkg_config_static worked
09:54:19Araqdom96, queued?
09:54:29Araquse nimbuild instead :-)
09:56:35FromGitter<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:55dom96why is that a problem?
10:06:05*krux02 joined #nim
10:13:10FromGitter<kaushalmodi> amosbird: Are you the one who I think you are (pinged me on ox-hugo repo a while back)? :) Welcome.
10:13:15dom96Seriously. It's just not running my commit. https://github.com/nim-lang/packages/pull/782
10:17:53FromGitter<Grabli66> Can i turn on "not nil" for all types in my program?
10:20:54amosbirdkaushalmodi: yeah, nice to see you again :)
10:22:46FromGitter<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:35FromGitter<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:03dom96mratsim: specify it in your Nimble file: requires "pkg#head"
10:25:46dom96We will get lock files eventually to properly fix this issue
10:27:15FromGitter<mratsim> This main issue is that there is no simple way to do `nimble update package`
10:31:39FromGitter<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:20amosbirdkaushalmodi: great. I'm also seeking a language to replace all my scripts
10:32:41FromGitter<kaushalmodi> Here's a little toy project/script: https://github.com/kaushalmodi/noxhugo
10:32:45FromGitter<kaushalmodi> :)
10:41:30FromGitter<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:40amosbirdcool!
10:51:24dom96mratsim: please make issues for these things
10:51:53dom96but look through the existing issues, there is likely already an issue for this
10:52:09dom96Feel free to bump it with "I need this **now**" :)
10:53:41FromGitter<kaushalmodi> dom96: Yes, I had requested an update switch for nimble too, a little while back.
10:54:25dom96https://github.com/nim-lang/nimble/issues/169
10:55:24*elrood joined #nim
10:56:36FromGitter<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:18FromGitter<Grabli66> It eats 25% of CPU. Why? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b3cae9d9b82c6701ba17f5d]
11:26:01dom96because you've got an infinite loop that's printing a hell of a lot of "GOOD"
11:26:40dom96although hrm, you've got that sleep in there
11:26:46FromGitter<Grabli66> What's why i added sleepAsync(1000) to sleep for a 1 second on each iteration
11:27:03dom96oh, I know why. Because you've got no sockets operations
11:27:23dom96so the async event loop just busy loops until the sleep timer finishes
11:27:49FromGitter<Grabli66> Great. How i can fix that?
11:28:01dom96perform some socket operations
11:28:18dom96you're creating a really small example, you'd never do that in a real application
11:28:47FromGitter<Grabli66> And if i have no socket operation?
11:28:49dom96if you don't need async sockets then stop using {.async.} and use os.sleep()
11:28:58FromGitter<Grabli66> Ok
11:29:42FromGitter<Grabli66> It works :)
11:43:48FromGitter<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:14YardanicoI didn't encounter any game like that in like 2-3 years
11:46:24*endragor joined #nim
11:46:41FromGitter<mratsim> SolForge and Eternal Card Game are like that
11:48:40FromGitter<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:03FromGitter<Quelklef> @kayabaNerve What's it (theoretically) gonna offer?
11:59:16FromGitter<Quelklef> and no I don't know Node, not really. I know of it
12:00:07FromGitter<tim-st> How can I get the async example working? https://nim-lang.org/docs/httpclient.html#retrieving-a-website
12:00:43FromGitter<tim-st> (with required imports etc)
12:04:57*nc-x joined #nim
12:05:04nc-x@tim-st
12:05:13nc-ximport httpclient
12:05:34nc-xproc abc() {.async.} =
12:05:38nc-x# put code here
12:06:19nc-xI think
12:07:54Yardanicoalso 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:34FromGitter<tim-st> thanks, seems to work, can I add async results in a loop to a list without problems?
12:29:40FromGitter<tim-st> besides sort order
12:30:39Yardanicowell, 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:51FromGitter<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:42FromGitter<Quelklef> ```code paste, see link``` ⏎ ⏎ Ooh, that's smooth [https://gitter.im/nim-lang/Nim?at=5b3cc7ca3c5abf52b63b4464]
13:13:21FromGitter<Yardanico> you can do the same with Nim
13:13:30FromGitter<Yardanico> even simpler :D
13:13:38FromGitter<Quelklef> Nim has assignment expressions?
13:14:09FromGitter<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:08dom96narimiran: why is it accepted then?
13:19:56FromGitter<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:44FromGitter<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:38FromGitter<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:22FromGitter<Quelklef> without a macro, anyway
13:30:11FromGitter<Araq> := works just fine
13:31:17FromGitter<narimiran> @Araq yeah, it works, but it is one of the stupidest additions to python, IM(NSH)O
13:31:27FromGitter<Quelklef> Not so... humble?
13:31:32FromGitter<narimiran> yup
13:31:36FromGitter<Araq> no, it works in Nim.
13:31:53Yardanico@Araq you mean `:=` as operator name?
13:31:57FromGitter<Araq> template `:=`(a, b: untyped): untyped = ⏎ let a = b ⏎ a
13:33:05FromGitter<Quelklef> ....... huh
13:33:10*Vladar quit (Remote host closed the connection)
13:33:40FromGitter<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:44FromGitter<Quelklef> ... it's becoming a `nnkStmtList` without being wrapped by a `nnkBlock` ..?
13:33:47FromGitter<narimiran> `:=` in python will raise so many questions and introduce, otherwise avoidable, bugs
13:34:06FromGitter<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:32FromGitter<Quelklef> @Yardanico Not true, the PEP outlines some efficiency advantages due to encouraging certain coding styles
13:34:59FromGitter<mratsim> `:=` will introduce less bugs than C reuse of `=`
13:35:23FromGitter<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:25FromGitter<Quelklef> I think I'm leaning towards liking the `->` syntax better because then the actual value gets read first
13:36:27FromGitter<Quelklef> compare the above to
13:36:42FromGitter<Quelklef> ```if re.match(regex, text) -> m: ⏎ groups = m.groups()``` [https://gitter.im/nim-lang/Nim?at=5b3ccd699b82c6701ba1d351]
13:36:44FromGitter<Araq> if (let x = re.match(); x.didMatch):
13:37:29FromGitter<Quelklef> @Araq I mean sure, in NIm
13:37:48FromGitter<mratsim> in Rust as well
13:38:18FromGitter<Quelklef> ya but what Nim/Rust can('t) do seems irrelevant to a Python change
13:38:25FromGitter<Araq> := is totally wrong for efficiency. for efficiency you need to weak the stmt/expr split
13:38:40FromGitter<Araq> not introduce more special cases for exprs.
13:39:11FromGitter<Araq> but thb I don't expect any kind of decent analysis in Python-land.
13:39:37FromGitter<mratsim> if people care about efficiency they wouldn’t use Python.
13:39:38FromGitter<Quelklef> ouch
13:39:53FromGitter<narimiran> @Quelklef your example with `->` could be implemented with the current `as`
13:39:56FromGitter<Quelklef> oops ouch @ araq not mratsim
13:40:03FromGitter<Araq> they still think you cannot have multiline lambdas in an indentation based language, after all...
13:40:36FromGitter<narimiran> like you have `with open('myfile') as f:`, you could analogously have `re.match(regex, text) as m`
13:40:36FromGitter<Quelklef> IIRC, Guido has stated that he knows multiline lambdas are possible but feels it's Unpythonic
13:41:25FromGitter<Quelklef> @narimiran `with re.match(regex, test) as m:`?
13:42:15FromGitter<mratsim> `:=` is unpythonic as it gets ;)
13:43:13FromGitter<narimiran> ```if re.match(regex, text) as m: ⏎ groups = m.groups()``` [https://gitter.im/nim-lang/Nim?at=5b3ccef1e534eb69a5c77c8e]
13:43:14FromGitter<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:33FromGitter<Quelklef> syntax error on 3.6.3
13:43:38FromGitter<narimiran> of course it is syntax error, just as using `:=`should be :D
13:43:50FromGitter<Quelklef> Wait, are you talking hypothetically
13:43:59FromGitter<narimiran> i'm just saying that would be more readable than the `:=`
13:44:07FromGitter<Quelklef> Oh. Yeah, I totally agree
13:46:24FromGitter<Araq> yup
13:46:32FromGitter<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:03AbnegationI'll try to learn nim for a third time.
14:00:57FromGitter<Quelklef> Abnegation: Do it! Nim is fantastic! Good luck!
14:01:04FromGitter<Quelklef> we're here if you need us!
14:03:04*ieatnerds quit (Quit: Lost terminal)
14:04:35AbnegationI 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:01FromGitter<Quelklef> Yeah I also found it overwhelming at first
14:05:09Abnegationmain 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:58FromGitter<Quelklef> ah if you were trying to replace an existing project from the get-go i can see the difficulty
14:06:00Abnegationby low I mean, I'm the kind of person that has to check over assembler its compilation code.
14:06:06Abnegation:P
14:06:13FromGitter<Quelklef> oh my
14:06:19*leorize joined #nim
14:07:30AbnegationI'm particularly interested in arraymancer
14:07:50*PMunch quit (Quit: Leaving)
14:08:36FromGitter<Quelklef> oh I hadn't seen that yet
14:08:58FromGitter<narimiran> Abnegation: @mratsim is very helpful!! don't hesitate to ask him if/when you don't understand something arraymancer-related
14:09:06FromGitter<Quelklef> haha this is bringing me back to when I tried to learn J
14:09:56FromGitter<narimiran> btw, i've learnt nim by trying to replace things i've done in python
14:10:14YardanicoI did that too
14:10:22FromGitter<Vindaar> same here :)
14:10:24FromGitter<Quelklef> i found nim looking for a "typed python"
14:10:28Yardanicoreimplemented a bot for social network in Nim
14:10:44Yardanico(i learned a lot from it, even macros and temlates)
14:10:47Yardanico*templates
14:11:02FromGitter<Quelklef> really?
14:11:06Yardanicoyes
14:11:12FromGitter<Quelklef> Huh. That's kinda surprising. Cool tho
14:11:23Yardanicoof course that's a bit too high-level, but still
14:11:41Yardanico(I mean a bot for social network is a bit too high-level)
14:12:44FromGitter<Quelklef> man the Nim AST continues to surprise me
14:13:14FromGitter<Quelklef> `import a as b` is `importStmt(infix(ident("as"), ident("a"), ident("b")))`
14:13:48FromGitter<Quelklef> that is, it's represented as an "infix", which is the same thing as an infix call `@[1] & @[2]`
14:14:28FromGitter<Quelklef> is this kind of thing typical? I'd have expected it be something like `importStmt(module_name, module_alias)`
14:14:47FromGitter<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:48Abnegationone 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:27FromGitter<Quelklef> What do you mean total control, exactly?
14:19:38FromGitter<Quelklef> i.e. you know 100% what's happening at every step?
14:22:15Abnegationhmno, 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:33Abnegationsomething that happened with python this week
14:22:50AbnegationI'm implementing a CNN in tensorflow
14:23:08*geocar quit (Quit: Connection closed for inactivity)
14:23:36Abnegationat some point I had to do an operation over 20k numbers, I knew what operation was specifically.
14:23:39AbnegationI know which data I had
14:23:46Abnegationbut there were so many layers of abstraction that it simply was not possible to do it in a performant manner.
14:24:42Abnegationme -> python -> tensorflow -> eigen -> cuda -> [my data]
14:24:42Abnegationit got to a point where something really easy became extremely cumbersome, I didn't even knew what to do.
14:25:49FromGitter<Quelklef> ah gee
14:26:25FromGitter<Quelklef> do these things not expose any way for you to handle data directly??
14:27:52Abnegationto 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:20AbnegationAnyway, I'll try nim again. I hope this time I can break through.
14:30:00FromGitter<Quelklef> yeah
14:30:20FromGitter<Quelklef> that doesn't really sound like something that can be totally solved with language design tho
14:30:24FromGitter<Quelklef> so hopefully arraymancer is nicer =)
14:30:48*SenasOzys joined #nim
14:31:14FromGitter<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:55FromGitter<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:56Abnegationit 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:44Abnegationoh wait, I'm talking with the developer :U
14:35:51FromGitter<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:04FromGitter<Quelklef> yeah, I've found that my Nim code magically tends to be less confusing than that in other languages
14:36:10FromGitter<mratsim> https://github.com/mratsim/Arraymancer/blob/master/src/tensor/private/incl_kernels_cuda.nim#L55
14:36:12FromGitter<Quelklef> but still can't 100% it
14:36:51*leorize quit (Ping timeout: 240 seconds)
14:37:03FromGitter<mratsim> I can’t wait to be able to use loop fusion in Arraymancer though: https://github.com/numforge/loop-fusion
14:37:57Abnegationwhat is this?
14:38:56FromGitter<mratsim> for loop on a variadic number of containers
14:39:22FromGitter<mratsim> it avoids lots of temporaries if you want to do a + b * c * sin(d) for example
14:40:01FromGitter<mratsim> obviously parallelized via OpenMP ;)
14:41:08FromGitter<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:37AbnegationI'll probably need to fully understand nim sintax before understanding this in full.
14:46:02FromGitter<mratsim> I tend to create new syntax while coding in Nim :P
14:46:15Yardanicoactually nim has pretty simple syntax (I would say)
14:46:27Yardanicoeven some things like "%" are called "mod" in nim for readability
14:47:40FromGitter<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:10FromGitter<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:01CodeVanceQuelklef 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:13CodeVancemratsim, i like := I think its pythonic.
16:11:30FromGitter<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:57FromGitter<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:39FromGitter<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:53CodeVanceit is an infix inside a import
16:13:14CodeVancethe import logic only has to check if its an infix or a ident
16:13:42CodeVanceidentdefs are used for type decleration, parameters, var statements
16:13:51CodeVanceidentdefs name: type = value
16:13:56FromGitter<Quelklef> nono i get that
16:14:04FromGitter<Quelklef> ok, better question
16:14:21FromGitter<Quelklef> why NOT instead have the `as` aliasing be a part of `importStmt`
16:14:29FromGitter<Quelklef> I suppose it would make parsing more complicated
16:14:49CodeVanceif it wasn't an infix it would be a command statement
16:14:57FromGitter<Quelklef> ??
16:15:05FromGitter<Quelklef> I don't think we're communicating well, lol
16:15:20CodeVanceif you want to reverse the import to render it then you need to know in what format it was given
16:15:48CodeVanceimportStmt(infix(as, bla, bla)) == import bla as bla
16:15:55CodeVancebla from bla
16:16:00CodeVancebla expect bla
16:16:17FromGitter<Quelklef> ok
16:16:21FromGitter<Quelklef> compared to
16:16:32CodeVancethe from infix won't work though
16:16:33FromGitter<Quelklef> let's use the use-case `import macros as m`
16:16:52FromGitter<Quelklef> ill call my hypothetical node `importStmt2`
16:16:58CodeVanceimportstmtas(module,folder)
16:17:04FromGitter<Quelklef> ?
16:17:22CodeVanceimportstmtalias(macros, m)
16:17:34CodeVancethen you'd have to have AST for all the variations
16:17:42FromGitter<Quelklef> No
16:17:44FromGitter<Quelklef> just one
16:17:51FromGitter<Quelklef> if no alias, m is an emptyNode
16:18:59CodeVanceyou can also do this in nim `import nimgame2/[nimgame, types, renderer]
16:20:04FromGitter<Quelklef> then make importStmt be importStmt(module, alias, sublist)
16:20:06CodeVancethe AST is actually generated as follows `nnkImportStmt.newTree(nnkInfix.newTree("as".ident, "module".ident, "alias".ident))`
16:20:16FromGitter<Quelklef> Yeah I know
16:20:40CodeVanceyou can . make a proc
16:20:54CodeVancenewImportStmt(module, alias):NimNode=
16:21:22FromGitter<Quelklef> I... What would that do
16:21:36FromGitter<Quelklef> we're talking about keeping the syntax the same and changing the ASt
16:21:42FromGitter<Quelklef> making a macro would not do that
16:22:14FromGitter<Quelklef> hahaha over here talking about nim, I went back to a Python project, and promptly wrote `proc`
16:22:36CodeVanceI don't see the harm of having the infix defined explicitly
16:22:48FromGitter<Quelklef> It's just kinda weird to me
16:23:19FromGitter<Quelklef> I can't point to any direct hindrances it causes, and I'm not trying to
16:23:22CodeVanceI think its more changable
16:23:27FromGitter<Quelklef> huh
16:23:48FromGitter<Quelklef> in my eyes it's less flexible because the AST becomes more about the syntax than the represented semantics
16:24:00CodeVanceIts more flexable
16:24:16FromGitter<Quelklef> thanks for the assertion
16:24:26CodeVanceI'm debating the value of it
16:24:30FromGitter<krux02> how would you want the import ast?
16:24:43CodeVanceI can see that it would be nicer to have the infix automatically inserted and taken out
16:25:22FromGitter<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:41FromGitter<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:01CodeVanceFor macros I think the current way is most flexable. Remember that the compiler probably parses the statement into something like you mentioned.
16:26:25CodeVancethere's nnkBla `macros.nim` and nkBla `internal/compiler`
16:27:30CodeVancequelklef its my hope that you can do the following in future nim versions `import nimgame/[nimgame,draw as drawmodule]
16:28:06FromGitter<krux02> why is the import statement so important?
16:28:13CodeVanceisn't isnot an infix too?
16:28:14FromGitter<Quelklef> It's not, it's just for example
16:28:17FromGitter<krux02> you type it litterally once and then stop dealing with it
16:28:20FromGitter<Quelklef> @krux02
16:28:22CodeVanceI thought it was a simple template
16:29:14FromGitter<krux02> to be honest I am happy with the java import statement.
16:29:52FromGitter<krux02> well ok that one is bad because without IDE it's actually horrible
16:29:52FromGitter<Quelklef> hahaha you are an appreciative person
16:30:05FromGitter<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:45FromGitter<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:35dom96I wouldn't :P
17:25:05FromGitter<Araq> the AST reflecting the syntax is an advantage and when the AST derivates from the syntax it becomes much more arbitrary
17:25:59FromGitter<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:47FromGitter<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:00FromGitter<Quelklef> Besides easier parsing
17:45:05*find0x90 joined #nim
17:46:00FromGitter<Quelklef> I looked at nnkProcDef. What makes it particularly bad?
17:47:19FromGitter<Araq> magic numbers.
17:47:45FromGitter<Araq> name is at position 0 then params is at 1, ah no because there can be a pattern,
17:48:13FromGitter<Quelklef> ah
17:48:15FromGitter<Araq> so pattern is 1, parameters is 2, return type is part of parameters, but pragmas are at 3
17:48:24FromGitter<Araq> and then body is at 4.
17:48:30FromGitter<Araq> and I probably got it wrong :P
17:48:33FromGitter<Quelklef> Isn't it similar for other things?
17:48:45FromGitter<Quelklef> there's one im thinking of, gimme a se
17:48:51FromGitter<Araq> it's the same for all "routines" (iterators, methods, etc)
17:48:58*yglukhov[i] quit (Ping timeout: 264 seconds)
17:49:02FromGitter<Araq> so it's not that bad. but still.
17:49:56FromGitter<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:02FromGitter<Quelklef> or a similar form
17:50:32FromGitter<Araq> see. and yet you want the same mess for nnkImportStmt.
17:50:35FromGitter<Quelklef> But I suppose type is not nearly as arcane as patterns
17:50:41FromGitter<Quelklef> ahhhhhhh
17:51:30FromGitter<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:34FromGitter<Quelklef> but I see what you mean
17:51:52FromGitter<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:53FromGitter<Quelklef> ?
17:53:05FromGitter<Araq> a property based AST sounds like repeating HTML's mistake.
17:53:25FromGitter<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:47FromGitter<Araq> with all the downsides that it brings for recursive traversal.
17:53:58FromGitter<Quelklef> yeah, but there would be no child nodes. just properties that are lists of nodes
17:54:02*find0x90_ joined #nim
17:55:15FromGitter<Araq> that only means you transform n[i] to n.kids[i] and the downsides remain.
17:56:11FromGitter<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:32FromGitter<Araq> well we have accessors for that.
17:57:07FromGitter<Quelklef> What do you mean?
17:57:23FromGitter<Quelklef> Also, real quick, is "having the AST similar ... and vice-versa" from above an accurate understanding?
17:57:29FromGitter<Araq> proc macros.name # retrieve the name of a nnkProcDef
17:57:46FromGitter<Araq> sure.
17:59:04FromGitter<Quelklef> but the issue you pointed out is in creation as well as retrieval
17:59:12FromGitter<Quelklef> oh I guess there's probably a `.name=` as well
18:00:19FromGitter<Quelklef> hm, but .name is an exception because it applies to all nodes
18:01:35FromGitter<Araq> it was just an example.
18:02:10FromGitter<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:36FromGitter<Araq> and that's exactly what Nim does.
18:02:58FromGitter<Quelklef> But within that you're usually looking for specific contexts/patterns, right?
18:03:08FromGitter<Quelklef> Wait. "properties can be layered on top of it" can you elaborate a little
18:03:23FromGitter<Araq> as I said, accessors like getPragmas
18:03:57*cryptocat1094 joined #nim
18:04:04FromGitter<Quelklef> and `.name=`? (getPragmas is not showing up in the stdlib)
18:04:23FromGitter<Araq> in macros it's called `pragmas=` iirc
18:04:31FromGitter<Araq> and `pragmas`
18:04:45FromGitter<Araq> but why does it matter. I'm talking about the concept.
18:05:26FromGitter<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:30FromGitter<Quelklef> OK I see `pragma` and `pragma=`
18:06:40FromGitter<krux02> well yea that is an issue, but the magic numbers can't go away either.
18:06:52FromGitter<Araq> Nim's AST is inspired by Lisp, Lisp has no "property" based AST either.
18:06:56FromGitter<Quelklef> But I don't quite understand how this is "layering" in a sense; it's just setting a positional attribute
18:08:00FromGitter<Quelklef> That's true, but Lisp is also dynamically typed and all that jazz
18:08:06FromGitter<Araq> (this is a (tree) (from a more civilized age))
18:08:23FromGitter<krux02> I mean there are templates to access indexed members by name
18:08:33*leorize quit (Ping timeout: 248 seconds)
18:08:34FromGitter<Araq> <html this"is">a pretty crappy</tree>
18:09:45FromGitter<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:00FromGitter<Quelklef> @krux02 true, but in general in macros the ast seems to be created lisp-style
18:10:05FromGitter<Araq> not the point.
18:10:34FromGitter<Araq> HTML is the property based tree you argue for and harder to work with. ymmv.
18:10:54FromGitter<Quelklef> Well, not quite
18:11:44*fjvallarino quit (Remote host closed the connection)
18:11:52*fjvallarino joined #nim
18:12:01FromGitter<Quelklef> In HTML, the children of tags are almost always allowed to be "more content"
18:12:22FromGitter<krux02> what do you think about. ``procNode[propName]`` where propName is a predefined enum
18:13:04FromGitter<krux02> I don't really like the templates, because they are, yea. I don't know I avoid them
18:13:11FromGitter<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:09FromGitter<Quelklef> @krux02, depends on the scope. Does propName include node-specific stuff, or node-insensitive properties
18:14:40FromGitter<Quelklef> i.e. `someProcDef[formalParams]` would be cool
18:15:32FromGitter<krux02> @Quelklef well I would like it, too.
18:15:40*ipjk quit (Quit: Leaving)
18:15:55FromGitter<Quelklef> What are your thoughts on what Araq has said, then?
18:16:29FromGitter<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:27FromGitter<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:51FromGitter<Quelklef> Sure, can you help me understand that, then?
18:18:59FromGitter<Quelklef> There are two parts there, the iteration and the properties
18:19:00FromGitter<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:09FromGitter<krux02> at the moment I can only match on position.
18:19:23FromGitter<Quelklef> I haven't seen the pattern matcher
18:19:36FromGitter<krux02> So I need a property system that is in some form instrospectable also from my pattern matching macros.
18:19:52FromGitter<krux02> the templates to access the members of the Nodes don't really do it.
18:20:19FromGitter<krux02> https://github.com/krux02/ast-pattern-matching
18:20:57FromGitter<Quelklef> Ah, that's cool!
18:21:18FromGitter<Quelklef> But wait
18:21:27FromGitter<Quelklef> I want to understand the statement from Araq from before
18:21:39FromGitter<Quelklef> I don't know what "properties can be layered on top of it" means exactl
18:23:14FromGitter<krux02> it means exactly that you can implement ``someProcDef[formalParams] = whatever`` just by overloading the `[]=` operator with the right types
18:23:45FromGitter<krux02> the `[]=` operator would then use the positions internally.
18:23:58FromGitter<krux02> so you have properties layered on top of positions.
18:24:13FromGitter<Quelklef> ohhh shit
18:24:19FromGitter<Quelklef> I totally misunderstood what "properties" meant
18:24:35FromGitter<krux02> np
18:24:45FromGitter<Quelklef> Ok, then the other one is iteration
18:25:00*find0x90_ quit (Quit: find0x90_)
18:25:29FromGitter<Quelklef> As we look over the AST, we're never going to be doing position-based manipulation, right?
18:25:29FromGitter<krux02> what do you mean?
18:25:49*leorize joined #nim
18:26:05FromGitter<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:19FromGitter<Quelklef> I'm *assuming*. I don't write compilers. Correct me if I'm wrong
18:26:23FromGitter<krux02> we are doing position based manipulation. nnkSomeKind.newTree(a,b,c,d) a tree is created position based.
18:26:27FromGitter<Quelklef> right
18:26:44*find0x90 joined #nim
18:26:46FromGitter<krux02> the order of a,b,c,d does matter
18:26:58FromGitter<krux02> most of the tree is created position based
18:27:03FromGitter<Quelklef> right no i got that
18:27:15*nsf quit (Quit: WeeChat 2.1)
18:27:19FromGitter<Quelklef> just what exactly is meant by "positions are superior because you can iterate over the whole AST pretty easily"
18:27:34FromGitter<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:50FromGitter<krux02> those are sparse nodes if you want to call it that way.
18:27:55FromGitter<Quelklef> sure
18:29:44FromGitter<Quelklef> but still, what's meant by the above
18:33:09FromGitter<krux02> ah that one. yea just look at pretty printers
18:33:18FromGitter<krux02> like the treeRepr
18:33:34FromGitter<krux02> @Quelklef you can just write a recursive function
18:33:44FromGitter<krux02> and iterate over all children
18:35:35FromGitter<Quelklef> hmmm
18:36:42FromGitter<Quelklef> you could iterate over properties, but I can see how it would be more complicated
18:37:36FromGitter<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:13FromGitter<krux02> well from the position you can infer the property tag
18:39:22*HYP3RBOR3A quit (Remote host closed the connection)
18:39:39FromGitter<Quelklef> yeah, the two formulations are kinda equivalent at some level
18:40:02*mitai joined #nim
18:40:11FromGitter<krux02> not equivalent
18:40:52FromGitter<Quelklef> i mean in the sense that they could wrap each other and provide identical functionality
18:43:24FromGitter<krux02> yea but the overhead in implementing and how it is stored on the computer is significant
18:44:41FromGitter<Quelklef> I wonder if you could abstract a near-zero attributes-based API on top of positions
18:44:49FromGitter<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:03CodeVanceconcepts
19:37:18CodeVanceI was thinking of making a concepts interface for macros.nim
19:53:12FromGitter<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:44FromGitter<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:52FromGitter<krux02> but here the semchecker can simply remove the static[T]
19:58:55FromGitter<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:46FromGitter<krux02> well the static[string] is still there.
19:59:50FromGitter<krux02> I don't know
20:02:39CodeVanceHow to build the docs from source?
20:02:57*miran_ is now known as miran
20:03:32mirannim doc myfile.nim
20:03:32YardanicoCodeVance, ./koch web
20:03:38Yardanicoah, for your file
20:04:02CodeVanceNo the nim-lang
20:04:08CodeVancekoch web makes rst
20:04:11CodeVanceI want html
20:04:30Yardanicowell ./koch web makes everything
20:04:33CodeVancenvm I see it working now
20:04:35Yardanicoand .html versions too
20:04:36CodeVanceThanks
20:04:40CodeVanceXD
20:04:49CodeVance+1 +1
20:06:52*PMunch joined #nim
20:07:42CodeVanceI want to change the documentation output html
20:08:56CodeVanceoh I see it goes to web folder
20:09:09CodeVanceweb/0.18.1
20:11:26shashlickaraq: 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:25Araqshashlick, legacy, let's change it
20:15:43Araqbut what would the output be? nothing but return code 0 ?
20:16:52Araqkrux02: IMO generics should be replaced by macros and I have some vaporware ideas of how to do that
20:17:02Araqbut it's beyond our v1 goals.
20:20:26ldleworkoh jesus christ
20:21:20Yardanicohow would that work? 0_0
20:21:35Yardanicoproc myproc(a: T) {.generic: T.} ? :D
20:21:53CodeVancegenerics are fancy macros
20:22:00CodeVancearen't they
20:22:18ldlework"things a compiler does" = "macros"
20:22:19CodeVancegeneric T:proc myproc(a:T)
20:22:46CodeVance"saves typing" = macros
20:24:13shashlickaraq: i'll change tissue to add the action: run by default
20:25:06krux02Araq: how about replacing the type system entirely by macros
20:25:23Araqshashlick, no please, patch testament instead
20:25:27Araqit comes up again and again.
20:25:40Araqand that's always an indication it's wrong.
20:25:56Araqkrux02, yup. :-)
20:26:12AraqYardanico, not the way you outline.
20:26:48nasusiroAraq, 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:43FromGitter<Varriount> Araq: Regarding that pegs.nim PR, the new functionality seems more suited for a tokenizer/lexer, rather than an AST parser.
20:28:18Yardaniconasusiro, nim.cfg
20:28:29Yardanicoor in filename.nims
20:28:32nasusiroYardanico: that's not what I asked
20:28:38Yardanicowhat do you want then?
20:28:39FromGitter<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:47Yardanicoyou want autosave?
20:28:55Yardanicoi don't really see any advantages in that
20:29:57nasusiroYardanico: 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:34cryptocat1094Generics -> Templates -> Macros?
20:30:41nasusiroinstead 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:50CodeVancenasusiro. Open the file then save the values?
20:31:00Yardaniconasusiro, just copy+paste this into nim.cfg
20:31:01Yardanicodone
20:31:15*yglukhov[i] quit (Remote host closed the connection)
20:31:19Yardanico(without `nim` and filename of course)
20:31:35nasusiroYardanico: I haven't used nim.cfg before. Can you provide an example?
20:31:52nasusiroshould I copy my existing /etc/nim.cfg or just a new one?
20:31:55Yardaniconasusiro, just write your flags in nim.cfg and place it in the same folder as your .nim file
20:32:00Yardanicoor in the place in PATH
20:32:11CodeVancenim/cfg/nim.cfg for global cfg
20:32:20dom96echo "-o:bin/foo --threads:on --any-flag-you-can-imagine:a-value-here" > nim.cfg
20:32:46nasusirodom96: oh that's much better. should I place it in my project's root or under src sub-directory?
20:32:53shashlickaraq: okay, i'll set action: run as default, and add an action: norun as an option for those that don't specify
20:32:58dom96(actually, might need to replace spaces with newlines)
20:33:09dom96nasusiro: wherever your source code is
20:33:19dom96`nim.cfg` will apply to all your source code
20:33:20nasusirodom96: yeah, newlines will be better
20:33:24nasusiroawesome
20:33:29dom96`file.nim.cfg` will only apply to `file.nim`
20:33:49nasusirodom96: so file.nim.cfg and file.nims are synonymous in this case?
20:34:01dom96sorta
20:34:12dom96.nims is nimscript
20:34:19nasusiroyeah, I meant behavior-speaking
20:35:46*lompik quit (Ping timeout: 264 seconds)
20:35:49Yardanicodom96, .cfg support newlines :)
20:35:54Yardanicosupports*
20:36:05dom96Yardanico: I know?
20:36:10YardanicoI mean you can type without them
20:36:34dom96You mean you don't need newlines? but can use spaces?
20:36:50Yardanicoyeah, you can use spaces in .cfg
20:38:34nasusirodom96: is it possible to have nim.cfg and make it run successfully with some kind of tweaks?
20:38:51nasusiro*to have it in project's root directory
20:39:08dom96Don't think so
20:39:41*miran quit (Ping timeout: 276 seconds)
20:40:29nasusirobummer...
20:40:59Yardaniconasusiro, usually you would use nimble-compliant project structure anyway
20:41:28nasusiroI'm still learning, so I don't yet know what nimble is all about.
20:42:34Araqshashlick, yeah please. thank you!
20:42:40Yardanicoit's a package manager for Nim
20:42:49Yardanico(not the only one actually)
20:45:32nasusiroYardanico: nice. slowly-slowly and I will feel right at home with Nim
20:46:39*mitai joined #nim
20:47:49AraqYardanico, huh? not the only one?
20:48:10YardanicoAraq, what about https://github.com/Araq/nawabs ? :P
20:50:18Araqthat's not a package manager :P
20:50:32*cryptocat1094 quit (Quit: later)
20:50:38Araqand doesn't compile anymore, sadly.
20:50:45*icebattle joined #nim
20:50:48Araqbut not hard to revive.
20:51:01*PMunch quit (Quit: leaving)
20:51:19Araqanyhow, 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:43Araqand 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:29nasusiroAraq: 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:46FromGitter<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:57FromGitter<kayabaNerve> Middleware: The Language
21:04:15FromGitter<kayabaNerve> Made for Microservices, APIs, Web Servers...
21:05:48CodeVancemiddleware isn't a language righT?
21:06:05FromGitter<kayabaNerve> Directly connecting a HTML thingy to an SQL database? ⏎ ⏎ IDK. Something.
21:06:24YardanicoCodeVance, it's not
21:06:32FromGitter<kayabaNerve> No. It's a thing. Like classes. I'm saying I want to make a language BUILT to be middleware.
21:06:59FromGitter<kayabaNerve> The whole language designed for it.
21:07:11CodeVancedsl?
21:07:26nasusirothat's what is known as Intermediate Representation, IR for short
21:07:26CodeVancebuild for performance?
21:07:31FromGitter<kayabaNerve> No, I have cable internet at this point. Who doesn't?
21:07:50FromGitter<Quelklef> DSL --> domain-specific language
21:08:07FromGitter<Quelklef> but, why
21:08:13Yardanicomiddleware is not a language neither a IR
21:08:32Yardanicomiddleware it's just a layer of software
21:08:38Yardanicohttps://en.wikipedia.org/wiki/Middleware
21:08:57*dom96 is still wondering how to best implement middleware for Jester
21:09:23FromGitter<krux02> @kayabaNerve well Nim is definitively a language that you can use to built middleware
21:09:39FromGitter<krux02> mut to be honest I don't know what you really want.
21:09:40FromGitter<kayabaNerve> That's not the whole point of this lol
21:09:55Araqdom96, you add a bunch of proc vars that can be overriden
21:10:04FromGitter<krux02> and also middleware is kind of a loose term
21:10:07YardanicoAraq, what if there's more than one middleware?
21:10:14FromGitter<krux02> it sits in the middle, of what? can be anything
21:10:20dom96It all adds cruft and slow-downs :(
21:10:38dom96I'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:53dom96so the tech empower benchmarks require it and I have to pollute httpbeast with this crap
21:10:57FromGitter<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:03nasusiroYardanico: 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:17FromGitter<kayabaNerve> dom96: Seq of procs? Clean? Simple? A pain but a way?
21:11:32FromGitter<kayabaNerve> *Express as in the NodeJS lib but really just any web server....
21:11:39AraqYardanico, ok ok, a seq of proc vars then.
21:11:54FromGitter<kayabaNerve> I just said that :(
21:11:54*yglukhov[i] joined #nim
21:11:55dom96In fact, I already have a seq of procs for Jester IIRC
21:12:00FromGitter<kayabaNerve> Araq stole my idea
21:12:16dom96Maybe I already have middleware support and don't even know it :P
21:12:22FromGitter<kayabaNerve> I think we're evolving past writing libs and programs. Now we're connecting existing pieces...
21:12:41Araqdom96, if you do it right it doesn't slow it down much
21:12:56Araqit's just another easy to predict branch
21:13:03FromGitter<kayabaNerve> Not actually making this language ofc. Just commenting if I made a language...
21:13:06Araqthat is, if you don't attach any middleware :P
21:13:12dom96Jester slows down by more than 50% in my tests so far
21:13:32FromGitter<kayabaNerve> dom96: Look at Express for usage inspiration. Just saying. Express does it really nicely
21:13:35dom96and as far as I can tell it's because of the extra async calls
21:14:10FromGitter<kayabaNerve> The entire thing is middleware. It has GET/POST functions to declare routes. They just make freaking middleware for you..
21:14:56Araqshhhht, don't tell anybody that every protocol automatically supports "middleware"
21:15:25dom96Yeah, I think middleware is in Jester
21:15:25dom96yay
21:15:26FromGitter<kayabaNerve> var in, out ⏎ for i in middleware ⏎ ....middleware(in, out)
21:15:34Araqit's the nature of message passing that you can introduce a node in between
21:15:39FromGitter<kayabaNerve> ... That's all Middleware is.
21:15:51krux02People 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:13FromGitter<kayabaNerve> That's why I want to build a language built around message passing and intermediaries... I won't though. Just commenting.
21:16:38krux02minus 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:49FromGitter<kayabaNerve> It'd best be used with C++ or Nim. Built the services in Nim as independent apps. Connect with my thingy.
21:17:03FromGitter<kayabaNerve> krux02: Do you use MySQL?
21:17:11Araqkrux02, why do I need to think of CSS now... :P
21:17:13krux02kayabaNerve: have you ever heared about linux pipes?
21:17:25FromGitter<kayabaNerve> Yeah.
21:17:32FromGitter<kayabaNerve> They're amazing.
21:17:44krux02kayabaNerve: No I don't, but that is because I don't collect user data.
21:18:11FromGitter<kayabaNerve> It's illogical to rewrite every single thing is my point
21:18:50FromGitter<kayabaNerve> MySQL is likely to be better than any DB you can build. It'd take a while to build anything close.
21:19:29krux02when I look at SQL tables, it doesn't look very different than several csv files + a query language
21:19:45FromGitter<kayabaNerve> Plus several optimizations and a binary format?
21:20:03FromGitter<kayabaNerve> Plus mass usage and a bugless query language?
21:20:10Araqyeah, don't reinvent DBs badly.
21:20:16AraqDBs 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:36krux02are you sure about bugless?
21:20:37Araq(and compilers do too)
21:20:41AbnegationPeople 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:42Abnegationsuper complex by then
21:20:43AbnegationI feel that's the status now, except people don't realize they need to delete half of their code. :P
21:21:54FromGitter<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:04krux02isn't mongodb the hip thing people use today?
21:22:13AbnegationPeople 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:20FromGitter<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:37Abnegation"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:51FromGitter<kayabaNerve> In the case of keys, you can't mess up at all.
21:23:10FromGitter<kayabaNerve> Or most cryptographic encryption/operations
21:23:17FromGitter<kayabaNerve> Especially when bundled with money
21:23:23FromGitter<kayabaNerve> In a system you can't control
21:23:24FromGitter<kayabaNerve> Etc etc
21:23:30krux02super rocket surgery physicists... are not necessarily good programmers
21:23:40FromGitter<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:04FromGitter<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:07krux02especially scientists often don't really care for performance. They need the program often only once
21:24:13dom96When you think about it from the perspective of engineering, taking off-the-shelf components makes sense.
21:24:32FromGitter<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:01Araqyou're all right. there are systems that definitely should be used instead of reinvented badly.
21:25:02FromGitter<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:11Araqand there are systems that don't add much value.
21:25:11dom96It's all about balance, Apple might reinvent the touch screen, but they won't reinvent the wifi antenna inside their iPhones
21:25:18Araqand systems that add negative value.
21:25:50FromGitter<kayabaNerve> dom96: First we removed the headphone jack. Now there's no 802.11 WiFi antenna.
21:25:58FromGitter<kayabaNerve> Smaller. Slimmer. Twice the price.
21:26:02Araqand CSS needs to be reinvented. quickly.
21:26:06Araq:-)
21:26:21krux02the web needs to be reinvented
21:26:26krux02irc needs to be reinvented
21:26:30krux02the problem is the people
21:26:32AbnegationThere are two reasons as to why you need to rewrite stuff:
21:26:32Abnegation1)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:33Abnegation2)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:40FromGitter<kayabaNerve> Not this god damn IRC debate again
21:26:43dom96kayabaNerve: Perfect.
21:26:55krux02just because there is something better. The old is still there and often it just results in a community split.
21:27:10FromGitter<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:14dom96kayabaNerve: Can't wait to buy a $100 dongle to connect my phone to Ethernet
21:27:21FromGitter<kayabaNerve> I won't comment on XMPP but what about Matrix?
21:27:40YardanicoLet's not start this debate as you said :)
21:27:40krux02I want a world where it doesn't matter in what language a library has been written.
21:27:44Yardanicothat's more for #nim-offtopic
21:27:52FromGitter<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:03FromGitter<kayabaNerve> krux02: That's why microservices exist.
21:28:23FromGitter<kayabaNerve> MySQL is language independent *ignoring the query language it uses for an API
21:28:26Yardanicohttp://3wifi.stascorp.com/stat
21:28:30Yardanicooh sorry, wrong window
21:28:32krux02microservices isn't that this thing that adds network latency to library calls?
21:28:45AbnegationAlso, 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:48FromGitter<kayabaNerve> Well tbh MySQL isn't micro
21:28:49AraqLOL
21:29:17Araq"microservices isn't that this thing that adds network latency to library calls?" hilarious
21:29:33FromGitter<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:50FromGitter<kayabaNerve> Also, they're generally on a local system. People already use MySQL. People used scripted languages.
21:29:57FromGitter<kayabaNerve> People already use web APIs.
21:29:58AbnegationYou know, I always thought that but I needed someone to articulate it for me.
21:30:36FromGitter<kayabaNerve> And compartmentalization is a balance. There has to be not too much or too little.
21:31:00FromGitter<kayabaNerve> And this language would need a standard lib that isn't independent services but either callable compiled or optimized script
21:31:05FromGitter<kayabaNerve> But anyways
21:31:23FromGitter<kayabaNerve> Araq: This channel used to be for something... I want to say... Min? https://min-lang.org
21:31:28FromGitter<kayabaNerve> Something like that
21:33:42dom96TIL you can start discussions with teams on GitHub https://github.com/orgs/nim-lang/teams/core
21:34:28FromGitter<kayabaNerve> dom96: Should I use Nim for a web server?
21:34:31FromGitter<kayabaNerve> Actual question
21:34:54FromGitter<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:04krux02kayabaNerve: That is not the question that dom96 can caltually answer
21:35:33FromGitter<kayabaNerve> Doesn't he work on these?
21:35:41krux02yes he does
21:35:45dom96I can't?
21:35:52dom96Too bad
21:35:55FromGitter<kayabaNerve> So...
21:36:03dom96Sorry kayabaNerve, I can't answer the question :(
21:36:04FromGitter<kayabaNerve> I'm not asking for a completely UNBIASED opinion
21:36:10FromGitter<kayabaNerve> I'm asking for an educated one lol
21:36:29FromGitter<kayabaNerve> Oh well dom96. You tried. I appreciated it.
21:36:42AbnegationPeople use php for web programming. So, I don't see no reason to not use anything for web programming :3
21:36:55dom96My answer should be obvious though :)
21:37:05krux02what 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:34krux02but in the end you still need to decide if you want to write the webserver in Nim or Not.
21:37:35FromGitter<kayabaNerve> LOL Abnegation
21:37:35FromDiscord<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:01FromDiscord<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:32AbnegationI 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:50Abnegationis an inhouse engine?
21:38:54death916i cant imagine thats very performant to use js in that capacity
21:39:11dom96oh no, the geoip API my snake game uses is returning 403's and breaking it :(
21:39:27dom96Too. Many. Projects.
21:39:52FromGitter<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:11dom96kayabaNerve: Do it.
21:40:19Abnegationthe 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:34krux02dom96, it helps to have all projects joined into a single project so that when you break one thing you instantly get feedback
21:40:41dom96I've built so much stuff using Nim now. It's all running steadily in productions for years.
21:40:41FromGitter<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:03dom96I'm almost finished releasing a brand new Jester version
21:41:08dom96With a bunch new features
21:41:10shashlickaraq: how come -> https://github.com/nim-lang/Nim/issues/5626#issuecomment-402562950
21:41:17dom96and which runs on httpbeast
21:41:29FromGitter<kayabaNerve> And I probably should just try it out. The Nim website is on a Nim server, right? Is the forum too?
21:41:39dom96The Nim website is static HTML
21:41:42dom96the forum is 100% nim
21:41:55FromGitter<kayabaNerve> What server is behind the website?
21:42:02FromGitter<kayabaNerve> You can have a Nim static server...
21:42:31FromGitter<kayabaNerve> Or is it... nGinx :O
21:42:43dom96nginx
21:42:53FromGitter<kayabaNerve> I hate nGinx expect as a SSL front/subdomain handler. Ngl.
21:42:57dom96nimforum is: nginx <-> httpbeast <-> jester
21:43:01dom96With karax on the frontend
21:43:05FromGitter<kayabaNerve> Got it
21:43:26FromGitter<kayabaNerve> So am I looking at Jester + Karax or...
21:44:01FromDiscord<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:07nasusirodom96: has anyone built a web server with Nim or not yet?
21:45:30AbnegationHrrm, 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:54Abnegationare you using webgl for drawing I hope.
21:46:08krux02Abnegation, for a snake game?
21:46:18krux02are you crazy
21:46:39krux02for that game even I would do a canvan object and draw rectangles
21:46:43FromGitter<kayabaNerve> nasusiro: dom96
21:46:46FromDiscord<exelotl> haha no, it's not about the snake game x)
21:47:08FromGitter<kayabaNerve> krux02: Agreed. I think dom made a Nim Snake game with multiplayer... something something talk/conference
21:47:11Abnegationwait... how is it a snake game going slow then?
21:47:27FromGitter<kayabaNerve> http://picheta.me/snake/.
21:47:36krux02I don't know. I thought you were talking about that
21:47:40FromDiscord<exelotl> omg the convos are getting mixed up xD
21:48:33FromDiscord<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:31AbnegationSorry, 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:38FromDiscord<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:44krux02I 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:02krux02it just too much work to use OpenGL the fast way for a pixel game.
21:51:25krux02and when you do the slow way (one draw call per object) then it really becomes very slow.
21:51:55krux02I had an at least 10 times performance boost when I changed from OpenGL rendering to software rendering on my Laptop.
21:52:03FromDiscord<exelotl> that's actually one area where I think SDL2 really messed up
21:52:15FromDiscord<exelotl> they made this lovely simple hardware accelerated 2D rendering API
21:52:30krux02yes sdl2 messed it up there
21:52:33FromDiscord<exelotl> then they forgot to add sprite batching as a thing that you can do, at all
21:52:49krux02simply 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:09krux02exelotl: I thought the same
21:53:36AbnegationThat 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:37AbnegationI would be quite skeptical of the framework implementation you're using if it goes faster on software.
21:54:06krux02it wasn't a framework it was just tiles rendering with the sdl2 api
21:54:23krux02and there you can change software and hardware rendering
21:54:30krux02and I really used low resolution
21:55:17krux02btw I was always sad with the rendering performance of SDL
21:55:39krux02at least on my Linux machines
21:55:47krux02but probably I was just using it incorrectly
21:56:21krux02before I used SDL1 I used blitzBasic on Windows. And even though it was interpreted, the drawing routines were pretty fast.
21:56:39krux02doing a pixel game in that environment was really a great experience.
21:56:56FromDiscord<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:18krux02everything was just functions and data. No framework, no callbacks, no classes, no inheritance, no complexity
21:57:52krux02but I really like the SDL events
21:58:09krux02especially in Nim with the events iterator :P
21:59:16FromDiscord<exelotl> oh is that a thing? I've yet to try it
21:59:29*yglukhov_ quit (Remote host closed the connection)
21:59:46krux02well it is just ``for e in events():``
22:00:51FromDiscord<exelotl> ah right
22:01:20FromDiscord<exelotl> so you still have to do `match e.kind` or whatever
22:02:14krux02yes
22:02:31krux02but you don't need a while loop
22:02:52FromDiscord<exelotl> ah that's nice
22:03:38*leorize quit (Ping timeout: 276 seconds)
22:05:33FromGitter<kayabaNerve> Araq: Have you seen Elm?
22:05:45Araqyeah.
22:05:58Araqhttps://forum.nim-lang.org/t/4006
22:06:07dom96This is the state of our developer world: https://twitter.com/samccone/status/1014341689253613569
22:06:29dom96Better profile those programs that pack all your Node crap into a single JS file!
22:10:18*leorize joined #nim
22:12:52AraqError: system module needs 'PNimrodNode'
22:12:52AraqFAILURE
22:12:52AraqCommand exited with code 1
22:13:03Araqit's one of those days ... :-/
22:25:22dom96Time for sleep :)
22:25:31krux02good night
22:28:02krux02today I made an experiment. I plugged in my headphones in the microphone jack and spoke into the headphones.
22:28:11krux02the result: it works
22:28:34krux02so whenever you need a microphone, you can just use a headphone and speak into it.
22:36:13*Jesin quit (Quit: Leaving)
22:38:12FromDiscord<exelotl> amazing
22:40:53*nasusiro quit (Quit: Quitting for now...)
23:19:05*Sembei joined #nim
23:28:19shashlickfeedback appreciated: https://github.com/nim-lang/Nim/issues/5626#issuecomment-402571433
23:41:58*Sembei quit (Ping timeout: 268 seconds)
23:48:45shashlickkrux02: i used that trick two decades ago on one of my songs, didn't have a microphone back then
23:49:21shashlickGood memories 😊