00:00:04 | Araq | I think the creators of ML weren't aware that 'fun' is already an english word |
00:00:11 | FromGitter | <mratsim> I think I’m in for a whole new batch of bugs: ⏎ with generic destroy on newruntime ⏎ ⏎ ```code paste, see link``` ⏎ ... [https://gitter.im/nim-lang/Nim?at=5a160f8bba39a53f1ad34d45] |
00:00:36 | noonien | ML=matlab? |
00:01:10 | FromGitter | <mratsim> Ocaml, etc |
00:01:13 | * | mr_yogurt joined #nim |
00:02:08 | vivus | noonien: and become absolutely unusable when the language itself becomes a barrier to usage |
00:02:43 | noonien | interesting |
00:04:52 | noonien | btw, hello guys |
00:05:13 | noonien | i'm pretty new to Nim, and have never really written anything |
00:05:41 | noonien | i was thinking of using it for some hobby embedded projects |
00:05:55 | vivus | noonien: feel free to jump right in. Nim is quite Pythonic (in many situations) |
00:06:04 | noonien | i mostly chose it because the build system doesn't appear to be a mess, and the language seems rather decent on first glance |
00:06:40 | FromGitter | <mratsim> Oh and @Araq `=move` and `=sink` takes precedence over assignment operator even if overloaded right? |
00:07:10 | noonien | i don't like python as much as I used to |
00:07:22 | noonien | however, i'm really enjoying go for a few years now |
00:07:32 | FromGitter | <mratsim> Welcome noonien :). Hope you'll like it there. |
00:07:42 | noonien | and i've discovered a library to that enables go-like interfaces in Nim, which is awesome! |
00:08:01 | Araq | mratsim: no, firstly there is no '=move' |
00:08:27 | Araq | secondly '=sink' is called if possible, read my blog post |
00:09:14 | FromGitter | <mratsim> You should post it on the forum, so many people request interfaces there is a specific wiki entry for it. It's like the Graal for some. |
00:09:55 | FromGitter | <mratsim> Yes I read the blog post several times already, it was in an overloading context |
00:11:44 | noonien | @mratsim: the forum is where I found it: https://forum.nim-lang.org/t/2422 |
00:11:59 | noonien | here it is on github: https://github.com/andreaferretti/interfaced |
00:12:28 | FromGitter | <mratsim> Oh right |
00:16:24 | federico3 | any hint on https://travis-ci.org/nim-lang/Nim/jobs/301687323 ? I can't replicate it |
00:16:50 | Araq | mratsim: what is an overloading context? |
00:17:26 | FromGitter | <mratsim> I overload `=` |
00:18:07 | FromGitter | <mratsim> The blog post says "The key insight here is that assignments are resolved into several distinct semantics that do "the right thing". Containers should thus be written to leverage the builtin assignment!" |
00:18:23 | FromGitter | <mratsim> Note the built-in. |
00:23:38 | Araq | well that's badly phrased |
00:23:54 | Araq | here builtin assignment means "=" |
00:28:32 | FromGitter | <mratsim> Cool :) |
00:29:44 | * | mr_yogurt quit (Ping timeout: 260 seconds) |
00:32:26 | * | mr_yogurt joined #nim |
00:33:27 | mr_yogurt | What's the convention for writing docstrings in nim? |
00:37:05 | Araq | ## doc string? |
00:39:26 | mr_yogurt | Araq: is there a convention for docstring layout beyond that? |
00:40:26 | Araq | well the repo is full of stdlib modules that practice the conventions |
00:45:14 | Araq | there are two ways to write docs, one is to assume that the user of your library cannot program in Nim and hardly can write down his own name. The other is to assume there is no need to write out the types in prosa. |
00:46:37 | Araq | option A is less common but if you don't do it your "attitude" is bad. |
00:46:49 | Araq | boy, this never gets old XD |
00:48:29 | noonien | does nim have compile-time "defines"? |
00:48:50 | noonien | hmm, actually, nvm |
00:51:33 | Araq | when declared(x) |
00:51:37 | Araq | when defined(y) |
00:59:29 | noonien | the difference between macros and templates it that in macros you have to return a nim AST and in templates you just write the code that's "replaces" the template call? |
01:03:31 | * | Jesin joined #nim |
01:15:00 | Araq | yes |
01:15:15 | noonien | awesome, thanks! |
01:22:40 | * | voidspacexyz joined #nim |
01:28:39 | * | mr_yogurt quit (Ping timeout: 260 seconds) |
01:33:41 | * | mr_yogurt joined #nim |
01:41:53 | * | Jesin quit (Quit: Leaving) |
01:45:36 | * | Jesin joined #nim |
01:51:57 | * | vlad1777d quit (Ping timeout: 240 seconds) |
02:00:08 | noonien | how |
02:00:17 | noonien | how can i set the extern pragma on variables? |
02:08:25 | Araq | var v {.extern.}: int |
02:10:08 | noonien | ```var vectorTable* {.extern "vector_table".}: ptr VectorTable``` seems to result in: vector.nim(19, 20) Error: string literal expected |
02:12:57 | * | chemist69 quit (Ping timeout: 246 seconds) |
02:19:14 | Araq | var vectorTable* {.extern: "vector_table".}: ptr VectorTable |
02:19:41 | noonien | uuh, awesome! |
02:21:12 | Araq | ok, 'not nil' is in a good shape now |
02:21:31 | Araq | one feature less we have to mark as .experimental |
02:21:50 | Araq | good night |
02:24:04 | noonien | good night |
02:24:49 | * | voidspace_xyz joined #nim |
02:25:15 | * | vivus quit (Quit: Leaving) |
02:25:19 | * | rbrt quit (Quit: Slán agat) |
02:25:30 | * | chemist69 joined #nim |
02:26:39 | * | voidspacexyz quit (Ping timeout: 248 seconds) |
02:29:54 | * | mr_yogurt quit (Ping timeout: 260 seconds) |
02:41:04 | * | MJCaley joined #nim |
02:43:57 | * | marenz quit (Ping timeout: 240 seconds) |
02:59:03 | * | arecaceae quit (Remote host closed the connection) |
02:59:21 | * | arecaceae joined #nim |
03:13:21 | * | skrylar joined #nim |
03:21:27 | * | endragor quit (Ping timeout: 260 seconds) |
03:24:49 | * | MJCaley quit (Quit: MJCaley) |
03:28:51 | FromGitter | <Varriount> Hm. Is there any standard on where to log to in *nix if you can't open the configuration file that contains the path to log to? |
03:31:46 | * | skrylar quit (Remote host closed the connection) |
03:31:59 | * | skrylar joined #nim |
03:37:49 | * | endragor joined #nim |
03:42:27 | * | dddddd quit (Remote host closed the connection) |
03:46:57 | * | voidspace_xyz quit (Ping timeout: 250 seconds) |
03:55:22 | * | yglukhov joined #nim |
03:58:19 | * | yglukhov quit (Remote host closed the connection) |
03:58:52 | * | yglukhov joined #nim |
04:03:01 | * | yglukhov quit (Ping timeout: 240 seconds) |
04:43:39 | * | sz0 quit (Quit: Connection closed for inactivity) |
05:00:49 | * | yglukhov joined #nim |
05:01:45 | * | xkapastel quit (Quit: Connection closed for inactivity) |
05:05:17 | * | yglukhov quit (Ping timeout: 260 seconds) |
05:11:00 | * | voidspacexyz joined #nim |
05:11:18 | * | voidspacexyz quit (Remote host closed the connection) |
05:11:45 | * | voidspacexyz joined #nim |
05:17:33 | * | voidspacexyz quit (Read error: Connection reset by peer) |
05:21:25 | * | yglukhov joined #nim |
05:25:21 | * | yglukhov quit (Ping timeout: 240 seconds) |
05:27:08 | * | mr_yogurt joined #nim |
05:28:25 | mr_yogurt | is there a way to get the contents of a module in AST form? (perhaps with include?) |
05:34:57 | * | SenasOzys quit (Ping timeout: 248 seconds) |
05:40:56 | skrylar | mr_yogurt, theres a parsestmt and staticread |
05:43:12 | mr_yogurt | skrylar: can you point me at the documentation for those? i can't find it |
05:45:53 | mr_yogurt | nvm, found it |
05:46:27 | * | SenasOzys joined #nim |
05:50:24 | * | JappleAck joined #nim |
06:02:41 | * | yglukhov joined #nim |
06:07:06 | * | yglukhov quit (Ping timeout: 258 seconds) |
06:15:56 | * | miran joined #nim |
06:36:58 | * | nsf joined #nim |
06:38:07 | * | yglukhov joined #nim |
06:45:24 | * | mr_yogurt quit (Ping timeout: 260 seconds) |
07:22:01 | * | miran quit (Ping timeout: 240 seconds) |
07:42:49 | * | xet7 quit (Quit: Leaving) |
07:47:40 | * | SenasOzys quit (Remote host closed the connection) |
07:48:12 | * | SenasOzys joined #nim |
07:48:55 | * | xet7 joined #nim |
07:51:53 | * | Arrrr joined #nim |
07:51:53 | * | Arrrr quit (Changing host) |
07:51:53 | * | Arrrr joined #nim |
07:52:22 | * | yglukhov quit (Remote host closed the connection) |
08:02:15 | FromGitter | <mratsim> You can use getAST to get result of proc in AST form as well @mr_yogurt |
08:03:24 | FromGitter | <mratsim> Well more correctly it embedded the AST of the proc/temllate/macro in the macro. |
08:04:01 | FromGitter | <mratsim> Don't forget to use treerepr to understand how Nim AST is represented |
08:04:09 | FromGitter | <Varriount> mr_yogurt: I'll try to fix the console output fot Nimlime a bit tomorrow and over the weekend. |
08:04:48 | FromGitter | <Varriount> I don't know how much time I'll have - finals are coming up and I have several projects that need to be completed. Bleh |
08:08:52 | skrylar | i tried that earlier, mratsim. i just got an error |
08:08:58 | skrylar | using it to get the ast from a template |
08:09:04 | skrylar | it wouldn't take parametric templates |
08:13:20 | * | yglukhov joined #nim |
08:17:27 | * | yglukhov quit (Ping timeout: 240 seconds) |
08:22:40 | FromGitter | <mratsim> ah, maybe result `quote` do would then |
08:23:41 | * | Vladar joined #nim |
08:25:40 | * | claudiuinberlin joined #nim |
08:26:39 | * | skrylar quit (Ping timeout: 248 seconds) |
08:31:02 | FromGitter | <alehander42> ```dumpTree: ⏎ # example ⏎ if e > 2: ⏎ s.x``` ⏎ ⏎ is also useful if you want to check how the ast looks for something [https://gitter.im/nim-lang/Nim?at=5a168746540c78242d3b4cc7] |
08:33:55 | * | yglukhov joined #nim |
08:38:09 | * | yglukhov quit (Ping timeout: 250 seconds) |
08:39:34 | * | floppydh joined #nim |
08:51:44 | * | sendell joined #nim |
09:10:06 | * | Lord_Nightmare2 joined #nim |
09:11:56 | * | Lord_Nightmare quit (Ping timeout: 268 seconds) |
09:11:58 | * | Lord_Nightmare2 is now known as Lord_Nightmare |
09:16:31 | * | Serenitor joined #nim |
09:18:54 | * | SenasOzys quit (Ping timeout: 246 seconds) |
09:31:12 | * | SenasOzys joined #nim |
10:08:03 | * | marenz joined #nim |
10:17:06 | * | yglukhov joined #nim |
10:20:34 | * | couven92 joined #nim |
10:21:01 | * | yglukhov quit (Ping timeout: 240 seconds) |
10:29:53 | * | endragor quit (Ping timeout: 248 seconds) |
10:31:33 | * | endragor joined #nim |
10:36:33 | crem | Oh no, it's again that time of the year when I buy lots of steam games and never start them.. |
10:37:42 | * | yglukhov joined #nim |
10:37:49 | crem | Had < 10 hours of playtime this year. |
10:42:09 | * | yglukhov quit (Ping timeout: 248 seconds) |
10:48:03 | couven92 | crem, maybe programming in Nim is just as much fun?! :P |
10:49:43 | crem | It is indeed more fun. Not necessary nim, programming in general. Except web frontend programming. |
10:49:59 | couven92 | yeah, I feel you! Same here :) |
10:51:39 | * | gangstacat joined #nim |
11:23:17 | * | PMunch joined #nim |
11:24:44 | * | PMunch quit (Remote host closed the connection) |
11:24:56 | * | PMunch joined #nim |
11:28:38 | couven92 | Hmm... I am writing an environment variable differ for vccexe. Should I add a diff proc to strtabs? What do people think? |
12:11:35 | * | kobi7 joined #nim |
12:12:10 | kobi7 | hi guys, is the admin for the nim forum by any chance here? |
12:14:32 | Araq | kobi7, here |
12:15:01 | * | dddddd joined #nim |
12:19:21 | couven92 | Araq, https://github.com/nim-lang/Nim/pull/6301 is now ready (unicode-PR), but we have a non-related test in vm/tcomponent failing? https://ci.appveyor.com/project/Araq/nim/build/2394/tests |
12:20:00 | couven92 | > request to generate code for .compileTime proc: initTable |
12:20:01 | Araq | couven92, rebase |
12:20:06 | couven92 | Ah, okay |
12:22:24 | * | PMunch quit (Read error: Connection reset by peer) |
12:22:27 | * | PMunch_ joined #nim |
12:40:08 | * | kobi7 quit (Remote host closed the connection) |
12:57:25 | * | chemist69 quit (Quit: WeeChat 1.9.1) |
12:58:25 | * | SenasOzys quit (Remote host closed the connection) |
12:58:55 | * | chemist69 joined #nim |
13:07:52 | * | Elronnd quit (Ping timeout: 276 seconds) |
13:11:52 | * | Elronnd joined #nim |
13:17:03 | couven92 | Araq, now I get failures in closure/tflatmaps and macros/tnimnode_for_runtime instead: https://ci.appveyor.com/project/dom96/nim/build/1042/tests |
13:17:34 | couven92 | after i merged origin/devel I mean |
13:17:57 | Araq | ah the old whack a mole game |
13:18:07 | Araq | -.- |
13:20:16 | couven92 | it's not my fault, right? As far as I can tell none of these tests does anything with unicode |
13:26:07 | Araq | of course not |
13:38:06 | Araq | couven92, hope this fixes it |
14:08:33 | * | Serenitor quit (Ping timeout: 268 seconds) |
14:23:33 | couven92 | Araq, looks like it did, thanks... AppVeyor is still queued, but TravisCI was happy... |
14:26:50 | * | JappleAck quit (Quit: Leaving) |
14:45:42 | * | MJCaley joined #nim |
14:56:22 | * | gmpreussner quit (Read error: Connection reset by peer) |
14:57:13 | * | sz0 joined #nim |
14:58:05 | * | gmpreussner joined #nim |
14:58:15 | * | nsf quit (Quit: WeeChat 1.9.1) |
15:08:32 | * | riberoni joined #nim |
15:10:40 | riberoni | Hello, I'm starting to learn Nim, and I'm looking into reading a binary file structure into memory properly. For this, I'm using tuples, with the proper types assigned to each element. I'm looking to answer a few questions. How do I properly read a file structure into memory? I know I can just fread() a file into a proper struct in C. Is this also possible in Nim? |
15:11:37 | FromGitter | <andreaferretti> you may want to have a look at https://github.com/andreaferretti/spills |
15:11:51 | FromGitter | <andreaferretti> It is a small library I made exactly for this task |
15:13:01 | riberoni | The file is small enough to fit into memory, and I need quick access to it. |
15:13:07 | riberoni | My goal was optimizing a python program. |
15:16:26 | riberoni | I'm not sure this spills thing is what I should be using to interpret binary data from a file stream, and store it in memory, really. |
15:16:43 | FromGitter | <andreaferretti> Well, it is just an option |
15:16:52 | FromGitter | <andreaferretti> It maps a file into memory |
15:17:07 | FromGitter | <andreaferretti> and treats it as a contiguous chunk of structs |
15:17:59 | FromGitter | <andreaferretti> you can do the same using just the stdlib memory mapping module |
15:18:56 | FromGitter | <andreaferretti> you get a pointer and you cast it to a MyStruct or an array of MyStruct |
15:18:59 | FromGitter | <andreaferretti> done |
15:19:11 | riberoni | Ooh, that sounds like what I want. |
15:19:21 | FromGitter | <andreaferretti> it is what spills does :-) |
15:20:10 | * | enthus1ast joined #nim |
15:20:40 | enthus1ast | hey is somebody doing #GitHubGameOff ? |
15:20:48 | FromGitter | <andreaferretti> have a look at https://nim-lang.org/docs/memfiles.html |
15:22:23 | enthus1ast | there are still 8 days left :) |
15:22:52 | riberoni | Right, I never knew posix supported mapping files to memory. I've always just read the appropriate amount of bytes into a struct and interpreted from there, allocating memory as required. |
15:23:48 | riberoni | This looks pretty great aside from the fact this file contains 0-terminated strings of variable sizes I need to skip over at times. |
15:28:52 | riberoni | Is there any example of memfiles usage I can look at to judge it's usability in this case better? |
15:34:43 | Araq | riberoni: the compiler's "symbol files" feature uses memfiles but I doubt it makes for a good example |
15:35:20 | Araq | it's used in a stream-like fashion, nothing is mapped directly into an array of objects or such |
15:35:56 | riberoni | Ah. |
15:35:57 | GitDisc | <treeform> Can some one help me with the type system around arrays[N, char], I think the N is special some how or I don't get some thing? https://forum.nim-lang.org/t/3363 |
15:39:39 | Araq | treeform, you're looking for 'static[int]' |
15:39:59 | Araq | type PackedString[N: static[int]] = array[N, char] |
15:40:13 | Araq | which should be renamed I think... |
15:40:20 | FromGitter | <andreaferretti> @riberoni of course there is an example - read the source of spills :-) |
15:40:55 | GitDisc | <treeform> interesting let me test |
15:42:15 | GitDisc | <treeform> nice yeah that works 100%, thanks! |
15:49:01 | FromGitter | <mratsim> @treeform if you have issues with static you should look into the old linalg library from andrea. |
16:02:37 | * | floppydh quit (Quit: WeeChat 1.9.1) |
16:09:10 | couven92 | Araq, okay the unicode PR https://github.com/nim-lang/Nim/pull/6301 is now ready for review and merging |
16:09:17 | couven92 | all tests ran green |
16:09:19 | riberoni | Can I convert an array of char to string? |
16:10:14 | couven92 | riberoni, `toSeq(myMagicString.items)` |
16:10:40 | couven92 | ah, wait... char-array to string, ehrm... |
16:14:19 | couven92 | riberoni, https://play.nim-lang.org/?gist=c15f1a550264196d3ab2d0e8d8d0826f |
16:14:58 | riberoni | ah, thanks! |
16:15:27 | * | nsf joined #nim |
16:18:14 | riberoni | Apparently, if properly 0-terminated, the `$` operator can also be used. |
16:19:53 | FromGitter | <mratsim> string(yourarray) should work since string are just `distinct seq[char]` |
16:23:18 | * | xkapastel joined #nim |
16:25:13 | * | couven92 quit (Quit: Client disconnecting) |
16:28:43 | riberoni | Is it possible to declare anonymous tuples through the indentation syntax? |
16:29:20 | riberoni | As in, "var thing = tuple[x: int, y: int]" but with that nice syntax. |
16:30:22 | Araq | var thing = (x: 3, y: 8) |
16:30:35 | Araq | types are not values but there is no problem |
16:32:13 | riberoni | I mean, something like what you can do with the `type` keyword: https://play.nim-lang.org/?gist=749cdf60aa7f6c517914a90878d9d7d3 |
16:32:49 | Arrrr | why |
16:32:55 | riberoni | Dunno, just wondering. |
16:44:48 | Araq | that's not supported even if you use ':' instead of '=' |
16:45:11 | Araq | (seriously, get this into your head please) |
16:45:33 | Araq | (types are not values, type aliases are completely different from giving a variable a type) |
16:46:02 | riberoni | Sorry, yes, I meant to use ':' |
16:49:04 | federico3 | t |
16:56:55 | * | Trustable joined #nim |
16:59:45 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
17:03:30 | * | rauss quit (Read error: Connection reset by peer) |
17:04:47 | * | rauss joined #nim |
17:05:24 | Arrrr | maybe with macros ... |
17:08:36 | * | miran joined #nim |
17:08:43 | * | PMunch_ quit (Quit: Leaving) |
17:13:05 | * | sendell quit (Remote host closed the connection) |
17:13:21 | * | Arrrr quit (Read error: Connection reset by peer) |
17:22:28 | * | MJCaley quit (Quit: MJCaley) |
17:23:19 | dom96 | riberoni: the playground gist you posted with a ':' is not possible because it's redundant, you can just use the tuple[x, y:int] syntax. |
17:24:55 | * | MJCaley joined #nim |
17:28:53 | * | endragor quit (Remote host closed the connection) |
17:34:09 | * | endragor joined #nim |
17:36:19 | * | endragor quit (Remote host closed the connection) |
17:51:25 | * | claudiuinberlin joined #nim |
18:04:58 | * | MJCaley quit (Quit: MJCaley) |
18:18:06 | * | riberoni quit () |
18:26:18 | * | couven92 joined #nim |
18:33:44 | * | Sentreen quit (Quit: WeeChat 1.6) |
18:41:08 | * | Sentreen joined #nim |
18:42:48 | * | Sentreen quit (Read error: Connection reset by peer) |
18:44:17 | * | Jesin quit (Quit: Leaving) |
18:44:22 | * | sendell joined #nim |
18:48:04 | * | Sentreen joined #nim |
18:48:50 | * | Sentreen quit (Client Quit) |
18:59:18 | * | elrood joined #nim |
19:05:18 | * | nsf quit (Quit: WeeChat 1.9.1) |
19:06:27 | * | Sentreen joined #nim |
19:08:34 | * | Sentreen quit (Read error: Connection reset by peer) |
19:10:54 | * | Sentreen joined #nim |
19:19:40 | * | gangstacat quit (Quit: Ĝis!) |
19:22:19 | * | chemist69 quit (Ping timeout: 252 seconds) |
19:34:55 | * | chemist69 joined #nim |
19:51:39 | FromGitter | <nanortemis> Hi, I'm trying to compile examples from https://github.com/def-/nim-binary-size |
19:51:49 | FromGitter | <nanortemis> Unfortunately they don't work with the latest compiler, I'm getting "Error: system module needs 'echoBinSafe'" |
19:51:54 | FromGitter | <nanortemis> Is there any simple fix for it? |
19:55:26 | FromGitter | <nanortemis> it's related with --os:standalone |
19:56:33 | miran | Araq: is this intended or a bug? https://play.nim-lang.org/?gist=eebfc40aa78257291e2fd47e551d106d |
19:57:15 | miran | (the difference is just the position of `and` - at the end or at the beginning of the line |
20:01:03 | * | vlad1777d joined #nim |
20:05:36 | dom96 | nanortemis: hrm, seems like a possible bug. |
20:05:50 | dom96 | In Nim that is. |
20:06:21 | dom96 | Unfortunately AFAIK standalone mode isn't documented well so there is no reference that specifies what should and shouldn't be defined in the `panicoverride.nim` file. |
20:08:02 | dom96 | nanortemis: could you submit a bug report for this? |
20:09:10 | * | vivus joined #nim |
20:09:40 | FromGitter | <nanortemis> @dom96 yes sure, thanks |
20:12:16 | Araq | miran, that's intended |
20:12:57 | Araq | dom96, well you can also just read the example panicoverride.nim |
20:13:13 | miran | to me both versions are the same.... how come this is intended as different? |
20:13:27 | dom96 | Araq: I just found one in the tests |
20:13:41 | dom96 | https://github.com/nim-lang/Nim/blob/devel/tests/manyloc/standalone/panicoverride.nim |
20:13:48 | dom96 | Doesn't mention echoBinSafe |
20:13:49 | Araq | miran, binary operators at line endings are line continuations |
20:14:26 | Araq | at the beginning of the line they don't do anything :P |
20:15:15 | Araq | dom96, yes, why would it? 'echo' is not supported to work when you write your own OS |
20:15:28 | miran | Araq: ok, thanks for the clarification |
20:15:57 | dom96 | Araq: Okay, well do you know what the problem is? |
20:16:03 | vivus | Hello folks |
20:16:09 | dom96 | The code presumably used to work so this is a regression |
20:16:11 | dom96 | hey vivus! |
20:16:18 | vivus | Hi dom96 . how are you mate? |
20:16:31 | dom96 | Not bad, neck deep in Uni assignments |
20:16:51 | Araq | dom96, *shrug* the implementation of 'echo' changed |
20:16:58 | vivus | I thought you wrapped up your education? Probably doing your masters :P |
20:17:25 | vivus | Araq decided that echo("") is better than echo "" :P |
20:17:25 | Araq | I don't think we ever said "echo works when you don't have an IO subsystem for your OS yet" |
20:17:32 | dom96 | vivus: heh, nope. I'm not that old :P |
20:17:40 | * | dom96 gets sad about getting old |
20:17:55 | dom96 | Araq: So def-'s code was wrong this whole time? |
20:18:06 | Araq | never looked at it |
20:18:17 | vivus | dom96: as long as you become a greybeard, it's fine to grow old |
20:19:00 | dom96 | Araq: https://github.com/def-/nim-binary-size |
20:19:03 | federico3 | sometimes I wish for a "bytestring" type to handle raw bytes |
20:19:24 | Araq | federico3, use 'string'? |
20:19:42 | Araq | I use it to handle raw bytes, I think you can do the same |
20:20:13 | Araq | dom96, that contains multiple examples and only the first one uses 'echo' |
20:20:46 | federico3 | Araq: unittest and some other modules assume that printing `$` on screen is safe but on a raw byte string it messes up the terminal |
20:21:09 | dom96 | nanortemis: how are you compiling these? |
20:21:45 | federico3 | and a distinct type with the right procedures to handle raw data also prevents some bugs |
20:21:45 | Araq | federico3, so ... don't use unittest? |
20:22:14 | FromGitter | <nanortemis> @dom96 ./run.sh |
20:22:16 | FromGitter | <nanortemis> or manually |
20:23:06 | FromGitter | <nanortemis> all examples with --os:standalone don't work |
20:27:01 | Araq | nanortemis: nim c --os:standalone -r tests\manyloc\standalone\barebone.nim |
20:27:27 | Araq | works. |
20:28:08 | Araq | as far as I can tell everything in def-'s repo works except the very first example which worked by accident |
20:28:38 | Araq | if you strip Nim's IO out, why would 'echo' continue to work? I don't think we have to support that. |
20:38:58 | FromGitter | <nanortemis> @Araq hmm ok, should examples hello2-5 (no "echo") work? |
20:39:49 | Araq | yes |
20:42:10 | FromGitter | <nanortemis> @Aray maybe I'm doing something wrong but I'm getting the same error also for hello2-5 |
20:42:40 | * | nsf joined #nim |
20:48:04 | elrood | doesn't look like nanortemis is doing anything wrong, seems like a bug to me too. def-'s code doesn't use echo, the compiler complains about the system module requiring echoBinSafe |
20:49:14 | elrood | additionally, if you remove the -d:release compiler switch, suddenly compilation fails with system module needs 'nimFrame' |
20:49:20 | elrood | doesn't look sane to me |
20:54:08 | * | Jesin joined #nim |
21:12:10 | * | sz0 quit (Quit: Connection closed for inactivity) |
21:12:20 | elrood | should it be possible to compile v0.17.2 with git head, or isn't that supposed to work even for the latest release? |
21:26:49 | dom96 | elrood: I don't think so. |
21:29:51 | Araq | as I said, the test still works |
21:29:54 | Araq | it uses |
21:29:58 | Araq | --os:standalone |
21:30:06 | Araq | --deadCodeElim:on |
21:30:07 | Araq | --gc:none |
21:37:28 | elrood | should omitting --gc:none result in system module needs 'echoBinSafe' ? that's, well, somewhat unintuitive and not necessarily leading in the right direction, don't you think? |
21:37:37 | * | bkerin joined #nim |
21:38:14 | bkerin | can anyone tell me what the {.inject.} pragma in the Identifier construction section of the language manual does, or where it is documented? |
21:38:17 | FromGitter | <nanortemis> I've just fixed the problem by adding --gc:none |
21:41:25 | FromGitter | <nanortemis> for examples without "echo" |
21:43:43 | elrood | os:standalone kinda implies gc:none, doesn't it? why does the gc flag have to be set explicitly in that case? |
21:48:39 | FromGitter | <nanortemis> "--os:standalone (this implies --gc:none)" this is from the blog post, but I cannot find it in the doc, maybe this has changed |
21:50:15 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
21:52:52 | * | Vladar quit (Quit: Leaving) |
21:53:41 | * | miran quit (Ping timeout: 240 seconds) |
21:55:24 | bkerin | ahhhh then get described under Hygiene in templates... but sadly without the surrounding {..} making them unfindable |
22:04:00 | * | kunev quit (Ping timeout: 268 seconds) |
22:06:22 | * | kunev joined #nim |
22:13:12 | * | Trustable quit (Remote host closed the connection) |
22:16:06 | Araq | --os:standalone means "no OS", the GC can still be used (I suppose we have no test for that though) |
22:17:06 | Araq | you can always get a heap via a global var myHeap: array[SomeSize, byte] |
22:18:31 | Araq | so ... yeah, a GC doesn't require an operating system :-) |
22:19:34 | FromGitter | <nanortemis> thanks for the help and explanation |
22:21:46 | bkerin | Araq: What do you think of including {..} in references to pragmas? |
22:22:06 | FromGitter | <nanortemis> Has someone tried to make a simple linux kernel module in Nim? |
22:22:18 | FromGitter | <nanortemis> I think this would be possible and interesting, but I cannot find any example on the net |
22:22:50 | bkerin | it's noisy but for some (e.g. inject) the description of the pragma isn't findable without |
22:23:08 | bkerin | or it could be done just for those unfindable cases I guess |
22:23:46 | Araq | https://nim-lang.org/docs/theindex.html search for "inject" and you find it |
22:23:57 | Araq | that said, this section of the manual is really weak |
22:24:06 | Araq | and needs to be improved |
22:24:25 | Araq | but i don't want to write ``{.pragma.}`` everywhere |
22:24:38 | bkerin | Araq: the templates section? |
22:24:50 | bkerin | Araq: yep everywhere is indeed too ugly |
22:25:02 | Araq | the section that merely mentions it that theindex points to |
22:25:06 | dom96 | nanortemis: IIRC somebody has tried creating a linux kernel module, could it have been you federico3? |
22:25:58 | Araq | elrood, --os:standalone used to imply --gc:none but this was changed |
22:28:32 | bkerin | Araq: index does show it easily. Its just search in lang manual itself has many inject words but it does get found... I dunno for whatever reason took me a while. Maybe the right answer is that .inject. and .gensym. should appear in Pragmas section as I did look there |
22:29:56 | Araq | people requested a "list of all pragmas" before but I think that's a bit misguided, many pragmas are not officially part of the spec |
22:30:19 | bkerin | Araq: i'll make pull request if you agree. I'm interesting in trying to help with templates docs as well though I'm still in the process or sorting out how they work myself |
22:30:34 | Araq | and many are very rarely used |
22:30:46 | Araq | bkerin, that would be really nice, thanks! |
22:31:18 | federico3 | dom96 it was an experiment but yes |
22:31:23 | bkerin | Araq: I understand you want to avoid/reduce/turn-into-syntax pragmas and agree that's a good idea... they make the lang look somewhat scary |
22:32:34 | bkerin | Araq: are .inject./.gensym. likely to go away though? if they turn into syntax or something the lang doc would need corresponding edits anyway |
22:33:44 | Araq | no, they are here to stay |
22:33:46 | FromGitter | <nanortemis> federico3: could you provide a simple example, tips, a single "Hello World" print would be great |
22:35:06 | bkerin | Araq: add to big Pragmas list in lang manual ok then? |
22:35:41 | dom96 | Araq: Even for v2? :) |
22:37:29 | Araq | dom96, yeah, I have no ideas about this |
22:38:02 | dom96 | Just to give bkerin some hope |
22:38:11 | dom96 | v1 is too close in our future for such a chance though ;) |
22:38:15 | dom96 | *change |
22:38:16 | Araq | introducing more keywords seems not a good way to do it either. we can have more system.x magics |
22:38:54 | FromGitter | <mratsim> "part of the spec" uh? Is this nim-lang? |
22:38:58 | dom96 | A nicer pragma syntax would be neough |
22:39:38 | * | Jesin quit (Quit: Leaving) |
22:39:43 | Araq | mratsim: for me "spec" and "manual" are the same :P |
22:40:59 | FromGitter | <mratsim> They are as scary as Haskell compiler directives or Rust [#derive(Clone)] but maybe I use too much pragmas for my own good. |
22:41:07 | * | nsf quit (Quit: WeeChat 1.9.1) |
22:41:19 | bkerin | yeah just turning into keywords is not an honest approach, and nim currently scores high on honesty |
22:43:06 | sendell | as a newcomer the two things that looked "unfriendly" regarding the rest of the syntax were pragma syntax and dereferencing operator [] |
22:43:52 | Araq | I agree about the deref [] but it's somewhat logical |
22:43:58 | sendell | not sure why this last was chosen, besides the semantic proximity with C arrays |
22:44:24 | Araq | the pragmas can even look sexy with some Unicode overlays |
22:44:40 | bkerin | well its sort of like perl too, I like that :) |
22:45:15 | sendell | didnt know that |
22:45:35 | Araq | sendell, a[] derefs a pointer, accessing its single element, a[0] accesses the 0th element of an array |
22:45:38 | bkerin | ah maybe i'm not clear what operator your're talking about |
22:45:43 | Araq | seemed logical to me to use this syntax |
22:45:43 | bkerin | ^ |
22:46:04 | sendell | yeah that's what i supposed (or read somewhere, cant remember haha) |
22:46:08 | sendell | but still |
22:46:28 | Araq | originally I used Pascal's x^ postfix operator |
22:46:29 | sendell | a two char operator for this sounds weird haha |
22:46:35 | sendell | yeah? |
22:46:56 | Araq | but then some guy came along and told me he needs ^ for exp() |
22:47:28 | sendell | !eval echo 2^10 |
22:47:29 | NimBot | Compile failed: in.nim(1, 7) Error: type mismatch: got (int literal(2), int literal(10)) |
22:47:50 | Araq | !eval import math; echo 2^10 |
22:47:52 | NimBot | 1024 |
22:48:01 | sendell | hehe nice didnt know that |
22:48:13 | sendell | probably a good idea to keep that for pow |
22:48:34 | Araq | but more convincingly Nim had no other postfix operators and so p[] made even more sense |
22:48:35 | sendell | and on french keyboards ^ is a dead key |
22:48:44 | sendell | so one more reason ahah |
22:49:04 | Araq | template `*`(x: untyped): untyped = x[] |
22:49:14 | Araq | *x # now like in C, yay |
22:49:28 | bkerin | *warm feeling* |
22:49:31 | sendell | hehe |
22:49:45 | sendell | such a customizable language :) |
22:50:43 | sendell | remembers me of : template `++`*(x:typed)= inc x i did last night |
22:50:58 | bkerin | its like in C, if you don't like braces, you #define end } or so and have a friend check it in |
22:51:12 | bkerin | *warm feelilng* |
22:51:28 | Araq | lol yeah, won't be accepted in Nim's stdlib though |
22:51:53 | Araq | maybe we could use ^x |
22:52:09 | * | SenasOzys joined #nim |
22:52:50 | Araq | looks better than [] but it might annoy Pascal programmers that are so used to the postfix ^ |
22:53:48 | Araq | well [] is so rarely used in Nim that it's not worth thinking about it |
22:54:02 | sendell | what was the problem about prefix * ? |
22:54:40 | Araq | no problem but I always found it weird in C. |
22:55:01 | Araq | "what do all these strange crippled multiplications do here?" |
22:55:18 | sendell | yeah, probably deserves its own symbol |
22:55:27 | sendell | good argument |
22:55:46 | Araq | plus with Nim's export marker which is also * things can look weird |
22:56:31 | sendell | yeah but in separate space, as you wont put dereferencing aside a proc name |
22:56:47 | sendell | (where the export marker belongs) |
22:59:10 | Araq | maybe, maybe not. prefix ^ seems the best solution except that [] is so uncommon |
22:59:44 | sendell | probably a silly question, but why can't ptr auto dereference as with refs? |
23:00:05 | sendell | and maybe have a special operator when you want to access the address itself, which is less common |
23:02:08 | Araq | ptrs and refs are the same for auto derefs |
23:07:47 | sendell | hmm yeah just tried some stuff i got wrong |
23:07:54 | sendell | good then, i guess its even less a problem :) |
23:10:31 | * | Serenitor joined #nim |
23:13:21 | * | bkerin quit (Quit: Confucius say: that man with four balls cannot walk!) |
23:29:16 | sendell | i just found why i got this wrong: the module where i experimented with ptrs previously was not enabling {.experimental.}, and I just discovered auto-deref was part of it :) |
23:34:54 | * | MJCaley joined #nim |