00:07:20 | * | aziz joined #nim |
00:13:37 | * | CodeVance quit (Ping timeout: 256 seconds) |
00:14:04 | * | CodeVance joined #nim |
00:17:10 | * | CodeVance quit (Read error: Connection reset by peer) |
00:27:27 | * | deech quit (Ping timeout: 240 seconds) |
00:35:31 | * | CodeVance2 joined #nim |
00:35:31 | * | CodeVance2 quit (Client Quit) |
01:03:04 | * | aziz quit (Quit: Ex-Chat) |
01:04:09 | * | skrylar quit (Remote host closed the connection) |
01:36:30 | FromDiscord | <treeform> you can probably write the struct in c, maybe using an {.emit.}, then importc it? |
01:37:16 | FromDiscord | <treeform> I import c structs all the time, don't know if there is a way to export one |
01:37:29 | FromDiscord | <treeform> I would look at the generated code for answers. |
01:48:21 | * | arecaceae quit (Remote host closed the connection) |
01:48:44 | * | arecaceae joined #nim |
01:57:07 | * | smt` joined #nim |
02:00:33 | * | smt quit (Ping timeout: 265 seconds) |
02:02:04 | * | smt` quit (Read error: Connection reset by peer) |
02:02:16 | * | smt` joined #nim |
02:03:43 | * | sherjilo_ joined #nim |
02:04:27 | * | sherjilo_ is now known as sherjilozair |
02:08:15 | * | sherjilozair quit (Remote host closed the connection) |
02:08:33 | * | sherjilozair joined #nim |
02:17:12 | FromDiscord | <emekoi> i think you can export a struct by using the `cdecl` and `export` pragmas. |
02:36:40 | * | tefter joined #nim |
03:04:30 | * | leorize quit (Ping timeout: 256 seconds) |
03:06:36 | * | endragor joined #nim |
03:20:03 | FromDiscord | <awr> `exportc` pragma |
03:24:41 | * | dddddd quit (Remote host closed the connection) |
03:34:36 | * | SenasOzys quit (Remote host closed the connection) |
03:35:00 | * | SenasOzys joined #nim |
03:44:35 | * | SenasOzys quit (Ping timeout: 240 seconds) |
04:08:48 | * | FuntDobra joined #nim |
04:31:44 | * | xkapastel quit (Quit: Connection closed for inactivity) |
04:39:05 | * | FuntDobra quit (Ping timeout: 240 seconds) |
04:46:58 | * | carterza[m] joined #nim |
04:47:32 | carterza[m] | https://github.com/zacharycarter/nim-playground |
04:48:15 | carterza[m] | it's not complete but it's runnable now |
04:51:01 | * | endragor quit (Remote host closed the connection) |
05:05:05 | * | tefter quit (Ping timeout: 240 seconds) |
05:08:50 | * | FuntDobra joined #nim |
05:54:38 | * | Rush quit (Ping timeout: 256 seconds) |
06:20:50 | * | CodeVance joined #nim |
06:22:47 | * | FuntDobra quit (Ping timeout: 276 seconds) |
06:34:19 | * | CodeVance quit (Read error: Connection reset by peer) |
06:35:04 | * | CodeVance joined #nim |
06:35:04 | * | CodeVance quit (Client Quit) |
06:42:59 | * | nsf joined #nim |
06:45:08 | * | CodeVance joined #nim |
06:49:35 | * | miran joined #nim |
06:56:46 | * | yglukhov quit (Ping timeout: 264 seconds) |
06:57:30 | * | yglukhov joined #nim |
07:38:16 | FromGitter | <OldhamMade> hey everyone. I'm working on a little project using Nim, and I'm calling `osproc.execProcess` to check whether an executable exists. I'd like to mock out the results of this call so I can write tests for both cases (exists or doesn't). What's the ideomattic approach for this? I can't really see anything for mocking/patching other than `patchFile` which doesn't seem like a great fit. |
07:44:37 | * | yglukhov quit (Remote host closed the connection) |
07:47:53 | * | sherjilozair quit (Remote host closed the connection) |
07:53:06 | * | sherjilozair joined #nim |
07:57:11 | Araq | just write a test for a file that doesn't exist |
07:57:36 | Araq | testing doesn't require mocking, testing is about running your code over data |
07:58:24 | * | sherjilozair quit (Ping timeout: 260 seconds) |
08:04:09 | * | gmpreussner quit (Ping timeout: 268 seconds) |
08:05:41 | * | gmpreussner_ joined #nim |
08:10:20 | FromGitter | <stisa> @OldhamMade if you are testing from within the module with `when isMainModule` you could just overload `execProcess` I guess |
08:20:58 | * | Trustable joined #nim |
08:29:25 | FromGitter | <mratsim> @tim-st C and Nim mod are reminder |
08:30:08 | FromGitter | <mratsim> This is the logic to determine the sign: https://github.com/status-im/nim-stint/blob/master/stint/private/int_div.nim#L50-L51 |
08:30:31 | FromGitter | <mratsim> x mod y, —> result has the same sign as x |
08:30:57 | FromGitter | <mratsim> x div y —> if x and y are opposite signs result is negative |
08:31:19 | FromGitter | <mratsim> the goal is that x == q * y + r (q quotient, r reminder) |
08:31:38 | FromGitter | <mratsim> @treeform too |
08:45:33 | * | MyMind joined #nim |
08:46:04 | FromGitter | <kayabaNerve> This is interesting. I have a Math header (uint32Math.h) with a math.nim wrapper. The wrapper is just ⏎ proc `+`*(x: uint32, y: uint32): uint32 {.header: "../lib/c/uint32Math.h", importc: "add".} ⏎ and so on. When I compile though.... ⏎ C:\FILE_PATH\nimcache\math.o:math.c:(.text+0x0): multiple definition of `add' ⏎ C:\FILE_PATH\nimcache\usesMath.o:usesMath.c:(.text+0x0): first defined here ... |
08:46:04 | FromGitter | ... [https://gitter.im/nim-lang/Nim?at=5affe44c1cfca775e11f6625] |
08:46:32 | FromGitter | <kayabaNerve> Anyone have any idea? |
08:46:57 | * | Sembei quit (Ping timeout: 240 seconds) |
08:46:58 | FromGitter | <kayabaNerve> Thanks for any help in advance by the way :D |
08:48:03 | Araq | your header doesn't use inline for the add function? |
08:48:09 | FromGitter | <kayabaNerve> And I'm doing this because the Nim compiler doesn't have these operations for uint32_t. Just int32_t. My C compiler handles it fine so I'm assuming they were left out as not all compiler handles it fine? |
08:48:36 | FromGitter | <kayabaNerve> My header is just ⏎ ⏎ uint32_t add(uint32_t x, uint32_t y) { ⏎ ⏎ ```return x + y;``` ... [https://gitter.im/nim-lang/Nim?at=5affe4e32df44c2d063db7bd] |
08:49:15 | Araq | if you don't know Nim, not knowing C doesn't really help you. |
08:49:16 | FromGitter | <kayabaNerve> It does not use the inline pragma... |
08:49:29 | Araq | you cannot have function bodies in header files, generally speaking |
08:49:37 | FromGitter | <kayabaNerve> I've coded C for years and have used Nim on/off for months. |
08:49:51 | Araq | and Nim can add unsigned ints anyway |
08:50:17 | FromGitter | <kayabaNerve> I get errors when I try it. system.nim on GitHub doesn't have the proc `+` for it |
08:51:12 | Araq | !eval echo 4u + 5u |
08:51:14 | NimBot | 9 |
08:51:51 | FromGitter | <kayabaNerve> !eval var a, b: uint32; a =1; b =2; echo $(a+b) |
08:51:53 | NimBot | 3 |
08:52:00 | FromGitter | <kayabaNerve> My compiler doesn't handle that |
08:52:12 | FromGitter | <kayabaNerve> https://pastebin.com/ikW7x1X5 |
08:52:25 | FromGitter | <kayabaNerve> *My Nim compiler |
08:52:52 | Araq | so don't mix signed with unsigned numbers |
08:53:13 | FromGitter | <kayabaNerve> I'm an idiot. You're right |
08:53:17 | FromGitter | <kayabaNerve> int literal, not int |
08:53:29 | FromGitter | <kayabaNerve> All my types are uint but I didn't think to cast the literals. |
08:53:39 | FromGitter | <kayabaNerve> Thanks Araq |
08:53:59 | FromGitter | <kayabaNerve> Can I ask where the proc for this is if it's not in system.nim? I'm actually curious how you set it up :) |
08:54:29 | * | nsf quit (Quit: WeeChat 2.1) |
08:56:29 | Araq | https://nim-lang.org/docs/system.html#%2B,T,T |
08:56:43 | Notkea | hello, I'm trying to build nim (0.18.0) and run the tests, but some fail possibly due to missing dependencies. Is there a document describing how to buid a proper test environment? |
08:56:57 | Araq | Notkea: the .travis script |
08:57:19 | Araq | and here is how I found it, https://nim-lang.org/docs/theindex.html searched for '+' |
08:57:20 | Notkea | thanks! |
08:58:20 | Araq | kayabaNerve: yeah, to be honest, integer literals are pretty bad in Nim. sometimes they convert to unsigned/float, sometimes they don't |
08:58:53 | FromGitter | <kayabaNerve> Templates. Got it. |
08:59:00 | FromGitter | <kayabaNerve> Thanks for all the help Araq |
08:59:05 | Araq | in retrospect, they were a mistake. maybe we can still remove them... |
08:59:09 | FromGitter | <kayabaNerve> Sorry for not catching this at first glance |
08:59:10 | Araq | :-) |
08:59:15 | FromGitter | <kayabaNerve> It is not v1 yet ;) |
08:59:54 | Araq | but again, you can't have function bodies in headers unless you ensure the header is included only once |
09:00:17 | Araq | that's not Nim specific |
09:05:37 | * | CodeVance quit (Quit: Leaving) |
09:07:33 | FromGitter | <kayabaNerve> I did that |
09:07:44 | FromGitter | <kayabaNerve> ifndef ⏎ define ⏎ ⏎ endif [https://gitter.im/nim-lang/Nim?at=5affe9605a1d895fae511dcc] |
09:08:54 | FromGitter | <kayabaNerve> I hate having two files for one purpose. I understand readability but I think docs should be good enough to stop people from reading your code (and if others won't...). ⏎ ⏎ Plus, it's easy enough to scope out the function bodies. |
09:17:49 | * | qwertschaf is now known as qwertfisch |
09:18:47 | * | DaringlyEsoteric joined #nim |
09:21:11 | * | CodeVance joined #nim |
09:24:30 | * | CodeVance left #nim (#nim) |
09:24:57 | * | CodeVance joined #nim |
09:25:33 | * | CodeVance left #nim (#nim) |
09:27:16 | FromGitter | <mratsim> +1 for changing literals. They make converters a pain because literals are “all types” and I get ambiguous calls due to this. |
09:28:34 | FromGitter | <tim-st> @mratsim thanks for the information! |
09:28:55 | FromGitter | <tim-st> (regarding mod) |
09:29:03 | FromGitter | <mratsim> you’re welcome |
09:31:45 | * | CodeVance_ joined #nim |
09:33:54 | FromGitter | <kayabaNerve> I love C chars and string operators https://gist.github.com/kayabaNerve/acc8cfa41a4f44d5d72049ef916908a6 |
09:35:55 | FromGitter | <kayabaNerve> That's what I've been trying to do. I know there's a Nimble package for this BUT: ⏎ I already had a Java version, wanted to do some work in Nim, needed uint32, and the Nimble package is... messy. 111 lines of non-straightforward arithmetic for what I can do, and is easy to read using established base conversion algorithms, in 68 lines. |
09:36:38 | FromGitter | <kayabaNerve> I don't know if they did it as a port of some other code that was also messy or if it's ultra optimization. Either way. |
09:37:54 | * | CodeVance joined #nim |
09:38:12 | FromGitter | <kayabaNerve> It won't handle a Bitcoin address. I'd need 8 times the bits for that. I'm adding in Boost's Precision library soon. |
09:38:59 | Araq | mratsim: want to write an RFC? |
09:39:00 | * | CodeVance_ quit (Quit: Leaving) |
09:39:54 | FromGitter | <mratsim> @Araq I have no idea of how the solution should look like :/ |
09:40:42 | Araq | I would simply make 0, 1, 2, 3 of type 'int' and throw away the "int literal" concept :P |
09:41:27 | Araq | but then you would need to write posixcall() < 0i32 everywhere instead of < 0, or we promote mixed types to 'int' |
09:41:54 | FromGitter | <mratsim> @kayabaNerve AFAIK, bitcoin addresses are uint256 no? You can just reuse what we use for Ethereum: https://github.com/status-im/nim-secp256k1, https://github.com/status-im/nim-eth-keys, https://github.com/status-im/nim-stint |
09:43:01 | FromGitter | <mratsim> or `converter foo(x: int{lit}): int32` |
09:43:59 | FromGitter | <OldhamMade> Thanks @stisa |
09:44:41 | FromGitter | <OldhamMade> Unfortunately I’m looking to do this in separate unittest files. |
09:46:26 | FromGitter | <kayabaNerve> @mratsim Yep. 32 * 8 |
09:46:43 | FromGitter | <mratsim> just use stint and Uint256: https://github.com/status-im/nim-stint |
09:47:00 | FromGitter | <mratsim> and nim-secp256k1 is a wrapper for bitcoin libsecp256k1 |
09:47:59 | FromGitter | <kayabaNerve> Yep. I see that |
09:48:09 | FromGitter | <kayabaNerve> My plan was to use Boost + https://github.com/niv/ed25519.nim |
09:48:33 | FromGitter | <kayabaNerve> Especially as I want to use Boost already but stint is looking great. |
09:48:34 | FromGitter | <kayabaNerve> Thanks |
09:48:58 | FromGitter | <OldhamMade> @Araq thanks, I’m so used to mocking that it’s the natural “go to”. I guess I could pass the name of the exe I’m looking for into the proc and pass in something that doesn’t exist in the tests. 👍 |
09:49:08 | FromGitter | <kayabaNerve> I had no idea Status used Nim |
09:49:43 | FromGitter | <mratsim> Currently Nim is for research on sharding and Proof of Stake. |
09:49:53 | FromGitter | <kayabaNerve> Awesome that they do. I have some SNT dust on my wallet. |
09:50:05 | FromGitter | <kayabaNerve> I used to run a SNT Gitter TipBot too |
09:50:38 | * | xet7 joined #nim |
09:50:40 | FromGitter | <kayabaNerve> That was a fun project. Too bad the group I made it for didn't want it... but it got me my job now so it all worked out. |
09:50:49 | FromGitter | <mratsim> This is the main Nim product, there is a Google docs with the use-case/objectives: https://github.com/status-im/nimbus |
09:51:05 | * | Vladar joined #nim |
09:51:18 | FromGitter | <kayabaNerve> Yeah. I sorted GitHub by the Nim language. |
09:51:23 | FromGitter | <kayabaNerve> Looking nice. |
09:52:10 | FromGitter | <mratsim> there will be more SNT bounties in the coming weeks for Nim devs |
09:53:04 | FromGitter | <kayabaNerve> I'm not a huge fan of status as I've not looked into it too much. I've not heard bad things yet though. |
09:53:21 | FromGitter | <kayabaNerve> It's one of the larger and respectable Ethereum projects. |
09:54:14 | FromGitter | <mratsim> Being able to work the whole day in Nim from home is enough to be a fan for me ;) and the team is awesome. |
09:56:21 | FromGitter | <kayabaNerve> So about Stint: it's labelled as experimental. It is stable enough for use, and is unlimited precision? |
09:56:43 | FromGitter | <kayabaNerve> (not unlimited ofc. Nothing is unlimited. But it's not just up to 2048bits) |
09:56:46 | FromGitter | <mratsim> Yes it’s stable enough for use, it works only on devel |
09:57:01 | FromGitter | <kayabaNerve> Nim devel? Not even 0.19? |
09:57:03 | FromGitter | <mratsim> it depends on your stack size |
09:57:09 | FromGitter | <mratsim> 1) 18.1 |
09:57:15 | FromGitter | <mratsim> from April at minimum |
09:57:29 | FromGitter | <mratsim> there is a required commit from March 21 iirc |
09:57:53 | FromGitter | <mratsim> you can use stuint[65536] if your stack is big enough |
09:58:15 | FromGitter | <kayabaNerve> I'm just trying to decide it or Boost :P |
09:58:18 | FromGitter | <kayabaNerve> Thanks for your help |
09:59:16 | FromGitter | <mratsim> it will be passed through a security audit before widespread use ;) |
10:00:13 | FromGitter | <kayabaNerve> I think I'll use Boost. I appreciate this and will definitely keep my eye on it, but I already need Boost and it's esablished |
10:00:38 | dom96 | ooh, a security audit. First Nim code to be put through that I guess :) |
10:00:42 | FromGitter | <kayabaNerve> (*already plan on using Boost) |
10:00:59 | FromGitter | <mratsim> no problem. Good luck, we had issue with C++ because often we got error when casting |
10:01:05 | FromGitter | <kayabaNerve> dom96 giving confidence to the success and security of Nim |
10:01:13 | FromGitter | <mratsim> “This type has a non-trivial destructor and cannot be …” ... |
10:01:28 | dom96 | Does that mean they will need to audit the compiler too? :P |
10:01:39 | FromGitter | <kayabaNerve> SDL Nim also had destructor issues IIRC |
10:01:45 | FromGitter | <kayabaNerve> I wonder if it's a similar cause |
10:02:00 | FromGitter | <kayabaNerve> Likely not though as its C... |
10:02:23 | dom96 | I guess you mean SFML? |
10:03:56 | FromGitter | <kayabaNerve> SFML Nim... Maybe. |
10:04:10 | FromGitter | <kayabaNerve> I rarely get the two wrong. Now that you mention it though, I think you're right |
10:04:41 | FromGitter | <kayabaNerve> I think the SFML lib was better and I got it to install properly (SFML installation can be a bitch) |
10:04:46 | FromGitter | <kayabaNerve> And SFML is C++ |
10:05:12 | FromGitter | <kayabaNerve> But there is a C variant IIRC |
10:06:36 | FromGitter | <kayabaNerve> SFML is in C++ ⏎ CSFML is a C wrapper ⏎ Nim-CSFML is the library I used |
10:06:41 | FromGitter | <mratsim> Coming soon, crypto-unimcorn |
10:06:49 | FromGitter | <kayabaNerve> Unimcorn? |
10:07:11 | FromGitter | <mratsim> Unicorn + Nim ;) |
10:08:47 | FromGitter | <mratsim> Given the low level possibilities of Nim, the interfaccing with C/C++, the productivity, Nim has a lot of potential for crypto/blockchain research. |
10:09:06 | FromGitter | <kayabaNerve> Why I'm using it with my crypto |
10:09:42 | FromGitter | <kayabaNerve> I'm making my multi-coin wallet in Java/JS though |
10:10:05 | FromGitter | <kayabaNerve> ShapeShift bounty is quite big |
10:11:04 | FromGitter | <kayabaNerve> I think I'm changing from Boost to Stint... Depends if it works on the stock Nim stable. |
10:11:42 | * | superpyrin joined #nim |
10:12:08 | superpyrin | Client: HexChat 2.14.1 • OS: Microsoft Windows 7 Professional (x64) • CPU: Intel(R) Core(TM) i5 CPU 650 @ 3.20GHz (3.33GHz) • Memory: 7.9 GiB Total (4.1 GiB Free) • Storage: 1.1 TiB / 4.8 TiB (3.7 TiB Free) • VGA: ATI Radeon HD 5670 • Uptime: 3d 17h 50m 21s |
10:12:24 | FromGitter | <mratsim> Stint doesn’t work on Nim stable unfortunately. Also you can’t compile it to Javascript, too much cast inside :/ have to go through emscripten/asm.js |
10:16:01 | FromDiscord | <crem> ```$ choosenim stable |
10:16:01 | FromDiscord | <crem> Info: Version 0.17.2 already selected``` |
10:16:05 | FromDiscord | <crem> :-\ |
10:16:31 | FromDiscord | <crem> update stable is what I needed. Sorry for the noise. |
10:18:44 | * | superpyrin left #nim ("Leaving") |
10:20:30 | FromGitter | <kayabaNerve> Fun. Just upgraded from 0.17 to 0.18 and broke my Base58 code |
10:20:42 | FromGitter | <kayabaNerve> @mratsim That doesn't mean I can't get it to work ;) |
10:27:55 | FromGitter | <mratsim> @kayabaNerve this is the required commit: https://github.com/nim-lang/Nim/commit/121b9e26fb9d1ae6037c806dbb12a3ae0e26ded6 |
10:28:14 | * | DaringlyEsoteric left #nim ("The Lounge - https://thelounge.github.io") |
10:30:44 | crem | Uh, I remember nothing about nim. Again. |
10:35:36 | FromGitter | <kayabaNerve> Thannks @mratsim |
10:35:44 | FromGitter | <kayabaNerve> For some reason, my strings have a space at the end |
10:37:21 | FromGitter | <kayabaNerve> Splice behavior of strings changed. In 0.17, string = string[1 .. end] would shift the null terminator. Now it doesn't...\ |
10:40:09 | * | noonien joined #nim |
10:41:11 | crem | Can I make nimble build binary with dash in name? |
10:41:32 | crem | Sorry, there will be lots of basic questions from me this weekend. |
10:43:06 | crem | Also, it either creates binary called nim, or if I rename it in nimble config and source, it says that I shoould have nim.nim. |
10:45:33 | crem | I guess I won't start coding in the nearest hour, will be looking for ways to please nimble instead. |
10:46:37 | crem | :( |
10:48:48 | crem | There is not a word about nim.nim at https://github.com/nim-lang/nimble.. |
10:52:50 | Araq | --out option? |
10:53:18 | crem | In nimble config? |
10:54:16 | Araq | switch("out", "dash-y") |
10:54:21 | Araq | in the .nimble file |
10:55:35 | crem | In random place?.. doesn't seem to work. |
10:56:13 | crem | Also, is there a way to know the latest version of parsetoml without installing the package? |
10:56:35 | crem | But that's later, first I have to understand the nimble files layout. |
10:57:15 | Yardanico | crem, https://github.com/NimParsers/parsetoml/blob/master/parsetoml.nimble#L3 |
10:57:33 | crem | Thanks. |
10:57:36 | Yardanico | but if a repo for a nim project has releases (tags) on github, nimble will use that instead |
10:57:49 | Yardanico | it will use latest release (tag) by default AFAIK |
10:58:33 | Yardanico | "Nimble always fetches and installs the latest version of a package. Note that latest version is defined as the latest tagged version in the Git (or Mercurial) repository, if the package has no tagged versions then the latest commit in the remote repository will be installed. " |
10:58:47 | Yardanico | so not a release, but a latest github/mercurial tag |
11:00:03 | crem | https://gist.github.com/mooskagh/0e69aa806eaf3e30b87a11a6c0bde518 still produces ./lc0client instead of ./dash-y.. And complains about nim.nim, but if I rename lc0client.nim to nim.nim it fails as it cannot find lc0client.nim |
11:00:29 | Yardanico | complains about nim.nim? |
11:00:34 | Yardanico | can you give an error log? |
11:03:11 | * | Snircle joined #nim |
11:03:25 | crem | Warning: Package 'nim' has an incorrect structure. The top level of the package source directory should contain at most one module, named 'nim.nim', but a file named 'lc0client.nim' was found. This will be an error in the future. |
11:03:35 | crem | ah! |
11:03:39 | crem | it's package nim! |
11:04:13 | crem | That's confusing. I remember being confused about this last time. |
11:04:35 | crem | Ok, so dashed binary would be nice to have, but not a major problem for now. |
11:04:51 | Yardanico | so your lc0client is in the same directory as nim ? :) |
11:05:36 | crem | no, but probably as nim is listed as dependency, it complains about it. |
11:05:52 | Yardanico | it didn't do that for me |
11:06:05 | Yardanico | I have nim as a dep in all my .nimble files |
11:06:13 | crem | I created an empty directory.... |
11:06:21 | crem | I know what happened! |
11:06:23 | Yardanico | e.g. requires "nim >= 0.18.0" |
11:06:26 | crem | I did 'nimble init' |
11:06:49 | crem | And by default it thinks that I'll create 'nim' package instead of asking for the name. |
11:07:19 | crem | or no |
11:07:25 | crem | it takes directory name.. |
11:07:30 | Yardanico | yes, it does |
11:09:44 | crem | Ok, and about dash in binary?.. No way? "lc0-client" would be nice |
11:11:09 | Yardanico | dash or - ? |
11:11:14 | Yardanico | because dash is — :) |
11:11:57 | crem | minus |
11:12:10 | crem | hyphen |
11:12:26 | crem | hyphen-minus |
11:13:25 | Yardanico | crem, why not _ ? but I think dom96 may know if it's possible to change output binary name with nimble |
11:14:43 | crem | Underscore.. In binary names hyphen-minus is more common, I think. |
11:15:00 | crem | Better without anything then. |
11:15:01 | * | dddddd joined #nim |
11:15:20 | dom96 | crem: If you have ideas about how to make that warning better please let me know |
11:15:27 | dom96 | I did my best to make it as useful as possible |
11:15:47 | dom96 | Sorry, no dashes possible |
11:16:07 | dom96 | You can always copy the resulting binary, but installation via Nimble won't work |
11:16:34 | dom96 | task mybuild, "Build things my way": exec "nimble build"; cp "lc0_client", "lc0-client" |
11:16:43 | dom96 | then run `nimble mybuild` |
11:16:55 | Yardanico | crem, I think _ is much more common than - |
11:17:05 | Yardanico | well, it depends |
11:17:08 | dom96 | btw guys, feel free to ping me when users have problems with Nimble |
11:18:18 | crem | I wasn't aware that package happened to be named nim, so though nim.nim is some standard filename on the root of any package. |
11:20:38 | dom96 | Perhaps "Package *with name* 'nim' has an incorrect structure." would help? |
11:21:04 | dom96 | !eval import json; echo(%*{"foo": "ß"}) |
11:21:05 | NimBot | Compile failed: <no output> |
11:21:15 | dom96 | !eval echo("Hello?") |
11:21:18 | NimBot | Hello? |
11:21:51 | dom96 | That's strange. Anyway, shouldn't the ß be escaped in the JSON? |
11:22:03 | Araq | no. |
11:22:10 | Araq | JSON is unicode ready |
11:26:27 | FromGitter | <kayabaNerve> How can I wrap a C++ operator? |
11:28:23 | FromGitter | <mratsim> look here: https://github.com/status-im/nim-ttmath/blob/master/src/ttmath.nim # is your friend |
11:28:49 | FromGitter | <mratsim> #and @ |
11:28:56 | FromGitter | <mratsim> \# and @ |
11:29:31 | FromGitter | <mratsim> details are here: https://nim-lang.org/docs/manual.html#importcpp-pragma-importcpp-for-procs |
11:29:53 | * | FuntDobra joined #nim |
11:35:39 | FromGitter | <kayabaNerve> Thanks |
11:37:12 | crem | So if my main file is src/lc0client.nim, and I want to have config processing in a separate file, should it be src/config.nim or src/lc0client/config.nim or src/config/config.nim ? |
11:37:55 | FromGitter | <mratsim> src/lc0client/config.nim |
11:38:11 | crem | thanks |
11:38:29 | FromGitter | <mratsim> or lc0client.nim and lc0client/config.nim |
11:42:25 | dom96 | or if you don't intend for others to use your code as a library you can add `skipExt=@["nim"]` to your Nimble file and pick whatever structure you want |
11:45:38 | FromGitter | <diegogub> hello, I have some private packages and I'm trying to vendor them to build a docker with nimble.. Does nimble support vendoring? |
11:45:56 | FromGitter | <kayabaNerve> @mratsim How does this work? |
11:45:57 | FromGitter | <kayabaNerve> proc initIntT (a: cstring): T {.importcpp: "'0(#)".} |
11:46:13 | crem | Maybe some nim fomatter appeared in last 8 months? |
11:46:45 | FromGitter | <kayabaNerve> That's the equivalent of TTMath::UInt<size> = "1", right? |
11:46:49 | FromGitter | <mratsim> The first # match with the first argument passed to the nim proc, the second # with the second, the third # with the third, and @ matches with the reminder |
11:47:05 | FromGitter | <kayabaNerve> ... that doesn't explain the 0 |
11:47:18 | FromGitter | <mratsim> ‘0 matches with the type |
11:47:20 | * | Trustable quit (Remote host closed the connection) |
11:47:22 | FromGitter | <kayabaNerve> Or this module's lack of = |
11:47:23 | FromGitter | <kayabaNerve> Got it |
11:47:31 | FromGitter | <kayabaNerve> So it's a constructor call |
11:47:36 | FromGitter | <mratsim> so with T, the type of the result |
11:47:43 | FromGitter | <mratsim> yes |
11:47:48 | dom96 | diegogub: kind of, you can specify --nimbleDir:<dir> and everything will be installed there |
11:48:22 | FromGitter | <mratsim> usually you can also put {.importcpp: "'0(#)”, constructor.} but it seems like we got away without it :P |
11:51:23 | FromGitter | <kayabaNerve> @mratsim So. It's trying to compile with gcc, not g++ |
11:51:26 | FromGitter | <kayabaNerve> Idea on that? |
11:51:32 | FromGitter | <mratsim> nim cpp |
11:51:33 | FromGitter | <kayabaNerve> Thanks by the way |
11:51:36 | FromGitter | <kayabaNerve> Got it |
11:53:40 | FromGitter | <mratsim> Note: if you try to reuse the same nimcache to compile to C after compiling to C++, you will need to cleanup the nimcache because Nim will not do it and try to link C symbols to C++ mangled symbols or something like this. |
11:54:32 | Yardanico | there's nim c, nim cpp, nim js, nim objc if you didn't know btw :) @kayabaNerve |
11:54:49 | FromGitter | <mratsim> R.I.P. `nim php` |
11:55:15 | FromGitter | <mratsim> 2008-2018 `nim php` the unsung hero. |
11:55:28 | Yardanico | :D |
11:57:16 | Yardanico | AFAIK nim php was used in the production, but I don't know who used it |
12:01:29 | * | gokr joined #nim |
12:06:49 | * | Vladar quit (Quit: Leaving) |
12:10:38 | * | yglukhov joined #nim |
12:15:18 | * | yglukhov quit (Ping timeout: 256 seconds) |
12:16:42 | FromGitter | <kayabaNerve> @mratsim You ever get this error? |
12:16:43 | FromGitter | <kayabaNerve> C:\Users\lukeP\AppData\Local\Temp\ccD06IHg.s: Assembler messages: ⏎ C:\Users\lukeP\AppData\Local\Temp\ccD06IHg.s:916: Error: operand type mismatch for `movq' ⏎ C:\Users\lukeP\AppData\Local\Temp\ccD06IHg.s:917: Error: incorrect register `%edx' used with `q' suffix |
12:17:23 | FromGitter | <kayabaNerve> Is this related to that GitHub commit not in stable yet? |
12:17:24 | FromGitter | <mratsim> Only when I tried to do inline assembly. |
12:18:39 | FromGitter | <mratsim> that’s not Nim, it’s assembly for x86_64 (movq) used with a 32-bit register (%edx) apparently |
12:19:56 | FromGitter | <arnetheduck> https://trends.google.com/trends/explore?date=all&q=restructuredtext,markdown |
12:19:58 | FromGitter | <mratsim> maybe you have to pass a -DX86_64 or some other define to the library you’re wrapping? |
12:20:27 | FromGitter | <mratsim> use {.passC: “-DYOUR_CUSTOM_DEFINE”.} |
12:23:46 | * | FuntDobra quit (Ping timeout: 264 seconds) |
12:25:03 | FromGitter | <kayabaNerve> I'm trying to convert a std::string to a char* |
12:25:23 | FromGitter | <krux02> std::string has a method for that |
12:28:22 | FromGitter | <kayabaNerve> .c_str() |
12:28:23 | FromGitter | <kayabaNerve> I know |
12:28:25 | FromGitter | <kayabaNerve> I'm using it |
12:42:53 | * | gokr quit (Ping timeout: 268 seconds) |
12:45:21 | FromGitter | <arnetheduck> hahaha: https://github.com/arnetheduck/nlvm/issues/1#issuecomment-390402510 |
12:46:03 | carterza[m] | :D |
12:46:03 | Yardanico | hahah, joke about C++ being compiled to C before it got its' own C++->native compiler :) |
12:49:15 | * | CodeVance1 joined #nim |
12:49:18 | * | CodeVance quit (Read error: Connection reset by peer) |
12:50:53 | Yardanico | of course having more backends is good, but we shouldn't hate other ones :) |
12:51:24 | FromGitter | <arnetheduck> no, but the t word was mentioned :) |
12:51:53 | Yardanico | yeah, I saw it !! |
12:52:11 | carterza[m] | that's a trigger for some people round these parts |
12:53:21 | Yardanico | well, why don't we call LLVM a transpiler? |
12:53:41 | Yardanico | it "transpiles" your code to IR and then compiles this IR to machine code :) |
12:54:51 | FromGitter | <arnetheduck> well, I've already written one thing I used to call a transpiler: https://github.com/arnetheduck/j2c |
12:55:14 | FromGitter | <arnetheduck> I'm sure there's some important difference between the two :) |
12:55:54 | carterza[m] | well - I think you have to have a level of abstraction difference |
12:56:01 | carterza[m] | to technically be compiling |
12:56:13 | carterza[m] | if the targets share the same level of abstraction |
12:56:15 | carterza[m] | you're transpiling |
12:56:18 | carterza[m] | at least that's my understanding of it |
12:57:13 | FromGitter | <data-man> https://en.wikipedia.org/wiki/Source-to-source_compiler |
12:57:22 | FromGitter | <data-man> Nim in the list |
12:57:27 | Yardanico | "This article has multiple issues." :) |
12:57:39 | carterza[m] | https://github.com/zacharycarter/nim-playground - now has HMR |
12:57:41 | Yardanico | @data-man well, you know what wikipedia can be edited by anyone, right? :) |
12:58:05 | FromGitter | <data-man> Anyway Nim has more high level than C :-D |
12:59:19 | Araq | oh it's yet another transpiler vs compiler discussion. |
12:59:37 | Araq | so ... C is close to machine code and "compiled", right? |
12:59:48 | FromGitter | <data-man> @Yardanico: I don't want to become a Wiki warrior :) |
12:59:53 | Araq | how does that work for the transpiler people? |
13:00:42 | Araq | sadly, my own term, transfinitiler hasn't taken off |
13:02:46 | FromGitter | <data-man> I always use Google Transpiler and Yandex Transpiler :) |
13:04:36 | FromGitter | <data-man> Because human langs have approximately the same level of abstraction :) |
13:05:21 | Yardanico | hahah |
13:05:49 | * | xcm quit (Remote host closed the connection) |
13:06:53 | federico3 | Araq: are you being serious? |
13:07:14 | Araq | no. |
13:12:04 | federico3 | try with "metapiler" |
13:39:12 | * | skrylar joined #nim |
13:50:02 | CodeVance1 | C is a transpiler too |
13:54:24 | * | noonien quit (Quit: Connection closed for inactivity) |
14:00:42 | * | Trustable joined #nim |
14:02:29 | * | FuntDobra joined #nim |
14:11:03 | * | sherjilozair joined #nim |
14:14:27 | * | FuntDobra quit (Ping timeout: 240 seconds) |
14:14:56 | skrylar | CodeVance1, i wasn't here for the context; guessing someone brought up the "not real language because just outputs C" trope? |
14:15:50 | FromGitter | <zetashift> someone posted on a nlvm issue where Nim's C target is so 1970ss |
14:16:09 | skrylar | technically haXe (well, they style it Haxe now) also transpiles to C++ but yet none of the people getting paid to write games with it are complaining |
14:16:18 | FromGitter | <zetashift> haxe now also compiles to C |
14:16:23 | skrylar | it did before too |
14:16:25 | skrylar | actually they're greatful to be off the swf target |
14:16:45 | skrylar | people just like shitting on things that are different from what their useless education programs ground in to them |
14:16:51 | FromGitter | <zetashift> It did? I thought only C++; https://hashlink.haxe.org/ |
14:17:00 | skrylar | it had a c target before, but it was well |
14:17:13 | skrylar | less than great |
14:17:23 | FromGitter | <zetashift> I bet if Nim had a Rust target it'd be revolutionary according to news sites he |
14:17:34 | skrylar | rust is illegible so its good |
14:18:04 | FromGitter | <krux02> but Haxe is not such a good language |
14:18:10 | skrylar | i mean you could always be pharo/squeak, where you are self-hosted with a VM and awesome compiler yet fail to comprehend the idea of shipping code without the IDE bolted on :3 |
14:18:24 | FromGitter | <narimiran> hey @zetashift! have you seen my PM? |
14:18:38 | FromGitter | <zetashift> @krux02 haxe is nice, I think you just really really hate OOP :P |
14:18:41 | FromGitter | <zetashift> no I have not |
14:18:47 | skrylar | haxe was ok. |
14:18:50 | FromGitter | <krux02> maybe |
14:19:04 | FromGitter | <krux02> was? |
14:19:14 | dom96 | Haxe is the "compiles to everything" language AFAIK |
14:19:25 | FromGitter | <krux02> I takes more for a Programming language to take off than to be OK. |
14:19:27 | FromGitter | <zetashift> @narimiran I have now; this is why I hate gitter :D |
14:19:40 | skrylar | you can (and could) get work done with it. while nim is better than <insert>, i feel neither the joy of clicking on SUnit buttons to inspect failing tests and going yay its green now (livecoding) nor like i get anything done. most of my nim experience is more or less writing wrappers and macros so that one day i might do something i care about :| |
14:19:45 | FromGitter | <data-man> From https://www.stevefenton.co.uk/2012/11/compiling-vs-transpiling/ ⏎ ⏎ > So (simplistically) when you compile C#, your method bodies are transformed by the compiler into IL. This cannot be called transpiling because the two languages are very different levels of abstraction. |
14:19:56 | FromGitter | <krux02> dom96: basically yes |
14:20:05 | FromGitter | <zetashift> last few months it got a lot easier to use thanks to some improved editor plugins |
14:20:35 | skrylar | this would be less annoying if the completion of said yak shaving came to the fruition of more than nonexistent fanfare (FLTK, Firebird) |
14:20:42 | enthus1ast | any idea why recvfrom (<sys/socket.h>) ss_family/sa_family does not change for ipv4 or ipv6 udp? |
14:20:45 | FromGitter | <krux02> @data-man lol |
14:21:07 | skrylar | enthus1ast, why should it, the abstractions aren't different |
14:21:18 | skrylar | ip6 and ip4 are addressing and tcp/udp are reliability layers |
14:21:23 | FromGitter | <data-man> So Nim cannot be called transpiler because the two languages are very different levels of abstraction. :) |
14:21:46 | skrylar | data-man: don't feel bad, your average coder is a hack fit only to write basic jquery scripts |
14:21:57 | skrylar | citation: IBM study where most professionals failed to grasp binary search from spec |
14:22:07 | FromGitter | <zetashift> Haxe has some really shitty(they're all over the place) docs and if you have trouble with a haxe target good luck trying to fix gthat |
14:22:19 | FromGitter | <krux02> I vote for Araqs suggestion to call it transfinitiler |
14:22:24 | FromGitter | <zetashift> ^ |
14:22:26 | skrylar | if they can't even grasp bsearch, how can they understand macros |
14:22:37 | skrylar | and if you can't understand macros, you've lost the point of why nim is useful |
14:22:38 | skrylar | :| |
14:22:40 | skrylar | </soapbox> |
14:22:51 | FromGitter | <krux02> @zetashift but Nim has these things, too |
14:22:58 | FromGitter | <krux02> (these problems) |
14:23:24 | FromGitter | <zetashift> Nim currently has the excuse of being pre-1.0 about those issues |
14:23:29 | enthus1ast | skrylar: should it not be set to AF_INET6 for udp6? |
14:23:31 | FromGitter | <zetashift> and not having 1000 targets is a plus this time |
14:24:00 | FromGitter | <krux02> skrylar: for be Nim is great because of the combination of the macros, static type information, and the low level C like datastructures |
14:24:15 | FromGitter | <zetashift> also honestly Nim has nice docs(book included) it just doesn't have great stuff for absolute beginners |
14:24:20 | FromGitter | <mratsim> and no OO forced down your throat. |
14:24:24 | Araq | "transpiling vs compiling" makes no sense to me, mapping C# to IL is easy |
14:24:40 | Araq | and the IL was kinda made for an OO language. |
14:24:57 | FromGitter | <mratsim> We should say that Nim transmogrify to C: http://calvinandhobbes.wikia.com/wiki/Transmogrifier |
14:25:17 | dom96 | It makes some sense when you go by the Wikipedia definition: Nim -> C: Compiler, Nim -> JS: Transpiler |
14:25:25 | FromGitter | <krux02> every feature of Nim on it's own is either already very well known and implemented in other languages. But bringing it all togethar in one language that is usable is very unique |
14:25:36 | Araq | it's the other way round, everybody calls it the "C# compiler" and so it the guy who wrote the article said "very different levels of abstraction" |
14:25:55 | FromGitter | <mratsim> > transmogrifier ⏎ > someone or something that can change or transform its appearance to something else |
14:26:22 | Araq | and everything that does lambda lifting is a compiler anyway. |
14:26:26 | FromGitter | <krux02> I feel entertained :) |
14:26:40 | FromGitter | <data-man> @mratsim 💯 |
14:27:03 | FromGitter | <mratsim> I think we have an April’s Fool article :P |
14:27:28 | Araq | LL is a heavy transformation, indicating your target language is on a different abstraction level. |
14:27:47 | FromGitter | <krux02> I usually say "only hip people use the word transpiling" |
14:28:49 | FromGitter | <mratsim> “Following heated debates in the Nim community whether Nim was a compiled to C or transpiled to C, and also compiled to JS or transpiled to JS, with arguments one way or another, we felt the need to introduce a new terminology as the current ones didn’t address our concerns and failed to communicate what Nim is. In short Nim transmogrify to C and JS." |
14:29:26 | dom96 | mratsim: Better written than any of our articles so far :D |
14:29:35 | dom96 | submit it as a draft |
14:29:39 | FromGitter | <mratsim> lol |
14:30:29 | skrylar | what was that old quote, there are languages that people complain about and then there are languages that nobody uses |
14:30:36 | skrylar | and then someone jokingly tacked on "and somehow Go is both" |
14:30:55 | CodeVance1 | Frankly I think compiling to C is better. I wish more langs would do it |
14:31:51 | CodeVance1 | nim should compile to haxe then to C then to ASM then to bytecode XD |
14:31:55 | FromGitter | <krux02> CodeVance1: transmogrifies to C |
14:32:02 | skrylar | CodeVance1, it just depends |
14:32:15 | skrylar | Chicken Scheme compiles to C, nobody seems to care that it does, although C is a bad fit |
14:32:27 | skrylar | they had to do a lot of hackery to force a C target to support CPS and friends |
14:32:48 | CodeVance1 | Haxe didn't have ide support last I checked |
14:32:51 | FromGitter | <data-man> The best transpilers - sed and awk :) |
14:32:57 | FromGitter | <mratsim> @dom96 here is the draft: https://gist.github.com/mratsim/1c0e5427e68015452726ae6badc61e20 |
14:33:08 | skrylar | haxe has a nimsuggest equivalent and some editors have plugins to use it |
14:33:20 | * | PMunch joined #nim |
14:33:25 | skrylar | they did have a (windows-only) IDE, not sure if its still around |
14:33:27 | CodeVance1 | krux02 I like metapiles more |
14:33:29 | skrylar | Flashdevelop? |
14:33:46 | dom96 | mratsim: PR or create an issue with a link to this on the website repo |
14:33:53 | CodeVance1 | skrylar: flashdevelop no worky last I checked. |
14:33:59 | FromGitter | <krux02> I think it is a good idea to compile to Webassembly at some point. Because I think it is independently of the Web a great idea for a complation target format that will still work in the future when we have different processor architectures. |
14:34:33 | skrylar | CodeVance1, it worked for me but this was eight years ago |
14:34:48 | PMunch | flashdevelop used to be cross platform |
14:35:00 | FromGitter | <krux02> I think everything that a good proramming language needs a good support in widely adopted editors. |
14:35:12 | PMunch | But they removed Linux support for some reason. It was based on Eclipse though, so not quite sure why |
14:35:12 | FromGitter | <arnetheduck> @krux02 nlvm does that now |
14:35:17 | FromGitter | <krux02> And I am sorry to tell this, nimsuggest is a bit crap. |
14:35:23 | skrylar | gamedev on linux is well, not a thing |
14:35:30 | skrylar | and haxe was being used by gamedevs |
14:35:43 | PMunch | I remember writing Flash code in FlashDevelop under Windows Java installed under Wine |
14:35:49 | FromGitter | <krux02> After long time struggeling with it, I just disable it because the frustration isn't worth the benefit |
14:36:12 | FromGitter | <krux02> skrylar: I do gamedev on Linux |
14:36:33 | PMunch | Gamedev is entirely possible on Linux |
14:36:40 | skrylar | possible yes, pain in the ass very yes |
14:36:43 | FromGitter | <krux02> yes it is I am doing it |
14:36:46 | PMunch | If you just use something that supports Linux |
14:37:04 | FromGitter | <krux02> I just had some interesting experiences with the opengl debugger |
14:37:26 | skrylar | Krita finally doesn't crash daily, so that's nice. Kdenlive is broken. Audacity and Ardour work (for hacking up foley sounds), but music is a pain |
14:37:38 | PMunch | I developed a game/interactive display in Unity under Wine loading native MonoDevelop |
14:37:48 | FromGitter | <krux02> that worked on Linux then it got bouht by AMD and was then windows and and only (i have none) and then there were other debuggers with similar interesting histories |
14:37:59 | * | zielmicha_ quit (Ping timeout: 256 seconds) |
14:38:02 | FromGitter | <krux02> in sort the tool support is a bit inconsistent. |
14:38:23 | skrylar | Godot however is still great and seems to have always been, so those guys are awesome |
14:38:23 | PMunch | Also wrote an actual game in Nim on Linux :) |
14:38:25 | PMunch | Using Vim |
14:38:36 | PMunch | Yeah I've been meaning to check out Godot |
14:38:49 | PMunch | Not a huge fan of the monolithic engine/editor thing though.. |
14:39:00 | CodeVance1 | monolithic? |
14:39:06 | CodeVance1 | its got plugins |
14:39:08 | PMunch | Yeah, all-in-one |
14:39:11 | skrylar | godot is modular but they cram it all in the build |
14:39:16 | FromGitter | <krux02> skrylar: you can run the music editor in pario paint on an znes emulator on Linux just fine. Where is your problem? |
14:39:19 | * | zielmicha_ joined #nim |
14:39:26 | PMunch | I know that it is modular |
14:39:40 | CodeVance1 | the one plugin is too much? |
14:39:42 | * | hohlerde quit (Ping timeout: 256 seconds) |
14:39:45 | CodeVance1 | like break it up |
14:39:56 | PMunch | I meant in general, not specifically Godot |
14:40:02 | FromGitter | <krux02> yea I also don't like the Enigine/Framework idea on it's own with plugins |
14:40:07 | skrylar | godot isn't an engine where you bolt its parts on to your own thing, its more like OGRE where it demands control of your stuff |
14:40:17 | skrylar | the upside is that its very well made |
14:40:19 | PMunch | Unity, Unreal, and Godot are all shipped as editor/engine/framework combo package |
14:40:43 | PMunch | skrylar, oh yeah |
14:40:49 | PMunch | It definitely has it's benefits |
14:40:52 | FromGitter | <krux02> PMunch: that is exactly what I don't linke |
14:40:55 | skrylar | one of the first times too i've seen an engine come with a sensible GUI *already built in* and not as an extra paid freaking addon to an already thousand dollar license |
14:41:07 | PMunch | But as someone who are used to my own workflow it's a bit annoying having to change that just to use an engine |
14:41:25 | skrylar | i guess torque did too |
14:41:30 | FromGitter | <krux02> I have done so many proramming languages in so many different editors all with their different keyboard controls. I am tired of it. |
14:41:42 | PMunch | Exactly |
14:41:59 | skrylar | godot doesn't care if you edit in sublime tho |
14:42:12 | skrylar | have done that to multi-caret some boilerplate and it auto-reloads back in to itself |
14:42:18 | * | zahary__ joined #nim |
14:42:27 | * | surma_ joined #nim |
14:42:39 | FromGitter | <krux02> I use emacs. Emacs sucks in a lot of ways (especially default keyboard shortcuts), but it just works for basically every programming language, even the obscure ones. |
14:42:50 | * | skrylar used to use a heavily edited emacs |
14:43:01 | PMunch | I'd rather learn my Vim/Emacs/Sublime/VS Code/whichever-editor-you-like key bindings and set it up to be just right for me, and then work with multiple languages in that. Rather than having to learn how to use 10 different editors, all with their pros and cons. |
14:43:05 | * | zahary_ quit (Ping timeout: 256 seconds) |
14:43:06 | * | surma quit (Ping timeout: 256 seconds) |
14:43:06 | * | zahary__ is now known as zahary_ |
14:43:06 | * | surma_ is now known as surma |
14:43:25 | * | skrylar just wants livecoding and a class browser >:( |
14:43:25 | federico3 | +1 PMunch |
14:43:30 | * | CodeVance1 is now known as CodeVance |
14:44:01 | * | CodeVance quit (Quit: Leaving.) |
14:44:05 | FromGitter | <krux02> skrylar: And then you realize that a class browser isn't really that useful. And live coding yea, I can't argue with that |
14:44:15 | * | CodeVance joined #nim |
14:44:25 | PMunch | Actually saw a guy writing about live coding in Nim |
14:44:36 | PMunch | Basically hot-loading .so files into his project |
14:44:46 | FromGitter | <krux02> well live coding isn't really hard |
14:44:57 | PMunch | So it was looking for updates to files, and if they got updated it would recompile them and swap out the .so |
14:45:20 | FromGitter | <krux02> the problem is that for basic live coding you normally have to split your program into a persistent part and a hot swapable module |
14:45:42 | FromGitter | <krux02> depending on what you are working on this separation needs to be flexible |
14:45:59 | skrylar | krux02: it's plenty useful in smalltalk land |
14:46:06 | FromGitter | <krux02> and really great tools that exist for the jvm can do that automatically for you |
14:46:33 | FromGitter | <krux02> yea in smalltalk it is basically like on a lisp machine |
14:46:33 | * | hohlerde joined #nim |
14:46:57 | FromGitter | <krux02> you work, live, edit and do stuff in the same universe |
14:46:57 | FromGitter | <mratsim> @dom96: https://github.com/nim-lang/website/issues/84 |
14:47:02 | FromGitter | <krux02> and you never leave it |
14:49:45 | PMunch | Hmm, who is it that now has push-rights to parsetoml? |
14:49:50 | PMunch | https://github.com/NimParsers/parsetoml |
14:49:50 | FromGitter | <krux02> the problem with class browsers that I normally have is that in theory they should provide you with a great overview of the useful classes and what they can do. But the problem I got with tham is that very often they get polluted with tons of unimportant classes that I don't want to know about. And then the really important classes are just one name is this big list of classes |
14:49:54 | FromGitter | <data-man> Who well knows SublimeText's syntax files? NimLime can't find declarations (consts, vars, enums, types, etc.). Note: I don't use NimSuggest. |
14:50:01 | PMunch | After it moved to the NimParsers organization |
14:50:06 | FromGitter | <krux02> and in the end you just never look in the list of classes. |
14:50:46 | PMunch | I find vim marks more practical :) |
14:50:54 | PMunch | And just a regular search.. |
14:51:17 | FromGitter | <data-man> @PMunch: yes. Do not want to move your parser repositories there? ;) |
14:51:32 | PMunch | Which ones? |
14:51:43 | PMunch | binaryparse and combparser? |
14:52:06 | FromGitter | <data-man> Maybe both. |
14:52:11 | FromGitter | <krux02> PMunch: I reccomend to bind a key to a project wide identifier search of the identifier under the cursor |
14:52:17 | FromGitter | <mratsim> I think that can be hacker news or r/programming worthy: https://github.com/nim-lang/website/issues/84 thoughts? |
14:52:25 | PMunch | I thought the idea behind the org. was to have parsers for specific formats |
14:52:33 | PMunch | I guess my pcap library could move there |
14:53:01 | FromGitter | <krux02> and this project wide search is best implemented with ag (Araq would suggest nimgrep, but that probably is not that well integrated into vim) |
14:53:17 | skrylar | krux02: this is probably related to class browsers in non-smalltalk worlds being garbage |
14:53:26 | skrylar | the smalltalk ones sort classes in to packages and methods in to categories |
14:53:45 | skrylar | the java ones (at least when i used them) just blurt out all of the classes in java packages which have no actual relation to semantics |
14:53:46 | PMunch | Uhm, "someone or something that can change or transform its appearance to something else" |
14:54:16 | PMunch | That's the whole point of it being compiled, it changes more than just appearance |
14:54:18 | skrylar | a package in smalltalk is purely organization material, there is no semantic "shit i moved this class now must edit all imports" |
14:54:19 | FromGitter | <krux02> skrylar: I don't know how smalltalk works, but I can only compare it to working with emacs. |
14:54:25 | FromGitter | <data-man> @krux02: I prefer finished this: https://github.com/universal-ctags/ctags/pull/401 |
14:54:44 | FromGitter | <data-man> to finish :) |
14:54:55 | FromGitter | <krux02> There you can also always jump to the declaration of a function. Change it, and it will have instant effect as soon as you reload that specific funciton. |
14:55:14 | skrylar | krux02: well its like you have NimCore-HTTP-Async, and under that are the async classes, and then an async class has "initialization" as a category, which then has init(blah blah) functions. |
14:55:54 | skrylar | Smalltalk class browsers are sorted semantically, most others are syntactically |
14:56:13 | FromGitter | <krux02> I never worked with tag files. I don't like that they can get outdated. |
14:56:28 | FromGitter | <krux02> and project wide read serach of a symbol is instant |
14:56:42 | FromGitter | <krux02> so the is also no performance benefit in tag files |
14:58:19 | FromGitter | <krux02> s/read/real/ |
14:59:13 | * | FuntDobra joined #nim |
14:59:37 | * | leorize joined #nim |
14:59:39 | FromGitter | <data-man> I use https://github.com/cppit/jucipp It supports ctags like many other editors and IDEs. |
15:00:47 | FromGitter | <krux02> @data-man I am not trying out new text editors anymore. |
15:01:03 | FromGitter | <krux02> Basically every new editor fucked up keyboard support |
15:01:17 | FromGitter | <krux02> and supporting keyboards in an editor is not optional |
15:03:17 | FromGitter | <krux02> worst is currently vscode that looks up under the hood what keyboard layout you have set (fucks that up because it doesn't get notified when you change the layout) and does some weird keyboard shortcut translations in a semi smart way thet prevent you from being able to press certain shortcuts and others are available through several different keys. |
15:04:15 | FromGitter | <data-man> And I have a choice problem: finish Nim's support for ctags or improve ```nim ctags``` command :) |
15:05:38 | FromGitter | <krux02> @data-man Nim is still a language under construction |
15:05:41 | FromGitter | <data-man> I thought the idea about new ```nim grep``` command |
15:06:02 | * | dddddd quit (Remote host closed the connection) |
15:06:06 | FromGitter | <data-man> Or ``` nim find``` |
15:06:06 | FromGitter | <krux02> recently the func keyword was enabled to declare a function without side effects |
15:06:21 | FromGitter | <arnetheduck> just do it: https://langserver.org/ |
15:06:24 | skrylar | krux02: https://technabob.com/blog/wp-content/uploads/2010/08/supercoder_2000_binary_keyboard.jpg |
15:07:40 | FromGitter | <krux02> @arnetheduck langserver has this idea about classes and methods that doesn't really apply to Nim, but generally a good idea provide a common interface for new languages |
15:09:24 | PMunch | I think langserver would be great to have in Nim |
15:11:48 | FromGitter | <arnetheduck> looks like a lot of languages on the langserver list have figured out a way to deal with it |
15:13:13 | PMunch | Yeah if a languages like Clojure, Erlang, and Haskell can do it so can Nim :P |
15:13:21 | PMunch | Or RST and XML for that matter :P |
15:13:34 | * | BitPuffin joined #nim |
15:14:01 | dom96 | It's not hard, it just requires time |
15:15:47 | FromGitter | <arnetheduck> less time than trying to solve it from scratch with nimsuggest + N editors.. |
15:19:43 | FromGitter | <data-man> @skrylar: Why this keyboard does not have the backspace? :) |
15:21:22 | PMunch | data-man, what do you need that for? Making mistakes? |
15:22:11 | skrylar | professionals never make mistakes. all things are easy mode |
15:22:19 | skrylar | or at least that's how they always act when i'm around |
15:22:28 | PMunch | And if you should need one just type 00001000 |
15:23:16 | carterza[m] | I could use some help with PRE if anyone has a sec |
15:23:35 | PMunch | carterza[m], just ask away := |
15:23:37 | PMunch | :)* |
15:23:57 | carterza[m] | I have a readme - https://raw.githubusercontent.com/zacharycarter/nim-playground/master/README.rst |
15:24:15 | * | superbia joined #nim |
15:24:16 | * | carterza[m] sent a long message: carterza[m]_2018-05-19_15:24:15.txt <https://matrix.org/_matrix/media/v1/download/matrix.org/xpkIWOFNYkJnEiRxBhMXNHBh> |
15:24:30 | carterza[m] | I'm trying to grab the entire tree and replace it |
15:24:34 | superbia | how would one use nim to write for fpgas |
15:24:46 | carterza[m] | so far I have - `cat README.rst | perl -00pe 's/^\s{4}\..*\r?\n(?:^\ +.*\r?\n)*/foo/'` |
15:24:49 | FromGitter | <data-man> @PMunch: Zero or one supplied is not in the right place can become fatal error. Format the HDD, e.g. :-D |
15:25:07 | * | carterza[m] sent a long message: carterza[m]_2018-05-19_15:25:07.txt <https://matrix.org/_matrix/media/v1/download/matrix.org/WfueaGLDucTPammDvzuieVBu> |
15:25:11 | carterza[m] | so not at all what I want... |
15:27:31 | carterza[m] | superbia: https://en.wikipedia.org/wiki/C_to_HDL - maybe start there? |
15:28:47 | * | leorize quit (Ping timeout: 276 seconds) |
15:28:57 | PMunch | carterza[m], "cat readme | grep [│├└]" |
15:30:02 | carterza[m] | PMunch: right on - do you know of a way I can replace that match with some other text? |
15:30:03 | carterza[m] | that's my goal |
15:30:17 | PMunch | What do you mean? |
15:30:49 | * | CodeVance quit (Quit: Leaving.) |
15:30:53 | miran | superbia: are you the same superbia from #manjaro ? :) |
15:31:14 | superbia | ask PMunch |
15:31:33 | PMunch | Uhm, yes he is :P |
15:31:50 | PMunch | superbia, why should he ask me? |
15:32:03 | * | gokr joined #nim |
15:32:13 | carterza[m] | PMunch - I mean that I want to replace that section of my readme with another string |
15:32:21 | carterza[m] | basically replace the match grep produced with some other text |
15:32:24 | PMunch | Oh, in the same readme? |
15:32:30 | PMunch | Hmm |
15:32:30 | carterza[m] | mmhmm |
15:32:46 | * | FuntDobra quit (Ping timeout: 264 seconds) |
15:32:46 | miran | haha, there seems to be some strange manjaro-nim connection, unexpectely high number of us use both |
15:32:54 | carterza[m] | I think I have a way though - I think I can pass it into sed |
15:33:50 | * | enigmeta quit (Remote host closed the connection) |
15:33:50 | * | mgdelacroix quit (Remote host closed the connection) |
15:33:50 | * | dashed quit (Remote host closed the connection) |
15:33:50 | * | msmorgan quit (Remote host closed the connection) |
15:35:00 | PMunch | Problem with sed is that it is line based |
15:35:18 | PMunch | So you could probably replace all those lines with the same line |
15:36:26 | * | enigmeta joined #nim |
15:36:29 | * | dashed joined #nim |
15:36:48 | * | CodeVance joined #nim |
15:37:32 | * | CodeVance quit (Client Quit) |
15:37:39 | FromGitter | <sramsay> Stupid extreme newbie question: How do do I get a string representing the name of the current timezone? |
15:37:55 | * | msmorgan joined #nim |
15:37:56 | PMunch | The name? |
15:37:56 | * | mgdelacroix joined #nim |
15:38:04 | superbia | like CEST |
15:38:08 | superbia | central european summer time ? |
15:38:08 | FromGitter | <sramsay> Right |
15:38:42 | superbia | theres is a unix command that that does that |
15:38:59 | * | leorize joined #nim |
15:39:04 | FromGitter | <sramsay> I can get a UTC offset from the procs in the times module, and there seems to be a "name" field in the Timezone object, but I don't know how to get at it. |
15:39:44 | dom96 | !eval echo getTime().local().timezone.name |
15:39:46 | NimBot | Compile failed: in.nim(1, 6) Error: undeclared identifier: 'getTime' |
15:39:53 | dom96 | !eval import times; echo getTime().local().timezone.name |
15:39:56 | NimBot | LOCAL |
15:40:02 | dom96 | lol |
15:40:05 | superbia | lol |
15:40:10 | FromGitter | <sramsay> hmm |
15:40:17 | dom96 | might work locally :) |
15:40:22 | superbia | hi dom96 |
15:40:47 | FromGitter | <sramsay> Nope, prints LOCAL for me. |
15:40:53 | FromGitter | <sramsay> I mean, it's not wrong. ;) |
15:40:54 | superbia | dom96: mind a pm? |
15:42:52 | FromGitter | <zetashift> dom86 don't you need to use `now().utcOffset`? |
15:43:21 | * | FuntDobra joined #nim |
15:43:49 | FromGitter | <sramsay> Sorry, was I being asked about a pm? Totally fine. |
15:44:29 | dom96 | superbia: go for it, but only if it really requires PM |
15:44:56 | PMunch | federico3, have you tried Nim for FPGA? |
15:45:33 | dom96 | sramsay: bug report I guess :) |
15:45:35 | federico3 | no, and besides, how would Nim be used for an FPGA? |
15:46:13 | PMunch | I dunno, just a thought I had |
15:46:29 | FromGitter | <data-man> !eval import times; echo now().timezone; echo now().utcOffset |
15:46:31 | PMunch | carterza[m], cat readme | sed -Ez 's/\n *[│├└]+[^\n]*/\nSomething else/g' |
15:46:32 | NimBot | LOCAL↵0 |
15:46:39 | PMunch | federico3, or rather superbia asked about it |
15:48:08 | federico3 | I mean: running Nim on a CPU implemented on an FPGA or using Nim as an HDL? |
15:48:32 | PMunch | I dunno, ask superbia :P |
15:49:19 | superbia | federico3: first is possible, i wondered about the second |
15:49:50 | PMunch | carterza[m], cat readme | sed -Ez 's/\n *[│├└]+[^\n]*/\nSomething else/g' | sed -Ez 's/(Something else\n)+/This is the text we want to replace it with\n/' |
15:50:06 | PMunch | That will replace the whole section with "This is the text we want to replace it with" |
15:50:48 | PMunch | Or better yet: cat readme | sed -Ez 's/\n *[│├└]+[^\n]*/\nSomething else/g' | sed -Ez 's/\.\n(Something else\n)+/This is the text we want to replace it with\n/' |
15:51:01 | PMunch | That grabs the dot as well |
15:52:59 | FromGitter | <mratsim> ugh, those regexp are completely mangled on Gitter |
15:53:11 | PMunch | Or all in one sed command: cat readme | sed -Ez 's/ *\.(\n *[│├└]+[^\n]*)+/\nThis is the text we want to replace it with/' |
15:53:17 | PMunch | mratsim, they are? |
15:53:54 | FromGitter | <data-man> Yes. :) Use `````` |
15:54:00 | PMunch | Haha, Gitter seems to try to make italics from parts of it |
15:54:12 | federico3 | superbia: the second sounds very possible and easier than other languages but I guess it's a lot of work |
15:54:19 | PMunch | Like this: ```cat readme | sed -Ez 's/ *\.(\n *[│├└]+[^\n]*)+/\nThis is the text we want to replace it with/'``` |
15:54:50 | dom96 | I wonder how fast a Nim implementation of this would be: https://twitter.com/mnt_io/status/997411477572276224 |
15:56:22 | FromGitter | <sramsay> The docs contain this example for the local proc: |
15:56:26 | FromGitter | <sramsay> doAssert now().timezone == local() ⏎ doAssert local().name == "LOCAL" |
16:02:56 | PMunch | dom96, are you trying to tease us into optimizing another benchmark? :P |
16:03:08 | * | sherjilozair quit (Remote host closed the connection) |
16:03:12 | dom96 | sure :P |
16:06:26 | FromGitter | <data-man> https://github.com/JuliaLang/Microbenchmarks e.g. |
16:07:56 | FromGitter | <GULPF> @sramsay there is currently no way to get the "human name" of a timezone. `Timezone.name` is meant to be the timezones name in the IANA tz database, or "LOCAL" if it's the systems local timezone |
16:10:52 | superbia | you could get it from your public ip, or your lunix machine, or ... |
16:11:24 | FromGitter | <data-man> @PMunch: http://kaitai.io Is it interesting for you? |
16:11:42 | * | yglukhov joined #nim |
16:11:45 | PMunch | Yeah someone linked me that earlier |
16:11:55 | PMunch | Looks like a more verbose version of my binaryparse library |
16:13:00 | FromGitter | <data-man> Compiler written on Scala. |
16:13:39 | FromGitter | <mratsim> @data-man I can destroy any language on integer matrix multiply. |
16:14:04 | FromGitter | <mratsim> I’m 10x faster than Julia, and 22x faster than Numpy on 1500x1500 matrices |
16:14:15 | FromGitter | <data-man> Just do it in Julia's repo! :) |
16:15:27 | FromGitter | <data-man> @PMunch: https://github.com/kaitai-io/kaitai_struct_examples/blob/master/compiler_browser/formats/zip.ksy |
16:15:57 | * | yglukhov quit (Ping timeout: 240 seconds) |
16:17:42 | PMunch | Yeah I though abut implementing that as an example |
16:17:44 | PMunch | Or PNGs |
16:17:47 | * | superbia quit (Quit: WeeChat 2.1) |
16:19:27 | FromGitter | <data-man> Maybe it's will be useful for Windows users (AFL port for Windows): https://github.com/ivanfratric/winafl |
16:20:12 | FromGitter | <sramsay> @GULPF I'm trying to get the code from IANA database (So, "CDT" for Central Daylight Time). How does nim resolve this? It appears not to read the TZ environment variable on *nixes. Does some version of zoneinfo need be installed? |
16:22:53 | FromGitter | <mratsim> @data-man for the next 3 months I embarked into a data science competition to predict credit default: https://www.kaggle.com/c/home-credit-default-risk |
16:23:49 | FromGitter | <data-man> Awesome! |
16:26:10 | * | sherjilozair joined #nim |
16:29:37 | FromGitter | <GULPF> @sramsay Nim lets C resolve the local timezone, so the TZ variable should be respected. What I meant with IANA timezone names is the region based ones, e.g "Europe/Stockholm". IANA doesn't deal with localization of TZ names afaik (e.g, "Central Daylight Time"). |
16:30:19 | FromGitter | <data-man> Yet another persistent key/value storage engine (skiplist based): https://github.com/Softmotions/iowow |
16:30:22 | FromGitter | <sramsay> @GULPF Ah, I see. Thanks. |
16:31:01 | FromGitter | <GULPF> if your goal is to use some specific timezone you might want to use my timezone lib: https://github.com/GULPF/timezones |
16:32:07 | FromGitter | <GULPF> it only supports region based names as well though |
16:32:43 | * | sherjilozair quit (Quit: Leaving...) |
16:33:32 | * | kobi joined #nim |
16:33:41 | kobi | hello |
16:34:07 | FromGitter | <data-man> Hi! |
16:34:15 | kobi | :) |
16:34:36 | FromGitter | <data-man> Bye? :) |
16:34:50 | kobi | I am porting an old framework I wrote, |
16:35:24 | kobi | But I am not sure how some things are done in nim |
16:35:30 | FromGitter | <sramsay> @GULPF Nice. I don't need it that bad, I was just assuming (as a total newb) that I was doing something wrong. |
16:35:48 | FromGitter | <data-man> @kobi: just ask |
16:37:08 | kobi | is there something like a 'dynamic' type in nim? |
16:37:55 | kobi | I am passing data where the receiving part decides the format |
16:38:19 | kobi | I can change that design though to pass tuples or something but want to have a general type in the library |
16:39:23 | kobi | something like a general anonymous object, or a hashtable then the receiving part knows what it needs to extract from the information |
16:39:43 | euantor | Can anybody chime in here? https://github.com/euantorano/nixpkgs/pull/1#issuecomment-390414934 |
16:39:44 | FromGitter | <data-man> @kobi: maybe https://github.com/yglukhov/variant ? |
16:40:09 | euantor | Got down to just a few failing tests now, hopefully they can be easily fixed :) |
16:41:18 | Yardanico | kobi, you can also just use json :D |
16:41:22 | kobi | I can have a hashtable of string -> object, but nim isn't really oo |
16:41:56 | dom96 | kobi: create an object variant: https://nim-lang.org/docs/manual.html#types-object-variants |
16:41:58 | kobi | yes, json is a good idea. is there something akin to json without the parsing? |
16:42:16 | kobi | hi dom96 and Yardanico |
16:42:19 | dom96 | You can take a look at how the JsonNode is implemented too as an example (it's an object variant) |
16:42:23 | Yardanico | kobi, if you want hashtable - you can just use tables module |
16:42:39 | Yardanico | but of course only if your values in a table have one type :) |
16:42:47 | PMunch | Yeah I think that's his issue :P |
16:42:50 | PMunch | They aren't the same type |
16:42:57 | PMunch | But yeah, object variants is the way to go |
16:43:12 | PMunch | Or using a JSON object (which can be constructed in Nim without parsing text) |
16:45:09 | kobi | I think an object variant was what I wanted. Thanks! but I'll also look into JSON object. maybe it'll simplify my code |
16:45:18 | dom96 | !eval import json; echo(%*{"key": {"foo": 4.2, "bar": 5.4, "baz": "string"}}) |
16:45:22 | NimBot | {"key":{"foo":4.2,"bar":5.4,"baz":"string"}} |
16:46:27 | kobi | can I pass types that are not in the basic list, for example a matrix or array of arrays? |
16:46:46 | dom96 | try it :) |
16:46:58 | kobi | :) |
16:48:35 | * | endragor joined #nim |
16:49:31 | kobi | docs were faster, getInt, getFloat, getStr, and getBool. so I guess no. |
16:50:11 | dom96 | "guess" != "know" |
16:51:00 | dom96 | !eval import json; echo(%*{"list": [1,2,3]}) |
16:51:04 | NimBot | {"list":[1,2,3]} |
16:52:13 | kobi | my nim fu is too weak :/ |
16:52:58 | kobi | :-] |
16:53:27 | kobi | back to coding, silence is golden |
16:56:47 | kobi | awesome, nim-regex has named captures |
16:58:24 | kobi | What do you guys usually use for quick builds? I see 'nake' as a nice tool. any cons with it? |
16:58:50 | skrylar | nim c something? |
17:02:02 | kobi | ah ok |
17:03:56 | dom96 | You don't need makefiles for Nim |
17:04:18 | kobi | because nim automatically adds the imported files right? |
17:04:19 | * | endragor quit (Remote host closed the connection) |
17:04:33 | kobi | old habits i guess |
17:06:05 | kobi | so, I have an architecture where the user has to create an enum, and use it like a generic type. Is it possible or should I resort to a set[string]? |
17:06:31 | Yardanico | kobi, you have nimble in nim |
17:06:46 | Yardanico | for building, but really VSCode+ nim extension handles it :) |
17:07:46 | kobi | do you mean that vscode checks for errors? |
17:07:58 | FromGitter | <mratsim> yes |
17:08:11 | FromGitter | <mratsim> you have errors highlighting |
17:08:17 | kobi | so the usual workflow doesn't require constant building, then? |
17:08:37 | FromGitter | <mratsim> building libraries will likely take 2 seconds at most |
17:08:51 | kobi | I meant manual building |
17:09:08 | kobi | ok, wonderful |
17:09:46 | FromGitter | <mratsim> `nim c yourfile` is enough. but the syntax/error highlighting will give you errors without building the project. |
17:09:58 | Yardanico | kobi, nim c -r myfile.nim (-r will start it after compiling) |
17:10:14 | FromGitter | <mratsim> building is still useful for the stacktraces sometimes |
17:10:14 | Yardanico | nimble is used for separating different packages (so they can be added to the package repository) |
17:11:01 | kobi | does nimble have a role in building? |
17:11:24 | kobi | I know that you can specify dependencies |
17:11:33 | Yardanico | "nimble build" |
17:11:49 | FromGitter | <data-man> There is ```nim check``` |
17:12:09 | Yardanico | but really for development you will use "nim c" almost always :) |
17:12:09 | Yardanico | https://github.com/nim-lang/nimble#nimble-build |
17:12:45 | kobi | good. thanks guys. now to dig for generics docs ... |
17:17:32 | kobi | wow, generics are really advanced in nim |
17:17:45 | kobi | (coming from c#) |
17:19:47 | FromGitter | <data-man> Nim has everything advanced :) |
17:22:26 | federico3 | except its popularity |
17:32:03 | * | gangstacat quit (Quit: Ĝis!) |
17:32:12 | dom96 | federico3: ouch |
17:34:00 | FromGitter | <tim-st> is there a best way to use a shared cache folder in nim like golang does? |
17:34:15 | FromGitter | <tim-st> (compiled binary cache) |
17:36:11 | FromGitter | <tim-st> at least the stdlib shouldnt be recompiled everytime, so it would be good to have the possibility to mark files as "cachesafe" or something |
17:36:16 | kobi | how do I define a type saying T where T is enum |
17:36:36 | Yardanico | @tim-st yes, you can have shared directory for all C files |
17:36:47 | * | endragor joined #nim |
17:37:01 | Yardanico | but it'll be required to recompile them quite often |
17:37:10 | FromGitter | <tim-st> yes, but it doesnt work for all files. When I have file `x.nim` in different directories they obviously cant share the same folder |
17:37:11 | Yardanico | because of dead code elimination\ |
17:37:16 | Yardanico | they can |
17:37:26 | * | gangstacat joined #nim |
17:37:29 | Yardanico | I mean they can share same nimcache folder :) |
17:37:37 | * | FuntDobra quit (Ping timeout: 256 seconds) |
17:37:48 | FromGitter | <tim-st> do they overwrite each other when needed? |
17:38:45 | Yardanico | of course |
17:39:03 | Yardanico | but it's not really useful because of dead code elimination |
17:39:22 | FromGitter | <data-man> Maybe ccache may help |
17:39:23 | FromGitter | <tim-st> but exactly this overwriting I wanted to avoid |
17:39:33 | Yardanico | well, you can't currently AFAIK |
17:39:53 | * | endragor quit (Remote host closed the connection) |
17:39:57 | kobi | Yardanico: can this somehow work? |
17:39:59 | kobi | import json |
17:39:59 | kobi | type SimpleData* = tuple[part:enum,data:JsonNode] |
17:40:05 | FromGitter | <tim-st> Today I realized that is the only thing that makes golang compiler quick, and additionally that they only have one main() func |
17:40:14 | Yardanico | kobi, "enum" is not a concrete type :) |
17:40:21 | kobi | enum is not in runtime, but when building it could be discovered what it is |
17:41:06 | kobi | i can pass a set of strings, but ideally it could be constrained further |
17:41:49 | kobi | the user of the library makes the enum and the library allows any such T:enum |
17:42:53 | kobi | nevermind, i'll just initialize in a way that spelling mistakes won't happen |
17:43:00 | FromGitter | <data-man> Let's rename Nim to Nemesidium :) |
17:43:36 | federico3 | dom96: speaking of advanced, declarative cooperative tasks like https://en.wikibooks.org/wiki/Ada_Programming/Tasking could be very interesting |
17:43:37 | kobi | data-man, will that help the popularity factor? |
17:44:10 | FromGitter | <tim-st> no, popularity is got by good marketing |
17:46:06 | FromGitter | <data-man> @kobi: This will reduce the number of results in search queries :) |
17:46:22 | FromGitter | <tim-st> I always type `nimlang` |
17:47:06 | FromGitter | <tim-st> but there is not even a wikipedia article about nim in German, I think this is a bit weird |
17:48:23 | Yardanico | https://gist.github.com/Yardanico/96b252808798af7656d05f2412c0c489 my first Nim gist :D |
17:50:05 | * | xkapastel joined #nim |
17:52:26 | FromGitter | <data-man> @Yardanico: You saw it? https://eax.me/nim/ |
17:52:38 | * | xkapastel quit (Disconnected by services) |
18:00:03 | FromGitter | <zetashift> I google translate'd that site, some really nice things about nim are being said |
18:01:16 | FromGitter | <data-man> @zetashift: https://habr.com/search/?q=Nim |
18:01:20 | FromGitter | <data-man> :) |
18:01:25 | FromGitter | <zetashift> @data-man this is hilarious: "I do not know if Nim will shoot, but I really want to shoot. Already now I really want to pee on it pet project'" |
18:02:04 | Yardanico | @data-man of course I did :) |
18:02:09 | Yardanico | and that's 2015 |
18:03:46 | Yardanico | Nim isn't very popular, so first time I saw a Nim webpage was 2014, but language looked very hard for me (yes, "very hard"). And then in 2017 in some discussion with a person about Python he mentioned Nim. |
18:04:47 | FromGitter | <data-man> @zetashift: lol replace "to pee" to "to write" :) |
18:04:51 | FromGitter | <tim-st> I still vote to change the example code on the nim website, that looks a bit difficult indeed |
18:05:07 | FromGitter | <tim-st> `for line in stdin.lines` |
18:05:26 | Yardanico | well, I was 14 in 2014 and only had a little bit of python knowledge :D |
18:06:13 | FromGitter | <tim-st> btw has someone experience with building a minimal perfect hash function for a nim array? |
18:07:57 | FromGitter | <data-man> @tim-st: https://github.com/nitely/nim-unicodedb/blob/master/gen/min_perfect_hash.nim |
18:09:09 | FromGitter | <tim-st> looks interesting, thank you, I hope the lookup time is not much worse than direct indexing |
18:10:31 | FromGitter | <data-man> http://rosettacode.org/mw/index.php?title=Category:Nim&action=history :( |
18:12:32 | crem | How can I get a directory where binary runs in? |
18:13:02 | FromGitter | <data-man> http://rosettacode.org/wiki/Category:Nim linked to http://nimrod-lang.org |
18:13:32 | FromGitter | <data-man> It's "very good tutorial." :) |
18:13:45 | Yardanico | crem, getAppPath() ? |
18:13:51 | Yardanico | ah, sorry |
18:14:04 | Yardanico | you mean current dir or dir where binary is located? |
18:14:11 | crem | getAppDir. |
18:14:14 | crem | Thanks! |
18:14:23 | crem | Not current, that's what I need. |
18:15:31 | crem | No code formatter for nim yet, right? I'm spoiled by using code formatter in all languages. :) |
18:16:31 | PMunch | Unfortunately not.. |
18:16:31 | Yardanico | crem, no, there's nimpretty, but it's far from being ready |
18:17:15 | crem | What do I do with "Warning: not GC-safe" warning?.. |
18:17:35 | Yardanico | crem, fix it ? :) |
18:17:50 | Yardanico | or if your program is single-threaded, you can probably ignore it (but not always) |
18:18:19 | crem | https://gist.github.com/mooskagh/363c5a895a692ea92c53f9dd1aac2ec1 what makes it not GC-safe? |
18:18:39 | FromGitter | <data-man> @crem: try use nimfix from compiler/nimfix |
18:18:57 | Yardanico | ehm, I don't have that warning |
18:19:26 | Yardanico | What is your Nim version? and can you show full compiler output? |
18:20:09 | crem | Ah, I start to remember it.. It's only shown by NimLime (sublime plugin) |
18:20:29 | Yardanico | nimcheck doesn't show it either |
18:20:45 | Yardanico | (and that's probably the thing NimLime uses for checking for warnings/errors before compilation) |
18:24:08 | crem | Trying to figure out how to get any debug info from nimlime |
18:24:28 | FromGitter | <data-man> Yes, NimLime uses ```nim check``` |
18:24:51 | Yardanico | crem, so what's your nim version? |
18:25:12 | Yardanico | https://github.com/nim-lang/Nim/issues/4128 can this be closed? it outputs "plexcoin.nim(17) message: hello world!" and that seems correct for me. |
18:25:43 | crem | https://gist.github.com/mooskagh/5ec0e2d28bef562caf62da3868460471 if that's is of any help. |
18:27:46 | Yardanico | do you use any compiler switches? |
18:27:48 | Yardanico | like --threads:on |
18:28:47 | crem | Nope. I created .nim file in sublime, typed the code and saved. As as nimlime has check_on_save: on, it shows me those warnings. |
18:30:39 | Yardanico | well, I just don't know, I have none of the warnings you said. maybe you can provide a minimal snippet which triggers the GC warning? |
18:31:28 | crem | https://gist.github.com/mooskagh/363c5a895a692ea92c53f9dd1aac2ec1 is the entire file. But I can try to minimize it further. |
18:32:56 | crem | afk for some tens of minutes |
18:34:45 | * | yglukhov joined #nim |
18:38:13 | Yardanico | well, I really don't get any of these errors neither on devel or on 0.18.0 stable |
18:38:17 | Yardanico | *warnings |
18:38:36 | Yardanico | can you try "nimble install parsetoml" |
18:39:29 | * | yglukhov quit (Ping timeout: 260 seconds) |
18:51:02 | * | Ven`` joined #nim |
18:53:22 | * | FuntDobra joined #nim |
18:56:47 | crem | It said it already existed, reinstall didn't change anything. |
18:58:01 | PMunch | Is there a problem with parsetoml? |
18:58:43 | dom96 | What's the exact warning you're getting? |
18:59:40 | crem | https://gist.github.com/mooskagh/5ec0e2d28bef562caf62da3868460471 |
18:59:42 | crem | config.nim(26, 19) Warning: not GC-safe: 'parseFile(GetConfigFileName())' [GcUnsafe] |
18:59:57 | * | nsf joined #nim |
19:00:47 | dom96 | line 26? Your file isn't that long |
19:01:43 | crem | https://github.com/Varriount/NimLime/issues/89 seems to be related. |
19:02:01 | PMunch | Oh, it's only shown by NimLime? |
19:02:02 | crem | I didn't copy the GPL header comment. |
19:02:06 | crem | Yes! |
19:02:43 | PMunch | I ran the file with both --threads:on and without. Never got the warning, so I'm not sure if that is related.. |
19:02:58 | crem | Updated https://gist.github.com/mooskagh/363c5a895a692ea92c53f9dd1aac2ec1 to include comment on top, so that lines match. |
19:04:06 | dom96 | Varriount mentions verbosity, but AFAIK this warning does not disappear with different verbosities |
19:04:56 | crem | It would be interesting to find which command line exactly nimline runs.. |
19:05:22 | dom96 | it probably uses nimsuggest |
19:09:01 | crem | nim check --verbosity:2 a.nim |
19:09:15 | crem | reproduces for me |
19:09:42 | dom96 | oh, same |
19:11:26 | crem | Is it something I should care about?. |
19:12:17 | dom96 | I skimmed parsetoml and it seems fine |
19:12:21 | dom96 | dunno what Nim's issue is |
19:12:42 | dom96 | make an issue about it in the Nim repo if you can |
19:14:35 | crem | In nim repo or parsetoml? |
19:16:13 | dom96 | Nim repo |
19:17:05 | * | xkapastel joined #nim |
19:18:05 | FromGitter | <xmonader> Good evening |
19:24:50 | * | yglukhov joined #nim |
19:25:06 | FromGitter | <zetashift> hello! |
19:26:35 | * | yglukhov quit (Read error: Connection reset by peer) |
19:27:10 | * | yglukhov joined #nim |
19:45:42 | enthus1ast | can one confirm? https://gist.github.com/enthus1ast/14016b538c0433c76287f83ea2309aa9 |
19:50:20 | dom96 | confirm what? |
19:51:05 | dom96 | oh hrm |
19:51:05 | enthus1ast | that this is a bug |
19:52:09 | federico3 | how can I get the type of an object as a string? |
19:52:17 | dom96 | looks like a bug indeed |
19:52:42 | enthus1ast | ok i'll file it |
19:53:26 | dom96 | that's really strange, why would a new socket have 'fd' set to 7? (I just echo'd it) |
19:53:33 | * | dddddd joined #nim |
19:54:15 | * | kobi quit (Quit: Leaving) |
19:54:48 | * | enthus1ast shrugs |
19:56:55 | FromDiscord | <emekoi> somebody is struggling to get the `{.noInit.}` pragma to work. the reddit thread is [here](https://www.reddit.com/r/nim/comments/8k7ny8/my_random_notes_on_nim_wip/). |
19:57:16 | FromDiscord | <emekoi> somebody is struggling to get the `{.noInit.}` pragma to work. the reddit thread is here https://www.reddit.com/r/nim/comments/8k7ny8/my_random_notes_on_nim_wip/. |
20:03:40 | FromGitter | <tim-st> how can I open a file in the same directory? it just wont work^^ |
20:03:54 | enthus1ast | getAppDir() |
20:04:20 | FromGitter | <tim-st> this wont print the correct directory |
20:04:30 | FromGitter | <tim-st> like three dirctories below |
20:05:25 | enthus1ast | "same directory" like your executable? |
20:05:54 | FromGitter | <tim-st> yes |
20:07:17 | FromGitter | <tim-st> thanks, it works, now the directory is appropriate |
20:07:24 | enthus1ast | vscode? :) |
20:07:26 | FromGitter | <tim-st> with getAppDir() |
20:07:30 | FromGitter | <tim-st> yes |
20:07:44 | enthus1ast | yeah it acts a little strange with its dir's |
20:08:09 | FromGitter | <tim-st> the most worst thing with vscode is compiling in terminal always throws IOError |
20:08:26 | FromGitter | <tim-st> I think it is a problem with nim though, because gcc never fails only nim |
20:08:50 | enthus1ast | are you on windows? |
20:08:58 | FromGitter | <tim-st> yes |
20:09:30 | FromGitter | <tim-st> (I prefer arch linux, but they dont prefer supplying drivers that work like on windows) |
20:09:39 | enthus1ast | it might be your antivirus or the windows indexing |
20:09:41 | FromGitter | <tim-st> the battery is only 30% |
20:10:01 | enthus1ast | but im just guessing :) |
20:10:10 | FromGitter | <tim-st> No, someone had the same problem, I think it is known |
20:11:20 | * | nyeaa joined #nim |
20:12:18 | FromGitter | <tim-st> maybe it would be a good feature to allow loading files from same folder automatically |
20:14:17 | dom96 | tim-st: there is an issue in VS code's issue tracker for this |
20:14:25 | dom96 | So I'm pretty sure it's a VS code bug |
20:15:14 | enthus1ast | vscode is not chdir into the appDir folder, but it executes nim with absolute path |
20:15:51 | FromGitter | <tim-st> yes, makes sense, so it actually would work |
20:16:19 | * | FuntDobra quit (Ping timeout: 260 seconds) |
20:16:42 | FromGitter | <tim-st> dom96: my feeling is that the bug is on nim side; as I said it never happened to gcc, not a single time, only one nim side and only while compile phase of stdlib etc |
20:16:55 | * | FuntDobra joined #nim |
20:17:26 | FromGitter | <tim-st> it also only happens in terminal, not in vscode "run plugin" |
20:17:30 | dom96 | it happens to python too IIRC |
20:17:34 | * | cavariux joined #nim |
20:18:02 | enthus1ast | i know nobody believes me, but i hat such an error in the past, it was windows indexing or/and a hacked machine |
20:18:05 | enthus1ast | had |
20:18:30 | FromGitter | <tim-st> hacked machine? |
20:18:58 | FromGitter | <tim-st> should I install clean version xD |
20:19:17 | FromGitter | <zetashift> that IOError happens outside of Nim and only on Windows :( |
20:19:58 | FromGitter | <tim-st> but nims throws it, and gcc doesnt, and also only in terminal version not in silent (non terminal) mode |
20:20:24 | FromGitter | <zetashift> yea it's really iffy but I remember trying an other lang(I think it was Elixir) and I still got it |
20:20:58 | FromDiscord | <awr> seems as if you're not the only one |
20:20:59 | FromDiscord | <awr> https://forum.nim-lang.org/t/3367 |
20:21:16 | FromGitter | <zetashift> https://github.com/Microsoft/vscode/issues/36630 |
20:22:14 | FromDiscord | <awr> so it's probably VS Code's fault and not nim's |
20:22:19 | * | FuntDobra quit (Ping timeout: 256 seconds) |
20:23:51 | FromGitter | <tim-st> I think the way they included the default terminal of vscode is very aggressive and nim and others are sensitive to this and throw error, gcc stays very cool and chills |
20:32:26 | FromGitter | <tim-st> ok, the solution in the forum also works for me 👍 ; thanks |
20:38:20 | crem | Huh.. It goes slow with unfamiliar language. :) By the end of the day I have 5 lines of code written. |
20:39:18 | * | yglukhov quit (Remote host closed the connection) |
20:45:11 | Araq | muhaha, used Mem: 94.06MiB time: 2.622s |
20:47:42 | Araq | saved 40MB and 0.5s of the runtime |
20:48:18 | FromGitter | <data-man> @Araq: Nice! When can we try it too? :-) |
20:50:08 | Araq | the JSON file is 200MB on my disc, btw |
20:50:20 | Araq | it compresses it down to 94MB |
20:53:50 | FromGitter | <data-man> Does Windows 10 support extended masks? Like ```a[b-l]*.txt``` |
20:54:10 | * | nsf quit (Quit: WeeChat 2.1) |
20:54:53 | Araq | who gives a ..., use nimgrep with its --filenames switch |
20:55:52 | FromGitter | <data-man> I need this info for right description of ```pathMatches```. :) |
20:56:13 | Araq | why not work on important things? :-( |
20:56:44 | enthus1ast | idk dom96 but makes this assert sence here? if a fresh client always has 0 as fd? net.nim:793 |
20:56:51 | FromGitter | <data-man> It's important! |
20:57:01 | Araq | for whom? |
20:57:09 | * | miran quit (Ping timeout: 260 seconds) |
20:57:29 | Araq | dir/*.ext covers 99% of all use cases and os.nim is about the common cases |
20:57:29 | cavariux | Hi Araq, has there been any projects like nimscript that fully support the os, or an integration of nim syntax into a script type in c++ like lua? |
20:57:32 | FromGitter | <data-man> For upcoming other PRs. |
20:58:27 | Araq | cavariux, Nimscript is used in Nimble (and NimEdit) but until recently the API was pretty bad |
20:59:26 | FromGitter | <data-man> @Araq: Please, give me the list of important things. In PM, if possible. |
20:59:29 | Araq | that is mostly fixed now |
21:01:11 | cavariux | yes, I have been using it to make tasks in nimble and it has been great, just wondering if anyone has made a project to integrate it with other languages like lua in c |
21:03:37 | Araq | well the work is ongoing on making the compiler free of global variables |
21:03:43 | Araq | then we can document it better |
21:04:39 | Araq | and ideally we also make the API adhere to NEP1... |
21:05:25 | cavariux | sounds great, can't wait for 1.0 (some day) you have been doing a great work |
21:06:49 | Araq | well the "front/high level API" is stable in devel |
21:06:59 | * | gangstacat quit (Quit: Ĝis!) |
21:06:59 | Araq | so you might want to give a try already |
21:08:49 | cavariux | it would come handy if you have a link to the src or some of the starting doc you where talking about |
21:13:48 | Araq | https://github.com/nim-lang/Nim/blob/devel/compiler/nimeval.nim (already outdated...) |
21:14:06 | Araq | the real question is what do you want to do |
21:15:51 | cavariux | well, the optimal case would be to integrate nim to a game engine. Realistic, learn how nim integrates with the vm and leverage to write as much as possible on nim |
21:16:16 | * | BitPuffin quit (Remote host closed the connection) |
21:16:39 | Araq | ok, game engine |
21:17:26 | Araq | that requires clean hooks for implementing Nim procs outside of the VM and a way to turn the AST into the native representations. |
21:17:44 | Araq | that all exists, but needs to be cleaned up |
21:19:17 | cavariux | that is all in the compiler code, right? |
21:19:36 | * | xkapastel quit (Quit: Connection closed for inactivity) |
21:20:26 | Araq | yep |
21:20:45 | Araq | but Nimble uses all these things too, so it's a good example |
21:20:51 | Araq | of how to use the API |
21:21:21 | cavariux | great, I will take a look into both projects and learn more about how nim compiler works |
21:21:23 | FromGitter | <data-man> @cavariux: there is https://github.com/Serenitor/embeddedNimScript |
21:21:48 | cavariux | if I get more specific questions I will be bugging dom96 |
21:21:50 | cavariux | thanks Araq |
21:21:59 | Araq | no, ask me please |
21:22:39 | cavariux | oh well, thanks Araq meanwhile I will check the link data-man gave and reading both projects |
21:22:56 | Araq | it's likely outdated |
21:23:05 | Araq | the compiler API changed quite a bit recently |
21:23:53 | cavariux | if I find that I can fix something while checking it, will make a PR to try to update it |
21:24:07 | Araq | that's the spirit, thanks |
21:24:31 | cavariux | sure, thanks to you |
21:25:23 | * | jaco60 quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:30:53 | * | lmariscal joined #nim |
21:31:33 | * | lmariscal left #nim (#nim) |
21:44:53 | * | cavariux quit (Quit: WeeChat 1.9.1) |
21:45:49 | * | sz0 quit (Quit: Connection closed for inactivity) |
21:50:10 | * | cavariux joined #nim |
21:52:01 | * | nyeaa quit (Quit: Leaving) |
22:09:11 | * | gmpreussner_ quit (Ping timeout: 276 seconds) |
22:10:10 | * | endragor joined #nim |
22:10:40 | * | endragor quit (Remote host closed the connection) |
22:11:15 | * | gmpreussner_ joined #nim |
22:21:15 | * | chris__ joined #nim |
22:21:45 | * | chris__ quit (Client Quit) |
22:31:06 | * | gangstacat joined #nim |
22:33:27 | FromDiscord | <crem> dom96: Araq closed the issue that you told me to file: https://github.com/nim-lang/Nim/issues/7847 |
22:34:08 | FromDiscord | <crem> ``` |
22:34:08 | FromDiscord | <crem> <dom96> make an issue about it in the Nim repo if you can |
22:34:08 | FromDiscord | <crem> <crem> In nim repo or parsetoml? |
22:34:08 | FromDiscord | <crem> <dom96> Nim repo |
22:34:08 | FromDiscord | <crem> ``` |
22:34:53 | dom96 | I reopened i |
22:34:54 | dom96 | t |
22:35:17 | FromDiscord | <crem> Thanks. :) |
22:39:52 | * | yglukhov joined #nim |
22:44:29 | * | yglukhov quit (Ping timeout: 260 seconds) |
22:46:18 | Araq | seriously? you reopened it? It's just a forward decl in parsetoml that lacks the .gcsafe annotation |
22:46:24 | Araq | most likely. |
22:51:27 | Araq | # Forward declaration |
22:51:27 | Araq | proc parseValue(state: var ParserState): TomlValueRef |
22:51:38 | Araq | didn't have to read it to guess the error :P |
22:53:42 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
22:53:57 | FromDiscord | <awr> i wonder if anyone had ever tried to get nim working with WinRT |
22:54:22 | FromDiscord | <awr> via microsoft's C++/CX compiler thing |
22:55:01 | dom96 | Araq: So you don't even need a test case ;) |
22:55:09 | dom96 | This is just needlessly confusing |
22:55:18 | dom96 | Why is it hidden behind --verbosity:2? |
22:55:30 | dom96 | Why are forward declarations even not gc-safe? |
22:55:41 | Araq | because consistency |
22:56:12 | Araq | procs have every possible effect and then you restrict them |
22:56:22 | Araq | we don't have a .notGcsafe annotation either. |
22:56:52 | Araq | once we removed forward decls the analysis will get smarter anyway |
22:57:05 | Araq | but for now, it's what it is and the spec explains it |
22:57:41 | dom96 | But why --verbosity:2? |
22:58:05 | Araq | because --verbosity:2 means "be more chatty" |
22:58:22 | Araq | and it hints at a potential weakness, this code is not threadsafe |
23:09:09 | * | Trustable quit (Remote host closed the connection) |
23:28:45 | * | xet7 quit (Remote host closed the connection) |
23:29:55 | FromGitter | <Varriount> awr: I've done a bit of preliminary research, however Microsoft hasn't published much regarding how to interface with the abi |
23:32:28 | Araq | varriount: btw your 'cmp' implementation is wrong, you only check for the minlengths |
23:32:39 | Araq | so ABC is equal to ABCDEF |
23:32:45 | Araq | (common prefix) |
23:41:41 | FromDiscord | <awr> i guess for winRT compatibility (i've never programmed for winRT but as i understand you can't use Win32 stuff at all) you'd have to create a new os option for the compiler |
23:44:13 | FromDiscord | <awr> a significant amount of the standard library functions may be left non-implementable due to winRT's restrictions |
23:47:46 | * | gokr quit (Ping timeout: 264 seconds) |
23:51:42 | Araq | isn't winRT with windows' API? |
23:59:00 | * | xkapastel joined #nim |
23:59:29 | FromDiscord | <awr> winRT is its own API |