<< 29-10-2018 >>

00:10:17FromGitter<zetashift> @endragor I got an issue with PackedScene not showing up after connecting a signal in godot-nim. You there by any chance to have a quick look?
00:28:52FromGitter<gogolxdong> At least found Intel HD520 supports vulkan API, accroding https://askubuntu.com/questions/807857/how-to-install-intel-graphics-driver-for-using-vulkan-on-ubuntu-16-04 , do as it says, added DRI3 extension, binary works.
00:55:12*vlad1777d_ joined #nim
01:17:48*krux02 quit (Remote host closed the connection)
02:16:03*vlad1777d_ quit (Ping timeout: 252 seconds)
02:18:02*dddddd quit (Remote host closed the connection)
02:20:50*dcefram joined #nim
02:23:47*vlad1777d_ joined #nim
02:27:30*endragor joined #nim
02:32:24*enthus1ast quit (Ping timeout: 246 seconds)
02:38:24*fyber is now known as im_jeb
02:50:45*skellock quit (Quit: WeeChat 2.2)
02:55:46FromGitter<zacharycarter> @gogolxdong - I like this tweet from the bgfx guy about Vulkan
02:55:48FromGitter<zacharycarter> one sec
02:56:23FromGitter<HeadClot> Hello
02:56:51FromGitter<zacharycarter> https://twitter.com/bkaradzic/status/1056241856734945280
02:57:04FromGitter<HeadClot> I saw that tweet
02:57:13FromGitter<zacharycarter> @HeadClot o/
02:57:13FromGitter<HeadClot> Also hey @zacharycarter :)
02:57:23FromGitter<zacharycarter> hey bud :)
02:57:31FromGitter<HeadClot> How are you doing?
02:57:51FromGitter<zacharycarter> good thanks - well doing better recently anyway, now if I could just sell my GD house so I could quit my job haha
02:58:10FromGitter<zacharycarter> you?
02:58:16FromGitter<HeadClot> I saw you posted about that on twitter?
02:58:31FromGitter<zacharycarter> Yeah - I'm just sharing the listing on whatever little social media platform I have
02:58:41FromGitter<HeadClot> Let me retweet you real quick
02:58:43FromGitter<zacharycarter> in case - via some miracle - someone sees it that wants to buy it
02:58:44FromGitter<zacharycarter> thank you!
02:58:50FromGitter<zacharycarter> <3
02:59:27*platoff quit (Ping timeout: 240 seconds)
02:59:32FromGitter<HeadClot> Done
02:59:42FromGitter<zacharycarter> thank you!
02:59:53FromGitter<HeadClot> Welcome
03:00:47FromGitter<HeadClot> But yeah - I am kinda excited about learning CS right now
03:01:35FromGitter<zacharycarter> that's very cool :) there are some extremely intelligent people in this community to learn from
03:01:55FromGitter<HeadClot> So how is performance with NIM?
03:02:00FromGitter<zacharycarter> the language author, lead co-contributor, and the rest of the core contributors aver very active
03:02:07theelous3o/
03:02:15FromGitter<HeadClot> compared to a language like C++ or C
03:02:21FromGitter<zacharycarter> Nim performance compares to C - the way Nim works is this
03:02:28FromGitter<HeadClot> ok
03:02:57FromGitter<zacharycarter> you write your code in Nim, and can easily interop with C / C++ (C more easily than C++ - mostly because of name mangling - which is a concept you'll run into later, it's a way to disambiguate symbols)
03:03:11FromGitter<zacharycarter> then, you invoke the Nim compiler, much like you'd invoke any other compiler
03:03:42FromGitter<zacharycarter> keep in mind - Python has an interpreter - Nim does too, but it's limited and you'll mostly interact directly with the Nim compiler
03:04:02theelous3woah wat, there's a repl
03:04:06FromGitter<zacharycarter> the Nim compiler, will take your Nim source code and spit out source in the language you specify
03:04:09FromGitter<zacharycarter> a very limited repl
03:04:15FromGitter<zacharycarter> but yes there is
03:04:22FromGitter<HeadClot> So can I use Nim with Visual Studio?
03:04:26FromGitter<HeadClot> or VS Code?
03:04:37FromGitter<zacharycarter> both - but it more depends on what operating system you're using
03:04:40FromGitter<zacharycarter> because here's the fun part
03:04:43FromGitter<HeadClot> Ah ok
03:04:50FromGitter<zacharycarter> Nim compiles to whatever language you target via the compiler
03:04:50FromGitter<HeadClot> I am using Windows 10
03:04:55FromGitter<zacharycarter> so if you say - I want to use Nim's C backend
03:05:00FromGitter<HeadClot> :O
03:05:00FromGitter<zacharycarter> the Nim compiler - is going to produce C code
03:05:05FromGitter<HeadClot> That is awesome
03:05:09*banc quit (Quit: ZNC - http://znc.in)
03:05:21FromGitter<zacharycarter> and then you invoke the C compiler, for whatever OS / architecture you're o
03:05:22FromGitter<zacharycarter> n
03:05:29FromGitter<HeadClot> Ok - That is amazing
03:05:31FromGitter<zacharycarter> this is pretty common - this is how C++ started out - C++ originally compiled to C
03:05:53FromGitter<zacharycarter> the nifty thing about Nim is - you can compile to C / C++ / Objective-C (ios) / JavaScript (NodeJS too)
03:06:12FromGitter<zacharycarter> and you can also use libraries written in those languages - with Nim
03:06:24FromGitter<HeadClot> That is really cool
03:06:51FromGitter<zacharycarter> It is - but I won't pretend it's frictionless or necessarily straightforward / easy to do
03:06:53FromGitter<HeadClot> So how would I take a node.js lib and use it with NIM?
03:07:42FromGitter<zacharycarter> well - to even do that, you're going to need to understand how Nim's FFI (foreign function interface) capabilities work
03:07:48FromGitter<HeadClot> Ok
03:07:56FromGitter<zacharycarter> because you're going to have to wrap the NodeJS `require` function
03:08:18FromGitter<zacharycarter> but essentially - you'd just use a package.json as normal, include the Node dependency via NPM or Yarn or whatever package manager you want
03:08:35FromGitter<zacharycarter> and then in your Nim code - you would wrap whatever functionality you need from the NodeJS library
03:08:47FromGitter<zacharycarter> it's really trivial once you know what you're doing
03:08:51FromGitter<HeadClot> Ok
03:09:17FromGitter<zacharycarter> for instance - I was able to port (not just wrap, but port) 90% of - https://github.com/WebReflection/hyperHTML - in a weekend
03:09:21FromGitter<zacharycarter> to Nim
03:09:38FromGitter<HeadClot> So lets say that I wanted to use node as a server for a game. Would I need to do that for each node lib that I use?
03:09:48FromGitter<zacharycarter> I also ported a lot of - https://www.raylib.com/ - to Nim (that's what zengine is)
03:10:01FromGitter<HeadClot> Oh awesome
03:10:58FromGitter<zacharycarter> theoretically yes - but Nim does have its own emerging ecosystem - so hopefully you'd be able to lean on that and less on producing bindings
03:11:10FromGitter<zacharycarter> plus - if I were to write a game server in Nim - I'd use the C backend and not the JS backend
03:11:27theelous3in addition, servers are fun to write
03:12:47FromGitter<zacharycarter> haha well - multiplayer network programming is probably on the more difficult side of the comp-sci problem domain spectrum
03:13:24FromGitter<zacharycarter> but I like this approach very much so - https://thoughtstreams.io/glyph/your-game-doesnt-need-udp-yet/
03:13:24FromGitter<HeadClot> I have never written a server. But I look forward to it
03:13:33FromGitter<HeadClot> :)
03:13:59FromGitter<zacharycarter> @HeadClot - https://narimiran.github.io/nim-basics/ is a great starting point IMO for learning Nim
03:14:00FromGitter<HeadClot> Or at least putting bindings for spatial OS with NIM and godot
03:14:17FromGitter<HeadClot> Thanks :)
03:14:58FromGitter<zacharycarter> sure thing! it looks like spatial OS has a C api - https://docs.improbable.io/reference/13.3/capi/introduction
03:15:11FromGitter<zacharycarter> so producing bindings to that with Nim should be a rather trivial exercise once you know what you're doing
03:15:45FromGitter<zacharycarter> maybe not - based on the codegen stuff they're describing
03:15:49FromGitter<zacharycarter> but it's without a doubt possible
03:16:10FromGitter<zacharycarter> and is probably going to be easier than in most languages with tools like c2nim / nimgen
03:19:35FromGitter<gogolxdong> @zacharycarter , none revolutionize,only better API
03:19:57FromGitter<HeadClot> Awesome!
03:19:59FromGitter<gogolxdong> no better options.
03:20:20FromGitter<zacharycarter> @gogolxdong bgfx :)
03:20:34FromGitter<zacharycarter> and I know vulkan isn't there yet - but who cares?
03:20:39FromGitter<zacharycarter> vulkan is not yet critical to any platform
03:20:43FromGitter<zacharycarter> and it will be there eventually
03:20:44*banc joined #nim
03:21:22FromGitter<zacharycarter> I think it's pretty much insane NOT to look at bgfx / gfx-rs / some sort of bridge API at this point
03:22:04FromGitter<zacharycarter> BGFX does a lot of optimization you'd have to implement yourself right out of the gate - like sort-based draw call bucketing
03:22:42FromGitter<zacharycarter> and it cleanly abstracts away a lot of concepts that are super annoying in gfx programming
03:23:06FromGitter<zacharycarter> https://bkaradzic.github.io/bgfx/bgfx.html#views - for instance
03:23:10*vlad1777d_ quit (Remote host closed the connection)
03:23:23theelous3for arrarys, the only way to insert something is by index?
03:23:31theelous3no .append or similar no/
03:23:32theelous3?
03:25:08*vlad1777d joined #nim
03:26:37FromGitter<zacharycarter> theelous3 - there's syntactic sugar for getting at the len -1 element
03:26:44FromGitter<zacharycarter> but no - they're not resizable
03:26:49FromGitter<zacharycarter> gotta use a seq for that
03:26:54theelous3aye
03:27:38theelous3follow up to what you said, would len -1 not just be the last "slot" in the array rather than the farthest one in that's filled?
03:27:48theelous3so it'd always be the same index?
03:28:36theelous3like, if I have array[10, int] it gets initialised with 0s
03:28:50theelous3so, I don't get the len -1 thing
03:29:11*vlad1777d quit (Excess Flood)
03:31:08*vlad1777d joined #nim
03:31:28FromGitter<zacharycarter> yess
03:31:31FromGitter<zacharycarter> you're correct
03:32:17*theelous3_ quit (Changing host)
03:32:17*theelous3_ joined #nim
03:32:24theelous3_also, is it possible to write a comprehensiony kind of thing like: (var i: int; for x in countup(10, 100, 10): myArray[i] = x; inc(i))
03:32:40theelous3_where we do multiple things in each iteration
03:32:48leorizeyes, not recommended, but yes
03:33:06FromGitter<zacharycarter> I believe we have list comprehension now
03:33:13FromGitter<zacharycarter> not 100% though
03:33:31theelous3_I saw there is a comprehension lib by one of the peeps here, but not in stdlib iirc
03:33:38FromGitter<zacharycarter> https://stackoverflow.com/questions/29895918/nim-equivalent-of-pythons-list-comprehension
03:33:44leorizethere's one in `sugar`
03:33:47FromGitter<zacharycarter> yeah
03:33:54leorizebut usage is discouraged by the devs
03:34:12FromGitter<zacharycarter> I think we need a running list of modules like that ^
03:34:25theelous3_what's the nimmish way of doing what I was trying to do?
03:34:25FromGitter<zacharycarter> I never know what fringe modules to trust these days and which not to - it's understandable
03:34:59FromGitter<zacharycarter> but it's always the experimental stuff your really want to grab at - it's tough knowing what is considered stable (even relatively) and what is not, these days
03:35:00FromGitter<citycide> theelous3_: https://github.com/alehander42/comprehension is the nimble package
03:35:22theelous3that's the one I was thinking of
03:35:32FromGitter<zacharycarter> Instead of saying idiomatic
03:35:33FromGitter<zacharycarter> let's just say
03:35:41FromGitter<zacharycarter> nimiomatic :)
03:35:55FromGitter<zacharycarter> and invent our own version of the term
03:35:56theelous3nimatic
03:35:59theelous3less typing
03:36:12FromGitter<zacharycarter> yeah - but peeps are used to idiomatic
03:36:20FromGitter<zacharycarter> I feel losing that syllable also loses reference
03:36:26theelous3true
03:36:53theelous3nimonic
03:37:00FromGitter<zacharycarter> I like that too
03:37:07*vlad1777d quit (Ping timeout: 240 seconds)
03:37:12FromGitter<citycide> nimtactic
03:37:40*craigger quit (Quit: bye)
03:37:44FromGitter<zacharycarter> I also feel like this conversation has been had ad nauseam :P
03:37:50*craigger joined #nim
03:37:52theelous3yes probably :P
03:38:08theelous3so, what's the nimonic way of doing this kind of comp, on an array
03:38:28theelous3it's straight forward with a seq because we don't need inc(), but array be diff
03:39:42leorizesorry, I didn't catch the conversation before, what are you trying to do?
03:40:14FromGitter<citycide> iterating a seq is the same as an array tho
03:40:24theelous3I guess I can just stop being lazy and not try to do something in the style of a comprehension that shouldn
03:40:29theelous3't be in that style
03:40:49theelous3well, what I was doing wasn't iterating the array, I was iterating a countup to fill the array
03:40:56FromGitter<zacharycarter> I'm not sure you can :/
03:41:20FromGitter<zacharycarter> besides doing it the way you already are
03:41:34theelous3doesn't work that way
03:41:35FromGitter<zacharycarter> or creating a seq from your array
03:41:40FromGitter<citycide> it's probably more idiomatic in nim to do it imperatively tbh
03:41:43theelous3cos the inc() is only called after the loop completes
03:41:51FromGitter<zacharycarter> oh yess
03:41:57leorizeclosure iterator anyone?
03:42:08FromGitter<zacharycarter> ^
03:43:18*platoff joined #nim
03:43:21theelous3beyond me for the moment
03:43:49*craigger quit (Quit: bye)
03:44:02*craigger joined #nim
03:44:21FromGitter<zacharycarter> resumable iterators that can be passed around
03:44:27FromGitter<zacharycarter> so they maintain some state
03:44:39theelous3oh, like a coroutine
03:44:40theelous3?
03:45:15theelous3idk how general that term is in this context
03:46:11*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
03:48:48FromGitter<zacharycarter> I think the closure iterator gives you the ability to decide whether you need to fill your array or not - and if not, resume afterwardss
03:48:51FromGitter<zacharycarter> so like -
03:49:13FromGitter<zacharycarter> """ ⏎ proc countTo(n: int): iterator(): int = ⏎ return iterator(): int = ⏎ ⏎ ```break``` ... [https://gitter.im/nim-lang/Nim?at=5bd68338ef4afc4f28ea6df4]
03:49:23FromGitter<zacharycarter> whoopsss
03:49:36FromGitter<zacharycarter> ''' ⏎ proc countTo(n: int): iterator(): int = ⏎ return iterator(): int = ⏎ ⏎ ```break``` ... [https://gitter.im/nim-lang/Nim?at=5bd683503844923661b48b3b]
03:49:41FromGitter<zacharycarter> omg - wtf gitter
03:49:52theelous3lmao
03:49:56leorizeit's triple ```
03:50:01theelous3even worse, I am on irc, so this looks insane
03:50:12FromGitter<zacharycarter> https://gist.github.com/zacharycarter/fa91e0e448945b0c8a37b5502f18e9de
03:50:14theelous3(i checked gitter, looks insane there too!)
03:50:28theelous3ty
03:50:38FromGitter<zacharycarter> I've been balancing getting back on twitter facebook and gitter all in the same month
03:50:41FromGitter<zacharycarter> I'm not doing so well
03:50:48theelous3fb is trash
03:51:00FromGitter<zacharycarter> I'm just there to sell my house :P
03:51:09FromGitter<zacharycarter> and to punish everyone already there, with my house selling adverts
03:51:11theelous3estate agent > facebook
03:51:17theelous3:P
03:51:25FromGitter<zacharycarter> I got one of thems too - but she's too old to be on the book or the gram
03:51:31FromGitter<zacharycarter> I might need a new agent
03:51:54FromGitter<zacharycarter> or to produce some offspring to sell my house / use slang terms for me
03:53:28theelous3line 1 of that paste in the proc return type
03:53:39theelous3you need to specify the return type of the iterator there too?
03:55:04leorizethat proc returns an iterator so...
03:55:12leorizeyea this thing need a better API
03:55:18leorizeIIRC Araq have one
03:55:32theelous3looks super weird
03:55:56leorizebtw, do you absolutely have to use array?
03:56:06theelous3oh I'm just making up nonsense code to learn
03:56:12theelous3I don't have to do anything :D
03:56:42*smt quit (Ping timeout: 252 seconds)
03:56:46leorizeseq version: https://ptpb.pw/ORrP/nim
03:58:15theelous3is that missing a sequtils.
03:58:35leorize?
03:58:35theelous3or does import sequtils bring all in to namespace
03:58:46leorizeyes it bring all in to namespace, this is not python
03:58:50theelous3gottcha
03:59:18theelous3anyway, that's a lot neater :P
03:59:58leorizewith a bit of macro magic you could generate an array that way as well
04:00:21leorizebut then you could just use some list comprehension package :P
04:00:42FromGitter<zacharycarter> wow
04:00:44FromGitter<zacharycarter> this is amazing
04:00:59FromGitter<zacharycarter> https://twitter.com/marian42_/status/1056637654010339328v
04:01:09FromGitter<zacharycarter> gd
04:01:16theelous3broken link?
04:01:21FromGitter<zacharycarter> why does everyone delete tweets as soon as I share them?
04:01:33leorizestrip the `v` from the end of the link
04:02:18FromGitter<zacharycarter> https://twitter.com/marian42_/status/1056637654010339328
04:02:22FromGitter<zacharycarter> ah
04:02:49theelous3o wow, that's procedural
04:02:50theelous3v cool
04:02:54FromGitter<zacharycarter> yeah - just realized my own typo was at fault - not the author
04:03:03FromGitter<zacharycarter> code is on github too
04:07:59FromGitter<zacharycarter> bed time for me - have a good night all :)
04:08:25FromGitter<zacharycarter> hoping for a better week than this one has been
04:09:14theelous3nn
04:14:52theelous3whew, 4am, same
04:15:00theelous3thanks for help everyone and nn
04:19:00*dcefram quit (Quit: Konversation terminated!)
04:25:19FromGitter<timotheecour> big fat regression breaking every PR: https://github.com/nim-lang/Nim/issues/9551
04:31:21*theelous3 quit (Ping timeout: 252 seconds)
04:31:52*chemist69 quit (Ping timeout: 264 seconds)
04:33:22*chemist69 joined #nim
04:36:47*ng0 quit (Ping timeout: 240 seconds)
04:37:46*ng0 joined #nim
04:42:56*darithorn quit ()
04:57:00*nsf joined #nim
05:04:28*stefanos82 joined #nim
05:07:31*flaviu joined #nim
05:11:23*Tanger joined #nim
05:19:32FromGitter<kayabaNerve> How... supported is the ObjC backend?
05:22:27FromGitter<kayabaNerve> Does it mainly work off the C backend since Obj-C is a superset?
05:25:18*leorize quit (Ping timeout: 252 seconds)
05:51:01*leorize joined #nim
05:59:09*kapil____ joined #nim
05:59:24*vlad1777d joined #nim
06:22:37*flaviu quit (Remote host closed the connection)
06:24:50*d10n-work quit (Quit: Connection closed for inactivity)
06:59:33*mech422_ joined #nim
07:01:33*krux02 joined #nim
07:03:26*mech422 quit (Ping timeout: 272 seconds)
07:03:39*Vladar joined #nim
07:31:12FromGitter<xmonader> can someone check this PR for logging issue? ⏎ https://github.com/nim-lang/Nim/pull/9554
07:35:22*theelous3_ quit (Remote host closed the connection)
07:58:04FromGitter<gogolxdong> What's the relationship between gfx and bgfx ?
08:09:48*platoff quit (Ping timeout: 246 seconds)
08:51:23krux02gfx is just an abbreviation for graphics and bgfx is a library for graphics programming
08:58:27*leorize quit (Ping timeout: 240 seconds)
09:12:22*jjido joined #nim
09:23:41*PMunch joined #nim
09:29:27FromGitter<narimiran> hey Araq, thoughts about this: https://github.com/nim-lang/Nim/pull/9542 ? should "Nim 0.19.0 documentation" be added to the title? if so, how to automatically get the latest stable version?
09:29:40*leorize joined #nim
09:31:18*jjido quit (Ping timeout: 245 seconds)
09:31:58Araqhmm
09:32:26Araq<module_name> - Nim 0.12
09:32:43Araqshould be it, "documenation" is pointless what else would it be
09:33:01Araqor maybe <module_name> - Nim v0.12
09:33:07FromGitter<narimiran> agreed
09:33:18Araqthe version is system.NimVersion
09:33:32Araqprobably needs a minor docgen extension
09:34:52FromGitter<narimiran> oh, i didn't know about `nimVersion` - hiding in the plain sight! :)
09:36:09FromGitter<narimiran> but i guess using just that would now print 0.19.1, and the documentation is for 0.19.0? or is it ok since documentation is only created when a new stable version is out?
09:37:51*floppydh joined #nim
09:38:01FromGitter<narimiran> btw, i'm still getting infinite loop when trying to do `nim doc` on some modules (and my packages)!
09:38:29FromGitter<alehander42> @citycide thanks for the PR, sorry for the delay in merging it
09:38:37*Vladar quit (Remote host closed the connection)
09:38:44Araqfor now 0.19.1 is ok
09:39:00*Vladar joined #nim
09:39:17Araqwe'll backport the fixes to 0.19 to create 0.19.2 and devel will become 0.20
09:40:07Araqand also new policy: non-risky bugfixes should have 'backport' in the commit message so that the cherrypicking can be automated
09:40:40Araqwe'll see if that works out in practice :-)
09:41:50FromGitter<narimiran> btw, any plans to have some kind of "embargo", like: two or three days of no new commits, and asking everybody to use the latest devel on their projects to spot any regressions, before releasing a new stable version?
09:42:23FromGitter<narimiran> it's not perfect, but maybe a bit better than just releasing stable and hoping for the best
09:42:47FromGitter<narimiran> (IIRC the last two stable releases had "oh shit, this is broke")
09:42:58FromGitter<narimiran> *broken
09:43:42Araqwell if we test more nimble packages regularly out there we can fight this
09:43:57*lwiechec joined #nim
09:44:18Araqbut if we say "test this beta now, it's going stable" than that's not really different from just releasing and adding a patch release soon afterwards
09:44:37*lwiechec left #nim (#nim)
09:45:00Araqthe KDE devs didn't have luck with their beta releases
09:45:37Araqthey didn't get enough testing and so eg. 4.1 had to be released anyway
09:46:15PMunchThat reminds me that I should set up auto-build of my packages. Whenever a new stable version of Nim drops I want to ensure that my packages are up-to-date
09:46:22FromGitter<narimiran> did "adding a patch release soon afterwards" happen? ;)
09:47:23*lwiechec joined #nim
09:48:21*jjido joined #nim
09:48:49Araqnarimiran: these did happen for Nim, but always were effort
09:56:50FromGitter<narimiran> added version number. now we wait for CI (and hope that travis runs at all, and appveyor doesn't raise unrelated error ;))
10:05:35*derlafff quit (Remote host closed the connection)
10:05:58Araqso ... back to the problem
10:06:10Araqwhen the fuck does 'nim doc' run into endless loops?
10:06:18Araqhaven't seen that one ever before
10:08:05*derlafff joined #nim
10:10:42Araqwell?
10:11:40FromGitter<narimiran> i'm still trying to figure out what trips it. my guess is runnableExamples, but i have to test it some more to be sure
10:16:48FromGitter<narimiran> for example, `nim doc lib/pure/collections/sequtils.nim` works just fine (no runnable examples there), but `nim doc lib/pure/strutils.nim` is an infinite loop with 100% CPU used
10:18:12*kapil____ quit (Quit: Connection closed for inactivity)
10:18:46FromGitter<narimiran> happens both in devel and stable, linux
10:21:34FromGitter<narimiran> on the other hand, `nim doc lib/pure/algorithm.nim` works fine, and it has runnable examples!
10:24:41*krux02 quit (Remote host closed the connection)
10:25:02*krux02 joined #nim
10:25:56Araqnim doc strutils is part of the CIs and travis runs on Linux
10:26:10FromGitter<narimiran> SORRY! it is not infinite loop, it compiles each runnable example on its own. it just takes a lot of time and i've been impatient
10:26:15FromGitter<narimiran> sorry for the false alarm
10:26:20Araqyup ok
10:26:31FromGitter<alehander42> Araq, can you explain the ormin dsl a bit: https://github.com/Araq/ormin/blob/master/examples/chat/server.nim#L46 ⏎ what does `%arg` do ? what does `?userId` do? and what is `!!`? (I guess one of `%` and `?` is quoting, but what's the other?)
10:26:36Araqneed to change that back to "Only as much files as required2
10:27:20FromGitter<alehander42> (maybe `!!` converts to nim datetime / or just integer ?)
10:27:24Araqalehander42: I've never been happy with the "protocol" DSL
10:27:38FromGitter<alehander42> yeah, no, I wondered about the query dsl
10:27:41Araqbut !! is for "emit SQL directly that Ormin does not understand"
10:27:55Araqso it's dangerous, hence !!
10:27:55FromGitter<narimiran> was the `nim doc` / `runnableExamples` behaviour changed between 0.18 and 0.19? because i don't remember it taking such a long time before
10:28:00FromGitter<alehander42> ha, I had somethign like that in my orm idea
10:28:05FromGitter<alehander42> exactly for DATETIME
10:28:10Araqnarimiran: It changed due to a bugfix
10:28:28Araqthe % is for "my data is JSON"
10:28:32FromGitter<alehander42> but i based my example on your, so problably that's why
10:28:45Araqthe ? is for "my data is in native Nim types"
10:28:55Araqand that's it.
10:29:32Araqmaybe with more magic % and ? can be the same
10:29:54Araqbut these JSON extensions are of the category "useful, but meh"
10:29:59FromGitter<alehander42> so `%` would be like
10:30:11FromGitter<alehander42> `?arg{"stuff"}.getInt` ?
10:31:29AraqI don't remember the details :-)
10:31:37Araq-d:debugOrminDsl
10:31:52Araqto look at the results of the transformations :-)
10:32:19FromGitter<alehander42> I mean, that this is what does `%`, right (quoting the raw repr of a json value)
10:32:22FromGitter<alehander42> ok
10:32:34Araqand thanks for taking a look at it, I spent quite some time on it and like to see it picked up
10:34:04FromGitter<alehander42> yeah, I wanted to take a decision if I want to make my own orm or to somehow ormin
10:34:10FromGitter<alehander42> extend ormin*
10:34:51FromGitter<alehander42> I am starting to agree with the "generate models from schema" , as this is the only possible DRY solution
10:36:45AraqSQL also has varchar(N) and Nim has string
10:36:45*chemist69 quit (Ping timeout: 252 seconds)
10:37:09Araqso already you would need to introduce a Varchar[N] type that can then be mapped to SQL
10:37:10*chemist69 joined #nim
10:37:12FromGitter<alehander42> as it's compatible with migrations: you can have migrations (pure sql or based on some `changeTable` dsl) and make the orm generate types based on the current schema, otherwise you write in Nim models and you still have to write the field def-s again for the migrations
10:37:41Araqyup and keep in mind that a table can easily have hundreds of fields
10:38:35FromGitter<alehander42> yeah, probably the only thing further I'd want is to somehow *see* the generated types (e.g. in additional file)
10:39:14Araqwell Ormin doesn't generate types
10:39:23Araqor to put it differently
10:39:34Araqthe type belongs to a query, not to a table
10:40:23FromGitter<alehander42> hm, but does it somehow check if the query makes sense: I imagined that it has e.g. fieldKind info which is compared with the type of the field value
10:41:13Araqselect user.name, project.name from user inner join project on user.projectId = project.id
10:41:33Araq^ see? it doesn't work well by attaching types to tables
10:41:57FromGitter<alehander42> no, what I wondered was more like
10:42:15FromGitter<alehander42> if I pass `age=?ageVar`
10:42:31AraqIMO that's where the impedance mismatch comes from and why Ormin lacks it :P
10:42:35FromGitter<alehander42> is it statically proven
10:42:41FromGitter<alehander42> that `age` is actually a INTEGER field
10:42:43FromGitter<alehander42> if ageVar is int
10:42:53Araqyup, afair
10:43:03Araqthat's done. Ormin has a type checker.
10:43:25FromGitter<alehander42> but it's a part of the query macro? while it's building the query it does its own check?
10:44:55Araqyes
10:45:23Araqit can also complete the query for you
10:45:31FromGitter<narimiran> `math` module doesn't have `epsilon` or `isAproximatelyEqual` :'(
10:45:59Araqselect user.name, project.name from user inner join project # d'oh, guess the join predicate with the foreign key relation
10:46:16Araqthat is my favourite misfeature of SQL, it's so stupid
10:47:13Araqwell SQL is terribly designed but at least simple stuff is simple
10:49:12FromGitter<alehander42> epsilon would be useful
10:49:28FromGitter<alehander42> what do u mean by `complete` :D
10:49:29*Snircle joined #nim
10:50:53FromGitter<alehander42> hm, do databases have a way to infer the join predicate
10:51:03*shpx quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
10:51:30FromGitter<alehander42> they do
10:51:40FromGitter<alehander42> well I don't see the problem if there is no ambiguity
11:17:01*bitstoppa[m] quit (Ping timeout: 260 seconds)
11:17:01*AlexMax quit (Ping timeout: 260 seconds)
11:17:36*FromGitter quit (Ping timeout: 260 seconds)
11:17:49*bitstoppa[m] joined #nim
11:17:54*FromGitter joined #nim
11:18:17FromGitter<zacharycarter> https://azul.rs
11:18:24FromGitter<zacharycarter> just saw this being tweeted about on twitter
11:19:30*banc quit (Ping timeout: 246 seconds)
11:20:02FromGitter<tim-st> @narimiran can your `itertools` create this one? https://stackoverflow.com/questions/14931769/how-to-get-all-combination-of-n-binary-value/14931808#14931808
11:20:48*nc-x joined #nim
11:21:28Araqzacharycarter, looks interesting, thanks for that
11:21:33nc-xAnyone on Windows who has time to check the nightlies? Download (64-bit and 32-bit) from here - https://ci.appveyor.com/project/Araq/nightlies/builds/19873087
11:21:40FromGitter<zacharycarter> Araq: np!
11:21:43*banc joined #nim
11:22:13*AlexMax joined #nim
11:22:20nc-xAraq: https://github.com/nim-lang/nightlies/pull/8 Do you want me to re-add `koch docs`? Because as I said `winrelease` builds the docs as well.
11:23:58shashlicknc-x: thanks for all the c2nim fixes!
11:24:36FromGitter<narimiran> @tim-st i need to test it. i know i cut some corners here-and-there :)
11:25:07*nc-x quit (Client Quit)
11:26:56FromGitter<tim-st> @narimiran thanks :=
11:26:59FromGitter<tim-st> :)
11:27:14FromGitter<tim-st> nc-x: where can I download the file for windows?
11:27:29FromGitter<zacharycarter> https://github.com/jrmuizel/wr-binding/
11:27:51FromGitter<tim-st> the logfile says it is on: https://nim-lang.org/download/nim-0.19.1_x64.zip but this doesnt exists
11:28:48FromGitter<tim-st> ah, I see this is the url: https://ci.appveyor.com/project/Araq/nightlies/builds/19873087/job/vnbso386lejwvkp4/artifacts
11:28:51*nc-x joined #nim
11:28:55nc-xshashlick: Thank you!
11:29:35*lwiechec quit (Ping timeout: 256 seconds)
11:29:46nc-x@tim-st Open the link I gave above. There open the link for 32bit or 64bit. Then select artifact tab.
11:30:57FromGitter<tim-st> yes, I saw, the download is under artifacts, btw the log says it tries to create a windows installer is this supported one day?
11:31:27*platoff joined #nim
11:32:23nc-xIIRC there used to be a windows installer once. Now there is only a zip file.
11:33:02FromGitter<tim-st> x64 seems to work
11:33:28Araqer hmmm https://github.com/maps4print/azul/wiki/Two-way-data-binding
11:33:43AraqIn this chapter you have learned:
11:33:43AraqWhy the callback model is slightly more complicated than in other frameworks
11:33:43AraqWhy a text input suddenly stops working if you put it on the heap instead of the stack
11:33:43AraqWhat to watch out for when implementing custom components
11:33:44AraqHow to create heap-allocated lists of custom components and work around the current limitations
11:33:45Araq Pages 11
11:33:46AraqHome
11:33:47AraqInstallation
11:33:49AraqGetting Started
11:33:53AraqA simple counter
11:33:55AraqStyling your app with CSS
11:33:57AraqTwo-way data binding
11:33:59AraqOpenGL drawing
11:34:01AraqSVG drawing
11:34:03AraqTimers, daemons, tasks and async IO
11:34:05AraqUnit testing
11:34:07AraqClone this wiki locally
11:34:09Araqmy bad, my browser cannot copy&paste
11:34:16nc-xI think making the archive self-extracting would be good enough as an Installer. It could automatically run finish.exe in the end to set up PATH as well.
11:34:34Araqnc-x, tried to do that with 7z but failed :-)
11:35:18nc-xAraq: I might give it a try in a few weeks.
11:35:30FromGitter<tim-st> should I test also sqlite?
11:35:32nc-x@tim-st Thanks for testing.
11:35:37*nc-x quit (Quit: Page closed)
11:36:18Araq"Why a text input suddenly stops working if you put it on the heap instead of the stack"
11:36:58Araqwhat the ...? is this problem solving or problem creating?
11:37:33FromGitter<tim-st> nc-x: x86 works too
11:39:23FromGitter<tim-st> are these available now with every appvayor test?
11:40:42AraqI'm not sure about the trigger
11:40:59AraqI used to push pointless git tags to nightlies to trigger it :-(
11:43:26*dom96_w joined #nim
11:44:11FromGitter<tim-st> here are newer sqlite version for windows:
11:44:12FromGitter<tim-st> https://www.sqlite.org/2018/sqlite-dll-win64-x64-3250200.zip
11:44:18FromGitter<tim-st> https://www.sqlite.org/2018/sqlite-tools-win32-x86-3250200.zip
11:44:29FromGitter<tim-st> this: https://www.sqlite.org/2018/sqlite-dll-win32-x86-3250200.zip
11:44:43FromGitter<zacharycarter> Araq: yeah - those limitaitons and workarounds of azul don't look like they're fun to work with at all
11:44:51*elrood joined #nim
11:46:54Araquh oh, I have the strong desire to make Nim support "import url_here"
11:47:54*dom96_w quit (Changing host)
11:47:54*dom96_w joined #nim
11:47:59FromGitter<tim-st> yes, without it nim user packages can become a real problem: https://github.com/nim-lang/nimble/issues/574
11:48:08FromGitter<tim-st> https://github.com/nim-lang/nimble/issues/573
11:48:13dom96_wAraq: 0_o
11:48:39dom96_wHow do other languages solve this? (Rust)
11:50:10FromGitter<narimiran> btw, @tim-st, i know why you want those combinations :)
11:50:42FromGitter<tim-st> @narimiran I solved the example from yesterday but currently only with fixed bool entries the iterator is missing :D
11:50:57FromGitter<alehander42> Araq, so I looked through ormin, the thing I don't like it that it returns anon tuples : you have to access them later as `[0]` `[2]` instead of `.id` `.name` which makes code dealing with results not readable
11:51:20Araqyou can map it to your own typo too iirc
11:51:44FromGitter<alehander42> and `*`
11:51:51FromGitter<alehander42> as wait, it seems `_` does this
11:51:54Araqanon tuples is just the default
11:53:34FromGitter<tim-st> for the appveyor nightlies I think it's better to append a `_nightly` suffix to the file
11:53:35*jjido quit (Read error: Connection reset by peer)
11:54:04FromGitter<alehander42> well mapping them is a lot of boilerplate an orm is especially good at minimizing
11:54:30FromGitter<alehander42> (if you mean stuff like let t = query: .. let actual = (name: t[0], age: t[1]))
11:56:14Araqdom96_w, well convince me it's bad :-)
11:56:35Araqlet (name, age) = query: ...
11:56:52dom96_wAraq: well, convince me why they're necessary
11:56:54Araq^ that's why it produces a tuple, Nim has tuple destructuring builtin
11:57:10FromGitter<alehander42> eh ok, but why should I write select(name, age, f2, f3)
11:57:17FromGitter<alehander42> and then again let (name, age, f2..) =
11:57:52Araqbecause the SQL name may suck :P
11:57:56FromGitter<alehander42> on the other hand nim has tuples with keywords
11:58:07FromGitter<alehander42> well, then you can have `as`
11:58:26Araqtrue, I dunno, check out 'type' though
11:58:51FromGitter<alehander42> and actually how would you even pass it to select currently
11:59:05FromGitter<alehander42> select person("weird?SqlName") ?
12:00:43FromGitter<alehander42> what do you mean by `type
12:00:55FromGitter<alehander42> otherwise, the only two other things I wonder about are
12:01:49FromGitter<Clyybber> Araq How can I generate the type definition of a distinct int with "newNodeP" ?
12:02:35FromGitter<alehander42> would it be hard to get something like composable queries (they seemed useful in ecto : an elixir orm also macro-based, kinda similar dsl) ? ⏎ (at least we need a way to prepare a query with the DSL and execute it later , maybe `query:` and `prepareQuery:` or `exec:` and `query:`)
12:04:12AraqnewNodeP is parser specific
12:04:46FromGitter<alehander42> and 2) maybe we can have the ormin importer be able to get a db arg directly (and dump the schema and parse it I guess), would make it easier for migration runners to invoke it
12:06:45Araqdom96_w, I'm beginning to like the simplicity
12:07:15Araqimport an url, Nimble/Nim will cache the package in a project specific directory like "deps"
12:07:41Araqand to update you delete the package from deps. reproducible builds, project specific
12:08:08Araqand instead of Nimscripting my Nimble file I can use 'when defined()' in front of an import statement
12:08:37Araqor dream up of ways to staticExec() myself into a platform specific build setup
12:08:54dom96_wI think you need to sleep on this
12:09:25dom96_wIn any case, I doubt there are any possible advantages it can bring that would be worth the disruption this would cause
12:11:21Araqwell I'm doing anything right now, I have important bugs to fix, but I might write an RFC...
12:12:15Araqthe idea feels Nim'ish to me and I sense we mostly rejected it because Go does it too and that's not good enough :-)
12:12:34FromGitter<Clyybber> Araq So can I use newNodeP to generate a `identifier = distinct cint` statement?
12:12:45Araqwhy would you? are you patching the parser?
12:12:56FromGitter<Clyybber> Im modifying c2nim
12:13:00Araqoh I see
12:13:09Araqwell yeah, you can
12:13:16FromGitter<Clyybber> So that instead of outputting enums, it outputs statics and distinct ints
12:13:23Araqah I love it
12:15:43Araqdom96_w, different topic: I changed my mind, the 'out' keyword needs to go
12:16:02Araqwe don't need even if we introduce 'out' parameters one day thanks to Nim's flexible syntax
12:16:27dom96_was far as I'm concerned our `var` is already an "out" parameter
12:16:52dom96_wunless you're thinking about adding something like `var` but that you need to specify `out` when calling the proc or something too
12:17:18Araqno 'var' means 'inout'
12:17:27Araqand 'out' means "must assign first"
12:17:45Araqthis means that for example:
12:17:53Araqvar x: ref T not nil
12:18:11AraqpassToOutParam(x) # x is initialized afterwards
12:18:23AraqpassToVarParam(x) # we don't know if x is initialized afterwards
12:19:02dom96_whmmm
12:19:10dom96_whow can you even have a `ref T not nil`?
12:19:28dom96_wwithout initialising it immediately
12:20:19Araqwell "immediately" is not well defined
12:20:33FromGitter<Clyybber> lazy
12:20:36FromGitter<Clyybber> ?
12:20:54dom96_wIf you want to analyse the following statements then IMO that's too complex
12:20:59dom96_wYou should make the job easier for yourself
12:21:12dom96_wand not complicate the compiler further with these inferences
12:21:42Araqit's quite simple to analyse but without 'out' the compiler would have to perform an inter-procedural analysis
12:22:12Araqand that's usually where we draw the line to keep compiletimes low
12:25:16AraqClyybber: one definition would be "assign a not-nil value to it before you read the variable"
12:25:56FromGitter<Clyybber> Thats what I figured
12:31:36dom96_wAraq: yeah, screw that. Just get the user to give the ref a default value that isn't nil.
12:31:51dom96_w(or come up with a way to do that for them, could be handy)
12:33:27AraqI didn't make a proposal, all I did was explain why 'out' and 'var' are not the same
12:34:05Araqfowl came up with an "import by url" feature with a macro btw
12:34:26FromGitter<Clyybber> Oh, that sounds interesting
12:34:57Araqso we already have it in the language, it's not a major change in the language
12:35:14Araqbut I can understand why you dislike it, ofc
12:35:44FromGitter<Clyybber> Does that macro still work in current nim?
12:36:22Araqprobably it's just staticExec("curl ...") under the hood, so yeah
12:54:17*shpx joined #nim
12:56:15FromDiscord_<Shield> @Araq can you use -export-dynamic in a nim library? I didn't have luck with it
12:59:31leorizeshouldn't `--passL:'-Wl,--export-dynamic'` work?
13:01:21FromDiscord_<Shield> I think the problem declaring a function without a body in nim
13:02:19leorize`= discard` is your friend for empty functions
13:04:34FromGitter<zacharycarter> Araq - you will like this tweet :) - https://twitter.com/KevinHoffman/status/1056881620072964096
13:07:21FromDiscord_<Shield> the function is imported to the library by importc, the way it works in C is that the function need to be forward declared, I'm not sure about the correct way in Nim, using discard basically gives it a body and give you an empty function instead of linking properly
13:07:51*platoff quit (Read error: Connection reset by peer)
13:08:08*platoff joined #nim
13:08:39leorizeShield: uhmmm, `proc name(param) {.importc: "name".}`?
13:08:43leorizethat's all you'd need
13:10:13leorizeoh, and `{.cdecl.}`
13:12:50FromDiscord_<Shield> i keep getting "undefined reference to `hostProc' "
13:13:20leorizehave you linked your program to the library that provides it?
13:13:42leorizeor just use `{.dynlib: "libname.(so|dll|whatever)".}`
13:17:11FromDiscord_<Shield> this is what I want to do https://stackoverflow.com/questions/17081131/how-can-a-shared-library-so-call-a-function-that-is-implemented-in-its-loader
13:17:44FromDiscord_<Shield> I want the lib to call functions defined in the loader program
13:18:33leorizecan I see your current .nim file?
13:18:37*platoff quit (Ping timeout: 246 seconds)
13:19:52*platoff joined #nim
13:21:01leorizeoh you mean the second answer
13:22:01FromDiscord_<Shield> yeah
13:22:12leorizetag your functions with `{.exportc.}`
13:22:20leorizeso that the compiler won't mangle them
13:22:43leorizesorry `{.exportc: "name".}`
13:23:04leorizethen `--export-dynamic`
13:23:14leorizein the library, use `{.importc.}`
13:28:22*endragor quit (Remote host closed the connection)
13:29:50FromDiscord_<Shield> https://hastebin.com/cahamujifo.nim
13:30:21*platoff quit (Ping timeout: 252 seconds)
13:30:51FromDiscord_<Shield> i keep getting "undefined reference to `hostProc' "
13:31:03*platoff joined #nim
13:32:07leorizeShield: see the comment section of that second answer
13:36:13FromGitter<tim-st> btw on windows the error messges dont look good anymore it always prints lile `..\..\..\..\..\C:\Program Files\Nim\lib\system.nim(2661, 15) Error` I'm pretty sure this is new, is it the same on linux?
13:36:14FromDiscord_<Shield> I'm using minGW
13:38:46FromDiscord_<Shield> to answer my own question " Windows does not support "automatic reverse dynamic linking" "
13:38:50FromDiscord_<Shield> gg windows
13:38:57*Perkol joined #nim
13:39:07leorizealso your snippet won't work since GC...
13:40:35FromDiscord_<Shield> what about it? do I need to change GC options for a lib?
13:40:35FromGitter<narimiran> @tim-st yeah, it is the same/similar on linux, started not so long ago
13:42:50leorizeShield: IIRC you'd have to link both to libnimrtl
13:43:00leorizeusing `-d:useNimRtl`
13:43:12FromGitter<Clyybber> Araq How would I create a PNode that is equal to `: SomeTypeIdentifier` ?
13:44:44FromGitter<tim-st> @narimiran thanks, I think it's a bug, will have a look if there is already an issue
13:45:10FromGitter<tim-st> (or an issue at least)
13:45:14FromGitter<Clyybber> Araq Nevermind I figured it out
13:48:24*endragor joined #nim
13:49:21FromDiscord_<Shield> thanks leorize, I intend to use shared libraries for modding and I wanted to ask how to deal with GC'd objects
13:52:20leorizeShield: https://github.com/nim-lang/Nim/tree/devel/tests/dll
13:52:24leorizethose are some examples
13:53:12*endragor quit (Ping timeout: 272 seconds)
13:55:45FromDiscord_<Shield> checking it, thanks
13:58:17dom96_wtim-st: bug report
13:58:55*platoff quit (Read error: Connection reset by peer)
14:00:02*platoff joined #nim
14:01:25FromGitter<tim-st> dom96: yes, I need to find the example code that printed this
14:03:02copygirlIf I pass a block to a macro, in which a type is being used, how can I compare that against my own type?
14:03:32copygirl`when node is T0:` I doubt this would work..?
14:04:15copygirlI suppose the block might need to be typed..? But that's about as far as I can think.
14:04:19shashlickfinally reading the survey results
14:04:50shashlickawesome that the full results were also shared
14:13:39Araqto export to a DLL, use {.exportc, dynlib.}
14:15:15FromGitter<narimiran> @tim-st added linux examples. now i see it is the same for devel and 0.19.0, so i guess that was not-so-recent change :/
14:33:57*elrood quit (Quit: Leaving)
14:40:41*dddddd joined #nim
14:42:25*theelous3 joined #nim
14:42:49dom96_wYeah, so what do you guys think about the survey results?
14:42:56FromGitter<alehander42> @copygirl `is` should work
14:43:15*Vladar quit (Remote host closed the connection)
14:43:17*dom96_w is desperate for some feedback after spending many days writing this up :)
14:43:19FromGitter<alehander42> in the generated code, if you mean to check the type of node
14:43:22FromGitter<alehander42> hmm
14:43:39copygirlIt would be in the macro itself, not generated code.
14:43:40*Vladar joined #nim
14:43:41FromGitter<alehander42> @dom96 https://forum.nim-lang.org/t/4337 was quite extensive :D
14:44:05FromGitter<alehander42> @copygirl you can generate this check in your generated code, that's the approach I took in gara
14:44:13dom96_woh yeah, I need to read that
14:44:17FromGitter<alehander42> but it might be too messy in your case
14:44:55copygirlWant to make a match macro for my Either type: `either.match(value): \n string: echo value \n int: echo $value \n else: echo "not int or string"`
14:45:23Araqdom96_w, and I need to reply ...
14:45:32Araqit's a long post but the end is so nice :-)
14:45:35copygirleither could be a `Either4[string, bool, int, float]` for example.
14:45:46copygirldom96_w: Link? I'm curious.
14:46:03dom96_whttps://nim-lang.org/blog/2018/10/27/community-survey-results-2018.html
14:50:49FromGitter<alehander42> @copygirl I think with some work gara's unpackers might be able to do it too (making it possible to use gara's match for Either)
14:51:02FromGitter<narimiran> i just read that "extensive response" and it shares lots of my views too. (so when you read it dom96_w, that is my response too :))
14:52:45FromGitter<alehander42> anyway, for now can't you just
14:53:01PMunchWait, did I manage to miss a community survey? :S
14:53:04FromGitter<alehander42> generate ⏎ ⏎ if isType(either, string): ⏎ let value = .. ⏎ elif .. ... [https://gitter.im/nim-lang/Nim?at=5bd71ed0bbdc0b2505bb656d]
14:53:35PMunchOh wait, it ran long ago. So I probably responded
14:53:40FromGitter<narimiran> dom96_w, in general (and i said that in the survey): more/better documentation, tutorials, examples, blogposts is something that we (the community) should work on
14:53:43FromGitter<alehander42> and have isType being a template which can check if either has a subtype ? @copygirl
14:53:46FromGitter<tim-st> @narimiran Yes, I think it worked at 0.18.0 stable
14:53:48copygirl@alehandler42: I'll take a look at gara, too. Thanks ;)
14:54:11FromGitter<narimiran> PMunch: the results are here: https://nim-lang.org/blog/2018/10/27/community-survey-results-2018.html that's what's new
14:54:14FromGitter<alehander42> @copygirl the isType-based if/elif seems the simplest solution to me
14:57:53dom96_whah, this person sure gives a lot of praise to Araq
14:58:46PMunchWho?
14:59:09dom96_whttps://forum.nim-lang.org/t/4337
14:59:11shashlicki kind of agree with the thesis - nim rocks but interface (editor/ide, debugger, stability, 1.0, documentation) needs work
14:59:39PMunchOh wow, that's a long post :P
14:59:42shashlickpeople standing at the door because of peripheral reasons
15:00:36shashlickwhich is fickle but very practical
15:00:57*kapil____ joined #nim
15:03:37dom96_wYep. VS Code isn't good enough
15:03:52dom96_wI learned not to use a debugger with Nim
15:03:59dom96_wand learned not to use autocomplete
15:04:12FromGitter<tim-st> I never used a debugger in my life. what is it?
15:04:14dom96_wThis needs to be fixed, but honestly, I want the community to step in here
15:04:15FromGitter<tim-st> :D
15:04:31dom96_wWe cannot possibly make sure that Sublime, VS Code, emacs, vim and whatever else has perfect Nim support
15:05:04copygirlOh actually instead of comparing to the generic types I bet I can compare to `type(valueX)` and such.
15:05:20Araqdom96_w, actually I am trying to support Sublime, VSCode, emacs and Vim....
15:05:25PMunchThat's why I was hoping to get the language server up and running
15:05:27Araqthese 4.
15:05:33dom96_wWhy?
15:05:43Araqbecause what's the alternative?
15:06:09FromGitter<alehander42> @dom96_w I don't really agree, supporting those editors is absolutely the best shot we have for IDE right now
15:06:18FromGitter<alehander42> making a custom IDE is 20x the work
15:06:20dom96_wThe alternative is: ensure VS Code works perfectly and tell people "This is the flagship example, if you can't get the same support then your editor sucks so use VS code"
15:06:36PMunchWith the language server you have one thing to maintain (Nim -> language server) then the language server -> editor step is maintained by someone else
15:06:38FromGitter<alehander42> well, people are religious about their editors
15:06:47FromGitter<alehander42> you can't force them to use vs code
15:06:55dom96_walehander42: Don't worry. I know perfectly well how much work writing an IDE is
15:07:11FromGitter<alehander42> I guess so :D
15:07:15PMunchAgain, language server should help bridge the gap between editors
15:07:26Araqdom96_w, that works better if somebody spent some time in fixing the VSCode<->nimsuggest interop
15:07:30FromGitter<alehander42> and yeah, the language server is something that would help a lot, I a gree
15:07:31copygirlA *custom* editor for Nim?
15:07:33FromGitter<narimiran> +1 for language server
15:07:43Araqlanguage server is just a buzzword
15:07:45dom96_wAraq: ... yes.
15:07:53Araqnimsuggest has a protocol, editors can learn it
15:08:02dom96_wYou just said you're fixing all of these editors
15:08:04Araqand Emacs and VSCode already speak this protocol
15:08:13dom96_wAnd now you're saying that it would help if someone fixed VS Code?
15:08:20Araqyes. :-)
15:08:36AraqI want Nim to support these 4 editors.
15:08:44PMunchAraq, yes. But then every editor needs to re-implement the protocol. If we write Nim -> language server then we can use all the existing editor -> language server plug-ins and get the editor support "for free"
15:08:50FromGitter<alehander42> but if we have a good LSP, we wouldn't need to teach all those editors ..
15:08:54PMunchMaintain one tool, but support all the editors
15:09:05AraqI'm unwilling to write TypeScript (VSCode), Python (Vim, sublime) or Lisp (emacs)
15:09:20FromGitter<alehander42> well, that's the entire point
15:09:31leorizeFYI neovim got TCP socket support now
15:09:45AraqLSP assumes that every language is like Java or C#...
15:09:49FromGitter<narimiran> "nimsuggest has a protocol, ... VSCode already speak this protocol" ...not very well ;)
15:09:54Araqhave you looked into it? I have.
15:10:07PMunchYes I have looked into it, even started implementing it
15:10:14leorizeI once tried to write a nimsuggest-based highlighter plugin, but was met with some nimsuggest bug...
15:10:18dom96_wI also believe LSP is the right way to go
15:10:29dom96_wBut not in the way most of you think (I'm guessing)
15:10:46Araqit's really like this: good editor integration takes effort in the langauge the editor happens to support for plugins
15:10:49PMunchHow so dom96_w?
15:11:04dom96_wThe LSP server should merge multiple sources of information about Nim code
15:11:04Araqfor example, I also want
15:11:10dom96_wNimsuggest is just one source
15:11:11Araq"expand this macro for me" support
15:11:23Araqhow does LSP deal with it? custom extension in the protocol?
15:11:36Araqthere you go, it's a Nim specific extension that every editor should learn.
15:11:38dom96_wAraq: *shrug* build the common things first
15:11:46dom96_wStop worrying about fancy features when even the basics don't work reliably
15:11:55FromGitter<narimiran> this!
15:12:01PMunchYeah..
15:12:28PMunchAnd besides, it's probably easier to write the small editor specific LSP plug-in than to rewrite the entire editor support..
15:12:28Araqthe reason VS-Code works not well with nimsuggest is not because of the lack of LSP
15:12:33shashlickwell, I guess we can all agree that the editors need more work - who is maintaining these plugins today? Are they still active and accepting PRs
15:12:40FromGitter<tim-st> @narimiran The example code crashes on 0.18.0 so an other code is needed to test it, but it's hard to find one :\
15:12:54FromDiscord_<Epictek> LSP is the best hope for nim autocomplete in such a niche editor such as kakoune atm
15:13:11FromDiscord_<Shield> it seems that I can't import the module os if I use "--define:useNimRtl", why is that?
15:13:23leorizea bug perhaps?
15:13:56FromDiscord_<Shield> I get a "Error: cannot 'importc' variable at compile time" in 0.19.0
15:14:06FromGitter<narimiran> @tim-st you mean: it compiles? because that's what it does on my end with 0.18.0
15:14:26Araqwell you can work on LSP, or you can fix VSCode.
15:14:59Araqor you can do both of course.
15:15:07AraqI see much more value in fixing what we have though.
15:15:41AraqLSP is just a buzzword, look at it in detail and try to imagine how it would improve the Nim experience on VSCode.
15:15:47FromGitter<tim-st> @narimiran no the given code crashes on 0.18.0 windows, I tested this code (used from one issue) and saw it works on 0.19.1 but the path is wrong
15:16:08FromDiscord_<Shield> is this some kind of sandboxing for the dlls?
15:16:13leorizeShield: please file a bug for it
15:16:17AraqI don't see any benefits, just something that works even worse because LSP doesn't know about proc vs template vs method, for example.
15:16:21*stisa[m] quit (Ping timeout: 250 seconds)
15:16:22*Miguelngel[m] quit (Ping timeout: 250 seconds)
15:16:24*toofly[m] quit (Ping timeout: 250 seconds)
15:16:24*zielmicha[m] quit (Ping timeout: 250 seconds)
15:16:24*TheManiac[m] quit (Ping timeout: 250 seconds)
15:16:25*GitterIntegratio quit (Ping timeout: 250 seconds)
15:16:39FromGitter<narimiran> @tim-st huh, it compiles just fine on linux with v0.18.0 :/
15:16:47dom96_wAraq: LSP is just a protocol. The general idea is to commit time to this whole thing. Using LSP feels far easier because we can sort of start from scratch.
15:16:51FromGitter<tim-st> nimsuggest works quite good I saw lately the problem was the vscode nim plugin
15:16:52FromDiscord_<Shield> i'm checking if it's intended or not since it's my first time using it
15:16:55*darithorn joined #nim
15:16:57dom96_wIf I had the time I would be writing a major plugin for VS Code from scratch
15:16:59FromGitter<tim-st> the latest version works better
15:17:00*Miguelngel[m] joined #nim
15:17:09FromGitter<tim-st> @narimiran interesting :D
15:17:32dom96_wLSP would act as an agent for nimsuggest and allow users to report issues in it
15:17:44dom96_wHonestly, one of the biggest problems with nimsuggest is that reporting problems with it is a giant PITA
15:18:25FromGitter<tim-st> nimsuggest issues should be in main repo too like nimpretty
15:18:36Araqfor me the biggest problem is that I'm a nimsuggest developer but not a VSCode developer
15:18:50*TheManiac[m] joined #nim
15:18:50*toofly[m] joined #nim
15:18:55Araqso I don't control the "full stack" for developing it further
15:19:08*GitterIntegratio joined #nim
15:19:23*zielmicha[m] joined #nim
15:19:39Araqyour solution: keep me a nimsuggest developer but make nimsuggest speak LSP, I don't see how that helps me in any way
15:20:00leorizecan't someone just make a nimsuggest -> LSP bridge?
15:20:05*stisa[m] joined #nim
15:20:12Araqzahary started on that, feel free to help him
15:20:25Araqbut the protocol question is NOT the problem I'm having.
15:22:08dom96_was far as you're concerned, you'll get reports with 1) the source code 2) the command that was passed to nimsuggest 3) (Optionally) nimsuggest's state
15:22:08dom96_was far as you're concerned, you'll get reports with 1) the source code 2) the command that was passed to nimsuggest 3) (Optionally) nimsuggest's state
15:22:13dom96_wYou don't need to worry about LSP
15:23:04AraqI also have different ideas, for example
15:23:31Araqrun 'nim filldb myproject.nim' and then nimsuggest doesn't compile anything it just queries some knowledge database
15:23:43FromGitter<tim-st> @narimiran I found another prefix dotted error here: https://github.com/nim-lang/Nim/issues/9420#issue-371294002
15:23:50FromDiscord_<Shield> it's already reported in https://github.com/nim-lang/Nim/issues/8405
15:23:56FromGitter<Clyybber> Araq How would I append a nkConstSection to another nkConstSection?
15:23:59FromDiscord_<Shield> :/
15:24:23AraqClyybber: nkConstSection consists of nkConstDef nodes
15:24:43Araqshould be easy enough to merge 2 const sections, maybe in the postprocessing step
15:24:44*couven92 quit (Quit: Client disconnecting)
15:25:05FromGitter<Clyybber> Yeah, thank you
15:25:08*nsf quit (Quit: WeeChat 2.2)
15:25:27Araqwith the database idea we can just write an external Nim program that speaks LSP and queries the database for information
15:25:41Araqthis way nimsuggest truely becomes independent from the compiler
15:26:07FromDiscord_<Shield> except here it affects strformat.nim and any use of importc, how can I use normal modules then
15:27:26PMunchThe development of a LSP bridge doesn't make it impossible to write custom plug-ins however. This is about support the widest range of editors with at least the basic functionality. It will allow people who are just trying Nim to get a much better impression, and if they like it they can look into getting an IDE with a custom Nim plug-in that gives them more powerful capabilities.
15:28:02leorizeShield: I think we need a mini nimrtl with only the GC
15:30:04*Perkol quit (Quit: Leaving)
15:30:41*Trustable joined #nim
15:30:43FromDiscord_<Shield> I wanted people to use nim for modding through dlls but this problem is beyond my limited knowledge
15:30:58Araqhmm thinking further about it, I can use nimedit just to test and improve nimsuggest...
15:33:03PMunch@Shield, the last time I tried Nim -> Nim Dlls it was completely broken
15:34:34Araqit covered by the test suite...
15:35:00Araqwell I'm not saying that it isn't "completely broken" but still, it's tested :P
15:35:36FromGitter<Clyybber> It can't be that broken if this https://github.com/xomachine/SteamForwarder has been built with it
15:38:48theelous3is there a mapIt for arrays?
15:39:20leorizemapIt works on array
15:40:09theelous3sequtils.mapIt?
15:40:19theelous3or is there another mapIt
15:40:24Araqthere is only one
15:40:25leorizeyes, it works on array
15:41:13theelous3the first param to mapIt, which is a type. This is the type of the things in the seq/array?
15:41:37theelous3sorry, it's the return type of the expression?
15:42:46theelous3I have a proc with side effects and return type void, trying to use map it to run it over an array, can't seem to get the types correct
15:43:37PMunchhttps://github.com/nim-lang/Nim/issues/6886
15:43:51PMunchIn reference to dynlib being broken
15:45:07leorizetheelous3: can you give us a small snippet?
15:45:32FromGitter<alehander42> Araq, well the problem with this filldb is what happens when you change two lines in module C
15:45:41FromGitter<alehander42> do you need to run filldb again?
15:45:56FromGitter<alehander42> does it somehow get ran automatically on build?
15:46:28*theelous3_ joined #nim
15:46:34theelous3_http://dpaste.com/05F8HG9
15:46:54theelous3_I know that void doesn't work here, but it's an example of what I'm trying to do
15:47:34PMunchClybber, that isn't Nim -> Nim DLLs though, unless you have a Windows game written in Nim, in which case that might break.
15:47:45PMunchBut I think it's written in a way to not actually use the GC and such
15:47:52leorizetheelous3_: oh, map requires the proc to return AFAIK
15:48:56Araqalehander42, it's just some background process :P
15:49:10theelous3_ah ok
15:49:23leorizetheelous3_: in the case specified here just use a for loop :P
15:49:29leorizeor return the same element out
15:49:46theelous3_aye I'm just trying to do weird stuff to get to know it :)
15:49:52theelous3_ty
15:49:58FromGitter<Clyybber> Araq Where does repr handle unions?
15:50:04FromGitter<Clyybber> Or fields of union objects?
15:50:33Araqit doesn't, it doesn't know they exist, it's an object with fields
15:50:46leorizetheelous3_: and typically you only specify two param for *It functions
15:50:53Araqso you can every possible field value interpretation if it doesn't crash before
15:50:59Araq*can see
15:51:27FromDiscord_<Shield> I am making a windows game in Nim which loads Nim libraries :/
15:52:09*vlad1777d quit (Ping timeout: 246 seconds)
15:52:23leorizeShield: wait until --gc:destructors become a thing then
15:52:40PMunchShield, well I only tried on Linux, so who knows it might work just fine on Windows
15:52:44FromGitter<Clyybber> Araq There is a small visual bug with those unions in repr
15:53:53FromGitter<Clyybber> It displays them without whitespace or any seperator in between
15:54:39FromGitter<Clyybber> So for example for TNode there is no seperation between `kind` and the conditional fields
15:55:24FromGitter<Clyybber> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bd72d6b1c100a4f290236a6]
15:55:52FromGitter<Clyybber> Where there ideally should be a seperator between `nkConstSection` and `sons`
15:57:01Araqer, the AST can be debugged much more effectively with astalgo.debug
15:57:10Araqor with renderer.renderTree
15:57:16AraqI never use repr
15:57:21FromGitter<Clyybber> Oh
15:57:33FromGitter<Clyybber> Thanks
16:22:23*elrood joined #nim
16:25:06PMunchOuch, somehow the options module managed to make an option without a has field: http://ix.io/1qnK/
16:27:27*david2 joined #nim
16:27:48FromGitter<Clyybber> Araq Should I acess/change the type of a PNode by accessing `sons[1]` or is there some template/builtin way to do it?
16:31:12*david2 quit (Client Quit)
16:37:36PMunchAnd it works with 0.18.0, so it's newly introduced..
16:39:29PMunchI have to look into what causes this later..
16:39:30*PMunch quit (Quit: Leaving)
16:41:38*zachk joined #nim
16:42:20*zachk quit (Changing host)
16:42:20*zachk joined #nim
16:43:28*rockcavera quit (Remote host closed the connection)
16:45:10AraqClyybber: n[i] is the same as n.sons[i]
16:45:20Araq'sons' is just an artifact from Pascal times
16:46:02FromGitter<Clyybber> Nice, does that work by overloading `[]`?
16:47:24dom96_wAraq: Imagine the amount of days of your life you've saved not having to type those 4 extra letters in `children` :P
16:47:37FromGitter<Clyybber> chil ?
16:47:42FromGitter<Clyybber> oh
16:50:55shashlickdoes defer not work in templates
16:51:22Araqdom96_w, plus the time I saved by not having to look at the more verbose word
16:51:49Araqshashlick, since it's builtin, it works
16:52:01shashlickdefer gets called within template instead of the end of the proc the template is called in
16:52:46*narimiran joined #nim
16:55:40shashlickman makes no sense - defer within the if statement also runs within the if - am I not getting this right?
16:55:43Araqshashlick, well I trust your word but knowing the implementation it makes no sense
16:56:19Araqat least the "it's in a template" aspect should make no difference
16:57:40shashlickok - so moving defer outside the if works whether in template or in proc directly
16:57:52shashlickbut inside an `if` block, defer runs at the end of that block
16:58:02shashlicki suppose that's the expeceted behavior
16:59:41*adeohluwa joined #nim
17:00:06*rockcavera joined #nim
17:01:55FromGitter<Clyybber> Araq Is it intended that a IntLiteral cant get automatically converted to a `distinct int`
17:01:59FromGitter<Clyybber> ?
17:03:48FromGitter<Clyybber> I see it is, nvrmind then
17:11:46*PMunch joined #nim
17:13:47narimiran@tim-st you here?
17:21:09FromGitter<iffy> I want to define an interface for a type and then provide implementations for the procs of that type depending on the system (`when defined(macosx): the mac version`). What is the best way to do that and have the compiler enforce that every proc I expect to be implemented is implemented?
17:21:10FromGitter<iffy> concepts?
17:32:44FromGitter<iffy> or do I put all my `when defined(...)` pieces in the body of the procs?
17:44:54*krux02 quit (Remote host closed the connection)
17:46:41leorizeiffy: see `os` module
17:47:09leorizeit's a combination of `when defined(` with consideration for nimdoc
17:51:15Araqiffy: since it's a compiletime switch the easiest way is to put
17:51:19FromGitter<iffy> leorize: I see -- so mostly `when`s inside the body of procs. I wonder how hairy that will get for me since I'm using `emit` pragmas and using obj-c
17:51:23Araqnim check --os:windows foo.nim
17:51:27Araqnim check --os:linux foo.nim
17:51:32Araqnim check --os:macosx foo.nim
17:51:40Araqto your CI/testing and call it a day
17:52:06Araqan interface/concept is for something else
17:53:59FromGitter<iffy> oh, I didn't know about `nim check`
17:55:25*shpx quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:57:24dom96_wIf it's easier you can split your code into mymodule_windows, mymodule_posix, etc
17:57:35dom96_wand just implement the same API in each for the different OS'
17:58:07narimiranis there a way to automatically convert openArray to a seq?
17:58:25*tzui joined #nim
17:59:44leorize`seq[type](openarrayhere)`?
18:00:04leorizeafaik openArray is more or less a typeclass and not actually a type...
18:00:52Araqnarimiran: @ operator
18:01:25narimiranAraq: once again - too easy!
18:01:42narimiranthanks! :)
18:02:51*tzui quit (Ping timeout: 256 seconds)
18:03:08FromGitter<iffy> dom96_w: I'd prefer that if there were a way to have the compiler ensure the same API was implemented. I guess if I have thorough enough tests, that would work?
18:03:27dom96_wyep
18:03:44dom96_wLike Araq said, you can just run `nim check --os:windows`
18:03:53dom96_wfor each OS on your test file
18:03:58dom96_wbut your test file must use your full API
18:04:06FromGitter<iffy> right, okay, that's what I thought
18:04:17FromGitter<iffy> I'm trying to see if I can be lazier :)
18:04:17Araqthe problem is as soon as you use 'when' the compiler only follows one branch
18:04:28Araqand no concept or interface can help you
18:05:09Araqand following more than one branch at the same time would be a confusing experience with the module having symbols from both winapi and posix.nim at the same time...
18:05:13dom96_wYou can also create a thin mymodule.nim which reimplements the API and just calls the corresponding OS-specific function
18:05:24FromGitter<iffy> I was hoping I could define all my proc... what are they called? declarations? in one file, then import implementations for those procs inside a `when` thing
18:05:33dom96_wproc getVersion() = when defined(Windows): mymodule_windows.getVersion() ...
18:05:43dom96_wThat way you'll have it tested for effectively free
18:05:47dom96_wYou'll need code like this anyway
18:05:52Araqyou can do that but it doesn't help much with the checking aspect
18:06:12Araqosproc.nim declares the proc headers once and has multiple implementations
18:06:36Araqbut again, as soon as a 'when' is involved you need to simulate the different branches
18:06:47FromGitter<iffy> and would `nim check --os:windows` check that the implementations exist for those osproc.nim headers?
18:07:00Araqcertainly
18:07:10FromGitter<iffy> huh, I thought I tried importing implementations and it didn't work -- let me make sure I was trying it right
18:07:37FromDiscord_<Shield> I wonder if having each dll deal with its own memory would work, godot-nim compiles the dlls with "-d:useRealtimeGc --threads:on", it worked fine save for some quirky behavior, but I never checked if there's a memory leak
18:08:53FromDiscord_<Shield> wouldn't it be better if the host exposes GC functions to the libraries?
18:09:40AraqShield: what is the host? godot?
18:09:50*couven92 joined #nim
18:10:10FromDiscord_<Shield> a nim application
18:10:30Araqwell the GC is in the nimrtl.dll to be shared across DLLs
18:10:47Araqthat's comparable to how other langs do it on Windows
18:11:03Araqlanguages that do not have a GC but the same problems
18:11:15FromGitter<tim-st> @narimiran now^^
18:12:12FromGitter<iffy> Araq: hmm... what am I doing wrong here? https://gist.github.com/iffy/00b4426ebeaa870c4691ebe27bb09e8b
18:12:35FromGitter<xmonader> @Araq does it make sense to flush stderr if it's buffered already? or i should call flush on the case of stdout only? https://github.com/nim-lang/Nim/pull/9554
18:12:46FromDiscord_<Shield> yeah but why does it block the library from using os and libraries that rely on importc
18:13:46FromGitter<tim-st> @iffy maybe the implementation for a forward declaration is expected in the same file
18:13:55Araqiffy: you use import where you should be using include
18:14:02FromGitter<iffy> ah
18:14:46FromGitter<iffy> That works great!
18:15:02FromDiscord_<demotomohiro> This old open issue seems like solved.
18:15:02FromDiscord_<demotomohiro> https://github.com/nim-lang/Nim/issues/3482
18:15:04FromGitter<iffy> thank you Araq and dom96_w
18:16:12Araqxmonader: tbh I don't really remember but I do remember that stderr is buffered on Windows and unbuffered on Posix or the other way round
18:16:35*mech422__ joined #nim
18:17:37FromDiscord_<Shield> how about you only expose gc_ref and unref and let each library have its own gc, would that break things?
18:18:13Araqthat breaks every GC :-)
18:18:21narimiran@tim-st i've tried the example you have posted earlier (https://stackoverflow.com/questions/14931769/how-to-get-all-combination-of-n-binary-value/14931808#14931808) and to my surprise, it is possible to do it with itertools :)
18:19:10FromGitter<tim-st> narimiran: really? do you have an example for `iterator binaryCombinations(length: int): seq[bool]` ?
18:19:27*mech422_ quit (Ping timeout: 240 seconds)
18:19:34narimiranBUT, it is limited to only 4 "repeats", by doing `for x in (a, a, a, a)` :D
18:20:03FromGitter<tim-st> ah, because your code is static
18:20:08narimirannow i'm trying to make this version of product: `product*[T](s: openArray[T], repeat: Positive): seq[T] =`
18:20:34FromDiscord_<Shield> i'd go for gc:none if i knew better but i guess luajit is the only viable option
18:20:34FromGitter<tim-st> nice, I think this is what I need
18:20:48narimirancurrently available version is the way it is to allow openArrays of different types, yielding tuples
18:20:53AraqShield: use gc:regions it's much better
18:21:44Araqeverything allocs into a region, you can free the full region. soon to be patched to be a real GC...
18:21:53FromGitter<xmonader> @Araq then it won't harm to call flush on unbuffered fd correct?
18:22:50Araqtrue
18:23:23narimiran@tim-st i think i'll have it quite soon, thanks to @iffy and his earlier PR
18:25:23FromDiscord_<Shield> so ignore nimrtl and use gc:regions for each library?
18:26:35FromGitter<xmonader> Awesome can you check the PR and tell me if it makes sense to you? @Araq
18:28:40*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
18:32:29*shpx joined #nim
18:35:02*dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:40:49FromGitter<tim-st> narimiran: nice, when you need help I can have a look at the code
18:41:29narimirani just need to write some runnableExamples and update readme, and should be online soon
18:42:04FromGitter<tim-st> I think I can write an overload for static int, the static version can operate on array
18:46:13PMunchI think this has to be the strangest Nim bug I've seen in a while: http://ix.io/1qod
18:47:10PMunchHaving the first block of code somehow tells the compiler to create the right code for the option type. While removing it means Nim creates a bad options structure (or doesn't know how to check it)
18:48:26PMunchThis shows the output of the jsonSchema macro: http://ix.io/1qoe
18:48:35*PMunch quit (Remote host closed the connection)
18:48:53*kapil____ quit (Quit: Connection closed for inactivity)
18:52:42*macsek1911[m] quit (Ping timeout: 264 seconds)
18:53:02*macsek1911[m] joined #nim
18:55:55FromDiscord_<Shield> i don't know how to use gc:regions and i can't find any resources on it
18:57:29leorizejust pass `--gc:regions` to the compiler
18:57:44leorizeI never know how it actually works tho, Araq said he was working on a blog post for it
18:59:00*kapil____ joined #nim
19:00:51FromDiscord_<Shield> most of the procs are empty like GCref in gc_regions.nim, that implies that you need to free things on your own, i have no idea how to actually use it and how it's useful for a dll
19:03:40narimiran@tim-st a new version of https://github.com/narimiran/itertools is here — now you can do `for i in product([0, 1], repeat = 3): echo i`
19:06:17*floppydh quit (Quit: WeeChat 2.2)
19:07:56FromGitter<tim-st> narimiran: nice, thanks :)
19:08:16FromGitter<tim-st> is it also possible to operate on bool or should I just use int 0,1 ?
19:08:39narimiranyou can use seqs of any type, strings, and arrays of any type
19:09:03narimiran(that's `openArray[T]` :))
19:10:08FromGitter<tim-st> ok, I try :D
19:10:38narimiran...and that goes to (almost) all iterators there
19:13:45FromGitter<tim-st> is the code correct?
19:13:46FromGitter<tim-st> let a = [false, true] ⏎ var s1: seq[seq[bool]] = @[] ⏎ var length = 3 ⏎ for x in product(a, length): ⏎ s1.add(x) [https://gitter.im/nim-lang/Nim?at=5bd75bea6e5a401c2ded6878]
19:14:31FromDiscord_<Shield> according to https://forum.nim-lang.org/t/3107#19528 gc:regions indeed require to free objects manually, but what about the result variable in every proc
19:14:55narimiran@tim-st what's the problem with it?
19:15:22FromGitter<alehander42> well
19:15:45FromGitter<tim-st> for me it doesnt compile: Error: type mismatch: got <array[0..1, bool], int>
19:15:46FromGitter<rayman22201> I thought this was documented but I guess not. This template illustrates how to use gc:regions well I think: https://github.com/nim-lang/Nim/blob/27b081d1f77604ee47c886e69dbc52f53ea3741f/lib/system/gc_regions.nim#L90
19:15:56FromGitter<rayman22201> @Shield
19:16:07narimirani copy-pasted it and it works
19:16:13FromDiscord_<Epictek> PMunch: hope you don't mind me asking, what's your progress on the LangServer like so far? Last time I checked there wasn't much progress. Just curious with the discussions today. :)
19:16:29narimirando you have the latest itertools? (probably it is not yet in nimble)
19:16:53narimirani guess `nimble install itertools@#head` might do the trick
19:16:58FromGitter<tim-st> I did `nimble install https://github.com/narimiran/itertools@#master`
19:18:05FromGitter<tim-st> narimiran: it works now :D thanks!
19:18:18FromGitter<tim-st> `@[@[false, false, false], @[false, false, true], @[false, true, false], @[false, true, true], @[true, false, false], @[true, false, true], @[true, true, false], @[true, true, true]] ⏎ `
19:18:39narimiranglad to hear it. yup, that's the output :)
19:19:03FromGitter<tim-st> thanks for the help :)
19:21:56narimirannp, i'm glad to hear someone uses it :)
19:22:16FromGitter<tim-st> narimiran: here is the code from yesterday with your iterator: https://gist.github.com/tim-st/e8b5fa36120462d8924b67a8587a73b8
19:26:49shashlickfor anyone interested in IRC/Slack/Gitter bridging - https://github.com/nim-lang/Nim/issues/7418#issuecomment-434046369
19:30:27*Trustable quit (Remote host closed the connection)
19:34:39*nsf joined #nim
19:35:37FromDiscord_<Epictek> I'm confused, we already have IRC, gitter and discord. Not really sure yet another chat platform would make sense.
19:36:06*oky quit (Ping timeout: 252 seconds)
19:37:34*poopBot joined #nim
19:38:14*oky joined #nim
19:38:15theelous3leorize: hey, I only saw this now "leorize> theelous3_: and typically you only specify two param for *It functions"
19:38:24theelous3_it was in relation to code like: http://dpaste.com/003VSX0
19:39:26theelous3_can you elabourate that a bit? I only have one param for the proc, and type / proc call in the map
19:44:43*theelous3_ quit (Ping timeout: 244 seconds)
19:45:20poopBothmm i have wierd issue i created new project to start clean form start , i did nimble init and all and when i copy pasted code i have this error "SHCnim.nim(1, 15) Error: cannot open file: oldgtk3/gtk"
19:46:05poopBotin other project it opens no problem , have smame config.nims too threads:on and clang
19:46:28*shpx quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:50:18shashlick@Epictek: Nim is everyone and people have their own chat client preferences - I'm for bridging
19:51:21poopBoti am for irc only but all people cry for discord, gitter and other craps
19:51:29FromDiscord_<Shield> I honestly don't know if memory doesn't get released back to the os or i'm handling it wrong under gc:regions
19:52:56*shpx joined #nim
19:57:38*mech422_ joined #nim
19:59:24poopBothmm cant get wtf is with this project in resintalled oldgtk3, even reinstalled whole gtk3genui just to be sure but it still works in one project and does not work in other
20:00:03poopBothow can it import it in 1 project and in aother it crys cannot open file: oldgtk3/gtk
20:00:44*mech422__ quit (Ping timeout: 244 seconds)
20:05:34FromGitter<tim-st> Pythons `a == b == c` would be nice to have in nim :\
20:08:16poopBothmm created new project same again get "cannot open file: oldgtk3/gtk" even i installed it using nimble and it works in other project np
20:11:57*NimBot joined #nim
20:12:04poopBoti dont get it, wtf is wrong
20:15:25poopBoti am moraly devasted now
20:15:27poopBot:)
20:16:18poopBoti will cone whole project to see
20:16:32*shpx quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:17:17*shpx joined #nim
20:19:47FromDiscord_<Shield> so from what I got from gc_regions.nim, you can allocate to either the default memory region or a custom one, that way you can isolate things that you want to keep and dealloc the rest
20:22:07FromDiscord_<Shield> the problem is, most of its functions are behind "when false", it doesn't keep track of freed chunks and doesn't reuse any memory at all, it will keep asking the os for new memory with every allocation, and giving how bad windows is, the os never claims it back
20:24:41FromDiscord_<🐍 Aareon 🐳> How would one go about taking a `.nim` source file, passing it to the lexer, and getting back the tokens?
20:28:21poopBoti solved my issue nimble build woudet work but building with nim went to problem
20:32:33AraqpoopBot: strange
20:33:01AraqAareon: read compiler/main.nim which does that
20:33:19AraqShield: regions have to be freed by yourself
20:38:39FromGitter<tim-st> poopBot: make sure the package is only installed once with nimble, I got the same error here https://github.com/nim-lang/nimble/issues/573
20:38:45FromDiscord_<Shield> it doesn't reuse memory until you use deallocAll() right?
20:39:12poopBotAraq, execting nim reads config.nims right?
20:39:35poopBottim-st will try that too
20:40:36AraqShield, yes
20:40:48FromDiscord_<Shield> you free the memory like a batch instead of individual objects, but where do result variables and variables defined within functions and loops go?
20:42:14Araqthese are on the stack and are freed at function exit
20:45:21FromDiscord_<Shield> oh, correct me if i'm wrong, the correct way for using regions is deallocAll since they don't support reusing freed object memory that introduce holes right?
20:45:34*Cthalupa quit (Ping timeout: 246 seconds)
20:47:37*Cthalupa joined #nim
20:48:03Araqyup
20:50:50*shpx quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:52:35FromDiscord_<Shield> nice, they're certainly better than manual management
20:53:47*shpx joined #nim
20:54:47*shpx quit (Client Quit)
20:55:02Araqas I said, I'm turning this into a regular GC mechanism but one without an enforced heap topology or conservative stack marking
20:56:20*nsf quit (Quit: WeeChat 2.2)
21:03:55FromDiscord_<🐍 Aareon 🐳> Araq: Thank you 😃
21:07:26*shpx joined #nim
21:08:48*narimiran quit (Remote host closed the connection)
21:08:53*kapil____ quit (Quit: Connection closed for inactivity)
21:11:27*mech422 joined #nim
21:14:07*mech422_ quit (Ping timeout: 240 seconds)
21:15:00*Vladar quit (Remote host closed the connection)
21:26:07*vlad1777d joined #nim
21:28:51*adeohluwa quit (Quit: Connection closed for inactivity)
21:50:12copygirlIs it possible to get the type of a `typed` NimNode?
21:50:43copygirlNot that it.. would help me. I'm just trying to figure out possible ways of doing what I want to do.
21:52:49copygirlSo I have an `EitherX[T0, T1, ..]` (still working on this, yeah) and want to create a macro that allows for easy matching of the possible types and get their values with a case-like syntax:
21:53:16copygirlhttps://gist.github.com/copygirl/60d5446bdcfe305d70a2c17a8c199790 This code currently works but the branch indices are hardcoded.
21:54:22copygirlI somehow need to find out that an ident node `"string"` is stored in the `value0` field of the case type..?
21:55:33*timotheecour joined #nim
21:56:18copygirlI could also create a separate generic macro (assuming I can) for each either type, though not sure how convenient this would be.
21:57:15copygirlIdeally I'd have a compile-time proc that tells me the index of a type. But not sure how to compare ident with generic type..?
21:59:46dom96getType et al. https://nim-lang.org/docs/macros.html#getType%2CNimNode
21:59:55dom96the json `to` macro uses it
22:00:22copygirlRight, right!
22:04:07*timotheecour_ joined #nim
22:09:56*timotheecour_ quit (Quit: Page closed)
22:10:07*timotheecour quit (Quit: Page closed)
22:14:10*shpx quit (Quit: Textual IRC Client: www.textualapp.com)
22:17:01*kapil____ joined #nim
22:22:11dom96Jesus, the amount of GitHub notifications
22:23:14copygirlAaand.. if I have a Sym node and a Ident node.. should I be able to match them using `==`, or..?
22:25:24*Jesin quit (Remote host closed the connection)
22:30:04dom96I think you can get the ident out of a Sym somehow
22:30:50copygirlBut I want to compare the types, not the idents.
22:30:56copygirlCould be an alias in some odd case.
22:31:39copygirlIdeally I want to create a sym of the ident in the context that it's used in and see if it matches with the getType() symbol..? I hope I'm making sense.
22:31:58copygirlWhat does it mean if I get "cannot evaluate at compile time: branch" ?
22:32:10*hagna quit (Quit: Page closed)
22:32:13copygirlI'm inside a macro ... that's all compile time!
22:35:42FromGitter<recloser> you can't get the type with just an ident since they're untyped
22:35:47FromGitter<recloser> you need a sym for that
22:36:03copygirlYeah but bindSym spits out that error.
22:36:37FromGitter<recloser> what's the code?
22:37:28dom96bindSym needs a literal IIRC
22:44:25*Jesin joined #nim
22:47:40*cyraxjoe joined #nim
22:49:22copygirlSorry I was going to update my Gist but I ran into something.
22:49:26copygirl^^"
22:50:27*elrood quit (Ping timeout: 252 seconds)
22:55:35*stefanos82 quit (Quit: Quitting for now...)
23:12:25copygirl@recloser: https://gist.github.com/copygirl/60d5446bdcfe305d70a2c17a8c199790
23:12:33copygirlIt's.. quite a lot.
23:12:52copygirlThere is a "FIXME" where I want to make improvements.
23:14:45copygirlSo right now I get the type of the case node, and the ident I pass to the match, and compare them as strings (using `.repr`).
23:15:15copygirlBut I probably want to turn the ident (`"string"`) to a symbol and then compare the type symbol with it.
23:21:52copygirldom96: According to https://nim-lang.org/docs/macros.html#bindSym%2C%2CBindSymRule, `bindSym` should also be able to take a `NimNode`..?
23:25:54FromGitter<recloser> maybe that's for that experimental dynamicBindSym pragma
23:26:40FromGitter<recloser> but i don't think that would get the type from the actual macro invocation place
23:26:46copygirlGotta upgrade to 1.19, hmm? ^^
23:27:30FromGitter<recloser> i think it simply get the sym from the module in which the macro is defined, like regular bindsym
23:28:15copygirlThat will not be useful.
23:28:36copygirlIt would have to bind it from where it's called..?
23:29:06*darithorn quit ()
23:30:14FromGitter<recloser> if you want to get the type of that ident at the invocation site, yeah
23:32:45FromGitter<recloser> you probably implement that type check by making a static block with assertions in it
23:33:07copygirlA static block?
23:33:24*skellock joined #nim
23:34:10skellockevenin
23:34:51FromGitter<recloser> yeah, `static: some code which will run at compile time here`
23:38:49copygirlNot sure how that would help. My macro already runs at compile time..?
23:41:39FromGitter<recloser> but you can't get the typed sym with just an ident inside your macro
23:41:45FromGitter<recloser> wait a sec
23:43:24FromGitter<recloser> https://gist.github.com/recloser/6f1ebf3ca8b1a6027e1051d3849e9261
23:47:31*platoff quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
23:52:03copygirlAh..
23:54:05copygirlI'd definitely have to rewrite my code then. Wouldn't be able to use case with the checking done in the actual branches.