00:08:27 | * | endragor quit (Ping timeout: 256 seconds) |
00:18:24 | * | vlad1777d joined #nim |
00:20:39 | * | MJCaley joined #nim |
00:26:09 | FromGitter | <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:15 | FromGitter | <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:45 | FromGitter | <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:57 | FromGitter | <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:12 | FromGitter | <gogolxdong> could not load: (libmysql.dll|libmariadb.dll) |
07:46:56 | * | arnetheduck quit (Remote host closed the connection) |
08:01:36 | Tanger | Hey 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:24 | Tanger | Nevermind, 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:30 | Araq | raydf: no. but for me it's more about finding a convenient model than about performance |
08:33:25 | Araq | though I doubt you can beat my latest version performance-wise, it has essentially no overhead |
08:36:22 | * | arnetheduck joined #nim |
08:43:08 | PMunch | Hmm, Araq why can't you define signed ints as hexadecimal numbers? |
08:43:19 | PMunch | ie: var x: int8 = 0xff |
08:43:39 | Araq | 0xff is 255 |
08:43:48 | Araq | and 255 doesn't fit in an int8 |
08:44:16 | * | Vladar joined #nim |
08:44:31 | PMunch | Well, most languages just treat hex as bit patterns, leaving sign resolution to when it's converted to base 10 |
08:44:47 | Araq | that's not true |
08:45:22 | PMunch | They don't? |
08:45:22 | Araq | in C hexadecimal numbers are unsigned and there are lots of questionable type conversions to make your example compile |
08:45:38 | PMunch | Well yeah, that's what I meant |
08:46:26 | PMunch | For most people though that's what is "normal" |
08:46:47 | Araq | I prefer a type system that works over one that is "normal" |
08:47:03 | PMunch | Hmm |
08:47:08 | Araq | var x: int8 = -1 |
08:47:16 | Araq | you meant -1, so write -1 |
08:48:00 | Araq | you 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:05 | PMunch | Well, 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:14 | FromGitter | <matrixbot> `Temperance` what's archaic about hexadecimal numbers? |
09:20:19 | Araq | they were introduced when conversion to decimal numbers was too slow :P |
09:21:44 | Araq | 0b0011 is a bit pattern, 0xfa is line noise ;-) |
09:22:29 | FromGitter | <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:57 | PMunch | 0b1111_1111 doesn't work either though.. |
09:23:39 | Araq | PMunch: well we don't have a type for "bit pattern" |
09:25:01 | FromGitter | <matrixbot> `Temperance` also, hexadecimal is much better for remembering max number for unsigned integers :P |
09:26:24 | PMunch | Yeah hexadecimal has lots of uses |
09:27:09 | Araq | yeah 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:45 | PMunch | Haha, what? |
09:28:32 | Araq | https://en.wikipedia.org/wiki/Bailey%E2%80%93Borwein%E2%80%93Plouffe_formula |
09:30:26 | PMunch | Huh, 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:50 | FromGitter | <matrixbot> `Temperance` uh, that's... quite interesting. |
09:37:24 | Yardanico | matrixbot: you can use matrix-irc bridge directly btw, because #nim is hosted on freenode |
09:37:30 | Yardanico | *Temperance |
09:37:56 | FromGitter | <matrixbot> `Temperance` I know not enoguh about matrix to understand what that means. |
09:39:23 | FromGitter | <Bennyelg> sqlquery to string? |
09:41:27 | * | sendell joined #nim |
09:45:32 | PMunch | Bennyelg, was that a question? |
09:45:39 | PMunch | Have you tried $? |
09:49:14 | * | xet7 quit (Quit: Leaving) |
09:50:53 | * | yglukhov joined #nim |
09:53:42 | FromGitter | <Bennyelg> yea, |
09:53:46 | FromGitter | <Bennyelg> $ not working. |
09:55:13 | Araq | string(s) |
09:56:24 | * | xet7 joined #nim |
09:56:29 | PMunch | What? Why doesn't it have $? |
09:57:31 | Araq | because it's a distinct string and its point is to not convert to string too easily |
09:58:12 | PMunch | Ah, that makes sense |
09:58:18 | PMunch | I 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:48 | Yardanico | Temperance: https://gist.github.com/fstab/ce805d3001600ac147b79d413668770d |
10:01:10 | Yardanico | so you need to join #freenode_nim:matrix.org channel on matrix |
10:01:19 | Yardanico | sorry, #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:12 | FromGitter | <matrixbot> `Temperance` I'll look into it later |
10:30:36 | Yardanico | Temperance: 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:43 | Temperance[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:40 | krux02[m] | I am now in Matrix |
11:13:05 | FromGitter | <ZarsBranchkin> oh, neat. Haven't looked into it myself |
11:13:34 | FromGitter | <krux02> I lot of latency when I join channels |
11:13:45 | FromGitter | <krux02> I have no Idea right now how all this bridging works |
11:14:19 | FromGitter | <krux02> I joinde the git channel from matrix and that is forwarded here to gitter |
11:16:41 | krux02[m] | ok all the gitter messages are mapped to the user "FromGitter" which is fine |
11:16:52 | krux02[m] | It was never different |
11:18:48 | planetis[m] | @krux02 congrats ;D |
11:21:39 | krux02[m] | maybe some time in the future also names will be mapped correctly. |
11:22:38 | krux02[m] | not names I mean pictures of people |
11:25:52 | krux02[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:24 | krux02[m] | currently its irc |
11:27:04 | * | xet7 quit (Ping timeout: 260 seconds) |
11:29:26 | Yardanico | krux02[m], well, mapping names require networks to trust each other |
11:30:43 | krux02[m] | that's true |
11:30:48 | krux02[m] | but it's not impossible |
11:31:15 | krux02[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:01 | FromGitter | <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:18 | PMunch_ | Are you trying to use a C module on compile-time? |
12:20:58 | * | S1t1Schu quit (Ping timeout: 269 seconds) |
12:21:32 | FromGitter | <zacharycarter> Not that I'm aware of... |
12:21:55 | Araq | you use 'macro' where you should use a proc or something |
12:22:06 | Araq | you mix the NimScript API with macros |
12:22:18 | Araq | that's confusing for me too ;-) |
12:22:49 | Araq | make up your mind, do you want to use NimScript or a compiletime transformation? |
12:24:21 | FromGitter | <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:18 | Araq | you can do that |
12:27:40 | Araq | but I've only used templates for that :-) |
12:27:57 | FromGitter | <zacharycarter> ah okay - yeah I've seen it done with templates |
12:29:12 | FromGitter | <Bennyelg> hey |
12:29:20 | Araq | macro api*(impl: untyped): untyped = |
12:29:20 | Araq | let moduleName = splitFile(lineInfoObj(callsite()).filename).name |
12:29:20 | Araq | let module = graph.makeModule(moduleName) |
12:29:22 | FromGitter | <Bennyelg> can I response simple index.html static file using jester? |
12:29:45 | Araq | can't work, you try to run 'makeModule' at compiletime |
12:30:11 | FromGitter | <zacharycarter> ah okay |
12:30:26 | FromGitter | <zacharycarter> thx Araq |
12:30:45 | FromGitter | <ZarsBranchkin> Also damn, just found about `macros.quote`. Much neater than generating AST tree myself |
12:31:39 | FromGitter | <Bennyelg> @dom96 jester serving static html files? |
12:32:55 | Araq | bennyelg: Isn't there an example for this? it's rather simple |
12:33:00 | FromGitter | <ZarsBranchkin> @zacharycarter you should check out quote macro as well, would help cleaning up your macro as well |
12:33:30 | FromGitter | <Bennyelg> @Araq I'm sure it's but the docs on jester dont provide any example. |
12:34:59 | PMunch_ | Hmm, yeah there used to be an example for this.. |
12:35:13 | PMunch_ | You do have setStaticDir and getStaticDir |
12:35:38 | PMunch_ | Jester will automatically serve up files from it's static directory (if they are readable by others) |
12:36:26 | PMunch_ | And of course you can set static dir with the settings macro as well |
12:36:37 | Araq | let contentType = getMimetype(newMimetypes(), splitFile(path).ext) |
12:36:37 | Araq | let headers = newHttpHeaders([("Content-Type", contentType)]) |
12:36:37 | Araq | var file = openAsync(path, fmRead) |
12:36:39 | Araq | let data = await file.readAll() |
12:36:41 | Araq | await req.respond(Http200, data, headers) |
12:36:43 | Araq | file.close() |
12:36:48 | Araq | does it with asynchttpserver |
12:37:03 | Araq | and without jester |
12:37:09 | Araq | but maybe it's easy to adapt |
12:37:16 | PMunch_ | If it's static you could read it in before starting to serve routes and just reply it as a string |
12:37:23 | PMunch_ | That way it will stay in memory |
12:37:38 | Araq | shouldn't it ideally use Linux's sendfile? |
12:38:15 | Araq | why do we lack support for this in the stdlib? |
12:38:47 | PMunch_ | Hmm, well sendfile would be an option |
12:39:22 | * | r3d9u11 joined #nim |
12:42:03 | * | PMunch_ is now known as PMunch |
12:45:28 | FromGitter | <Bennyelg> if I return something as string, hows going to be rendered as html? |
12:45:30 | PMunch | dom96, saw you recently cloned a pcap library. Did you see this: https://github.com/PMunch/nim-pcap |
12:45:35 | PMunch | Pure Nim implementation |
12:45:54 | PMunch | Bennyelg, by setting Content-Type to text/html |
12:46:00 | PMunch | Or whatever it's mime type is |
12:47:44 | Yardanico | PMunch, maybe he asks about karax? |
12:49:19 | PMunch | Yardanico, 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:17 | euantor | if 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:43 | FromGitter | <krux02> no I haven't tested one example of me for quite a while and my example does not compile anymore. |
13:08:28 | dom96 | PMunch: Didn't see it, but I'm not reading pcap files :) |
13:08:53 | FromGitter | <krux02> the parser creates a different AST and then my macro fails the assert |
13:09:26 | dom96 | Bennyelg: you need to set the content-type |
13:09:52 | FromGitter | <krux02> euantor, that is forwarding, or piping, but not copying |
13:10:54 | FromGitter | <Bennyelg> Done. |
13:11:02 | FromGitter | <Bennyelg> I want to run it and expose it to the world |
13:11:11 | FromGitter | <Bennyelg> how can I set runForever(0.0.0.0) |
13:11:13 | FromGitter | <Bennyelg> for example |
13:11:22 | FromGitter | <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:57 | dom96 | Bennyelg: that's the default |
13:12:09 | FromGitter | <krux02> well somebody should be resonsible for deleting the created connection. so you should return somthing |
13:12:35 | euantor | @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:00 | euantor | And .net have both `CopyTo` and `CopyToAsync` - the latter obviously being async (as if you couldn't guess) |
13:13:17 | euantor | https://msdn.microsoft.com/en-us/library/dd782932(v=vs.110).aspx |
13:13:27 | FromGitter | <Bennyelg> thanks. |
13:14:08 | euantor | Also similar to Go's `io.Copy`: https://golang.org/pkg/io/#Copy |
13:14:12 | FromGitter | <krux02> well when a stream is at EOF. there is no reopening. |
13:14:16 | FromGitter | <krux02> it is at the end. |
13:14:32 | euantor | if it's a file stream or a memory stream you can rewind by setting `.Position = 0` |
13:14:49 | euantor | Obviously a network stream can't do that, but a simple file stream or memory stream can |
13:15:30 | euantor | I'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:53 | euantor | https://github.com/nim-lang/Nim/issues/6782 |
13:17:11 | Araq | euantor: I wanted to fix that for 0.18 but found no time for it :-( |
13:18:00 | dom96 | Bennyelg: I'd suggest putting jester behind nginx anyway though |
13:18:01 | FromGitter | <Bennyelg> @dom96 so I suppose that if the default is not working than the server has some security issues |
13:18:02 | FromGitter | <Bennyelg> ? |
13:18:20 | dom96 | hrm? |
13:18:22 | Araq | do we have a wrapper for ArangoDB? |
13:18:55 | euantor | Not 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:41 | FromGitter | <krux02> euantor: you don't need concepts to implement what you want to implement. |
13:21:11 | FromGitter | <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:11 | euantor | @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:54 | FromGitter | <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:07 | FromGitter | <krux02> unless you use the GoLikeInterfaces implementation |
13:22:14 | FromGitter | <krux02> that I wrote about some time in the past. |
13:22:47 | FromGitter | <krux02> https://forum.nim-lang.org/t/2422 |
13:23:01 | FromGitter | <krux02> https://github.com/andreaferretti/interfaced |
13:23:05 | euantor | no, I know that. But you can achieve something that acts in a similar way |
13:24:20 | * | floppydh_ joined #nim |
13:24:39 | FromGitter | <krux02> You can do what you want with what I suggested to you. You don't need to wait until concepts work. |
13:26:28 | FromGitter | <krux02> you can also make that generic Reader type manually and then provide `convert` functions for all implementations for it. |
13:26:45 | FromGitter | <krux02> you don't need to use those macros. |
13:29:01 | euantor | yep, 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:13 | FromGitter | <Bennyelg> hwo I change prots? |
13:31:19 | FromGitter | <Bennyelg> ports |
13:32:16 | Araq | template recv(f: File) = readBytes(f) |
13:33:26 | euantor | yep, that works Araq. Or you could do the inverse which would make more sense to me (eg: a `readBytes` for a socket) |
13:33:28 | PMunch | Bennyelg, settings? |
13:33:40 | FromGitter | <data-man> I wonder, the Ring language was ever mentioned here? :) |
13:33:40 | FromGitter | <Bennyelg> @dom96 where I change the address and the port before running jester server |
13:34:08 | dom96 | Bennyelg: I'm not sure how that is a security issue |
13:34:27 | * | Ven`` quit (Ping timeout: 240 seconds) |
13:34:34 | FromGitter | <Bennyelg> I cant run for example server.nim -p 1234 -h 0.0.0.0 |
13:34:38 | FromGitter | <Bennyelg> ? |
13:35:53 | PMunch | Bennyelg, use the settings macro |
13:36:10 | PMunch | settings: port = Port(<whatever port number>) |
13:36:24 | PMunch | If you want to read them from the command line you need to implement that yourself |
13:36:53 | PMunch | Just use a command-line parser and then use the port variable in that settings block |
13:44:49 | FromGitter | <Bennyelg> thanks. |
13:47:47 | * | Arrrr quit (Read error: Connection reset by peer) |
14:18:57 | * | SenasOzys quit (Ping timeout: 264 seconds) |
14:22:13 | r3d9u11 | Hi. Is it possible to create unordered enum? |
14:22:39 | PMunch | Don't think so |
14:22:45 | PMunch | What would you need that for? |
14:25:25 | FromGitter | <andreaferretti> just create an enum |
14:25:39 | FromGitter | <andreaferretti> you cam omit numbers, they will default to 0, 1, 2... |
14:25:43 | FromGitter | <andreaferretti> it will be orderd |
14:25:48 | FromGitter | <andreaferretti> but so what? |
14:25:58 | * | SenasOzys joined #nim |
14:26:00 | r3d9u11 | I'm want to implement this enum http://doc.qt.io/qt-5/qt.html#Key-enum |
14:26:02 | FromGitter | <andreaferretti> I cannot think of a case where this would be a problem |
14:26:40 | FromGitter | <andreaferretti> and? |
14:26:45 | FromGitter | <andreaferretti> what is the issue? |
14:26:56 | PMunch | That is ordered.. |
14:27:04 | r3d9u11 | no |
14:27:11 | PMunch | yes |
14:27:20 | r3d9u11 | I've got error about ordering |
14:27:46 | * | Jesin quit (Quit: Leaving) |
14:27:46 | r3d9u11 | many error |
14:27:51 | r3d9u11 | *errors |
14:28:01 | PMunch | Code? |
14:28:08 | FromGitter | <andreaferretti> can you paste what you have been trying and the errors you get? |
14:29:21 | r3d9u11 | https://pastebin.com/SYTh6X28 |
14:29:56 | r3d9u11 | errors are begin from QtKey_CapsLock |
14:31:13 | PMunch | Oh right |
14:31:34 | PMunch | Okay, so you need to re-order it to be in order |
14:32:25 | FromGitter | <andreaferretti> yeah, it's QtKey_AltGr which is out of order |
14:32:38 | FromGitter | <andreaferretti> you can just reorder linex |
14:32:43 | FromGitter | <andreaferretti> (tedious, I know) |
14:33:08 | dom96 | yeah, it'd be nice if Nim just accepted this, assuming that all values are specified. |
14:33:47 | r3d9u11 | :'( can I ask what is the point of such a strict rule for enums? |
14:34:33 | Araq | c2nim reorders it for you |
14:35:54 | dom96 | I'd also like to know :) |
14:37:30 | PMunch | I guess it's because you can define one and the rest will be automatically numbered |
14:37:49 | PMunch | Which would be weird with out-of-order values |
14:37:56 | PMunch | Not wrong though, just a bit strange |
14:38:55 | * | floppydh quit (Read error: Connection reset by peer) |
14:39:16 | dom96 | IMO 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:55 | PMunch | Agreed, not really a good reason to keep it like that. Apart from possibly confusing people |
14:40:22 | PMunch | But 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:36 | r3d9u11 | yes :( but I'll try to use c2nim as temporary solution (thans for hint!) |
14:42:53 | r3d9u11 | also thanks all for a little discussion!:) |
14:43:03 | PMunch | Hmm, another problem though |
14:43:10 | FromGitter | <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:19 | PMunch | QtKey_Space and Qt_Key_Any share a value.. |
14:43:50 | PMunch | r3d9u11, here is your reordered enum though: https://play.nim-lang.org/?gist=fcc2c747277fc720ea075bf9f5feae83 |
14:44:01 | PMunch | But without QtKey_Any |
14:46:52 | * | Jesin joined #nim |
14:48:13 | r3d9u11 | wow, many thanks! |
14:49:23 | dom96 | do use c2nim though if you can :) |
14:51:51 | PMunch | Yeah, wrapping Qt by hand sounds like a pain :P |
14:52:11 | PMunch | Assuming that is what you're trying to do |
14:53:37 | FromGitter | <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:21 | PMunch | dom96, 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:37 | r3d9u11 | I'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:47 | FromGitter | <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:32 | FromGitter | <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:16 | FromGitter | <krux02> how does C code store exposed functions in structs? |
15:17:27 | FromGitter | <ZarsBranchkin> Looks something like this: https://clbin.com/7pOU1 |
15:18:31 | FromGitter | <ZarsBranchkin> This is how I ended up handling it: https://clbin.com/JZSZ7 |
15:19:26 | FromGitter | <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:36 | FromGitter | <krux02> I know Nim has clusure and C does not. |
15:21:26 | FromGitter | <krux02> well I think you need to support emacs values somehow |
15:22:46 | FromGitter | <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:23 | FromGitter | <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:56 | FromGitter | <ZarsBranchkin> Then I can: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5aa0044853c1dbb743b4ef86] |
15:26:57 | FromGitter | <krux02> I would rename `value` to literal |
15:27:41 | FromGitter | <krux02> and the `[]` operator I would call it `symbol` |
15:28:09 | FromGitter | <ZarsBranchkin> Yeaah, I did that before, thought this might be handier |
15:28:17 | FromGitter | <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:06 | FromGitter | <ZarsBranchkin> Hmmm, I can either turn the emacs functions into macros or make emacs as global variable in the module |
15:29:18 | FromGitter | <krux02> I know that the environment parameter provides the ability to have in theory a second environment, but who does have that? |
15:30:00 | FromGitter | <krux02> lol, I just realized templates have dynamic scoping |
15:30:05 | FromGitter | <ZarsBranchkin> I guess setting it as global variable makes more sense, less hacking around with macros |
15:30:30 | FromGitter | <krux02> you could make the environment an environment-variables that needs to be defined |
15:31:45 | FromGitter | <ZarsBranchkin> Not really sure if environment can even be different in one instance |
15:33:11 | FromGitter | <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:17 | FromGitter | <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:01 | dom96 | ooh, Google Trends now has "Nim - Programming language" as an actual thing |
15:38:16 | PMunch | Nice! |
15:38:51 | * | el_tejon quit (Quit: el_tejon) |
15:39:01 | PMunch | Huh, strange "interest by region" breakdown |
15:39:19 | FromGitter | <krux02> @ZarsBranchkin : http://ix.io/TEK |
15:40:07 | FromGitter | <krux02> I recently looked at the tiobe index, and I saw the "Scratch" programming language skyrocketed in the last years |
15:40:44 | FromGitter | <krux02> so not to have to type actual text maybe is the future of programming languages. |
15:41:18 | FromGitter | <ZarsBranchkin> Wasn't aware of mixin. I was using macros for similar manipulations though |
15:41:33 | FromGitter | <krux02> there is mixin and bind |
15:41:48 | PMunch | Well, 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:49 | FromGitter | <krux02> and in the macros module there is bindSym |
15:42:04 | PMunch | Simply because they don't have to worry about syntax at all |
15:42:16 | FromGitter | <krux02> not just that |
15:42:22 | Araq | krux02: templates are "hygienic", but I doubt that gives them dynamic scoping |
15:42:39 | FromGitter | <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:41 | FromGitter | <krux02> they have to worry about syntax, but they have less freedom to make it wrong. they can only connect it "correctly" |
15:42:50 | FromGitter | <krux02> and it does not require english |
15:42:55 | PMunch | Yeah, that's what I meant |
15:43:00 | FromGitter | <krux02> very important for teaching childern in "not the USA" |
15:43:43 | PMunch | Haha, 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:48 | PMunch | Full-circle! |
15:44:06 | FromGitter | <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:15 | dom96 | https://trends.google.com/trends/explore?q=%2Fm%2F09gp44h,%2Fm%2F0dsbpg6,%2Fg%2F11bxfy42m1 |
15:44:33 | FromGitter | <krux02> like `newLit` in the macros module just make a literal of all it can make a literal of |
15:44:43 | FromGitter | <ZarsBranchkin> Alright, right now I had the approach of doing `emacsValue.toInt` and `emacsValue.toString` |
15:45:03 | Araq | krux02: I agree I never use 'converter' |
15:45:17 | Araq | weakens the type checking too much IMO. |
15:45:30 | FromGitter | <ZarsBranchkin> oh, yeah, I'm still trying to find my style of writing Nim |
15:46:37 | Araq | the major reason for 'converter' is easier wrapping of C++ which uses a custom string type everywhere ... |
15:46:44 | FromGitter | <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:14 | dom96 | krux02: I specifically picked the "Rust - programming language" query |
15:47:23 | dom96 | but yeah, how knows how accurate these are |
15:47:44 | Araq | Rust is also a computer game iirc with a scripting interface |
15:47:47 | FromGitter | <krux02> @ZarsBranchkin I would like to have a generic interface like this: ``toNimint (emacsValue)`` |
15:48:12 | FromGitter | <krux02> Araq: yes |
15:48:21 | FromGitter | <ZarsBranchkin> ah, okay, that looks neat |
15:48:39 | FromGitter | <ZarsBranchkin> Haven't used generic interfaces much |
15:49:42 | dom96 | Maybe 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:47 | FromGitter | <krux02> @ZarsBranchkin probably you will have to do type matching int he implementation. |
15:51:10 | dom96 | In February 2015 we were actually above D and Rust |
15:51:37 | dom96 | which was when we were slashdotted |
15:51:56 | Araq | that was 3 years ago |
15:51:57 | FromGitter | <krux02> ``proc toNimT (arg: EmacsValue): Option[T] = when T is int: #[...]# elif T is string: ...`` |
15:52:00 | FromGitter | <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:21 | FromGitter | <ZarsBranchkin> made simple string repeat, compared it to `s-repeat` |
15:52:27 | Araq | we have an elisp module in nimsuggest/ or something |
15:52:48 | Araq | we need to get v1 out and on slashdot... |
15:53:51 | dom96 | yes, it might be a good idea to look at the slashdot comments and try to alleviate their concerns |
15:54:49 | Araq | meh, I'm not good at caring about concerns. |
15:55:00 | FromGitter | <ZarsBranchkin> oh i see, that's elisp parser, I guess? |
15:55:05 | FromGitter | <krux02> Araq: I did not know about that elisp module. Might provide some nice inspiration |
15:55:34 | Araq | fear mongering doesn't produce unique ideas. |
15:55:47 | Araq | or new ones. |
15:56:09 | FromGitter | <krux02> fear mongering? |
15:56:16 | dom96 | people will rehash the same concerns and the attention will fizzle out like it did in 2015 then |
15:56:51 | Araq | "I can imagine this to cause problems" |
15:56:57 | FromGitter | <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:16 | Araq | "That's different from the 70ies and hence bad" |
15:57:56 | dom96 | actually, what would help is if you replied to people on slashdot |
15:58:32 | Araq | "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:31 | FromGitter | <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:08 | FromGitter | <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:41 | FromGitter | <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:20 | FromGitter | <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:59 | Araq | we had a python.nim module in the stdlib |
16:10:15 | FromGitter | <krux02> what happened to it? |
16:10:54 | Araq | https://github.com/nim-lang/python it's now here |
16:11:15 | Araq | and '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:37 | Araq | one thing I'd like to see in the stdlib is a follow up on graphics.nim |
16:16:05 | Araq | with some support in producing plots and maybe some simple immediate mode UI widgets |
16:17:30 | Araq | so that newcomers are not left with the choice between terminal apps and "er ... some wrapper you need to build DLLs for first" |
16:21:46 | Araq | it could have 2 backends, one producing HTML, the other based on SDL2. |
16:22:05 | Araq | most languages fail in this department |
16:22:32 | Araq | and only offer terminal vs "er .. some wrapper we hope works". like we do now. |
16:23:10 | dom96 | Factor has a nice opengl UI package |
16:23:22 | Araq | yes, well, I said 'most'. |
16:23:36 | dom96 | yes, I am giving you an example of a good one that you can copy |
16:23:58 | Araq | oh ok. |
16:24:47 | dom96 | but if you do, start it out as a Nimble package |
16:27:28 | FromGitter | <krux02> Araq: yes there are some modules on wraping python, but I would be confused by which one to pick from. |
16:28:14 | miran | i 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:47 | zarthur | Hi @Araq, curious why did you ask about ArangoDB? |
16:29:25 | miran | i'm sending `seq[index]`, which i want to be underlying array, "but expression 'atIndex(Ts, [t])' is of type: float" |
16:29:30 | Araq | zarthur: I am considering to use it |
16:29:46 | zarthur | What use cases? |
16:29:46 | FromGitter | <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:11 | FromGitter | <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:11 | FromGitter | <krux02> and the wrapper is on my github, I guess you remember it: https://github.com/krux02/nimAntTweakBar |
16:34:21 | dom96 | That doesn't look particularly appealing :/ |
16:34:28 | dom96 | Here is some info about Factor's UI: https://concatenative.org/wiki/view/Factor/UI |
16:34:46 | dom96 | Still looks pretty good |
16:34:54 | FromGitter | <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:31 | miran | to answer myself - you do that by not being stupid, as always |
16:40:51 | FromGitter | <krux02> Well I figured out when it is about UI there are two teams fighting each other. |
16:41:35 | FromGitter | <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:10 | FromGitter | <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:27 | FromGitter | <krux02> I am definitively in the first team |
16:43:07 | FromGitter | <krux02> and AntTweakBar is 100% a debugging UI. |
16:44:01 | FromGitter | <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:26 | miran | Araq: 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:32 | FromGitter | <krux02> And my wrapper also has SDL2 support (the original library does not support that, because development stopped before SDL2 was finished) |
16:44:40 | dom96 | There is a difference between obsessing over fonts and having your eyes burned by a window with some strange background colour |
16:45:17 | FromGitter | <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:35 | FromGitter | <krux02> well that video is old, and it does not look like that anymore |
16:45:44 | FromGitter | <krux02> but to be honest it does not loo too different |
16:46:43 | * | r3d9u11 quit (Remote host closed the connection) |
16:48:51 | FromGitter | <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:47 | Araq | krux02: that is just another wrapper, sorry. it doesn't even adhere to NEP-1 and things like |
16:52:49 | Araq | proc TwEventMouseButtonGLUT*(glutButton, glutState, mouseX, mouseY: cint): cint |
16:53:00 | Araq | are not what I have in mind |
16:54:26 | Araq | it also seems for 3D/OpenGL, graphics.nim was only 2D |
16:57:47 | Araq | zarthur: for some projects written in Nim (but not part of Nim's core) |
16:59:24 | Araq | Bennyelg: there is a nimble package that does that for you but I forgot its name |
17:00:02 | Araq | https://github.com/jlp765/db |
17:00:12 | Araq | Unified db access module, providing a single library module to access the db_sqlite, db_mysql and db_postgres modules. |
17:01:07 | Araq | when you use it, your program requires all 3 sets of DLLs to be present iirc |
17:11:00 | miran | in 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:24 | miran | because `a = seq[index]` would copy it, right? |
17:13:12 | miran | and 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:35 | GitDisc | <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:56 | FromGitter | <andreaferretti> @treeform cool! |
17:26:06 | FromGitter | <andreaferretti> any plans to implement LAB color space? |
17:32:49 | FromGitter | <andreaferretti> https://en.wikipedia.org/wiki/Lab_color_space |
17:33:08 | FromGitter | <andreaferretti> https://en.wikipedia.org/wiki/CIELUV |
17:33:30 | FromGitter | <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:12 | FromGitter | <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:45 | Yardanico | tuple for Color object? |
18:01:04 | Yardanico | well 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:13 | FromGitter | <data-man> @Yardanico: A tuples supports index operations, it's may be useful for colors. |
18:13:42 | FromGitter | <mratsim> uh. you can do `yourtuple[2]`? |
18:14:25 | FromGitter | <data-man> @mratsim: Yes, why not? |
18:16:28 | FromGitter | <data-man> !eval var a = (1, 2); echo a[0] |
18:16:30 | NimBot | 1 |
18:17:10 | FromGitter | <mratsim> for me tuples are not arrays ;) |
18:17:36 | FromGitter | <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:46 | zarthur | Any examples @Araq of the projects suitable? |
18:28:08 | * | PMunch joined #nim |
18:32:45 | * | SenasOzys quit (Ping timeout: 264 seconds) |
18:40:45 | miran | treeform: do you accept PRs for chroma? |
18:42:54 | * | SenasOzys joined #nim |
18:51:54 | Temperance[m] | I'm about to start the tutorial, tough I wanted to know |
18:52:08 | Temperance[m] | how abstract would be Nim in comparison to C? |
18:52:20 | PMunch | What do you mean by abstract? |
18:52:40 | Temperance[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:19 | PMunch | Ah, well Nim has it's macro system. Which is infinitely more powerful than the C pre-processor |
18:54:53 | Temperance[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:58 | Temperance[m] | on c, I mean. |
18:57:14 | PMunch | Oh yeah, C macros are a pain :P |
18:57:49 | Temperance[m] | however, my question is a little hard to phrase. |
18:58:24 | Temperance[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:41 | Temperance[m] | plus every time a template is added I feel the code becomes harder to read. |
18:59:01 | PMunch | Oh well, with Nim macros and templates it's more or less the exact opposite :P |
18:59:27 | Temperance[m] | what do you mean? |
18:59:34 | FromGitter | <ZarsBranchkin> Yeah, purpose of Nim templates/macros is to make the code more readable |
18:59:49 | PMunch | Nim macros, IMO, makes the code easier to read |
19:00:23 | FromGitter | <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:14 | FromGitter | <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:14 | FromGitter | <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:20 | FromGitter | <ZarsBranchkin> Oops, shouldn't have left the `expandMacros` there https://clbin.com/2L896 |
19:10:08 | PMunch | Or just have a look at how Jester works |
19:10:37 | FromGitter | <ZarsBranchkin> Oh true, it has neat interface too |
19:10:58 | * | athenot joined #nim |
19:11:47 | PMunch | Or 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:25 | FromGitter | <data-man> Wow! Clang 6.0 supports configuration files. Almost like Nim. :-D |
20:03:39 | GitDisc | <Lite5h4dow> Do you guys think it would be worth making a Video Tutorial for newcommers to nim? |
20:03:50 | GitDisc | <Lite5h4dow> since there isnt one |
20:04:22 | GitDisc | <Lite5h4dow> and the Manuals on the website are bad for newcomers |
20:05:06 | * | rbrt quit (Quit: Oíche mhaith) |
20:07:38 | dom96 | Lite5h4dow: of course |
20:08:11 | dom96 | Plenty 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:37 | PMunch | Lite5h4dow, yes! We've actually talked about this multiple times |
20:26:12 | PMunch | I 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:22 | PMunch | I've considered making one myself |
20:28:10 | * | nsf quit (Quit: WeeChat 2.0.1) |
20:31:12 | miran | PMunch: yes, it was me who is doing basic nim tutorial |
20:32:33 | PMunch | How's it coming along? |
20:32:36 | miran | i 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:33 | miran | i 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:49 | PMunch | Nice, let me know if you want a second pair of eyes on it :) |
20:37:24 | miran | PMunch: i will definitely need them, i'll let you know when it is ready for it |
20:37:45 | miran | nonetheless, video tutorials might be a nice addition! |
20:38:23 | salewski | Lite5h4dow, what is a Nim newcommer for you? Someone with 10+ years of C++ experience, or someone without programming experience at all? |
20:38:32 | salewski | You see the problem? |
20:38:59 | miran | and 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:24 | PMunch | salewski, better to have one of those categories than neither |
20:39:31 | PMunch | Or better yet both |
20:39:31 | salewski | And the official Nim tutorial is fine -- for most peole. |
20:39:42 | miran | salewski: for my tutorial, it would be for people with no/minimal programming experience |
20:40:18 | salewski | Yes, of course all new Nim docu is fine. |
20:40:24 | krux02[m] | I thought about writing a Nim tutorial for C++ programmers covering several generic c++ patterns and how they look in Nim |
20:40:47 | PMunch | krux02[m], that would be really neat |
20:40:57 | PMunch | There is a short Nim for C programmers. But that's really basic |
20:41:07 | salewski | But it is funny fact that often Nim newcommers intents to write tutorials. |
20:41:08 | miran | salewski: 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:13 | krux02[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:30 | miran | salewski: ...because more experienced nimmers don't want to waste their time on such basic/boring stuff? ;) |
20:42:55 | krux02[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:11 | krux02[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:39 | FromGitter | <ZarsBranchkin> Kind of an elitism at times, heh |
20:45:49 | FromGitter | <ZarsBranchkin> Programming isn't supposed to be easy! |
20:45:51 | * | craigger quit (Quit: bye) |
20:47:51 | Temperance[m] | "C++ patterns" would be a synonim of "oop patterns"? |
20:48:44 | GitDisc | <Lite5h4dow> @miran would you mind me making one too? |
20:49:01 | * | craigger joined #nim |
20:49:25 | miran | Lite5h4dow: would you do it in video form? |
20:54:13 | PMunch | Hmm: Error: attempting to call undeclared routine: 'readUint64' |
20:54:18 | PMunch | And I have imported streams |
20:54:37 | FromGitter | <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:52 | FromGitter | <tim-st> Or this already return type overloading? |
20:55:07 | PMunch | I think that's allowed |
20:55:15 | PMunch | Since one is var and the other isn't |
20:55:36 | FromGitter | <tim-st> Yes, I had the same feeling for my tests, but I think the compiler has a bug: |
20:56:35 | FromGitter | <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:16 | FromGitter | <tim-st> like `var x = ""; var y = ""` let x = procX(x, y)` |
20:58:04 | GitDisc | <Lite5h4dow> yes |
20:58:19 | GitDisc | <Lite5h4dow> video Tutorial and acompanying blog |
20:58:30 | GitDisc | <Lite5h4dow> as notes and somewhere to post material |
20:59:32 | miran | you 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:26 | GitDisc | <Lite5h4dow> i know but i know other youtubers dont like it if a youtuber posts similar content |
21:00:32 | GitDisc | <Lite5h4dow> knowing that they are working on it too |
21:00:54 | FromGitter | <tim-st> https://play.nim-lang.org/?gist=a348e9bcd9bb63ca08358ca2250be3f3 |
21:01:05 | FromGitter | <tim-st> that's the example for the failing code |
21:01:15 | miran | well, i'm *not* doing video tutorial. my thing will be written only. so you doing video tutorial would be a nice addition |
21:01:25 | GitDisc | <Lite5h4dow> awesome |
21:01:33 | GitDisc | <Lite5h4dow> if you want i can tie your written tutorial in |
21:02:03 | salewski | Fine videos are nice of course -- but unfortunally bad ones can repulse new users! |
21:02:28 | GitDisc | <Lite5h4dow> @tim what are you tying to do? |
21:02:31 | miran | that 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:04 | FromGitter | <tim-st> I'm writing strip procs like users actually want them. That needs overloading like this |
21:03:19 | GitDisc | <Lite5h4dow> tim, look at line 4. |
21:03:31 | GitDisc | <Lite5h4dow> var string, t: string |
21:03:41 | GitDisc | <Lite5h4dow> you dont need var string |
21:03:42 | FromGitter | <tim-st> yes? |
21:03:54 | GitDisc | <Lite5h4dow> var sorry |
21:04:08 | FromGitter | <tim-st> I need it, sure. I can have in place operations then |
21:04:08 | dom96 | tim-st: what's the issue here? Your proc doesn't return anything, and you're assigning it to a variable |
21:04:43 | GitDisc | <Lite5h4dow> but its doing nothing |
21:04:52 | GitDisc | <Lite5h4dow> not to mention the 2 procs have the same name |
21:05:05 | salewski | Maybe you could even do a video in other languages than english -- following english talks is not always easy for non native speakers. |
21:05:09 | FromGitter | <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:31 | krux02[m] | if I get it correctly it is an example of something that is supposed to not work |
21:05:46 | FromGitter | <tim-st> No, I expect it to work! |
21:05:55 | krux02[m] | I don't think he needs help to fix it |
21:05:58 | GitDisc | <Lite5h4dow> change the name of the second proc |
21:06:08 | krux02[m] | what, can't work like that |
21:06:18 | Temperance[m] | question... objects are... structs... under the hood? |
21:06:29 | FromGitter | <tim-st> @ krux02 why? |
21:06:40 | krux02[m] | overloading based on the return value does not exist in nim |
21:06:55 | FromGitter | <tim-st> it is not overloaded like Pmunch said |
21:06:56 | FromGitter | <ZarsBranchkin> Should be structs, yes. You can check what is generated under nimcache |
21:06:58 | dom96 | Temperance[m]: yep |
21:07:47 | dom96 | tim-st: what krux02 said, there is no return-based overloading |
21:07:58 | PMunch | Ah apparently updating to #devel worked to fix my issue |
21:07:58 | dom96 | and the 'var' overloading that you get is already pretty good |
21:07:59 | krux02[m] | tim-st: it is overloaded |
21:08:01 | krux02[m] | same name therefore it's overloading |
21:08:57 | FromGitter | <tim-st> But why does it work when I declare x,y with `let` not with `var`? |
21:09:29 | dom96 | because of 'var'-based overloading |
21:09:35 | Temperance[m] | okay... I kinda skimmed over the manual... and I've got... a question, well, several questions. |
21:09:42 | dom96 | the 'x' is no longer a 'var', so the other proc gets picked |
21:09:50 | dom96 | Temperance[m]: go for it |
21:09:59 | miran | tim-st: because you cannot use 'let-object' in 'var-argument' |
21:10:19 | miran | so there is no confusion which proc to use (it uses the first one) |
21:10:22 | FromGitter | <tim-st> In other words it is impossible in nim to overload strip procs to be in place? |
21:10:28 | Temperance[m] | if I run nim -c some.nim file |
21:10:36 | Temperance[m] | if I run nim -c somefile.nim |
21:10:42 | Temperance[m] | I meant |
21:10:52 | Temperance[m] | Will this include all other files that are included just like that? |
21:11:08 | dom96 | yes |
21:11:09 | * | natrys quit (Ping timeout: 264 seconds) |
21:11:39 | FromGitter | <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:42 | Temperance[m] | second question, how does nim know where to look for modules if that's the case? |
21:12:18 | FromGitter | <tim-st> When I type `let x = ...`I always want non-void |
21:12:24 | dom96 | tim-st: this is why we have reverse vs reversed: https://nim-lang.org/docs/algorithm.html#reverse,openArray[T],Natural,Natural |
21:12:54 | dom96 | Temperance[m]: relative to the module, followed by whatever is in Nim's "path" |
21:13:05 | FromGitter | <tim-st> @dom96 ok, thanks. |
21:13:10 | dom96 | Temperance[m]: By default the path contains the stdlib, and all Nimble packages |
21:13:22 | Temperance[m] | okay |
21:14:03 | * | miran quit (Quit: Konversation terminated!) |
21:15:47 | PMunch | Temperance[m], but you can configure this in the cfg file or by passing arguments to the compiler |
21:16:24 | Temperance[m] | Okay, so far it seems this is good |
21:17:40 | salewski | I still do not know about priority: What when module names in stdlib, nimble package and local dir are the same? |
21:17:45 | Temperance[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:46 | Temperance[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:22 | krux02[m] | @Temperance i dont mean oo patterns i mean template metaprogramming patterns |
21:19:56 | krux02[m] | i thik OO i ovorrated and only has niche use cases. |
21:20:10 | dom96 | salewski: stdlib comes first IIRC |
21:20:10 | * | rbrt joined #nim |
21:20:42 | dom96 | salewski: We are going to be adding a way to distinguish this, see here: https://github.com/nim-lang/Nim/issues/7250 |
21:20:55 | salewski | Thanks. |
21:21:03 | Temperance[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:03 | FromGitter | <krux02> i think nim attracts all those OO abandoners because it is a minority to be not classically OO |
21:23:21 | salewski | We would still need some examples how to replace OOP Java/C++ code in Nim without OOP. |
21:24:09 | FromGitter | <krux02> well only someone who ported such code can do that. |
21:26:15 | * | r3d9u11 joined #nim |
21:29:31 | PMunch | Hmm, I'm thinking of writing a documentation server in Nim |
21:29:53 | PMunch | That could get automatically updated when you push a new tag on GitHub or a local repo |
21:30:34 | PMunch | The 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:52 | PMunch | And 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:43 | dom96 | Do it |
21:33:07 | dom96 | That said, this will overlap with https://nimble.directory a bit. |
21:33:39 | dom96 | But don't be discouraged, never hurts to have multiple implementations :) |
21:34:10 | * | Yardanico quit (Ping timeout: 240 seconds) |
21:38:13 | PMunch | Well, this is more something people could set up for their own projects |
21:39:01 | PMunch | And link as their project website on nimble.directory :) |
21:39:02 | * | r3d9u11 quit (Remote host closed the connection) |
21:39:27 | Temperance[m] | what level of profanity is allowed on this chat? Just asking. |
21:39:46 | dom96 | I won't ban you if you say "fuck" |
21:40:24 | dom96 | But there are limits |
21:40:39 | dom96 | And I like to think that most people have enough common sense to know what they are :) |
21:40:49 | Temperance[m] | Well, holy fuck I don't get why regular C is so hard to compile. Nim just nails it. |
21:40:58 | dom96 | :D |
21:42:00 | * | MJCaley quit (Quit: MJCaley) |
21:43:17 | salewski | dom, I think this statement in the Nim FAQ is a bit too negative for current Nim: |
21:43:20 | salewski | The compiler is in development and some important features are still missing. |
21:43:31 | FromGitter | <ZarsBranchkin> Compilation and library linking was the biggest headache I had coming from a scripting language |
21:43:55 | * | MJCaley joined #nim |
21:43:59 | FromGitter | <ZarsBranchkin> that is when I first started learning C++ |
21:44:44 | PMunch | I downloaded some C sample code at some point, only to spend 2 hours trying to figure out how to actually compile it.. |
21:44:45 | dom96 | salewski: hrm, good point |
21:44:59 | dom96 | Pretty sure that sentence hasn't changed in 10 years |
21:45:39 | salewski | Bye. |
21:45:42 | * | salewski quit (Quit: WeeChat 1.9.1) |
21:45:43 | PMunch | Temperance[m], haha if that level of profanity was not allowed I think this chat would be pretty empty :P |
21:45:59 | PMunch | I know I would at least have gotten banned |
21:46:41 | * | ketralnis quit (Remote host closed the connection) |
21:48:18 | FromGitter | <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:35 | FromGitter | <ZarsBranchkin> Hehe, using Nim index felt bit too clunky for me |
21:50:27 | FromGitter | <krux02> thanks I did not know about devdocs I always used the index |
21:50:44 | FromGitter | <krux02> I mean using the browser serach is not the worst thing you can do |
21:51:15 | FromGitter | <krux02> Only those websites that append stuff as soon as you start scrolling fail at that |
21:51:20 | FromGitter | <krux02> like for example gitter |
21:51:22 | FromGitter | <ZarsBranchkin> True, but have to keep juggling tags and return to index agan |
21:51:38 | FromGitter | <ZarsBranchkin> *tabs not tags |
21:51:45 | Temperance[m] | does anybody use nim with visual studio code? |
21:51:53 | FromGitter | <zacharycarter> yes |
21:52:07 | PMunch | Temperance[m], most people I'd wager |
21:52:48 | FromGitter | <ZarsBranchkin> That reminds me of the broken company-mode in nim-mode.. Should get back to it whenever I can |
21:52:53 | FromGitter | <ZarsBranchkin> for now I keep it disabled |
21:52:54 | FromGitter | <krux02> I would say Visual Studio Code got some popularity and then there is Zars and Me who use emacs |
21:53:15 | FromGitter | <krux02> yes I keep it disabled, too |
21:53:23 | FromGitter | <krux02> flycheck also has issues |
21:53:38 | PMunch | krux02[m], we're some people using Vim as well |
21:53:45 | FromGitter | <krux02> would would be nice for flycheck is to set the root of the project in a buffer variable |
21:53:56 | FromGitter | <krux02> ah yea forgot vim |
21:54:01 | FromGitter | <krux02> how is Vim and Nim? |
21:54:07 | FromGitter | <ZarsBranchkin> Heh, using emacs with evil, so would kind of fit in both categories |
21:54:19 | PMunch | idk, I only use syntax highlighting |
21:54:21 | FromGitter | <Vindaar> emacs here as well |
21:54:28 | PMunch | But for that it works fine :) |
21:54:41 | Temperance[m] | I'm trying to set up debugging on vscode but I have not used it that much |
21:54:41 | FromGitter | <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:52 | PMunch | Would be interesting to get some autocomplete and such though |
21:55:02 | FromGitter | <krux02> sorry with flycheck I mean live highlighting of errors |
21:55:28 | FromGitter | <krux02> debugging is not a good experience in Nim |
21:55:46 | PMunch | I 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:08 | FromGitter | <krux02> very important --debugger:native |
21:56:17 | FromGitter | <krux02> way too verbose for my taste |
21:56:32 | FromGitter | <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:13 | FromGitter | <krux02> macros are not really the problem and can't be debugged anyway |
21:57:35 | FromGitter | <krux02> when debugging relly works way it is the default way to find out how code thet you did not write works. |
21:57:51 | FromGitter | <krux02> instead of just reading it, you just execute it step my step and see how the control flow is |
21:58:00 | FromGitter | <krux02> it is much faster to understand the code |
21:58:23 | * | rockcavera joined #nim |
21:58:27 | FromGitter | <ZarsBranchkin> Right, makes sense. Yeah, can see that |
21:59:03 | FromGitter | <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:21 | FromGitter | <ZarsBranchkin> That's what I love in emacs, has real neat debugger |
21:59:38 | FromGitter | <krux02> you actually like the debugger in emacs? |
21:59:59 | FromGitter | <krux02> do you mean the gdb frontend? or do you mean debugging emacs lisp? |
22:00:08 | Temperance[m] | so, its not possible to debug nim at the moment? |
22:00:14 | FromGitter | <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:15 | Demos[m] | huh? |
22:00:17 | Demos[m] | you can debug it with gdb |
22:00:19 | Demos[m] | or even windbg |
22:00:23 | FromGitter | <krux02> that is not true |
22:00:25 | FromGitter | <krux02> you can debug nim |
22:00:26 | FromGitter | <ZarsBranchkin> Debugging emacs lisp |
22:00:37 | FromGitter | <krux02> but it is not nice and it has a lot of friction everywhere |
22:01:04 | FromGitter | <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:46 | FromGitter | <krux02> there are gdb pretty printers somewhere so that you can print nim types and iterate nim collections |
22:03:08 | FromGitter | <krux02> @ZarsBranchkin it would be nice if you could find out where the performance bottleneck is when flycheck is active. |
22:03:20 | FromGitter | <krux02> sometimes emacs just freezes or things are really very slow |
22:03:33 | Temperance[m] | what about endb? |
22:03:44 | FromGitter | <ZarsBranchkin> I haven't gotten into using flycheck yet, but I found that company-mode causes freezing for me |
22:04:12 | FromGitter | <ZarsBranchkin> It requested completions from nimsuggest for every character you wrote, instead of narrowing down the initially acquired list |
22:04:19 | FromGitter | <ZarsBranchkin> Didn't fix it yet |
22:04:25 | FromGitter | <krux02> I don't think it's acceptable that on those computers we have today text processing is slightley unresponsive at all. |
22:05:14 | FromGitter | <krux02> Ah yea you mentioned it, and now I think I understand it |
22:05:28 | Temperance[m] | oh, I see that endb has been discontinued, that sounds sad |
22:06:07 | FromGitter | <krux02> yea, just use a normal C debugger |
22:06:35 | FromGitter | <krux02> nim generates instructions for the C compiler to convince his he is in the nim file |
22:06:42 | FromGitter | <krux02> I think it is called source mapping |
22:08:06 | FromGitter | <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:56 | FromGitter | <ZarsBranchkin> Heh, actually, emas module for nimsuggest would actually be practical use of the bindings I'm creating right now |
22:13:54 | FromGitter | <krux02> yes it would. And I would like to see that binding, too |
22:14:09 | FromGitter | <krux02> but please it should not be had to be integrated into emacs |
22:14:59 | FromGitter | <krux02> I think it would be best if the plugin can be built with `nimble install` |
22:15:47 | FromGitter | <krux02> then emacs just needs a single line in the config like (call-c-func (load-bin-module) "foobar") |
22:16:11 | FromGitter | <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:34 | FromGitter | <krux02> do you do it like I suggested with the template? |
22:16:45 | FromGitter | <krux02> or do you just use a global variable in the binding? |
22:16:52 | FromGitter | <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:18 | FromGitter | <krux02> it supports binary modules? |
22:17:21 | FromGitter | <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:50 | FromGitter | <krux02> yes that is ok I think |
22:18:06 | FromGitter | <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:34 | GitDisc | <treeform> andreaferretti, thanks! Sure I can add LAB color space. |
22:19:38 | GitDisc | <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:47 | FromGitter | <krux02> @ZarsBranchkin I have a key combination in emacs to open /tmp/scratch.nim |
22:20:00 | FromGitter | <krux02> and when I want to quickly test some code I just go there |
22:20:09 | FromGitter | <krux02> very effective for me |
22:20:10 | FromGitter | <ZarsBranchkin> Neat, that's what I should get. I usually just create a directory in tmp from terminal |
22:20:21 | FromGitter | <krux02> yea |
22:20:24 | FromGitter | <krux02> it is super simple |
22:20:25 | GitDisc | <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:43 | GitDisc | <treeform> miran, yes PRs are welcome. |
22:20:50 | FromGitter | <krux02> http://ix.io/TOx |
22:21:00 | FromGitter | <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:49 | GitDisc | <Lite5h4dow> hello |
22:22:29 | FromGitter | <krux02> hello |
22:22:33 | FromGitter | <krux02> welcome |
22:22:40 | FromGitter | <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:09 | FromGitter | <krux02> well that works, too |
22:23:21 | FromGitter | <krux02> nim and org work pretty fine |
22:23:28 | Temperance[m] | welp, running gdb without breakpoints kinda feels a little bit pointless. |
22:23:44 | FromGitter | <krux02> rbreak is your friend |
22:24:04 | FromGitter | <krux02> the gdb command rbreak breaks all functions that contain that name |
22:24:18 | FromGitter | <krux02> nim adds stuff around the name |
22:24:35 | FromGitter | <krux02> so you can use to break in function foobar `rbreak foobar` |
22:25:48 | FromGitter | <krux02> very important for flycheck and nim: http://ix.io/TOI |
22:26:20 | FromGitter | <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:20 | FromGitter | ... nim-lang/Nim?at=5aa0670c0a1614b712f41cd5] |
22:26:50 | FromGitter | <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:37 | FromGitter | <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:57 | FromGitter | <krux02> and then when it uses too much memory you might have to kill the process |
22:28:07 | FromGitter | <krux02> but generally specaking it does help |
22:28:08 | FromGitter | <ZarsBranchkin> Yeah, probably, since it's already setup for me, just didn't use it yet |
22:30:37 | Temperance[m] | so, I guess nimble is like, npm for node? |
22:31:14 | FromGitter | <ZarsBranchkin> Yeah, pretty much |
22:33:33 | FromGitter | <krux02> yea |
22:34:07 | FromGitter | <krux02> but unlike other package managers for statically compiled languages, it does not bundle package binaries |
22:34:28 | FromGitter | <krux02> it makes things a lot simpler |
22:35:13 | FromGitter | <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:18 | FromGitter | <polypus74> Hi guys. Getting into Nim here :) Got a Q: https://gist.github.com/polypus74/901324fb2e125b057ac05d68b381c4d4 |
22:43:11 | FromGitter | <krux02> what type of error is that? I am puzzled: http://ix.io/TP6 |
22:43:29 | Temperance[m] | how I can tell nim compiler to produce the executable on a particular folder? |
22:45:05 | FromGitter | <krux02> -o:FILE |
22:45:20 | FromGitter | <krux02> it is hidden in `nim --advanced` |
22:45:32 | FromGitter | <tim-st> @polypus74 if you explicity overload the proc, it works |
22:45:45 | FromGitter | <krux02> at lot of important arguments for nim are hidden under `nim --advanced` |
22:45:52 | FromGitter | <krux02> I don't really understand that distinciton |
22:48:28 | FromGitter | <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:59 | FromGitter | <polypus74> @Tim. Is that the only way? Do I need to use distinct? Thanks |
22:50:05 | FromGitter | <ZarsBranchkin> @krux02 what would be good template for getting symbol from emacs? `ident` is too ambiguous |
22:50:56 | Temperance[m] | when I run with --out:file |
22:51:01 | Temperance[m] | it doesn't produce a file |
22:51:08 | FromGitter | <krux02> in nim macros it is called bindSym |
22:51:11 | FromGitter | <ZarsBranchkin> Oh wait, never mind. Not symbol, thinking about literaly |
22:51:27 | FromGitter | <krux02> that is called newLit in macros |
22:51:30 | Temperance[m] | ah, I'm passing a path |
22:51:37 | FromGitter | <krux02> I don't want to say to call it the same |
22:51:49 | FromGitter | <tim-st> @polypus74 I missed something, I dont know how you can solve it, sry :( |
22:52:06 | FromGitter | <ZarsBranchkin> Well should definitely have different name, since it will only have one argument of basic type like int or string |
22:52:12 | FromGitter | <krux02> how about emacsLit(123) |
22:52:20 | FromGitter | <ZarsBranchkin> yeaah, seems clear |
22:52:21 | FromGitter | <krux02> or just eLit |
22:52:35 | FromGitter | <krux02> but that might be too short |
22:52:49 | FromGitter | <krux02> emLit |
22:53:18 | FromGitter | <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:38 | FromGitter | <ZarsBranchkin> Already slightly annoyed of `newLitNode` and similar procedures |
22:53:51 | FromGitter | <krux02> newEmptyNode() |
22:53:56 | * | beatmox joined #nim |
22:53:59 | FromGitter | <krux02> best one |
22:54:43 | Temperance[m] | is it possible to use nimble with a repository name, even if it doesn't appear on the package list? |
22:54:44 | Temperance[m] | repository url |
22:54:44 | Temperance[m] | I meant |
22:54:49 | FromGitter | <ZarsBranchkin> it's 3 times longer than node itself, heh |
22:55:44 | FromGitter | <krux02> Temperance I don't think so |
22:56:01 | FromGitter | <krux02> but you can clone and install a git repo and it is then a nimble package |
22:56:37 | FromGitter | <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:25 | dom96 | you can |
23:02:34 | dom96 | nimble install <url> works fine |
23:02:57 | FromGitter | <krux02> oh, did not know, sorry |
23:03:06 | FromGitter | <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:07 | Temperance[m] | hmm, packages with incorrect structure, what to do... |
23:08:03 | FromGitter | <ZarsBranchkin> Isn't it just a warning for now? Should be fine |
23:08:53 | Temperance[m] | It is |
23:09:19 | Temperance[m] | By the way, I'm finding several nim benchmarks that are slower than rust |
23:09:20 | Temperance[m] | but also |
23:09:26 | Temperance[m] | they specify that they use garbage collector |
23:11:17 | Temperance[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:32 | Temperance[m] | well, people using c++ do this kind of stuff |
23:12:32 | dom96 | Benchmarks 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:00 | Temperance[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:05 | FromGitter | <krux02> well not all benchmarks are fair |
23:19:19 | FromGitter | <krux02> I saw for example one a benchmark comparing C and Go |
23:19:48 | FromGitter | <krux02> the Go variant that used a memory pool was disqualified and the C variant the used a memory pool was not. |
23:19:52 | FromGitter | <krux02> very unfair |
23:20:12 | FromGitter | <ZarsBranchkin> Btw, got some more templates, now cleaner: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5aa073ac458cbde5570aadb4] |
23:20:49 | FromGitter | <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:50 | shashlick | how do you send a string to a function that expects a ptr Utf16Char |
23:20:54 | shashlick | rather a WCHAR* |
23:21:29 | FromGitter | <krux02> @ZarsBranchkin I showed you a pattern with template to automatically bind the emacs environment |
23:21:38 | FromGitter | <krux02> I just tried to do it again, and it will not work |
23:21:41 | FromGitter | <krux02> I don't know why |
23:21:59 | FromGitter | <ZarsBranchkin> Mixin seemed to work fine for me |
23:23:57 | FromGitter | <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:03 | FromGitter | <krux02> well I have problems with that pattern right now |
23:25:11 | FromGitter | <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:17 | FromGitter | <ZarsBranchkin> oh, what exactly is going on with it? |
23:25:26 | FromGitter | <krux02> even though I like it, I think maybe it's better if you don't use that pattern right now |
23:25:53 | FromGitter | <krux02> @ZarsBranchkin http://ix.io/TQ1 |
23:26:50 | FromGitter | <krux02> so you can provide a default environment and still allow it to be overriden by user code |
23:28:47 | FromGitter | <krux02> but when I did that with the mixin function it did fail. |
23:28:59 | FromGitter | <krux02> https://github.com/nim-lang/Nim/issues/7310 |
23:31:06 | FromGitter | <ZarsBranchkin> Odd, in my code I used similar pattern of calling procedure from template, which worked |
23:32:01 | FromGitter | <krux02> yes very odd |
23:32:21 | FromGitter | <krux02> what version are you using? |
23:32:44 | FromGitter | <krux02> because I just updated. |
23:32:48 | FromGitter | <ZarsBranchkin> Still on `0.17.3`, but your code fails to compile for me as well |
23:32:50 | FromGitter | <krux02> I suspect it's a regerssion |
23:33:11 | FromGitter | <krux02> then it's not a regression |
23:33:57 | FromGitter | <ZarsBranchkin> eh, will update anyway |
23:34:44 | FromGitter | <ZarsBranchkin> See, I used something similar: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5aa0771353c1dbb743b79672] |
23:36:31 | FromGitter | <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:39 | FromGitter | <krux02> I never used it |
23:36:58 | * | madpat quit (Remote host closed the connection) |
23:38:21 | FromGitter | <krux02> you might also provide a fast way to interact with emacs fucntios |
23:39:00 | FromGitter | <ZarsBranchkin> You still can, that `emacs->funcall(...)` is as fast as it will get, that's directly calling C function |
23:39:15 | FromGitter | <ZarsBranchkin> arrow is template for `emacs.funcall(emacs, ...)` |
23:40:02 | FromGitter | <krux02> for example: ``emacsfunctions(concat, length)`` |
23:40:26 | FromGitter | <ZarsBranchkin> oooh, okay, I get it |
23:40:52 | * | rbrt quit (Quit: Oíche mhaith) |
23:41:10 | FromGitter | <krux02> it would be a macro with varargs[untyped) |
23:41:15 | FromGitter | <ZarsBranchkin> So it provides procedurs of emacs functions `concat` and `length` |
23:41:23 | FromGitter | <krux02> each arg should be just an identifier |
23:41:28 | FromGitter | <krux02> yes |
23:42:01 | FromGitter | <krux02> all just with a varargs[EmacsValue] interface. |
23:42:17 | * | rbrt joined #nim |
23:42:23 | FromGitter | <ZarsBranchkin> Slight problem would be dash seperated emacs functions, which is a common thing |
23:42:52 | FromGitter | <krux02> well in the past nim also allowed dash separated names |
23:43:12 | FromGitter | <krux02> you can map them to underscores in Nim |
23:43:32 | FromGitter | <krux02> or you just use capital letters |
23:44:01 | FromGitter | <krux02> fooBar is then tranlated to foo-bar on emacs |
23:44:11 | Temperance[m] | am having a little bit of a problem reading through the indentation |
23:44:23 | FromGitter | <krux02> what indentation? |
23:45:09 | FromGitter | <ZarsBranchkin> Hmm, but then can't use symbols that have literal underscore in them |
23:45:34 | FromGitter | <krux02> true |
23:45:41 | FromGitter | <krux02> it's a problem |
23:45:48 | FromGitter | <krux02> so you might have to use strings |
23:45:55 | FromGitter | <ZarsBranchkin> Yeeah, should work fine |
23:47:17 | FromGitter | <krux02> emacsfunctions("concat", "length", "seq-length") |
23:47:30 | Temperance[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:34 | FromGitter | <krux02> and then it would remove the "-" for the nim identifier |
23:47:54 | FromGitter | <krux02> yes I had problems with indentation based syntax, too |
23:48:13 | FromGitter | <krux02> I like closing curly braced at the end of a block |
23:48:23 | FromGitter | <krux02> it really helps to see that there is the end of a block |
23:48:47 | FromGitter | <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:56 | FromGitter | <ZarsBranchkin> More tedious here |
23:49:04 | FromGitter | <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:18 | FromGitter | <krux02> I would not recommend to use it, but it is funny that it is there. |
23:49:27 | Temperance[m] | Just to know, indentation works like in python? or I'm missing something? |
23:49:46 | FromGitter | <krux02> yes % to jump to matching braces, I miss it in Nim |
23:49:59 | FromGitter | <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:02 | FromGitter | <krux02> Temperance you are right |
23:50:21 | * | craigger quit (Quit: bye) |
23:50:24 | FromGitter | <krux02> lol |
23:50:50 | FromGitter | <krux02> nim actually has that feature |
23:50:56 | FromGitter | <krux02> it is just hidden |
23:50:58 | FromGitter | <krux02> like the repl |
23:51:34 | FromGitter | <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:22 | FromGitter | <krux02> I like the repl |
23:52:43 | FromGitter | <krux02> It should be honest about it's limitations, but I really like that it is there |
23:52:52 | FromGitter | <krux02> but it hasn't been that much use for me |
23:53:03 | FromGitter | <krux02> especially because I can't really use libraries |
23:53:09 | * | craigger joined #nim |
23:57:23 | FromGitter | <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:44 | FromGitter | <krux02> you mean in nim-mode? |