00:06:34 | * | BitPuffin|osx joined #nim |
00:09:21 | * | couven92 quit (Quit: Client Disconnecting) |
00:10:32 | * | nsf quit (Quit: WeeChat 1.9.1) |
00:10:40 | * | bozaloshtsh joined #nim |
00:10:40 | * | bozaloshtsh quit (Changing host) |
00:10:41 | * | bozaloshtsh joined #nim |
00:18:28 | * | Snircle_ quit (Read error: Connection reset by peer) |
00:24:31 | * | dexterk quit (Ping timeout: 248 seconds) |
00:35:24 | * | rbrt joined #nim |
00:40:09 | FromGitter | <nitely> literally in hand |
00:49:14 | * | rbrt quit (Quit: Oíche mhaith) |
00:54:22 | * | rbrt joined #nim |
01:15:42 | laas | is there a good resource on macros |
01:15:44 | laas | ? |
01:15:56 | laas | I find the manual and the module-level documentation of macros insufficient |
01:17:08 | * | laas quit (Quit: WeeChat 1.9.1) |
01:20:07 | skrylar | i suppose one could be made |
01:25:19 | * | rbrt quit (Quit: Oíche mhaith) |
01:27:19 | * | rbrt joined #nim |
01:28:08 | * | arnetheduck quit (Remote host closed the connection) |
01:29:04 | * | rbrt quit (Client Quit) |
01:45:40 | * | tefter joined #nim |
01:49:33 | * | jsgrant__ quit (Remote host closed the connection) |
02:04:17 | * | rbrt joined #nim |
02:19:46 | * | arnetheduck joined #nim |
02:56:11 | * | chemist69 quit (Ping timeout: 240 seconds) |
03:10:17 | * | BitPuffin|osx quit (Ping timeout: 268 seconds) |
03:10:27 | * | chemist69 joined #nim |
03:11:05 | * | PMunch quit (Quit: leaving) |
03:22:11 | * | redlegion quit (Ping timeout: 255 seconds) |
03:27:28 | * | redlegion joined #nim |
03:27:29 | * | redlegion quit (Changing host) |
03:27:29 | * | redlegion joined #nim |
03:36:22 | * | fvs left #nim ("ERC (IRC client for Emacs 25.3.1)") |
03:43:12 | * | MJCaley joined #nim |
03:46:56 | * | vlad1777d quit (Ping timeout: 255 seconds) |
03:58:33 | * | sz0 joined #nim |
04:03:09 | * | MJCaley quit (Quit: MJCaley) |
04:04:56 | * | MJCaley joined #nim |
04:20:45 | * | SenasOzys__ joined #nim |
04:23:40 | * | SenasOzys_ quit (Ping timeout: 268 seconds) |
04:35:39 | * | MJCaley quit (Quit: MJCaley) |
04:43:26 | * | rbrt quit (Quit: Oíche mhaith) |
04:53:34 | * | skrylar quit (Remote host closed the connection) |
04:58:54 | * | MonsterAbyss quit (Ping timeout: 246 seconds) |
04:59:29 | * | MonsterAbyss joined #nim |
05:06:41 | * | SenasOzys__ quit (Ping timeout: 248 seconds) |
05:07:06 | * | endragor joined #nim |
05:22:25 | * | astronavt quit (Quit: Leaving...) |
05:55:38 | * | bkerin joined #nim |
05:55:57 | bkerin | hiya folks. ima on a quest to turn a string into an identifier in a template. possible? |
06:00:49 | FromGitter | <techate> that came up earlier today actually: *<laas>* what does !"some string" mean? *<laas>* what does !"some string" mean? *<Araq>* with extended raw string literals it's not required anymore |
06:01:19 | FromGitter | <techate> that repeat was supposed to be: *<Araq>* converts a string into an identifier |
06:01:29 | bkerin | techate: I was there for that but sadly I didn't fully understand it |
06:01:40 | bkerin | hmm |
06:02:50 | FromGitter | <techate> well a grep -Pr ' !"' within nim's repo will find some macros that use it |
06:03:12 | FromGitter | <techate> like in nimsuggest/tests/twithin_macro.nim |
06:03:42 | FromGitter | <techate> also: https://nim-by-example.github.io/oop_macro/ |
06:04:54 | bkerin | the emitted AST for the template when I try that is Prefix->(Sym "!", StrLit foo) |
06:05:35 | bkerin | what did aray mean about extended raw string lits obsoleting it I wonder |
06:08:05 | * | yglukhov joined #nim |
06:08:47 | * | brandonwolfhill joined #nim |
06:10:27 | bkerin | untyped/typed/typedesc also confuse the heck outa me |
06:11:14 | * | brandonwolfhill quit (Quit: Page closed) |
06:12:32 | * | yglukhov quit (Ping timeout: 260 seconds) |
06:17:13 | * | dddddd quit (Remote host closed the connection) |
06:32:24 | FromGitter | <techate> well I don't think the AST would be special. it's not syntax. it's defined in macros: proc `!`*(s: string): NimIdent {.magic: "StrToIdent", noSideEffect.} |
06:36:26 | FromGitter | <techate> of extended raw string literals, I dunno. what I've found on that just explains why echo"\" works and echo "\" is a syntax error |
06:39:29 | bkerin | hmm this is one wild wooly lang |
06:41:24 | bkerin | i think the whole approach of keeping any type info in strings at compile time is wrong or unused and it's all supposed to be in typedesc or something |
06:52:56 | FromGitter | <techate> you can avoid !"string" if you want, and use newIdentNode("string").ident , but that doesn't have anything to do with raw string literals |
06:56:06 | * | sz0 quit (Quit: Connection closed for inactivity) |
06:59:27 | bkerin | both approaches give NimNode values, which are great for macros but so far as I can tell not quite what I want in this case. |
06:59:45 | * | sz0 joined #nim |
07:00:50 | * | miran joined #nim |
07:01:05 | FromGitter | <techate> maybe that's one of the lines beyond which you need a macro rather than a template |
07:01:18 | FromGitter | <techate> what are you trying to do? |
07:04:17 | bkerin | something like this: |
07:04:18 | bkerin | template echoVar(varName:string): untyped = echo varName & ": " & `varName` |
07:05:22 | bkerin | only that doesn't work, `varName` just comes out a string, presumably because it's not a maical 'untyped' as in the language manual on Identifier construction in templates |
07:06:49 | bkerin | in general templates seem much harder to use than macros the latter are more verbose but its clear how they work templates not so much |
07:08:38 | bkerin | there's also the mysterious {.inject.} pragma in the Identifier construction example which so far as I can find isn't mentioned anywhere else in the documentation |
07:11:04 | bkerin | wll bedtime for me thanks for advice, I'll try again tomorrow |
07:11:07 | * | bkerin quit (Quit: Visit http://lice.muppetz.com) |
07:11:13 | FromGitter | <techate> ah wait a sec |
07:11:40 | FromGitter | <techate> https://github.com/nim-lang/Nim/blob/devel/tests/macros/tquotewords.nim |
07:12:22 | FromGitter | <techate> a macro that turns quoteWords(some, words, here, without, quotes) into ["some","words","here","without","quotes"] |
07:12:28 | FromGitter | <techate> like qw() in Perl or %w() in Ruby |
07:13:16 | FromGitter | <techate> I think you'll need a macro rather than a template for that, and that macro does something similar |
07:13:21 | FromGitter | <techate> otherwise, g'night |
07:13:54 | FromGitter | <techate> for templates being harder, it's easy to do easy stuff :) |
07:16:15 | * | endragor quit (Remote host closed the connection) |
07:19:06 | * | gokr joined #nim |
07:36:08 | * | skrylar joined #nim |
07:45:15 | skrylar | is it worth my time to tinker with openmp |
07:51:41 | * | endragor joined #nim |
07:56:01 | * | endragor quit (Ping timeout: 240 seconds) |
07:59:22 | skrylar | it sounds interesting, but i don't know how well it behaves with nim and i think ML stuff runs on opencl these days anyway. dunno |
08:03:11 | Araq | techate: when I introduced `!`, the syntax ident"xyz" was not available |
08:03:41 | Araq | and I wanted to avoid excessive () in the macro code |
08:04:15 | Araq | that's all there is to it, `!` is just a prefix operator defined in macros.nim |
08:04:25 | Araq | as you noticed. |
08:04:38 | FromGitter | <alehander42> that shouldn't matter for newIdentNode, right? |
08:05:55 | Araq | ident is an alias for newIdentNode |
08:06:13 | Araq | oh I see, `!` doesn't even do what I thought it does, lol |
08:06:26 | FromGitter | <techate> oh, I didnt' realize ident"str" worked. but yeah: ident"str".ident works in that animals macro example |
08:06:52 | Araq | well I was wrong |
08:07:11 | Araq | `!` doesn't even do what I thought it does |
08:08:26 | FromGitter | <alehander42> hygiene? |
08:28:01 | Araq | `!` is so rare that I forgot what it means |
08:28:36 | Araq | we use operators for common operations though, not for fringe cases so `!` needs to be replaced with toNimIdentifier |
08:29:25 | * | yglukhov joined #nim |
08:46:16 | * | claudiuinberlin joined #nim |
08:47:47 | FromGitter | <data-man> Good day! ⏎ @Araq: Why are a concepts almost not used in the stdlib? |
08:47:50 | FromGitter | <mratsim> @skrylar OpenMP is realtively easy for map/reduce/fold. And sorel lacking from Julia and Numpy (don’t know about matlab). There are a lots of preprocessing in ML that could benefit from parallelization but lacks Cuda implementation. (all the stuff on Scikit learn) |
08:48:29 | * | Vladar joined #nim |
08:52:42 | skrylar | mratsim: ah. i have little interest in cuda. |
08:52:54 | skrylar | i would be willing to learn OpenCL, but it seems weird to get in to |
08:54:56 | FromGitter | <mratsim> There is a tutorial to implement fast matrix multiplication in OpenCL, it’s 10 pages that introduces new concept little by little: https://cnugteren.github.io/tutorial/pages/page1.html |
08:55:21 | * | gokr quit (Ping timeout: 240 seconds) |
08:59:37 | FromGitter | <data-man> @mratsim: For CUDA I need some specific version of gcc? In Arch Linux, for some reason, it is suggested to install gcc6. And I do not want to do this. :-) |
09:01:22 | FromGitter | <mratsim> yes CUDA 8 requires gcc 5 and CUDA 9 requires gcc 6. Otherwise you can compile cuda kernels with LLVM since a year ago. |
09:03:03 | FromGitter | <data-man> Thanks! Does Arraymancer work without external dependencies? |
09:04:51 | FromGitter | <mratsim> it requires nimblas, math, nimcuda (though if you don’t pass the -d:cuda flag it won’t tell you to get a Nvidia GPU) |
09:04:55 | * | endragor joined #nim |
09:06:06 | * | sz0 quit (Quit: Connection closed for inactivity) |
09:06:26 | FromGitter | <mratsim> You should use it on nim devel as well. It’s probably 6x-8x faster than 0.17.2 due to useless allocations in the seq code that were fixed by edubart. |
09:09:11 | * | endragor quit (Ping timeout: 240 seconds) |
09:11:29 | FromGitter | <data-man> Thanks.I plan to add CPUID in stdlib. Which module is most suitable for this? The concurrency/cpuinfo? |
09:14:33 | FromGitter | <data-man> Or better to a separate module? |
09:18:13 | * | nsf joined #nim |
09:21:57 | * | arecaceae quit (Remote host closed the connection) |
09:22:16 | * | arecaceae joined #nim |
09:24:50 | skrylar | mratsim: sadly haven't done much in ML as of late. been dealing with art and database code |
09:41:42 | * | endragor joined #nim |
09:44:31 | Araq | data-man: because they are still in development |
09:45:42 | FromGitter | <alehander42> I have an ast represented as a nim variant, and I want to expose `[]` for most nodes (based on a children field), + `.<logical_name>` ⏎ e.g. `Array`: ⏎ ⏎ `node[0]` <=> `node.length` `node[1]` = `node.elementList` ⏎ ... [https://gitter.im/nim-lang/Nim?at=5a1152c6614889d4759c0002] |
09:46:07 | * | endragor quit (Ping timeout: 248 seconds) |
09:46:33 | FromGitter | <alehander42> my idea is to overload `.` so people can use the node api without much knowledge about the field names, but also use field names for clarity |
09:46:40 | FromGitter | <alehander42> (and this way I can also reuse names between branch) |
09:53:53 | skrylar | huh. i guess they are now shipping parts of firefox on rust |
09:54:14 | skrylar | i didn't mind rust 0.8. some later rusts look like an uglier c++, and it compiles dog slow, but the memory tracing was neat |
10:02:05 | * | endragor joined #nim |
10:02:06 | * | rauss quit (Read error: Connection reset by peer) |
10:02:10 | * | endragor quit (Remote host closed the connection) |
10:02:38 | * | endragor joined #nim |
10:03:58 | * | yglukhov quit (Remote host closed the connection) |
10:04:06 | * | rauss joined #nim |
10:06:06 | * | yglukhov joined #nim |
10:08:37 | * | yglukhov quit (Remote host closed the connection) |
10:09:17 | FromGitter | <alehander42> the nim compiler hangs for me in copyTree o.O |
10:10:31 | FromGitter | <alehander42> nah, it just takes a lot of time, is json supposed to support variants |
10:19:30 | FromGitter | <krux02> @alehander42 I kind of don't understand your DSL |
10:20:48 | FromGitter | <krux02> iirc ``x.foo`` is identical to ``x["foo"]`` is javascript |
10:21:29 | FromGitter | <krux02> So I think you could overload the ``.`` operator. |
10:21:53 | FromGitter | <krux02> But I am always a bit skeptical about acutally doing it. |
10:27:17 | FromGitter | <alehander42> the idea is e.g. you have |
10:28:17 | FromGitter | <alehander42> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a115cc171ad3f8736026f31] |
10:30:01 | FromGitter | <alehander42> then you have ⏎ ⏎ ```f = Node(kind: For, children: @[toLabel("child"), toLabel("children"), ..])``` [https://gitter.im/nim-lang/Nim?at=5a115d29e606d60e34e13366] |
10:31:03 | FromGitter | <alehander42> and you can access the elements with ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a115d67e606d60e34e13499] |
10:31:52 | FromGitter | <alehander42> the mapping is some kind of const array of seq-s ([@["target", "iterable", ..]]) |
10:33:31 | FromGitter | <alehander42> I know how to implement it, I wonder if there are better ways to achieve something like that ⏎ (notice that with this implementation I can have `label` in many branches too) |
10:38:06 | * | sz0 joined #nim |
10:39:26 | FromGitter | <mratsim> I’m considering Copy-on-write for Arraymancer tensors, especially because: ⏎ ⏎ 1) I don’t think even with move optimization support you could transform `let a = b[1..2, 1..2] + c` into `let a = b.unsafeSlice(1..2, 1..2) + c` ⏎ 2) Tensors are backed by seq on CPU, and pointers on Cuda (and OpenCL in the future). It’s easier to have seq {.shallow.} by default than giving value semantics to pointers. And |
10:39:26 | FromGitter | ... it’s definitely better to be consistent across backends. ⏎ ... [https://gitter.im/nim-lang/Nim?at=5a115f5e2837ee5106a06fdc] |
10:49:39 | * | marenz__ joined #nim |
10:50:49 | * | yglukhov joined #nim |
10:51:13 | * | vlad1777d joined #nim |
10:51:14 | skrylar | mratsim: that's a lot of copying... |
10:55:03 | FromGitter | <mratsim> only slicing b copies here, but often you slice in loops with the loop variable :/ |
10:56:11 | * | gangstacat quit (Quit: Ĝis!) |
11:23:19 | FromGitter | <alehander42> I wrote a macro `genKind(variant, kind)`, would it be useful for the stdlib? it generates an object of `variant` with kind dynamically |
11:23:55 | FromGitter | <alehander42> `genKind(MyVariant, M.A) # MyVariant(kind: M.A)` |
11:29:22 | * | xkapastel quit (Quit: Connection closed for inactivity) |
11:51:33 | FromGitter | <mratsim> seems not far from patty no? |
11:52:14 | * | endragor quit (Quit: Leaving...) |
11:55:54 | Araq | mratsim: maybe not with moves, but with TR macros? |
11:58:14 | FromGitter | <mratsim> I think I would need a TR for reshape, permute, asContiguous, slicing, broadcasting: i.e. all operations that does not touch data but only metadata |
11:59:49 | FromGitter | <mratsim> The “move {call}” that is available now works great: ⏎ ⏎ https://github.com/mratsim/Arraymancer/blob/1cfe13c0172dffccbe767bb4aa5a75e8bba1ed67/src/tensor/optim_move.nim#L19 |
12:00:33 | FromGitter | <mratsim> so that if I do a[1..2].asContiguous.reshape, the asContiguous.reshape are replaced by their unsafe version |
12:01:33 | FromGitter | <mratsim> I was thinking that instead I could use shallowCopy by default but with {`var`}, do deep copy. |
12:03:08 | FromGitter | <mratsim> i.e. let are shallow, but as soon as a var is involved as input or output everything is deep. |
12:08:51 | Araq | that lets are shallow is actually a bug :P |
12:09:13 | Araq | I hope when I fix it I don't introduce performance regressions by using some smart analysis |
12:13:22 | FromGitter | <mratsim> Well, hopefully I can use it as well because I have ugly code like this to avoid useless copies on slices: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a117562cc1d527f6b8c04e6] |
12:15:03 | FromGitter | <mratsim> vs the much cleaner (and 6x slower currently) ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a1175c7cc1d527f6b8c05f4] |
12:24:46 | * | couven92 joined #nim |
12:33:01 | federico3 | Araq: regarding #6481 , getNimcacheDir returns a path that does not exists. It seems that 'nim doc' is not generating a nimcache dir or it's generating it elsewhere. Should I create one? |
12:47:31 | * | sz0 quit (Quit: Connection closed for inactivity) |
13:00:49 | * | endragor joined #nim |
13:02:54 | * | SenasOzys__ joined #nim |
13:07:38 | * | elrood joined #nim |
13:07:45 | * | laas joined #nim |
13:11:49 | * | JappleAck joined #nim |
13:15:25 | * | couven92 quit (Quit: Disconnecting) |
13:16:11 | * | skrylar quit (Remote host closed the connection) |
13:25:10 | laas | Is there any way to do a try-catch like thing, but with templates to see if code compiles? |
13:25:31 | * | SenasOzys__ quit (Remote host closed the connection) |
13:26:42 | laas | e.g. `try: syntactically_valid_code except: something_else` |
13:29:52 | * | dddddd joined #nim |
13:36:02 | FromGitter | <mratsim> You can use assert at compile-time but you cannot use exceptions since they are ref objects |
13:37:11 | FromGitter | <mratsim> if you want to run something at compile time wrap it in a static bloc, or use `when foo: doSomething() else: doAnother()` |
13:41:52 | planetis[m] | there is when compiles(some code): |
13:43:29 | hohlerde | mhmm, do you always get the compiler message "template/generic instantiation from here" when using generic procs within a template? |
13:47:58 | hohlerde | https://privatebin.tarakis.de/?5c4ff1dc7d4e97c1#WN+iZ6TfDVlANamrjvb/xbyMBhrSo05Nl0vAE1V+VXg= |
13:47:59 | hohlerde | basically I get the compiler message for every "catchError" call. |
13:49:59 | laas | thanks planetis! |
13:58:13 | hohlerde | I got rid of the compiler message. i had a deprecation warning for using toLower() in the generic proc. getting rid of that pleased the compiler |
14:00:11 | * | gokr joined #nim |
14:02:43 | laas | is there a way to err at compile-time? |
14:03:09 | laas | I tried raiseAssert in a static block, but it did nothing |
14:03:42 | laas | nvm |
14:03:44 | laas | it does work |
14:05:17 | hohlerde | {.error: "your message".} |
14:06:07 | * | hohlerde sent a long message: hohlerde_2017-11-19_14:06:06.txt <https://matrix.org/_matrix/media/v1/download/matrix.org/RqILetpTErSjAGyPLlxzGZQc> |
14:07:07 | * | Snircle joined #nim |
14:07:25 | laas | ah thanks |
14:08:00 | hohlerde | laas: https://nim-lang.org/docs/manual.html#pragmas-error-pragma |
14:08:49 | FromGitter | <data-man> @hohlerde: Use toLowerAscii |
14:12:46 | hohlerde | data-man: yes, already changed it and the "template/generic ...." messages went away |
14:17:11 | * | vlad1777d quit (Read error: Connection reset by peer) |
14:19:58 | * | vlad1777d joined #nim |
14:55:55 | * | gangstacat joined #nim |
15:01:53 | * | BitPuffin|osx joined #nim |
15:02:37 | FromGitter | <alehander42> is there a module that renders valid nim code from nim ast? |
15:02:50 | FromGitter | <alehander42> I know about renderer but if that's used in repr(node) |
15:03:03 | FromGitter | <alehander42> it seems to render often invalid code |
15:03:15 | * | nhywyll joined #nim |
15:10:02 | * | noonien joined #nim |
15:10:06 | noonien | hello folks! |
15:10:09 | * | Arrrr joined #nim |
15:10:09 | * | Arrrr quit (Changing host) |
15:10:09 | * | Arrrr joined #nim |
15:20:44 | * | yglukhov quit (Remote host closed the connection) |
15:44:18 | * | miran_ joined #nim |
15:44:44 | Arrrr | What is nim's killer feature? |
15:44:47 | * | miran quit (Ping timeout: 260 seconds) |
15:50:20 | federico3 | being good at many things instead of having a killer feature |
15:51:18 | * | yglukhov joined #nim |
15:55:04 | * | JappleAck quit (Quit: Leaving) |
15:56:49 | * | yglukhov quit (Ping timeout: 250 seconds) |
16:06:28 | * | MJCaley joined #nim |
16:10:35 | * | arnetheduck quit (Ping timeout: 240 seconds) |
16:14:04 | * | gokr quit (Ping timeout: 268 seconds) |
16:19:03 | * | rbrt joined #nim |
16:20:32 | GitDisc | <treeform> So, `float` is both a type and a converter yes? `var a: float` and `float(1)`, how can I create a vector type `var a: vec3` that is both a type and a converter `vec3(0,0,0)` but have the name be the same to match how float and built in types work? |
16:21:16 | * | MJCaley quit (Quit: MJCaley) |
16:30:43 | * | Vladar quit (Quit: Leaving) |
16:31:54 | * | astronavt joined #nim |
16:33:47 | * | astronavt quit (Remote host closed the connection) |
16:33:57 | * | astronavt joined #nim |
16:41:35 | * | Sentreen quit (Ping timeout: 248 seconds) |
16:43:11 | * | BitPuffin|osx quit (Ping timeout: 250 seconds) |
16:48:05 | * | astronavt quit (Remote host closed the connection) |
16:48:44 | * | astronavt joined #nim |
16:50:03 | * | astronav_ joined #nim |
16:50:35 | Arrrr | What is vec3, a tupe? |
16:53:03 | * | astronavt quit (Ping timeout: 258 seconds) |
16:55:01 | * | Sentreen joined #nim |
16:56:12 | * | astronav_ quit (Remote host closed the connection) |
17:03:20 | * | rbrt quit (Quit: Oíche mhaith) |
17:03:48 | * | rbrt joined #nim |
17:06:01 | Arrrr | *tuple |
17:08:34 | * | astronavt joined #nim |
17:10:36 | * | astronavt quit (Remote host closed the connection) |
17:22:28 | * | mr_yogurt joined #nim |
17:29:48 | laas | Is there something akin to rust's Option? |
17:38:37 | Arrrr | https://nim-lang.org/docs/options.html |
17:39:18 | Arrrr | Also https://nim-lang.org/docs/theindex.html |
17:41:31 | * | ofelas joined #nim |
17:44:53 | * | Vladar joined #nim |
17:45:45 | laas | thanks |
17:45:47 | laas | ! |
17:45:57 | laas | another question: |
17:46:03 | laas | how do I put \n in a character literal? |
17:46:33 | Arrrr | \l |
17:47:07 | Arrrr | https://nim-lang.org/docs/manual.html#lexical-analysis-string-literals |
17:47:09 | laas | what's the difference? |
17:47:14 | laas | thanks |
17:47:43 | Arrrr | For some technical reason \n is not allowed in nim as a literal char |
17:50:24 | * | SenasOzys joined #nim |
17:52:41 | planetis[m] | i think /n is two characters depending on the os |
17:56:20 | planetis[m] | do you have windows; can you try echo "\n" == "\c\l" |
17:57:20 | dom96 | Yes, \n is platform dependent. |
18:01:35 | * | Arrrr quit (Ping timeout: 240 seconds) |
18:02:12 | laas | ah ok |
18:02:16 | laas | that's pretty nice |
18:03:19 | * | astronavt joined #nim |
18:05:52 | * | yglukhov joined #nim |
18:06:54 | * | Arrrr joined #nim |
18:09:04 | * | astronavt quit (Remote host closed the connection) |
18:10:01 | * | yglukhov quit (Ping timeout: 240 seconds) |
18:21:09 | * | astronavt joined #nim |
18:24:45 | GitDisc | <treeform> Arrrr, just a normal type https://gist.github.com/treeform/4f3811cb0e32284f65059781366bd7bd |
18:25:19 | GitDisc | <treeform> I am just asking is there a way to have `newV3` have name of `v3` some how? |
18:25:25 | GitDisc | <treeform> So it matches built in types. |
18:25:30 | * | mr_yogurt quit (Disconnected by services) |
18:25:31 | * | yglukhov joined #nim |
18:27:51 | * | Arrrr quit (Ping timeout: 240 seconds) |
18:28:30 | * | MJCaley joined #nim |
18:35:29 | * | Arrrr joined #nim |
18:35:59 | Arrrr | Yes, you can do `v3(x: 1, y: 2, z: 3)` |
18:36:27 | GitDisc | <treeform> yes, but I don't want to type all of that out every time. |
18:36:45 | GitDisc | <treeform> there is no way I can do v3(1, 2, 3)? |
18:37:02 | GitDisc | <treeform> like I can do with float(1) and int(2.3)? |
18:37:14 | Arrrr | No. However, you could define v3 as a tuple |
18:37:44 | GitDisc | <treeform> then overload x= and x functions? |
18:37:55 | GitDisc | <treeform> for getting [0] element? |
18:38:13 | Arrrr | Not necessary, look at this example |
18:40:17 | Arrrr | https://play.nim-lang.org/?gist=b9789a1afdec10f8af11d443d6f83c29 |
18:40:42 | Arrrr | Nim is very anal with types, i thought it would not be necessary to add '.0' to detect a float |
18:41:54 | GitDisc | <treeform> hmm so I would use (1,2,3) + (1,2,3) without the v3 event? |
18:42:06 | GitDisc | <treeform> v3 name* |
18:42:21 | Arrrr | Yeah, you could do that |
18:43:04 | GitDisc | <treeform> cool ill try this |
18:43:26 | GitDisc | <treeform> it should work |
18:43:28 | Arrrr | You could also rename your type to 'V3' and call the proc 'v3' |
18:43:37 | Arrrr | or 'Vector3' |
18:43:43 | GitDisc | <treeform> yes I did that at first |
18:44:10 | GitDisc | <treeform> in other langauges I called my types v3 and am used to it. |
18:44:15 | GitDisc | <treeform> but they had constructors |
18:44:29 | GitDisc | <treeform> v3 type and v3() constructor |
18:44:41 | GitDisc | <treeform> but maybe tuples are event better |
18:44:47 | GitDisc | <treeform> my code is littered with v3s |
18:46:34 | GitDisc | <treeform> I am working a font rasterizer, inspired by this dude: https://github.com/google/font-rs |
18:47:02 | GitDisc | <treeform> I don't have all of my curves right yet: https://dl2.pushbulletusercontent.com/tKAD614SiRICv5vcc8U1zk29m8jHgYjO/image.png |
18:48:26 | FromGitter | <Varriount> treeform: I think the O's look pretty |
18:48:53 | GitDisc | <treeform> You should see my heart shape |
18:49:14 | GitDisc | <treeform> oh I did not save it |
19:14:05 | * | nhywyll quit (Ping timeout: 240 seconds) |
19:15:46 | * | rbrt quit (Quit: Oíche mhaith) |
19:16:48 | * | mr_yogurt joined #nim |
19:18:40 | miran_ | there is no `toU64`, like there are `toU8`, `toU16` and `toU32`? |
19:19:18 | miran_ | or: how do i multiply uint64 and int? :) |
19:20:02 | mr_yogurt | are there any plans for user-addable binary operators that don't use punctuation symbols? maybe declared with something like proc ` opname `(...): ... = ... with spaces before & after since you'd have to add space to use them like with the builtins |
19:20:28 | Araq | mr_yogurt: never gonna happen, makes parsing dependent on a symbol table |
19:20:50 | laas | would conflict with commands maybe? |
19:20:54 | Araq | miran_: use a type conversion |
19:22:19 | laas | is there any way to control an iterator's state manually? |
19:22:25 | miran_ | Araq: thanks, works |
19:22:50 | mr_yogurt | right, since 'a b c' could be ambiguous without knowing about what a, b, c are |
19:22:57 | Araq | yes |
19:27:26 | * | nhywyll joined #nim |
19:29:38 | Araq | mr_yogurt: Fortran uses .op. iirc |
19:29:48 | Araq | but it's pretty ugly |
19:30:01 | * | xkapastel joined #nim |
19:30:08 | Araq | maybe some other lexical rule can help |
19:30:24 | * | vlad1777d quit (Remote host closed the connection) |
19:31:43 | mr_yogurt | well with the UFCS i guess a .b c works |
19:31:54 | Araq | true |
19:33:30 | * | rbrt joined #nim |
19:36:29 | FromGitter | <alehander42> Araq: can renderer.nim be made to produce valid code easily? |
19:37:11 | Araq | depends on what you mean by it |
19:37:24 | Araq | usually it emits valid Nim code |
19:37:39 | FromGitter | <alehander42> not always, I have to generate Nim code for something |
19:37:49 | FromGitter | <alehander42> and I wonder should I emit NimNodes and repr them |
19:37:54 | FromGitter | <alehander42> or directly generate the code |
19:38:15 | Araq | Ormin uses staticWrite and repr and that's what you should use too |
19:38:47 | FromGitter | <alehander42> most of the macros I write generate invalid code in repr |
19:40:02 | * | PMunch joined #nim |
19:40:46 | FromGitter | <alehander42> but if I am careful with the generation, I think it will work ok |
19:53:50 | * | yglukhov quit (Remote host closed the connection) |
20:01:53 | * | Trustable joined #nim |
20:08:37 | * | gokr joined #nim |
20:09:48 | * | NimBot joined #nim |
20:17:07 | * | rbrt quit (Quit: Oíche mhaith) |
20:18:04 | * | rbrt joined #nim |
20:40:26 | * | Ven joined #nim |
20:40:51 | * | Ven is now known as Guest57431 |
20:44:48 | euantor | I know that concepts are a work in progress, but is this intended? https://play.nim-lang.org/?gist=b2a465a953d4d49deb22160516b5d4e6 |
20:45:19 | euantor | If you remove the `posix` import, the result is `true, true`. With `import posix`, you get `false, true` |
20:45:27 | euantor | Seems like somehting related to name resolution? |
20:47:13 | * | rbrt quit (Quit: Oíche mhaith) |
20:50:49 | * | Arrrr quit (Read error: Connection reset by peer) |
20:54:51 | * | rbrt joined #nim |
21:10:56 | * | Guest57431 quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:11:02 | Araq | euantor: lol, wtf |
21:12:03 | euantor | Yeah, an interesting one imo |
21:12:33 | euantor | Took me a bit of playing to find the problem. Just playing with Concepts to see what they can do |
21:13:16 | * | Ven joined #nim |
21:13:40 | * | Ven is now known as Guest38788 |
21:15:07 | * | ofelas quit (Quit: shutdown -h now) |
21:16:34 | * | JappleAck joined #nim |
21:16:46 | * | nsf quit (Quit: WeeChat 1.9.1) |
21:21:00 | Araq | I think I know why it fails though and it's just a bug |
21:21:30 | euantor | Shall I report it on GitHub? |
21:21:39 | Araq | yes please |
21:22:12 | euantor | No problem, will do so in a while |
21:25:49 | * | Vladar quit (Quit: Leaving) |
21:25:50 | * | sendell joined #nim |
21:27:18 | Araq | import posix except read makes it work |
21:27:28 | sendell | hey guys :) Is vscode pluggin's autocompletion suposed to work with latest nim & VsCode ? |
21:27:54 | sendell | not working on both windows and linux for me :/ |
21:31:17 | * | jsgrant joined #nim |
21:39:35 | * | miran_ quit (Quit: Konversation terminated!) |
21:41:44 | Araq | sendell, too bad but it is supposed to work |
21:46:23 | * | rbrt quit (Quit: Oíche mhaith) |
21:46:24 | sendell | glad to hear that :) i'll keep searching then |
21:47:04 | * | rbrt joined #nim |
21:47:07 | * | MJCaley quit (Quit: MJCaley) |
21:48:34 | * | Jesin quit (Quit: Leaving) |
21:49:51 | * | rbrt quit (Client Quit) |
21:51:19 | * | rbrt joined #nim |
21:53:54 | federico3 | Araq: adding a new parser error to docgen.compilerMsgHandler for #6481 looks a bit messy: this is a doc "rendering" error rather than compiler/parser. Are you OK with it? |
22:03:12 | * | bluenote joined #nim |
22:04:57 | bluenote | Hello everyone! Quick question: If I have a NimNode from getType within a macro, how can I convert this NimNode into the corresponding typedesc? |
22:09:28 | * | sendell quit (Remote host closed the connection) |
22:09:33 | * | Guest38788 quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
22:10:47 | * | vlad1777d joined #nim |
22:15:50 | * | PMunch quit (Quit: leaving) |
22:17:31 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
22:18:41 | * | Trustable quit (Remote host closed the connection) |
22:24:11 | FromGitter | <mratsim> For use in a macro or in a non-completion proc? |
22:26:58 | bluenote | yes, for use in a macro at compile time. For example, I have mymacro(x: typed) so I can get x.getType(). But now I want to call a function f(T: typedesc) at compile time in the macro. So I need a function converting the NimNode to typedesc |
22:27:09 | * | rbrt quit (Quit: Oíche mhaith) |
22:27:37 | * | vivus joined #nim |
22:28:24 | FromGitter | <mratsim> Mmh would proc f(T: NimNode) work instead? |
22:29:49 | bluenote | it would compile, but what I'm trying to achieve requires calling a function with a typedesc argument |
22:31:16 | FromGitter | <mratsim> Maybe use quote do syntax |
22:32:03 | * | astronavt quit (Remote host closed the connection) |
22:32:06 | FromGitter | <mratsim> Or newCall to construct the call in the macro |
22:32:15 | * | rbrt joined #nim |
22:32:17 | * | astronavt joined #nim |
22:32:36 | * | Jesin joined #nim |
22:32:53 | * | astronavt quit (Remote host closed the connection) |
22:33:04 | FromGitter | <mratsim> I'm not aware of a way to transform a typedesc NimNode to typedesc |
22:33:27 | bluenote | yes exaclt, I tried newCall, but for some reason the argument stays of type NimNode and is not allowed as a typedesc |
22:33:28 | FromGitter | <mratsim> (but I'm a beginner at Nim metaprogramming) |
22:34:19 | FromGitter | <mratsim> Quote do / getAST maybe then |
22:36:40 | * | astronavt joined #nim |
22:36:53 | * | astronavt quit (Remote host closed the connection) |
22:40:01 | * | nhywyll quit (Quit: nhywyll) |
22:52:41 | bluenote | hm, that all gives me NimNodes. Tricky to escape from the NimNode world, maybe this is not even supposed to be possible? |
22:52:47 | * | bozaloshtsh quit (Ping timeout: 248 seconds) |
22:53:44 | * | bozaloshtsh joined #nim |
22:53:44 | * | bozaloshtsh quit (Changing host) |
22:53:44 | * | bozaloshtsh joined #nim |
23:20:16 | * | elrood quit (Quit: Leaving) |
23:46:24 | * | bluenote quit (Ping timeout: 260 seconds) |
23:46:40 | * | gokr quit (Ping timeout: 248 seconds) |
23:55:09 | * | mr_yogurt quit (Ping timeout: 260 seconds) |