<< 07-03-2018 >>

00:08:27*endragor quit (Ping timeout: 256 seconds)
00:18:24*vlad1777d joined #nim
00:20:39*MJCaley joined #nim
00:26:09FromGitter<zacharycarter> thanks arthurz and @zetashift ! I don't know about brave :P definitely blindly devoted to Nim :P
00:34:39*endragor joined #nim
00:57:05*endragor quit (Ping timeout: 248 seconds)
01:08:15FromGitter<raydf> @Araq did you get any performance feedback from your experimentation with reactive programming and karax?
01:12:23*vivus quit (Ping timeout: 252 seconds)
01:24:18*endragor joined #nim
01:47:45*endragor quit (Ping timeout: 248 seconds)
02:08:38*S1t1Schu joined #nim
02:12:34*S1tiSchu quit (Ping timeout: 268 seconds)
02:14:05*endragor joined #nim
02:37:21*endragor quit (Ping timeout: 248 seconds)
02:45:25*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
03:03:04*MJCaley quit (Quit: MJCaley)
03:03:55*endragor joined #nim
03:10:25*endragor quit (Ping timeout: 248 seconds)
03:10:33*SenasOzys quit (Ping timeout: 256 seconds)
03:12:01*SenasOzys joined #nim
03:14:53*vlad1777d quit (Ping timeout: 256 seconds)
03:20:35*SenasOzys quit (Ping timeout: 240 seconds)
03:33:45FromGitter<data-man> @Yardanico: t1ha is very portable. And I'll *port* it to Nim, not bind. ⏎ cmder? No, ConEmu! :-D https://github.com/Maximus5/ConEmu
03:36:57FromGitter<data-man> @zacharycarter: I wish you a speedy recovery!
03:39:04*endragor joined #nim
04:24:33*mal``` quit (Ping timeout: 240 seconds)
04:24:51*mal`` joined #nim
04:57:48*r3d9u11 joined #nim
05:03:33*arecacea1 quit (Remote host closed the connection)
05:03:52*arecacea1 joined #nim
05:14:28*zarthur joined #nim
05:14:29*sz0 joined #nim
05:17:42*arthurz quit (Ping timeout: 245 seconds)
05:17:44*kunev quit (Ping timeout: 256 seconds)
05:38:17*nsf joined #nim
05:43:57*r3d9u11 quit (Ping timeout: 240 seconds)
06:12:47*dddddd quit (Remote host closed the connection)
06:36:43*r3d9u11 joined #nim
07:13:47*sz0 quit (Quit: Connection closed for inactivity)
07:33:12FromGitter<gogolxdong> could not load: (libmysql.dll|libmariadb.dll)
07:46:56*arnetheduck quit (Remote host closed the connection)
08:01:36TangerHey guys, do I need to overload operators for any distinct type I create or is there a pragma to get it to inherit functionality from it's base type?
08:03:26*PMunch joined #nim
08:04:24TangerNevermind, found the relevant section in the manual :) {.borrow.} is my boy
08:06:19*rokups joined #nim
08:20:28*vlad1777d joined #nim
08:31:34*xkapastel quit (Quit: Connection closed for inactivity)
08:32:30Araqraydf: no. but for me it's more about finding a convenient model than about performance
08:33:25Araqthough I doubt you can beat my latest version performance-wise, it has essentially no overhead
08:36:22*arnetheduck joined #nim
08:43:08PMunchHmm, Araq why can't you define signed ints as hexadecimal numbers?
08:43:19PMunchie: var x: int8 = 0xff
08:43:39Araq0xff is 255
08:43:48Araqand 255 doesn't fit in an int8
08:44:16*Vladar joined #nim
08:44:31PMunchWell, most languages just treat hex as bit patterns, leaving sign resolution to when it's converted to base 10
08:44:47Araqthat's not true
08:45:22PMunchThey don't?
08:45:22Araqin C hexadecimal numbers are unsigned and there are lots of questionable type conversions to make your example compile
08:45:38PMunchWell yeah, that's what I meant
08:46:26PMunchFor most people though that's what is "normal"
08:46:47AraqI prefer a type system that works over one that is "normal"
08:47:03PMunchHmm
08:47:08Araqvar x: int8 = -1
08:47:16Araqyou meant -1, so write -1
08:48:00Araqyou don't get imaginary hackerz points for an archaic ambiguous notation
08:56:33*athenot quit (Ping timeout: 240 seconds)
08:57:23*kunev joined #nim
08:58:53*athenot joined #nim
09:06:05PMunchWell, in this case I was actually looking to see if shr behaved differently with signed and unsigned integers. So it made sense to just specify a bit pattern for both
09:13:57*jsn- quit (Ping timeout: 240 seconds)
09:15:19*jsn- joined #nim
09:19:14FromGitter<matrixbot> `Temperance` what's archaic about hexadecimal numbers?
09:20:19Araqthey were introduced when conversion to decimal numbers was too slow :P
09:21:44Araq0b0011 is a bit pattern, 0xfa is line noise ;-)
09:22:29FromGitter<matrixbot> `Temperance` there are plenty of nowaday uses, for example, it's quite easy to read color in hexadecimal in a compact manner
09:22:57PMunch0b1111_1111 doesn't work either though..
09:23:39AraqPMunch: well we don't have a type for "bit pattern"
09:25:01FromGitter<matrixbot> `Temperance` also, hexadecimal is much better for remembering max number for unsigned integers :P
09:26:24PMunchYeah hexadecimal has lots of uses
09:27:09Araqyeah and if humanity would use hexadecimal everywhere we would have a formular for PI that gives us the Nth digit without having to compute the N-1 digits before that
09:27:45PMunchHaha, what?
09:28:32Araqhttps://en.wikipedia.org/wiki/Bailey%E2%80%93Borwein%E2%80%93Plouffe_formula
09:30:26PMunchHuh, interesting
09:32:43*Arrrr joined #nim
09:32:43*Arrrr quit (Changing host)
09:32:43*Arrrr joined #nim
09:33:52*floppydh joined #nim
09:36:50FromGitter<matrixbot> `Temperance` uh, that's... quite interesting.
09:37:24Yardanicomatrixbot: you can use matrix-irc bridge directly btw, because #nim is hosted on freenode
09:37:30Yardanico*Temperance
09:37:56FromGitter<matrixbot> `Temperance` I know not enoguh about matrix to understand what that means.
09:39:23FromGitter<Bennyelg> sqlquery to string?
09:41:27*sendell joined #nim
09:45:32PMunchBennyelg, was that a question?
09:45:39PMunchHave you tried $?
09:49:14*xet7 quit (Quit: Leaving)
09:50:53*yglukhov joined #nim
09:53:42FromGitter<Bennyelg> yea,
09:53:46FromGitter<Bennyelg> $ not working.
09:55:13Araqstring(s)
09:56:24*xet7 joined #nim
09:56:29PMunchWhat? Why doesn't it have $?
09:57:31Araqbecause it's a distinct string and its point is to not convert to string too easily
09:58:12PMunchAh, that makes sense
09:58:18PMunchI thought it was a more complex type
09:58:20*Vladar quit (Quit: Leaving)
09:59:29*kunev quit (Ping timeout: 248 seconds)
10:00:48YardanicoTemperance: https://gist.github.com/fstab/ce805d3001600ac147b79d413668770d
10:01:10Yardanicoso you need to join #freenode_nim:matrix.org channel on matrix
10:01:19Yardanicosorry, #freenode_#nim:matrix.org
10:02:28*kunev joined #nim
10:09:18*yglukhov quit (Remote host closed the connection)
10:13:39*Solitude[m] joined #nim
10:15:11*r3d9u11 quit (Remote host closed the connection)
10:15:34*Solitude[m] is now known as solitudesf
10:19:40*xet7 quit (Quit: Leaving)
10:21:04*xet7 joined #nim
10:22:47*xet7_ joined #nim
10:23:17*xet7 is now known as Guest24245
10:23:33*xet7_ is now known as xet7
10:24:19*Guest24245 quit (Remote host closed the connection)
10:29:12FromGitter<matrixbot> `Temperance` I'll look into it later
10:30:36YardanicoTemperance: you just type /join #freenode_#nim:matrix.org in any room (if your matrix client supports commands) and it will join :)
10:33:21*SenasOzys joined #nim
10:46:42*Temperance[m] joined #nim
10:54:43Temperance[m]is there an out of the box repo of gim with opengl and imgui working? just asking if someone tought of doing something like that
11:10:06*Vladar joined #nim
11:11:56*krux02[m] joined #nim
11:12:40krux02[m]I am now in Matrix
11:13:05FromGitter<ZarsBranchkin> oh, neat. Haven't looked into it myself
11:13:34FromGitter<krux02> I lot of latency when I join channels
11:13:45FromGitter<krux02> I have no Idea right now how all this bridging works
11:14:19FromGitter<krux02> I joinde the git channel from matrix and that is forwarded here to gitter
11:16:41krux02[m]ok all the gitter messages are mapped to the user "FromGitter" which is fine
11:16:52krux02[m]It was never different
11:18:48planetis[m]@krux02 congrats ;D
11:21:39krux02[m]maybe some time in the future also names will be mapped correctly.
11:22:38krux02[m]not names I mean pictures of people
11:25:52krux02[m]maybe at some time in the future, if this seems the best way to connect the most networks possible, this might become the new center truth of communication.
11:26:24krux02[m]currently its irc
11:27:04*xet7 quit (Ping timeout: 260 seconds)
11:29:26Yardanicokrux02[m], well, mapping names require networks to trust each other
11:30:43krux02[m]that's true
11:30:48krux02[m]but it's not impossible
11:31:15krux02[m]if the networks want bridges to exist, then this might become possible.
11:39:58*xet7 joined #nim
12:01:58*NimBot joined #nim
12:02:28*Snircle joined #nim
12:08:58*yglukhov joined #nim
12:14:15*craigger quit (Quit: bye)
12:16:27*craigger joined #nim
12:17:25*S1tiSchu joined #nim
12:18:07*PMunch_ joined #nim
12:18:26*PMunch quit (Read error: Connection reset by peer)
12:19:01FromGitter<zacharycarter> Still having issues getting this to compile - ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ https://gist.github.com/zacharycarter/a4058a6e536e45c6eb88b493eb34708d [https://gitter.im/nim-lang/Nim?at=5a9fd8b5c3c5f8b90d433e23]
12:19:34*vlad1777d quit (Ping timeout: 264 seconds)
12:20:18PMunch_Are you trying to use a C module on compile-time?
12:20:58*S1t1Schu quit (Ping timeout: 269 seconds)
12:21:32FromGitter<zacharycarter> Not that I'm aware of...
12:21:55Araqyou use 'macro' where you should use a proc or something
12:22:06Araqyou mix the NimScript API with macros
12:22:18Araqthat's confusing for me too ;-)
12:22:49Araqmake up your mind, do you want to use NimScript or a compiletime transformation?
12:24:21FromGitter<zacharycarter> Hrmmm - I didn't realize I couldn't do both :/ ⏎ ⏎ I was essentially trying to make it possible so that I could add methods to NimScript with a compile time declaration
12:27:18Araqyou can do that
12:27:40Araqbut I've only used templates for that :-)
12:27:57FromGitter<zacharycarter> ah okay - yeah I've seen it done with templates
12:29:12FromGitter<Bennyelg> hey
12:29:20Araqmacro api*(impl: untyped): untyped =
12:29:20Araq let moduleName = splitFile(lineInfoObj(callsite()).filename).name
12:29:20Araq let module = graph.makeModule(moduleName)
12:29:22FromGitter<Bennyelg> can I response simple index.html static file using jester?
12:29:45Araqcan't work, you try to run 'makeModule' at compiletime
12:30:11FromGitter<zacharycarter> ah okay
12:30:26FromGitter<zacharycarter> thx Araq
12:30:45FromGitter<ZarsBranchkin> Also damn, just found about `macros.quote`. Much neater than generating AST tree myself
12:31:39FromGitter<Bennyelg> @dom96 jester serving static html files?
12:32:55Araqbennyelg: Isn't there an example for this? it's rather simple
12:33:00FromGitter<ZarsBranchkin> @zacharycarter you should check out quote macro as well, would help cleaning up your macro as well
12:33:30FromGitter<Bennyelg> @Araq I'm sure it's but the docs on jester dont provide any example.
12:34:59PMunch_Hmm, yeah there used to be an example for this..
12:35:13PMunch_You do have setStaticDir and getStaticDir
12:35:38PMunch_Jester will automatically serve up files from it's static directory (if they are readable by others)
12:36:26PMunch_And of course you can set static dir with the settings macro as well
12:36:37Araq let contentType = getMimetype(newMimetypes(), splitFile(path).ext)
12:36:37Araq let headers = newHttpHeaders([("Content-Type", contentType)])
12:36:37Araq var file = openAsync(path, fmRead)
12:36:39Araq let data = await file.readAll()
12:36:41Araq await req.respond(Http200, data, headers)
12:36:43Araq file.close()
12:36:48Araqdoes it with asynchttpserver
12:37:03Araqand without jester
12:37:09Araqbut maybe it's easy to adapt
12:37:16PMunch_If it's static you could read it in before starting to serve routes and just reply it as a string
12:37:23PMunch_That way it will stay in memory
12:37:38Araqshouldn't it ideally use Linux's sendfile?
12:38:15Araqwhy do we lack support for this in the stdlib?
12:38:47PMunch_Hmm, well sendfile would be an option
12:39:22*r3d9u11 joined #nim
12:42:03*PMunch_ is now known as PMunch
12:45:28FromGitter<Bennyelg> if I return something as string, hows going to be rendered as html?
12:45:30PMunchdom96, saw you recently cloned a pcap library. Did you see this: https://github.com/PMunch/nim-pcap
12:45:35PMunchPure Nim implementation
12:45:54PMunchBennyelg, by setting Content-Type to text/html
12:46:00PMunchOr whatever it's mime type is
12:47:44YardanicoPMunch, maybe he asks about karax?
12:49:19PMunchYardanico, I think he was asking about Jester. At least that's what his previous question was about
12:54:54*yglukhov quit (Remote host closed the connection)
12:55:28*yglukhov joined #nim
13:00:00*yglukhov quit (Ping timeout: 256 seconds)
13:02:17euantorif not using sendile, there should be a `copyTo(Stream, Stream)` proc to copy a stream's content to another without reading it all into memory at once - small chunks should be read at a time instead
13:07:43FromGitter<krux02> no I haven't tested one example of me for quite a while and my example does not compile anymore.
13:08:28dom96PMunch: Didn't see it, but I'm not reading pcap files :)
13:08:53FromGitter<krux02> the parser creates a different AST and then my macro fails the assert
13:09:26dom96Bennyelg: you need to set the content-type
13:09:52FromGitter<krux02> euantor, that is forwarding, or piping, but not copying
13:10:54FromGitter<Bennyelg> Done.
13:11:02FromGitter<Bennyelg> I want to run it and expose it to the world
13:11:11FromGitter<Bennyelg> how can I set runForever(0.0.0.0)
13:11:13FromGitter<Bennyelg> for example
13:11:22FromGitter<krux02> euantor: and how should it behave. should it leave two streams connected and forward everything from that point on onward and return immediately? should it read from the source until the buffer is empty and then return? or should it block until the source reached EOF?
13:11:57dom96Bennyelg: that's the default
13:12:09FromGitter<krux02> well somebody should be resonsible for deleting the created connection. so you should return somthing
13:12:35euantor@krux02 I'm looking at it from a .net point of view, where it reads from source until EOF, and writes to destination leaving both streams open (but obviously source at EOF and able to be rewound)
13:13:00euantorAnd .net have both `CopyTo` and `CopyToAsync` - the latter obviously being async (as if you couldn't guess)
13:13:17euantorhttps://msdn.microsoft.com/en-us/library/dd782932(v=vs.110).aspx
13:13:27FromGitter<Bennyelg> thanks.
13:14:08euantorAlso similar to Go's `io.Copy`: https://golang.org/pkg/io/#Copy
13:14:12FromGitter<krux02> well when a stream is at EOF. there is no reopening.
13:14:16FromGitter<krux02> it is at the end.
13:14:32euantorif it's a file stream or a memory stream you can rewind by setting `.Position = 0`
13:14:49euantorObviously a network stream can't do that, but a simple file stream or memory stream can
13:15:30euantorI'd love to see `Reader`, `Writer` concepts in Nim, but when I last tried to implement such a thing in a library there were a few concept bugs that tripped me up
13:15:53*Ven`` joined #nim
13:15:53euantorhttps://github.com/nim-lang/Nim/issues/6782
13:17:11Araqeuantor: I wanted to fix that for 0.18 but found no time for it :-(
13:18:00dom96Bennyelg: I'd suggest putting jester behind nginx anyway though
13:18:01FromGitter<Bennyelg> @dom96 so I suppose that if the default is not working than the server has some security issues
13:18:02FromGitter<Bennyelg> ?
13:18:20dom96hrm?
13:18:22Araqdo we have a wrapper for ArangoDB?
13:18:55euantorNot a problem, I'm very happy with concepts otherwise - they're a really useful tool that I find myself wishing I had in other languages
13:19:41FromGitter<krux02> euantor: you don't need concepts to implement what you want to implement.
13:21:11FromGitter<krux02> you can always instead of using the concept make it explicit what types implement your interface, for example ``type Reader = MyReadImpl|OtherMyReadImpl.
13:21:11euantor@krux02: obviously, but having those concepts would be neat - being able to read JSON or something from a generic `Reader` type (file, serial port, network stream, memory stream, etc.) is nice. having it strongly typed through a concept makes it clear what's happening
13:21:54FromGitter<krux02> but you should know that concepts are not interfaces from go. You can not straight forward port Go interfaces no nim code.
13:22:07FromGitter<krux02> unless you use the GoLikeInterfaces implementation
13:22:14FromGitter<krux02> that I wrote about some time in the past.
13:22:47FromGitter<krux02> https://forum.nim-lang.org/t/2422
13:23:01FromGitter<krux02> https://github.com/andreaferretti/interfaced
13:23:05euantorno, I know that. But you can achieve something that acts in a similar way
13:24:20*floppydh_ joined #nim
13:24:39FromGitter<krux02> You can do what you want with what I suggested to you. You don't need to wait until concepts work.
13:26:28FromGitter<krux02> you can also make that generic Reader type manually and then provide `convert` functions for all implementations for it.
13:26:45FromGitter<krux02> you don't need to use those macros.
13:29:01euantoryep, I'm also aware of that. It would be nice if core types would also implement the same names and parameters for procs- eg: reading from a socket would look the same as reading from a file (which it kind of does, except it's named `readBytes` for a file and `recv` for a socket)
13:31:13FromGitter<Bennyelg> hwo I change prots?
13:31:19FromGitter<Bennyelg> ports
13:32:16Araqtemplate recv(f: File) = readBytes(f)
13:33:26euantoryep, that works Araq. Or you could do the inverse which would make more sense to me (eg: a `readBytes` for a socket)
13:33:28PMunchBennyelg, settings?
13:33:40FromGitter<data-man> I wonder, the Ring language was ever mentioned here? :)
13:33:40FromGitter<Bennyelg> @dom96 where I change the address and the port before running jester server
13:34:08dom96Bennyelg: I'm not sure how that is a security issue
13:34:27*Ven`` quit (Ping timeout: 240 seconds)
13:34:34FromGitter<Bennyelg> I cant run for example server.nim -p 1234 -h 0.0.0.0
13:34:38FromGitter<Bennyelg> ?
13:35:53PMunchBennyelg, use the settings macro
13:36:10PMunchsettings: port = Port(<whatever port number>)
13:36:24PMunchIf you want to read them from the command line you need to implement that yourself
13:36:53PMunchJust use a command-line parser and then use the port variable in that settings block
13:44:49FromGitter<Bennyelg> thanks.
13:47:47*Arrrr quit (Read error: Connection reset by peer)
14:18:57*SenasOzys quit (Ping timeout: 264 seconds)
14:22:13r3d9u11Hi. Is it possible to create unordered enum?
14:22:39PMunchDon't think so
14:22:45PMunchWhat would you need that for?
14:25:25FromGitter<andreaferretti> just create an enum
14:25:39FromGitter<andreaferretti> you cam omit numbers, they will default to 0, 1, 2...
14:25:43FromGitter<andreaferretti> it will be orderd
14:25:48FromGitter<andreaferretti> but so what?
14:25:58*SenasOzys joined #nim
14:26:00r3d9u11I'm want to implement this enum http://doc.qt.io/qt-5/qt.html#Key-enum
14:26:02FromGitter<andreaferretti> I cannot think of a case where this would be a problem
14:26:40FromGitter<andreaferretti> and?
14:26:45FromGitter<andreaferretti> what is the issue?
14:26:56PMunchThat is ordered..
14:27:04r3d9u11no
14:27:11PMunchyes
14:27:20r3d9u11I've got error about ordering
14:27:46*Jesin quit (Quit: Leaving)
14:27:46r3d9u11many error
14:27:51r3d9u11*errors
14:28:01PMunchCode?
14:28:08FromGitter<andreaferretti> can you paste what you have been trying and the errors you get?
14:29:21r3d9u11https://pastebin.com/SYTh6X28
14:29:56r3d9u11errors are begin from QtKey_CapsLock
14:31:13PMunchOh right
14:31:34PMunchOkay, so you need to re-order it to be in order
14:32:25FromGitter<andreaferretti> yeah, it's QtKey_AltGr which is out of order
14:32:38FromGitter<andreaferretti> you can just reorder linex
14:32:43FromGitter<andreaferretti> (tedious, I know)
14:33:08dom96yeah, it'd be nice if Nim just accepted this, assuming that all values are specified.
14:33:47r3d9u11:'( can I ask what is the point of such a strict rule for enums?
14:34:33Araqc2nim reorders it for you
14:35:54dom96I'd also like to know :)
14:37:30PMunchI guess it's because you can define one and the rest will be automatically numbered
14:37:49PMunchWhich would be weird with out-of-order values
14:37:56PMunchNot wrong though, just a bit strange
14:38:55*floppydh quit (Read error: Connection reset by peer)
14:39:16dom96IMO this should be relaxed. I would create an issue for this.
14:39:38*dddddd joined #nim
14:39:40*floppydh joined #nim
14:39:55PMunchAgreed, not really a good reason to keep it like that. Apart from possibly confusing people
14:40:22PMunchBut the QT enum would be confusing to read when they are in order since a lot of the keys would not be grouped like they are now
14:41:29*floppydh_ quit (Quit: WeeChat 2.0.1)
14:41:30*floppydh quit (Client Quit)
14:42:36r3d9u11yes :( but I'll try to use c2nim as temporary solution (thans for hint!)
14:42:53r3d9u11also thanks all for a little discussion!:)
14:43:03PMunchHmm, another problem though
14:43:10FromGitter<krux02> @data-man I just looked at the ring language. it claims to be innovative yet it is thagged with `dynamic` wish is an alias for "slow and type unsafe"
14:43:19PMunchQtKey_Space and Qt_Key_Any share a value..
14:43:50PMunchr3d9u11, here is your reordered enum though: https://play.nim-lang.org/?gist=fcc2c747277fc720ea075bf9f5feae83
14:44:01PMunchBut without QtKey_Any
14:46:52*Jesin joined #nim
14:48:13r3d9u11wow, many thanks!
14:49:23dom96do use c2nim though if you can :)
14:51:51PMunchYeah, wrapping Qt by hand sounds like a pain :P
14:52:11PMunchAssuming that is what you're trying to do
14:53:37FromGitter<krux02> I once tried to make the GLenum actually into an enum. I just failed at that with similar problems.
14:57:45*zielmicha[m]1 joined #nim
14:58:21PMunchdom96, Araq, the documentation for doc2 is wrong after it was renamed to doc. I made a PR here that should fix it, along with jsondoc2: https://github.com/nim-lang/Nim/pull/7279
14:58:37r3d9u11I'm just trying to learn nimqml and I need to process textfiled's event :) And I want to implement enum of qt-keycodes to easy work
15:01:48*natrys joined #nim
15:07:07*el_tejon joined #nim
15:12:47FromGitter<ZarsBranchkin> I tried to use c2nim, kind of got hang of it, but it seems that the library's API isn't c2nim friendly
15:13:32FromGitter<ZarsBranchkin> C code that stores all it's exposed functions in structs, not global functions. Kind of C++ style
15:14:07*Jesin quit (Quit: Leaving)
15:17:16FromGitter<krux02> how does C code store exposed functions in structs?
15:17:27FromGitter<ZarsBranchkin> Looks something like this: https://clbin.com/7pOU1
15:18:31FromGitter<ZarsBranchkin> This is how I ended up handling it: https://clbin.com/JZSZ7
15:19:26FromGitter<ZarsBranchkin> `{.nimcall.}` is very crucial here, because closure(the default for proc type definitions) isn't a simple pointer to function, but has reference to both the function and environment
15:20:04*endragor quit (Remote host closed the connection)
15:20:36FromGitter<krux02> I know Nim has clusure and C does not.
15:21:26FromGitter<krux02> well I think you need to support emacs values somehow
15:22:46FromGitter<ZarsBranchkin> It's fine this way, it's just a pointer that I have to pass to emacs exposed functions
15:23:08*xkapastel joined #nim
15:23:52*endragor joined #nim
15:24:23FromGitter<ZarsBranchkin> I also managed to hide away the ugly emacs function interface, so this is how the module code looks now: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5aa004260a1614b712f1d257]
15:24:56FromGitter<ZarsBranchkin> Then I can: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5aa0044853c1dbb743b4ef86]
15:26:57FromGitter<krux02> I would rename `value` to literal
15:27:41FromGitter<krux02> and the `[]` operator I would call it `symbol`
15:28:09FromGitter<ZarsBranchkin> Yeaah, I did that before, thought this might be handier
15:28:17FromGitter<krux02> and I would remove the emacs environment parameter, because it is the same every time.
15:28:40*endragor quit (Ping timeout: 240 seconds)
15:29:06FromGitter<ZarsBranchkin> Hmmm, I can either turn the emacs functions into macros or make emacs as global variable in the module
15:29:18FromGitter<krux02> I know that the environment parameter provides the ability to have in theory a second environment, but who does have that?
15:30:00FromGitter<krux02> lol, I just realized templates have dynamic scoping
15:30:05FromGitter<ZarsBranchkin> I guess setting it as global variable makes more sense, less hacking around with macros
15:30:30FromGitter<krux02> you could make the environment an environment-variables that needs to be defined
15:31:45FromGitter<ZarsBranchkin> Not really sure if environment can even be different in one instance
15:33:11FromGitter<ZarsBranchkin> Emacs first passes `runtime` to the entry point function, from which you can later get `environment`. Not sure in what case you could get two different environments
15:35:45*athenot quit (Remote host closed the connection)
15:36:17FromGitter<ZarsBranchkin> If I get rid of `emacs` object, then will definitely go back to `symbol` and `literal`. Then I'll also be able to write proper converter for `EmacsValue` objects
15:36:19*athenot joined #nim
15:37:01dom96ooh, Google Trends now has "Nim - Programming language" as an actual thing
15:38:16PMunchNice!
15:38:51*el_tejon quit (Quit: el_tejon)
15:39:01PMunchHuh, strange "interest by region" breakdown
15:39:19FromGitter<krux02> @ZarsBranchkin : http://ix.io/TEK
15:40:07FromGitter<krux02> I recently looked at the tiobe index, and I saw the "Scratch" programming language skyrocketed in the last years
15:40:44FromGitter<krux02> so not to have to type actual text maybe is the future of programming languages.
15:41:18FromGitter<ZarsBranchkin> Wasn't aware of mixin. I was using macros for similar manipulations though
15:41:33FromGitter<krux02> there is mixin and bind
15:41:48PMunchWell, everyone trying to learn programming to children or new people might want to check out scratch, no matter what language they have used before
15:41:49FromGitter<krux02> and in the macros module there is bindSym
15:42:04PMunchSimply because they don't have to worry about syntax at all
15:42:16FromGitter<krux02> not just that
15:42:22Araqkrux02: templates are "hygienic", but I doubt that gives them dynamic scoping
15:42:39FromGitter<ZarsBranchkin> Then all of my emacs interface functions have to be templates/macros. I guess it's fine, but won't be able to make use of Nim converters
15:42:41FromGitter<krux02> they have to worry about syntax, but they have less freedom to make it wrong. they can only connect it "correctly"
15:42:50FromGitter<krux02> and it does not require english
15:42:55PMunchYeah, that's what I meant
15:43:00FromGitter<krux02> very important for teaching childern in "not the USA"
15:43:43PMunchHaha, in the future imagine if Scratch (or a similar visual language) became super popular, but everyone used keyboard shortcuts to avoid getting RSI
15:43:48PMunchFull-circle!
15:44:06FromGitter<krux02> @ZarsBranchkin that is true, but I would not want to have automatic converters anyway. I would prefer a unifited interface for all types to convert from emacs to nim and vice versa
15:44:15dom96https://trends.google.com/trends/explore?q=%2Fm%2F09gp44h,%2Fm%2F0dsbpg6,%2Fg%2F11bxfy42m1
15:44:33FromGitter<krux02> like `newLit` in the macros module just make a literal of all it can make a literal of
15:44:43FromGitter<ZarsBranchkin> Alright, right now I had the approach of doing `emacsValue.toInt` and `emacsValue.toString`
15:45:03Araqkrux02: I agree I never use 'converter'
15:45:17Araqweakens the type checking too much IMO.
15:45:30FromGitter<ZarsBranchkin> oh, yeah, I'm still trying to find my style of writing Nim
15:46:37Araqthe major reason for 'converter' is easier wrapping of C++ which uses a custom string type everywhere ...
15:46:44FromGitter<krux02> dom96: it seems like Nim is very popular in Usbekistan :P. but rust also has to do with old iron so it is not really a clean query.
15:47:14dom96krux02: I specifically picked the "Rust - programming language" query
15:47:23dom96but yeah, how knows how accurate these are
15:47:44AraqRust is also a computer game iirc with a scripting interface
15:47:47FromGitter<krux02> @ZarsBranchkin I would like to have a generic interface like this: ``toNimint (emacsValue)``
15:48:12FromGitter<krux02> Araq: yes
15:48:21FromGitter<ZarsBranchkin> ah, okay, that looks neat
15:48:39FromGitter<ZarsBranchkin> Haven't used generic interfaces much
15:49:42dom96Maybe this is more accurate: https://trends.google.com/trends/explore?q=%2B%22Nim%20programming%20language%22,%2B%22Rust%20programming%20language%22,%2B%22Crystal%20programming%20language%22,%2B%22D%20programming%20language%22
15:50:47FromGitter<krux02> @ZarsBranchkin probably you will have to do type matching int he implementation.
15:51:10dom96In February 2015 we were actually above D and Rust
15:51:37dom96which was when we were slashdotted
15:51:56Araqthat was 3 years ago
15:51:57FromGitter<krux02> ``proc toNimT (arg: EmacsValue): Option[T] = when T is int: #[...]# elif T is string: ...``
15:52:00FromGitter<ZarsBranchkin> Also, I already tried some benchmarking for fun, managed to get Nim function execute faster than byte compiled elisp function. It seems that elisp function triggered elisp GC more often, thus was slower
15:52:21FromGitter<ZarsBranchkin> made simple string repeat, compared it to `s-repeat`
15:52:27Araqwe have an elisp module in nimsuggest/ or something
15:52:48Araqwe need to get v1 out and on slashdot...
15:53:51dom96yes, it might be a good idea to look at the slashdot comments and try to alleviate their concerns
15:54:49Araqmeh, I'm not good at caring about concerns.
15:55:00FromGitter<ZarsBranchkin> oh i see, that's elisp parser, I guess?
15:55:05FromGitter<krux02> Araq: I did not know about that elisp module. Might provide some nice inspiration
15:55:34Araqfear mongering doesn't produce unique ideas.
15:55:47Araqor new ones.
15:56:09FromGitter<krux02> fear mongering?
15:56:16dom96people will rehash the same concerns and the attention will fizzle out like it did in 2015 then
15:56:51Araq"I can imagine this to cause problems"
15:56:57FromGitter<ZarsBranchkin> Got something like this from the quick tests: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ where 1. is total ellapsed time, 2. times elisp GC was triggered and 3. is time GC took. ... [https://gitter.im/nim-lang/Nim?at=5aa00bc98f1c77ef3a933caf]
15:57:16Araq"That's different from the 70ies and hence bad"
15:57:56dom96actually, what would help is if you replied to people on slashdot
15:58:32Araq"Language X did something different but which I claim to be similar and it was a bad idea there"
16:02:35*miran joined #nim
16:05:31FromGitter<krux02> I just checked out slashdot. There is a valid argument very early mad in 2015 about how well Nim works with other languages and a language quality is based on how well it works with others.
16:06:08FromGitter<krux02> "If I were to create a new language, I would not focus on creating the most beautiful syntax or the best built-in functionality. Instead, I would make damn sure it plays well with other languages and that it is trivial to use software packages already written. For example, R, Python, Java -- no one wants to recode the packages (machine learning algorithms, MPI, web automatisation) in yet another language."
16:07:41FromGitter<krux02> That is totally true. so it would really be great if there would be for example an official python interface in the Nim library.
16:08:20FromGitter<krux02> Not that I personally would care about it, but it could get python developers into the boat when they see that it is acually easy to interface with their code that already works.
16:09:59Araqwe had a python.nim module in the stdlib
16:10:15FromGitter<krux02> what happened to it?
16:10:54Araqhttps://github.com/nim-lang/python it's now here
16:11:15Araqand 'nimble search python' turns up many better ways how to wrap Python
16:13:22*athenot quit (Ping timeout: 260 seconds)
16:14:15*PMunch quit (Quit: Leaving)
16:15:37Araqone thing I'd like to see in the stdlib is a follow up on graphics.nim
16:16:05Araqwith some support in producing plots and maybe some simple immediate mode UI widgets
16:17:30Araqso that newcomers are not left with the choice between terminal apps and "er ... some wrapper you need to build DLLs for first"
16:21:46Araqit could have 2 backends, one producing HTML, the other based on SDL2.
16:22:05Araqmost languages fail in this department
16:22:32Araqand only offer terminal vs "er .. some wrapper we hope works". like we do now.
16:23:10dom96Factor has a nice opengl UI package
16:23:22Araqyes, well, I said 'most'.
16:23:36dom96yes, I am giving you an example of a good one that you can copy
16:23:58Araqoh ok.
16:24:47dom96but if you do, start it out as a Nimble package
16:27:28FromGitter<krux02> Araq: yes there are some modules on wraping python, but I would be confused by which one to pick from.
16:28:14mirani have a seq of arrays, and i'm trying to pass one of those arrays to some function, and i'm getting an error which i don't understand how to fix
16:28:47zarthurHi @Araq, curious why did you ask about ArangoDB?
16:29:25mirani'm sending `seq[index]`, which i want to be underlying array, "but expression 'atIndex(Ts, [t])' is of type: float"
16:29:30Araqzarthur: I am considering to use it
16:29:46zarthurWhat use cases?
16:29:46FromGitter<krux02> Araq: I have AntTweakBar wraped, and that works out of the box, no dll to built first. Batteries included if you want to call it like that.
16:33:11FromGitter<krux02> Araq: here is a very old video that shows that ui library in some production code: https://www.youtube.com/watch?v=l05HgqQbUs4
16:34:11FromGitter<krux02> and the wrapper is on my github, I guess you remember it: https://github.com/krux02/nimAntTweakBar
16:34:21dom96That doesn't look particularly appealing :/
16:34:28dom96Here is some info about Factor's UI: https://concatenative.org/wiki/view/Factor/UI
16:34:46dom96Still looks pretty good
16:34:54FromGitter<krux02> well it was not made to look appealing, it was made to get a usable UI fast without a lot of configurations
16:35:31miranto answer myself - you do that by not being stupid, as always
16:40:51FromGitter<krux02> Well I figured out when it is about UI there are two teams fighting each other.
16:41:35FromGitter<krux02> There are the people who don't want to deal too much with UI. People who just want their functionality in the UI and they don't really care about where things are as long as they work properly.
16:42:10FromGitter<krux02> And then there is the other team who spends the entire day of thinking what font to choose and how to layout the UI for bist visual appearance.
16:42:27FromGitter<krux02> I am definitively in the first team
16:43:07FromGitter<krux02> and AntTweakBar is 100% a debugging UI.
16:44:01FromGitter<krux02> If you don't care about the font and don't care about generally anything except that there is a button (or whatever ineraction) with your text on it that does what you want it to do. AntTweakBar is really your friend.
16:44:16*Trustable joined #nim
16:44:26miranAraq: don't know if you remember, but yesterday you asked me why i need 64-bit nim and lots of memory. guess what? if i rewrite my stuff - i don't need it and everything is 20x faster :D :D
16:44:32FromGitter<krux02> And my wrapper also has SDL2 support (the original library does not support that, because development stopped before SDL2 was finished)
16:44:40dom96There is a difference between obsessing over fonts and having your eyes burned by a window with some strange background colour
16:45:17FromGitter<krux02> But it is very simple and I had no problems at all with it, so just because it is "frozen" in development doesn't mean you should avoid it.
16:45:35FromGitter<krux02> well that video is old, and it does not look like that anymore
16:45:44FromGitter<krux02> but to be honest it does not loo too different
16:46:43*r3d9u11 quit (Remote host closed the connection)
16:48:51FromGitter<Bennyelg> Best way to implement something like this ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5aa017f2e4ff28713a058cba]
16:50:57*athenot joined #nim
16:52:47Araqkrux02: that is just another wrapper, sorry. it doesn't even adhere to NEP-1 and things like
16:52:49Araqproc TwEventMouseButtonGLUT*(glutButton, glutState, mouseX, mouseY: cint): cint
16:53:00Araqare not what I have in mind
16:54:26Araqit also seems for 3D/OpenGL, graphics.nim was only 2D
16:57:47Araqzarthur: for some projects written in Nim (but not part of Nim's core)
16:59:24AraqBennyelg: there is a nimble package that does that for you but I forgot its name
17:00:02Araqhttps://github.com/jlp765/db
17:00:12AraqUnified db access module, providing a single library module to access the db_sqlite, db_mysql and db_postgres modules.
17:01:07Araqwhen you use it, your program requires all 3 sets of DLLs to be present iirc
17:11:00miranin that example with seq of arrays, if i want to reference one of those arrays i use `a = addr seq[index]`? and then i need function which takes `ptr` as a parameter?
17:11:24miranbecause `a = seq[index]` would copy it, right?
17:13:12miranand then i can do stuff like `a[x] = y` and it will be modified in the original seq. any better way to do stuff like that?
17:24:35GitDisc<treeform> I made a color library to do color stuff, color parsers, spaces and functions: https://github.com/treeform/chroma feedback? suggestion? tests!
17:25:56FromGitter<andreaferretti> @treeform cool!
17:26:06FromGitter<andreaferretti> any plans to implement LAB color space?
17:32:49FromGitter<andreaferretti> https://en.wikipedia.org/wiki/Lab_color_space
17:33:08FromGitter<andreaferretti> https://en.wikipedia.org/wiki/CIELUV
17:33:30FromGitter<andreaferretti> These are used when working on colorization, since the first component is the lightness
17:53:09*sendell quit (Remote host closed the connection)
17:55:12FromGitter<data-man> @treeform ⏎ ⏎ > Everything you want to do with colors. ⏎ ⏎ Really ?! You could be more humble! :-D ... [https://gitter.im/nim-lang/Nim?at=5aa0277f53c1dbb743b5c3d1]
17:55:38*athenot quit (Ping timeout: 255 seconds)
17:57:25*Trustable quit (Remote host closed the connection)
18:00:45Yardanicotuple for Color object?
18:01:04Yardanicowell probably it's better, yeah, but not THAT better
18:01:37*yglukhov joined #nim
18:01:37*jjido joined #nim
18:08:38*smt joined #nim
18:09:13FromGitter<data-man> @Yardanico: A tuples supports index operations, it's may be useful for colors.
18:13:42FromGitter<mratsim> uh. you can do `yourtuple[2]`?
18:14:25FromGitter<data-man> @mratsim: Yes, why not?
18:16:28FromGitter<data-man> !eval var a = (1, 2); echo a[0]
18:16:30NimBot1
18:17:10FromGitter<mratsim> for me tuples are not arrays ;)
18:17:36FromGitter<mratsim> the compiler would be free to organize as it see fits
18:21:05*rbrt joined #nim
18:24:26*cspar quit (Ping timeout: 276 seconds)
18:26:37*cspar joined #nim
18:27:46zarthurAny examples @Araq of the projects suitable?
18:28:08*PMunch joined #nim
18:32:45*SenasOzys quit (Ping timeout: 264 seconds)
18:40:45mirantreeform: do you accept PRs for chroma?
18:42:54*SenasOzys joined #nim
18:51:54Temperance[m]I'm about to start the tutorial, tough I wanted to know
18:52:08Temperance[m]how abstract would be Nim in comparison to C?
18:52:20PMunchWhat do you mean by abstract?
18:52:40Temperance[m]I mean, I'm really interested on the part of having some sort of control over the preprocessor, but for example, I'm not that big on C++ direction of things.
18:53:19PMunchAh, well Nim has it's macro system. Which is infinitely more powerful than the C pre-processor
18:54:53Temperance[m]Yes, I skimmed over several descriptions about this, which actually sounds quite good, my main issue (and probably my only real issue) is how unusable macros feel to me.
18:54:58Temperance[m]on c, I mean.
18:57:14PMunchOh yeah, C macros are a pain :P
18:57:49Temperance[m]however, my question is a little hard to phrase.
18:58:24Temperance[m]While I don't like macros, at all, I also don't like c++ templates, their sintax, the way their errors are expressed, and the compilation times.
18:58:41Temperance[m]plus every time a template is added I feel the code becomes harder to read.
18:59:01PMunchOh well, with Nim macros and templates it's more or less the exact opposite :P
18:59:27Temperance[m]what do you mean?
18:59:34FromGitter<ZarsBranchkin> Yeah, purpose of Nim templates/macros is to make the code more readable
18:59:49PMunchNim macros, IMO, makes the code easier to read
19:00:23FromGitter<ZarsBranchkin> At the cost of abstracting it away, of course, but you have the control of how you transform the code via macros
19:07:14FromGitter<ZarsBranchkin> Here is example of how I use macros to hide away messy interfaces for some application's exposed C functions: https://clbin.com/G2CU6
19:08:14FromGitter<ZarsBranchkin> The macro-less code is generated automatically in that example, so it could be formatted bit nicer, but still is noisier and more verbose.
19:09:20FromGitter<ZarsBranchkin> Oops, shouldn't have left the `expandMacros` there https://clbin.com/2L896
19:10:08PMunchOr just have a look at how Jester works
19:10:37FromGitter<ZarsBranchkin> Oh true, it has neat interface too
19:10:58*athenot joined #nim
19:11:47PMunchOr my genui macros, that convert a nice hierarchy structure to ugly GUI code
19:19:55*cspar quit (Ping timeout: 256 seconds)
19:29:02*Vladar quit (Quit: Leaving)
19:31:02*elrood joined #nim
19:31:48*yglukhov quit (Remote host closed the connection)
19:32:21*yglukhov joined #nim
19:37:12*yglukhov quit (Ping timeout: 268 seconds)
19:43:30*rokups quit (Quit: Connection closed for inactivity)
19:52:24*arthurz joined #nim
19:52:59*yglukhov joined #nim
19:54:57*zarthur quit (Ping timeout: 264 seconds)
19:57:33*yglukhov quit (Ping timeout: 268 seconds)
19:57:46*dddddd quit (Remote host closed the connection)
20:02:25FromGitter<data-man> Wow! Clang 6.0 supports configuration files. Almost like Nim. :-D
20:03:39GitDisc<Lite5h4dow> Do you guys think it would be worth making a Video Tutorial for newcommers to nim?
20:03:50GitDisc<Lite5h4dow> since there isnt one
20:04:22GitDisc<Lite5h4dow> and the Manuals on the website are bad for newcomers
20:05:06*rbrt quit (Quit: Oíche mhaith)
20:07:38dom96Lite5h4dow: of course
20:08:11dom96Plenty of easy things to show too, like for example how to install Nim
20:09:58*Jesin joined #nim
20:16:48*xet7 quit (Quit: Leaving)
20:17:21*xet7 joined #nim
20:20:05*yglukhov joined #nim
20:23:46*athenot_ joined #nim
20:24:22*yglukhov quit (Ping timeout: 245 seconds)
20:25:37*athenot quit (Ping timeout: 245 seconds)
20:25:37PMunchLite5h4dow, yes! We've actually talked about this multiple times
20:26:12PMunchI think miran or mratsim was talking about it a while back (get those two nicks mixed up, sorry to the one it wasn't for highlighting you)
20:26:22PMunchI've considered making one myself
20:28:10*nsf quit (Quit: WeeChat 2.0.1)
20:31:12miranPMunch: yes, it was me who is doing basic nim tutorial
20:32:33PMunchHow's it coming along?
20:32:36mirani haven't worked on it in last 10 days or so, other things got in the way, but it is still in works (cc lite5h4dow)
20:33:33mirani figured out the stuff i have written is basic, but is probably not basic enough, so i need to redo some stuff and/or go to more "obvious" details
20:36:37*salewski joined #nim
20:36:49PMunchNice, let me know if you want a second pair of eyes on it :)
20:37:24miranPMunch: i will definitely need them, i'll let you know when it is ready for it
20:37:45mirannonetheless, video tutorials might be a nice addition!
20:38:23salewskiLite5h4dow, what is a Nim newcommer for you? Someone with 10+ years of C++ experience, or someone without programming experience at all?
20:38:32salewskiYou see the problem?
20:38:59miranand i plan to write a blogpost about python vs nim (vs maybe julia) for numerical computing. but can't promise when will that be
20:39:24PMunchsalewski, better to have one of those categories than neither
20:39:31PMunchOr better yet both
20:39:31salewskiAnd the official Nim tutorial is fine -- for most peole.
20:39:42miransalewski: for my tutorial, it would be for people with no/minimal programming experience
20:40:18salewskiYes, of course all new Nim docu is fine.
20:40:24krux02[m]I thought about writing a Nim tutorial for C++ programmers covering several generic c++ patterns and how they look in Nim
20:40:47PMunchkrux02[m], that would be really neat
20:40:57PMunchThere is a short Nim for C programmers. But that's really basic
20:41:07salewskiBut it is funny fact that often Nim newcommers intents to write tutorials.
20:41:08miransalewski: official tutorial is fine, but for me, coming from python, some things weren't clear after reading it (and i'm sure people with c/c++ background would have much less trouble)
20:42:13krux02[m]yea people with c++ background have much less trouble, but it is also hard to convince them that there are alternatives to c++.
20:42:30miransalewski: ...because more experienced nimmers don't want to waste their time on such basic/boring stuff? ;)
20:42:55krux02[m]The mindset is a bit weird here. The mindset of c++ programmers is, because it is hard it has to be good.
20:44:11krux02[m]and they want to be sure that if they do programming language hopping that their patters that they use to write software can be expressend in the new language.
20:45:39FromGitter<ZarsBranchkin> Kind of an elitism at times, heh
20:45:49FromGitter<ZarsBranchkin> Programming isn't supposed to be easy!
20:45:51*craigger quit (Quit: bye)
20:47:51Temperance[m]"C++ patterns" would be a synonim of "oop patterns"?
20:48:44GitDisc<Lite5h4dow> @miran would you mind me making one too?
20:49:01*craigger joined #nim
20:49:25miranLite5h4dow: would you do it in video form?
20:54:13PMunchHmm: Error: attempting to call undeclared routine: 'readUint64'
20:54:18PMunchAnd I have imported streams
20:54:37FromGitter<tim-st> When I have two procs `procX*(s: var string, t: string)` and `procX*(s: string, t: string): string` (both named `procX`) should this be allowed?
20:54:52FromGitter<tim-st> Or this already return type overloading?
20:55:07PMunchI think that's allowed
20:55:15PMunchSince one is var and the other isn't
20:55:36FromGitter<tim-st> Yes, I had the same feeling for my tests, but I think the compiler has a bug:
20:56:35FromGitter<tim-st> When I declare two strings as var types and pass them and at the same time tell the compiler that I expect a proc that returns a string, it doesnt know that the second proc should be taken unless I declare them with `let`
20:57:16FromGitter<tim-st> like `var x = ""; var y = ""` let x = procX(x, y)`
20:58:04GitDisc<Lite5h4dow> yes
20:58:19GitDisc<Lite5h4dow> video Tutorial and acompanying blog
20:58:30GitDisc<Lite5h4dow> as notes and somewhere to post material
20:59:32miranyou asked me if i would mind - it's not that i'm having a monopoly on nim tutorials :D so i say - go for it!
21:00:26GitDisc<Lite5h4dow> i know but i know other youtubers dont like it if a youtuber posts similar content
21:00:32GitDisc<Lite5h4dow> knowing that they are working on it too
21:00:54FromGitter<tim-st> https://play.nim-lang.org/?gist=a348e9bcd9bb63ca08358ca2250be3f3
21:01:05FromGitter<tim-st> that's the example for the failing code
21:01:15miranwell, i'm *not* doing video tutorial. my thing will be written only. so you doing video tutorial would be a nice addition
21:01:25GitDisc<Lite5h4dow> awesome
21:01:33GitDisc<Lite5h4dow> if you want i can tie your written tutorial in
21:02:03salewskiFine videos are nice of course -- but unfortunally bad ones can repulse new users!
21:02:28GitDisc<Lite5h4dow> @tim what are you tying to do?
21:02:31miranthat might be a nice way to go, so we don't duplicate on the written stuff. i guess i should hurry up with my part :)
21:03:04FromGitter<tim-st> I'm writing strip procs like users actually want them. That needs overloading like this
21:03:19GitDisc<Lite5h4dow> tim, look at line 4.
21:03:31GitDisc<Lite5h4dow> var string, t: string
21:03:41GitDisc<Lite5h4dow> you dont need var string
21:03:42FromGitter<tim-st> yes?
21:03:54GitDisc<Lite5h4dow> var sorry
21:04:08FromGitter<tim-st> I need it, sure. I can have in place operations then
21:04:08dom96tim-st: what's the issue here? Your proc doesn't return anything, and you're assigning it to a variable
21:04:43GitDisc<Lite5h4dow> but its doing nothing
21:04:52GitDisc<Lite5h4dow> not to mention the 2 procs have the same name
21:05:05salewskiMaybe you could even do a video in other languages than english -- following english talks is not always easy for non native speakers.
21:05:09FromGitter<tim-st> the first one does return a string, and it gets to strings. It only understands what I want when I declare as `let` but I dont always have this
21:05:31krux02[m]if I get it correctly it is an example of something that is supposed to not work
21:05:46FromGitter<tim-st> No, I expect it to work!
21:05:55krux02[m]I don't think he needs help to fix it
21:05:58GitDisc<Lite5h4dow> change the name of the second proc
21:06:08krux02[m]what, can't work like that
21:06:18Temperance[m]question... objects are... structs... under the hood?
21:06:29FromGitter<tim-st> @ krux02 why?
21:06:40krux02[m]overloading based on the return value does not exist in nim
21:06:55FromGitter<tim-st> it is not overloaded like Pmunch said
21:06:56FromGitter<ZarsBranchkin> Should be structs, yes. You can check what is generated under nimcache
21:06:58dom96Temperance[m]: yep
21:07:47dom96tim-st: what krux02 said, there is no return-based overloading
21:07:58PMunchAh apparently updating to #devel worked to fix my issue
21:07:58dom96and the 'var' overloading that you get is already pretty good
21:07:59krux02[m]tim-st: it is overloaded
21:08:01krux02[m]same name therefore it's overloading
21:08:57FromGitter<tim-st> But why does it work when I declare x,y with `let` not with `var`?
21:09:29dom96because of 'var'-based overloading
21:09:35Temperance[m]okay... I kinda skimmed over the manual... and I've got... a question, well, several questions.
21:09:42dom96the 'x' is no longer a 'var', so the other proc gets picked
21:09:50dom96Temperance[m]: go for it
21:09:59mirantim-st: because you cannot use 'let-object' in 'var-argument'
21:10:19miranso there is no confusion which proc to use (it uses the first one)
21:10:22FromGitter<tim-st> In other words it is impossible in nim to overload strip procs to be in place?
21:10:28Temperance[m]if I run nim -c some.nim file
21:10:36Temperance[m]if I run nim -c somefile.nim
21:10:42Temperance[m]I meant
21:10:52Temperance[m]Will this include all other files that are included just like that?
21:11:08dom96yes
21:11:09*natrys quit (Ping timeout: 264 seconds)
21:11:39FromGitter<tim-st> @miran the point is, that there is no confusion now. The compiler can prove there is only one proc that is possible!
21:11:42Temperance[m]second question, how does nim know where to look for modules if that's the case?
21:12:18FromGitter<tim-st> When I type `let x = ...`I always want non-void
21:12:24dom96tim-st: this is why we have reverse vs reversed: https://nim-lang.org/docs/algorithm.html#reverse,openArray[T],Natural,Natural
21:12:54dom96Temperance[m]: relative to the module, followed by whatever is in Nim's "path"
21:13:05FromGitter<tim-st> @dom96 ok, thanks.
21:13:10dom96Temperance[m]: By default the path contains the stdlib, and all Nimble packages
21:13:22Temperance[m]okay
21:14:03*miran quit (Quit: Konversation terminated!)
21:15:47PMunchTemperance[m], but you can configure this in the cfg file or by passing arguments to the compiler
21:16:24Temperance[m]Okay, so far it seems this is good
21:17:40salewskiI still do not know about priority: What when module names in stdlib, nimble package and local dir are the same?
21:17:45Temperance[m]Some of the things I've read felt a little bit wonky, but... it certainly feels substantially better than python, which was what I wanted.
21:17:46Temperance[m]I'll try to set up a debugger on my ide and I might start trying to type random stuff and see what happens.
21:19:17*Jesin quit (Quit: Leaving)
21:19:22krux02[m]@Temperance i dont mean oo patterns i mean template metaprogramming patterns
21:19:56krux02[m]i thik OO i ovorrated and only has niche use cases.
21:20:10dom96salewski: stdlib comes first IIRC
21:20:10*rbrt joined #nim
21:20:42dom96salewski: We are going to be adding a way to distinguish this, see here: https://github.com/nim-lang/Nim/issues/7250
21:20:55salewskiThanks.
21:21:03Temperance[m]I think OO is good for some cases, but it has been misused so much, SO MUCH, that it needs to be stopped and ignored and put underground for a thousand years until humanity is given a chance to evolve.
21:23:03FromGitter<krux02> i think nim attracts all those OO abandoners because it is a minority to be not classically OO
21:23:21salewskiWe would still need some examples how to replace OOP Java/C++ code in Nim without OOP.
21:24:09FromGitter<krux02> well only someone who ported such code can do that.
21:26:15*r3d9u11 joined #nim
21:29:31PMunchHmm, I'm thinking of writing a documentation server in Nim
21:29:53PMunchThat could get automatically updated when you push a new tag on GitHub or a local repo
21:30:34PMunchThe benefits would include having tags so you can see documentation for different versions of libraries. And see when a function was introduced for example
21:30:52PMunchAnd you would be able to have things like comments and examples as we've discussed in the past
21:31:56*MJCaley joined #nim
21:32:43dom96Do it
21:33:07dom96That said, this will overlap with https://nimble.directory a bit.
21:33:39dom96But don't be discouraged, never hurts to have multiple implementations :)
21:34:10*Yardanico quit (Ping timeout: 240 seconds)
21:38:13PMunchWell, this is more something people could set up for their own projects
21:39:01PMunchAnd link as their project website on nimble.directory :)
21:39:02*r3d9u11 quit (Remote host closed the connection)
21:39:27Temperance[m]what level of profanity is allowed on this chat? Just asking.
21:39:46dom96I won't ban you if you say "fuck"
21:40:24dom96But there are limits
21:40:39dom96And I like to think that most people have enough common sense to know what they are :)
21:40:49Temperance[m]Well, holy fuck I don't get why regular C is so hard to compile. Nim just nails it.
21:40:58dom96:D
21:42:00*MJCaley quit (Quit: MJCaley)
21:43:17salewskidom, I think this statement in the Nim FAQ is a bit too negative for current Nim:
21:43:20salewskiThe compiler is in development and some important features are still missing.
21:43:31FromGitter<ZarsBranchkin> Compilation and library linking was the biggest headache I had coming from a scripting language
21:43:55*MJCaley joined #nim
21:43:59FromGitter<ZarsBranchkin> that is when I first started learning C++
21:44:44PMunchI downloaded some C sample code at some point, only to spend 2 hours trying to figure out how to actually compile it..
21:44:45dom96salewski: hrm, good point
21:44:59dom96Pretty sure that sentence hasn't changed in 10 years
21:45:39salewskiBye.
21:45:42*salewski quit (Quit: WeeChat 1.9.1)
21:45:43PMunchTemperance[m], haha if that level of profanity was not allowed I think this chat would be pretty empty :P
21:45:59PMunchI know I would at least have gotten banned
21:46:41*ketralnis quit (Remote host closed the connection)
21:48:18FromGitter<ZarsBranchkin> Also, recently started using https://devdocs.io/nim/ So far has been super nice for quick reference, all gathered in one place
21:48:35FromGitter<ZarsBranchkin> Hehe, using Nim index felt bit too clunky for me
21:50:27FromGitter<krux02> thanks I did not know about devdocs I always used the index
21:50:44FromGitter<krux02> I mean using the browser serach is not the worst thing you can do
21:51:15FromGitter<krux02> Only those websites that append stuff as soon as you start scrolling fail at that
21:51:20FromGitter<krux02> like for example gitter
21:51:22FromGitter<ZarsBranchkin> True, but have to keep juggling tags and return to index agan
21:51:38FromGitter<ZarsBranchkin> *tabs not tags
21:51:45Temperance[m]does anybody use nim with visual studio code?
21:51:53FromGitter<zacharycarter> yes
21:52:07PMunchTemperance[m], most people I'd wager
21:52:48FromGitter<ZarsBranchkin> That reminds me of the broken company-mode in nim-mode.. Should get back to it whenever I can
21:52:53FromGitter<ZarsBranchkin> for now I keep it disabled
21:52:54FromGitter<krux02> I would say Visual Studio Code got some popularity and then there is Zars and Me who use emacs
21:53:15FromGitter<krux02> yes I keep it disabled, too
21:53:23FromGitter<krux02> flycheck also has issues
21:53:38PMunchkrux02[m], we're some people using Vim as well
21:53:45FromGitter<krux02> would would be nice for flycheck is to set the root of the project in a buffer variable
21:53:56FromGitter<krux02> ah yea forgot vim
21:54:01FromGitter<krux02> how is Vim and Nim?
21:54:07FromGitter<ZarsBranchkin> Heh, using emacs with evil, so would kind of fit in both categories
21:54:19PMunchidk, I only use syntax highlighting
21:54:21FromGitter<Vindaar> emacs here as well
21:54:28PMunchBut for that it works fine :)
21:54:41Temperance[m]I'm trying to set up debugging on vscode but I have not used it that much
21:54:41FromGitter<krux02> does flycheck and completion work well? Or do you just disable it because it is too complicated to setup correctly and then too slow to use?
21:54:52PMunchWould be interesting to get some autocomplete and such though
21:55:02FromGitter<krux02> sorry with flycheck I mean live highlighting of errors
21:55:28FromGitter<krux02> debugging is not a good experience in Nim
21:55:46PMunchI don't really use it, so I've just never bothered to figure out why it didn't work out of the box
21:56:08FromGitter<krux02> very important --debugger:native
21:56:17FromGitter<krux02> way too verbose for my taste
21:56:32FromGitter<ZarsBranchkin> Is debugging a good experience anywhere? But I can see, getting lost in macro errors isn't fun
21:56:46*rockcavera quit (Remote host closed the connection)
21:57:13FromGitter<krux02> macros are not really the problem and can't be debugged anyway
21:57:35FromGitter<krux02> when debugging relly works way it is the default way to find out how code thet you did not write works.
21:57:51FromGitter<krux02> instead of just reading it, you just execute it step my step and see how the control flow is
21:58:00FromGitter<krux02> it is much faster to understand the code
21:58:23*rockcavera joined #nim
21:58:27FromGitter<ZarsBranchkin> Right, makes sense. Yeah, can see that
21:59:03FromGitter<krux02> but when the default way to debug is "yea use `echo`" and integrating debuggers has a lot of friction, then you just give up at some point
21:59:21FromGitter<ZarsBranchkin> That's what I love in emacs, has real neat debugger
21:59:38FromGitter<krux02> you actually like the debugger in emacs?
21:59:59FromGitter<krux02> do you mean the gdb frontend? or do you mean debugging emacs lisp?
22:00:08Temperance[m]so, its not possible to debug nim at the moment?
22:00:14FromGitter<ZarsBranchkin> Well, best debugger I've used so far, haha. I came from language where I was forced to debug only via outputting things
22:00:15Demos[m]huh?
22:00:17Demos[m]you can debug it with gdb
22:00:19Demos[m]or even windbg
22:00:23FromGitter<krux02> that is not true
22:00:25FromGitter<krux02> you can debug nim
22:00:26FromGitter<ZarsBranchkin> Debugging emacs lisp
22:00:37FromGitter<krux02> but it is not nice and it has a lot of friction everywhere
22:01:04FromGitter<krux02> so when you really want it, and accept that it is the slowest thing to get done what you want to get done, then you can do it.
22:01:46FromGitter<krux02> there are gdb pretty printers somewhere so that you can print nim types and iterate nim collections
22:03:08FromGitter<krux02> @ZarsBranchkin it would be nice if you could find out where the performance bottleneck is when flycheck is active.
22:03:20FromGitter<krux02> sometimes emacs just freezes or things are really very slow
22:03:33Temperance[m]what about endb?
22:03:44FromGitter<ZarsBranchkin> I haven't gotten into using flycheck yet, but I found that company-mode causes freezing for me
22:04:12FromGitter<ZarsBranchkin> It requested completions from nimsuggest for every character you wrote, instead of narrowing down the initially acquired list
22:04:19FromGitter<ZarsBranchkin> Didn't fix it yet
22:04:25FromGitter<krux02> I don't think it's acceptable that on those computers we have today text processing is slightley unresponsive at all.
22:05:14FromGitter<krux02> Ah yea you mentioned it, and now I think I understand it
22:05:28Temperance[m]oh, I see that endb has been discontinued, that sounds sad
22:06:07FromGitter<krux02> yea, just use a normal C debugger
22:06:35FromGitter<krux02> nim generates instructions for the C compiler to convince his he is in the nim file
22:06:42FromGitter<krux02> I think it is called source mapping
22:08:06FromGitter<ZarsBranchkin> In a project that used medium sized library, the completions following after single `.` were already over 1000, so requesting those for every changed character after `.` is mad
22:08:30*MJCaley quit (Quit: MJCaley)
22:08:56FromGitter<ZarsBranchkin> Heh, actually, emas module for nimsuggest would actually be practical use of the bindings I'm creating right now
22:13:54FromGitter<krux02> yes it would. And I would like to see that binding, too
22:14:09FromGitter<krux02> but please it should not be had to be integrated into emacs
22:14:59FromGitter<krux02> I think it would be best if the plugin can be built with `nimble install`
22:15:47FromGitter<krux02> then emacs just needs a single line in the config like (call-c-func (load-bin-module) "foobar")
22:16:11FromGitter<ZarsBranchkin> Yeah, already trying to make it simple via macros. I will hide away that emacs environment variable, it's too verbose and unnescesary for writing/reading code
22:16:25*Elronnd quit (Quit: I'm out)
22:16:34FromGitter<krux02> do you do it like I suggested with the template?
22:16:45FromGitter<krux02> or do you just use a global variable in the binding?
22:16:52FromGitter<ZarsBranchkin> Emacs already nicely supports modules, it literarly just requires it to be in lisp search path and uses `(require 'moduleName)`
22:16:55*elronnd joined #nim
22:17:14*PMunch quit (Quit: leaving)
22:17:18FromGitter<krux02> it supports binary modules?
22:17:21FromGitter<ZarsBranchkin> I will probably do templates/macros as that's how I already began approaching it before
22:17:32*madpat joined #nim
22:17:50FromGitter<krux02> yes that is ok I think
22:18:06FromGitter<ZarsBranchkin> Yeah, GNU Emacs does have module support. It might need to be enabled during compilation, but for me on arch linux, packaged emacs already had it enabled
22:18:34GitDisc<treeform> andreaferretti, thanks! Sure I can add LAB color space.
22:19:38GitDisc<treeform> data-man, I can change it "Not quite everything want to do with colors"? I have trouble with marketing my stuff so I think now I go overboard some times.
22:19:47FromGitter<krux02> @ZarsBranchkin I have a key combination in emacs to open /tmp/scratch.nim
22:20:00FromGitter<krux02> and when I want to quickly test some code I just go there
22:20:09FromGitter<krux02> very effective for me
22:20:10FromGitter<ZarsBranchkin> Neat, that's what I should get. I usually just create a directory in tmp from terminal
22:20:21FromGitter<krux02> yea
22:20:24FromGitter<krux02> it is super simple
22:20:25GitDisc<treeform> @data-man, I don't use tuples much, because all colors are 3 or 4 floats, I don't want color spaces confused with other color spaces, so I just made them as types.
22:20:43GitDisc<treeform> miran, yes PRs are welcome.
22:20:50FromGitter<krux02> http://ix.io/TOx
22:21:00FromGitter<ZarsBranchkin> Also, I'm doing pretty bold procedure rewriting with macro right now, because the default emacs function interface is pretty ugly
22:21:26*Lite5h4dow joined #nim
22:21:49GitDisc<Lite5h4dow> hello
22:22:29FromGitter<krux02> hello
22:22:33FromGitter<krux02> welcome
22:22:40FromGitter<Vindaar> @krux02 that's quite nice. I usually just go to *scratch*, activate org-mode, open a nim source code block and test there. C-c C-c compiles and prints the output
22:23:09FromGitter<krux02> well that works, too
22:23:21FromGitter<krux02> nim and org work pretty fine
22:23:28Temperance[m]welp, running gdb without breakpoints kinda feels a little bit pointless.
22:23:44FromGitter<krux02> rbreak is your friend
22:24:04FromGitter<krux02> the gdb command rbreak breaks all functions that contain that name
22:24:18FromGitter<krux02> nim adds stuff around the name
22:24:35FromGitter<krux02> so you can use to break in function foobar `rbreak foobar`
22:25:48FromGitter<krux02> very important for flycheck and nim: http://ix.io/TOI
22:26:20FromGitter<ZarsBranchkin> Emacs calls external function by passing it elisp arguments as array of EmacsValues. So instead, I made a macro, that will extract nescessary arguments so that procedure can simply look like this: ⏎ ⏎ ```proc simpleProc(a: int, b: int): EmacsValue {.emacsProc.} = ⏎ return emacs.value(a * b)``` ⏎ ⏎ which can be already bound as emacs function. [https://gitter.im/
22:26:20FromGitter... nim-lang/Nim?at=5aa0670c0a1614b712f41cd5]
22:26:50FromGitter<ZarsBranchkin> But this means I have to account for all kinds of arguments and handle them properly. For example, `a, b: int` syntax isn't supported in this version of macro
22:27:37FromGitter<krux02> @ZarsBranchkin I recommend you to use at leat flycheck, it works at least in small programs and when you restart it from time to time when it hangs
22:27:57FromGitter<krux02> and then when it uses too much memory you might have to kill the process
22:28:07FromGitter<krux02> but generally specaking it does help
22:28:08FromGitter<ZarsBranchkin> Yeah, probably, since it's already setup for me, just didn't use it yet
22:30:37Temperance[m]so, I guess nimble is like, npm for node?
22:31:14FromGitter<ZarsBranchkin> Yeah, pretty much
22:33:33FromGitter<krux02> yea
22:34:07FromGitter<krux02> but unlike other package managers for statically compiled languages, it does not bundle package binaries
22:34:28FromGitter<krux02> it makes things a lot simpler
22:35:13FromGitter<krux02> and with macros and stuff it is probably not really simple to define what a shared library in nim is.
22:37:00*Lite5h4dow left #nim (#nim)
22:39:18FromGitter<polypus74> Hi guys. Getting into Nim here :) Got a Q: https://gist.github.com/polypus74/901324fb2e125b057ac05d68b381c4d4
22:43:11FromGitter<krux02> what type of error is that? I am puzzled: http://ix.io/TP6
22:43:29Temperance[m]how I can tell nim compiler to produce the executable on a particular folder?
22:45:05FromGitter<krux02> -o:FILE
22:45:20FromGitter<krux02> it is hidden in `nim --advanced`
22:45:32FromGitter<tim-st> @polypus74 if you explicity overload the proc, it works
22:45:45FromGitter<krux02> at lot of important arguments for nim are hidden under `nim --advanced`
22:45:52FromGitter<krux02> I don't really understand that distinciton
22:48:28FromGitter<ZarsBranchkin> It is slightly confusing, sometimes I forget to check there first
22:49:32*elronnd is now known as Elronnd
22:49:32*madpat quit (Read error: Connection reset by peer)
22:49:43*madpat joined #nim
22:49:59FromGitter<polypus74> @Tim. Is that the only way? Do I need to use distinct? Thanks
22:50:05FromGitter<ZarsBranchkin> @krux02 what would be good template for getting symbol from emacs? `ident` is too ambiguous
22:50:56Temperance[m]when I run with --out:file
22:51:01Temperance[m]it doesn't produce a file
22:51:08FromGitter<krux02> in nim macros it is called bindSym
22:51:11FromGitter<ZarsBranchkin> Oh wait, never mind. Not symbol, thinking about literaly
22:51:27FromGitter<krux02> that is called newLit in macros
22:51:30Temperance[m]ah, I'm passing a path
22:51:37FromGitter<krux02> I don't want to say to call it the same
22:51:49FromGitter<tim-st> @polypus74 I missed something, I dont know how you can solve it, sry :(
22:52:06FromGitter<ZarsBranchkin> Well should definitely have different name, since it will only have one argument of basic type like int or string
22:52:12FromGitter<krux02> how about emacsLit(123)
22:52:20FromGitter<ZarsBranchkin> yeaah, seems clear
22:52:21FromGitter<krux02> or just eLit
22:52:35FromGitter<krux02> but that might be too short
22:52:49FromGitter<krux02> emLit
22:53:18FromGitter<ZarsBranchkin> That should do it, don't want it to be too long as it will appear a lot
22:53:25*beatmox quit (Remote host closed the connection)
22:53:38FromGitter<ZarsBranchkin> Already slightly annoyed of `newLitNode` and similar procedures
22:53:51FromGitter<krux02> newEmptyNode()
22:53:56*beatmox joined #nim
22:53:59FromGitter<krux02> best one
22:54:43Temperance[m]is it possible to use nimble with a repository name, even if it doesn't appear on the package list?
22:54:44Temperance[m]repository url
22:54:44Temperance[m]I meant
22:54:49FromGitter<ZarsBranchkin> it's 3 times longer than node itself, heh
22:55:44FromGitter<krux02> Temperance I don't think so
22:56:01FromGitter<krux02> but you can clone and install a git repo and it is then a nimble package
22:56:37FromGitter<ZarsBranchkin> `nimble develop` is also handy for when you want to modify it or update it by just pulling
22:56:58*madpat quit (Remote host closed the connection)
23:02:25dom96you can
23:02:34dom96nimble install <url> works fine
23:02:57FromGitter<krux02> oh, did not know, sorry
23:03:06FromGitter<ZarsBranchkin> oh true, it's written here https://github.com/nim-lang/nimble#nimble-install
23:05:09*jjido quit (Ping timeout: 264 seconds)
23:07:07Temperance[m]hmm, packages with incorrect structure, what to do...
23:08:03FromGitter<ZarsBranchkin> Isn't it just a warning for now? Should be fine
23:08:53Temperance[m]It is
23:09:19Temperance[m]By the way, I'm finding several nim benchmarks that are slower than rust
23:09:20Temperance[m]but also
23:09:26Temperance[m]they specify that they use garbage collector
23:11:17Temperance[m]I also find that C++ does this kind of stuff on benchmarks, when they have to compete, they go out of their way for slower stuff, is there an explanation for this?
23:11:32Temperance[m]well, people using c++ do this kind of stuff
23:12:32dom96Benchmarks are misleading, it just takes some time to optimise the Nim versions. Something I'm sure the Rust versions have gotten a lot of.
23:13:47*madpat joined #nim
23:14:00Temperance[m]Hmm.. I wish to know a little bit more, I kinda have some kind of vendetta towards Rust, so I don't want to see it winning anywere :P
23:19:05FromGitter<krux02> well not all benchmarks are fair
23:19:19FromGitter<krux02> I saw for example one a benchmark comparing C and Go
23:19:48FromGitter<krux02> the Go variant that used a memory pool was disqualified and the C variant the used a memory pool was not.
23:19:52FromGitter<krux02> very unfair
23:20:12FromGitter<ZarsBranchkin> Btw, got some more templates, now cleaner: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5aa073ac458cbde5570aadb4]
23:20:49FromGitter<krux02> and then there are benchmarks showing how fast haskell is, but when you actually look at the haskell implementation it is all done with low level routines and thothing of the features tha make haskell a language that you actuallly might want to use.
23:20:50shashlickhow do you send a string to a function that expects a ptr Utf16Char
23:20:54shashlickrather a WCHAR*
23:21:29FromGitter<krux02> @ZarsBranchkin I showed you a pattern with template to automatically bind the emacs environment
23:21:38FromGitter<krux02> I just tried to do it again, and it will not work
23:21:41FromGitter<krux02> I don't know why
23:21:59FromGitter<ZarsBranchkin> Mixin seemed to work fine for me
23:23:57FromGitter<ZarsBranchkin> hmm although silently requiring `emacs` variable to be set is kind of confusing. Like, calling helper procedure, which would try to use these templates would fail, unless the `emacs` variable is passed to that procedure
23:25:03FromGitter<krux02> well I have problems with that pattern right now
23:25:11FromGitter<ZarsBranchkin> For that reason, globally set emacs variable would be more robust. But I'm not sure if there can be multiple environments
23:25:17FromGitter<ZarsBranchkin> oh, what exactly is going on with it?
23:25:26FromGitter<krux02> even though I like it, I think maybe it's better if you don't use that pattern right now
23:25:53FromGitter<krux02> @ZarsBranchkin http://ix.io/TQ1
23:26:50FromGitter<krux02> so you can provide a default environment and still allow it to be overriden by user code
23:28:47FromGitter<krux02> but when I did that with the mixin function it did fail.
23:28:59FromGitter<krux02> https://github.com/nim-lang/Nim/issues/7310
23:31:06FromGitter<ZarsBranchkin> Odd, in my code I used similar pattern of calling procedure from template, which worked
23:32:01FromGitter<krux02> yes very odd
23:32:21FromGitter<krux02> what version are you using?
23:32:44FromGitter<krux02> because I just updated.
23:32:48FromGitter<ZarsBranchkin> Still on `0.17.3`, but your code fails to compile for me as well
23:32:50FromGitter<krux02> I suspect it's a regerssion
23:33:11FromGitter<krux02> then it's not a regression
23:33:57FromGitter<ZarsBranchkin> eh, will update anyway
23:34:44FromGitter<ZarsBranchkin> See, I used something similar: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5aa0771353c1dbb743b79672]
23:36:31FromGitter<krux02> maybe you can use this instead, but I am not sure if it is better: https://nim-lang.org/docs/manual.html#overloading-resolution-automatic-self-insertions
23:36:39FromGitter<krux02> I never used it
23:36:58*madpat quit (Remote host closed the connection)
23:38:21FromGitter<krux02> you might also provide a fast way to interact with emacs fucntios
23:39:00FromGitter<ZarsBranchkin> You still can, that `emacs->funcall(...)` is as fast as it will get, that's directly calling C function
23:39:15FromGitter<ZarsBranchkin> arrow is template for `emacs.funcall(emacs, ...)`
23:40:02FromGitter<krux02> for example: ``emacsfunctions(concat, length)``
23:40:26FromGitter<ZarsBranchkin> oooh, okay, I get it
23:40:52*rbrt quit (Quit: Oíche mhaith)
23:41:10FromGitter<krux02> it would be a macro with varargs[untyped)
23:41:15FromGitter<ZarsBranchkin> So it provides procedurs of emacs functions `concat` and `length`
23:41:23FromGitter<krux02> each arg should be just an identifier
23:41:28FromGitter<krux02> yes
23:42:01FromGitter<krux02> all just with a varargs[EmacsValue] interface.
23:42:17*rbrt joined #nim
23:42:23FromGitter<ZarsBranchkin> Slight problem would be dash seperated emacs functions, which is a common thing
23:42:52FromGitter<krux02> well in the past nim also allowed dash separated names
23:43:12FromGitter<krux02> you can map them to underscores in Nim
23:43:32FromGitter<krux02> or you just use capital letters
23:44:01FromGitter<krux02> fooBar is then tranlated to foo-bar on emacs
23:44:11Temperance[m]am having a little bit of a problem reading through the indentation
23:44:23FromGitter<krux02> what indentation?
23:45:09FromGitter<ZarsBranchkin> Hmm, but then can't use symbols that have literal underscore in them
23:45:34FromGitter<krux02> true
23:45:41FromGitter<krux02> it's a problem
23:45:48FromGitter<krux02> so you might have to use strings
23:45:55FromGitter<ZarsBranchkin> Yeeah, should work fine
23:47:17FromGitter<krux02> emacsfunctions("concat", "length", "seq-length")
23:47:30Temperance[m]I having trouble understanding where things are opened and closed in an example file from some project. I'm trying to move things around and I find myself lost
23:47:34FromGitter<krux02> and then it would remove the "-" for the nim identifier
23:47:54FromGitter<krux02> yes I had problems with indentation based syntax, too
23:48:13FromGitter<krux02> I like closing curly braced at the end of a block
23:48:23FromGitter<krux02> it really helps to see that there is the end of a block
23:48:47FromGitter<ZarsBranchkin> Best part about braces is that I can use vim `%` binding on them, to quickly jump to start or end of the block
23:48:56FromGitter<ZarsBranchkin> More tedious here
23:49:04FromGitter<krux02> there is a hidden feature in nim that allows you to wring with curly brace blocks, but I don't know anymore how to activate it
23:49:18FromGitter<krux02> I would not recommend to use it, but it is funny that it is there.
23:49:27Temperance[m]Just to know, indentation works like in python? or I'm missing something?
23:49:46FromGitter<krux02> yes % to jump to matching braces, I miss it in Nim
23:49:59FromGitter<ZarsBranchkin> heh, reminds of that ⏎ ⏎ ```>>> from __future__ import braces ⏎ File "<stdin>", line 1 ⏎ SyntaxError: not a chance``` [https://gitter.im/nim-lang/Nim?at=5aa07aa6888332ee3a1024af]
23:50:02FromGitter<krux02> Temperance you are right
23:50:21*craigger quit (Quit: bye)
23:50:24FromGitter<krux02> lol
23:50:50FromGitter<krux02> nim actually has that feature
23:50:56FromGitter<krux02> it is just hidden
23:50:58FromGitter<krux02> like the repl
23:51:34FromGitter<ZarsBranchkin> funny how repl is hidden. I guess because it can only interpret NimScript and is hidden to avoid confusing people? Not sure
23:52:22FromGitter<krux02> I like the repl
23:52:43FromGitter<krux02> It should be honest about it's limitations, but I really like that it is there
23:52:52FromGitter<krux02> but it hasn't been that much use for me
23:53:03FromGitter<krux02> especially because I can't really use libraries
23:53:09*craigger joined #nim
23:57:23FromGitter<ZarsBranchkin> I wonder why `func` isn't highlighted as keyword in `emacs-mode`. Sometimes it throws me off while I try to understand the cryptic error message it causes when I try to use it as argument name
23:59:44FromGitter<krux02> you mean in nim-mode?