<< 19-05-2018 >>

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:30FromDiscord<treeform> you can probably write the struct in c, maybe using an {.emit.}, then importc it?
01:37:16FromDiscord<treeform> I import c structs all the time, don't know if there is a way to export one
01:37:29FromDiscord<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:12FromDiscord<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:03FromDiscord<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:32carterza[m]https://github.com/zacharycarter/nim-playground
04:48:15carterza[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:16FromGitter<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:11Araqjust write a test for a file that doesn't exist
07:57:36Araqtesting 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:20FromGitter<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:25FromGitter<mratsim> @tim-st C and Nim mod are reminder
08:30:08FromGitter<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:31FromGitter<mratsim> x mod y, —> result has the same sign as x
08:30:57FromGitter<mratsim> x div y —> if x and y are opposite signs result is negative
08:31:19FromGitter<mratsim> the goal is that x == q * y + r (q quotient, r reminder)
08:31:38FromGitter<mratsim> @treeform too
08:45:33*MyMind joined #nim
08:46:04FromGitter<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:04FromGitter... [https://gitter.im/nim-lang/Nim?at=5affe44c1cfca775e11f6625]
08:46:32FromGitter<kayabaNerve> Anyone have any idea?
08:46:57*Sembei quit (Ping timeout: 240 seconds)
08:46:58FromGitter<kayabaNerve> Thanks for any help in advance by the way :D
08:48:03Araqyour header doesn't use inline for the add function?
08:48:09FromGitter<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:36FromGitter<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:15Araqif you don't know Nim, not knowing C doesn't really help you.
08:49:16FromGitter<kayabaNerve> It does not use the inline pragma...
08:49:29Araqyou cannot have function bodies in header files, generally speaking
08:49:37FromGitter<kayabaNerve> I've coded C for years and have used Nim on/off for months.
08:49:51Araqand Nim can add unsigned ints anyway
08:50:17FromGitter<kayabaNerve> I get errors when I try it. system.nim on GitHub doesn't have the proc `+` for it
08:51:12Araq!eval echo 4u + 5u
08:51:14NimBot9
08:51:51FromGitter<kayabaNerve> !eval var a, b: uint32; a =1; b =2; echo $(a+b)
08:51:53NimBot3
08:52:00FromGitter<kayabaNerve> My compiler doesn't handle that
08:52:12FromGitter<kayabaNerve> https://pastebin.com/ikW7x1X5
08:52:25FromGitter<kayabaNerve> *My Nim compiler
08:52:52Araqso don't mix signed with unsigned numbers
08:53:13FromGitter<kayabaNerve> I'm an idiot. You're right
08:53:17FromGitter<kayabaNerve> int literal, not int
08:53:29FromGitter<kayabaNerve> All my types are uint but I didn't think to cast the literals.
08:53:39FromGitter<kayabaNerve> Thanks Araq
08:53:59FromGitter<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:29Araqhttps://nim-lang.org/docs/system.html#%2B,T,T
08:56:43Notkeahello, 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:57AraqNotkea: the .travis script
08:57:19Araqand here is how I found it, https://nim-lang.org/docs/theindex.html searched for '+'
08:57:20Notkeathanks!
08:58:20AraqkayabaNerve: yeah, to be honest, integer literals are pretty bad in Nim. sometimes they convert to unsigned/float, sometimes they don't
08:58:53FromGitter<kayabaNerve> Templates. Got it.
08:59:00FromGitter<kayabaNerve> Thanks for all the help Araq
08:59:05Araqin retrospect, they were a mistake. maybe we can still remove them...
08:59:09FromGitter<kayabaNerve> Sorry for not catching this at first glance
08:59:10Araq:-)
08:59:15FromGitter<kayabaNerve> It is not v1 yet ;)
08:59:54Araqbut again, you can't have function bodies in headers unless you ensure the header is included only once
09:00:17Araqthat's not Nim specific
09:05:37*CodeVance quit (Quit: Leaving)
09:07:33FromGitter<kayabaNerve> I did that
09:07:44FromGitter<kayabaNerve> ifndef ⏎ define ⏎ ⏎ endif [https://gitter.im/nim-lang/Nim?at=5affe9605a1d895fae511dcc]
09:08:54FromGitter<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:16FromGitter<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:34FromGitter<tim-st> @mratsim thanks for the information!
09:28:55FromGitter<tim-st> (regarding mod)
09:29:03FromGitter<mratsim> you’re welcome
09:31:45*CodeVance_ joined #nim
09:33:54FromGitter<kayabaNerve> I love C chars and string operators https://gist.github.com/kayabaNerve/acc8cfa41a4f44d5d72049ef916908a6
09:35:55FromGitter<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:38FromGitter<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:12FromGitter<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:59Araqmratsim: want to write an RFC?
09:39:00*CodeVance_ quit (Quit: Leaving)
09:39:54FromGitter<mratsim> @Araq I have no idea of how the solution should look like :/
09:40:42AraqI would simply make 0, 1, 2, 3 of type 'int' and throw away the "int literal" concept :P
09:41:27Araqbut then you would need to write posixcall() < 0i32 everywhere instead of < 0, or we promote mixed types to 'int'
09:41:54FromGitter<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:01FromGitter<mratsim> or `converter foo(x: int{lit}): int32`
09:43:59FromGitter<OldhamMade> Thanks @stisa
09:44:41FromGitter<OldhamMade> Unfortunately I’m looking to do this in separate unittest files.
09:46:26FromGitter<kayabaNerve> @mratsim Yep. 32 * 8
09:46:43FromGitter<mratsim> just use stint and Uint256: https://github.com/status-im/nim-stint
09:47:00FromGitter<mratsim> and nim-secp256k1 is a wrapper for bitcoin libsecp256k1
09:47:59FromGitter<kayabaNerve> Yep. I see that
09:48:09FromGitter<kayabaNerve> My plan was to use Boost + https://github.com/niv/ed25519.nim
09:48:33FromGitter<kayabaNerve> Especially as I want to use Boost already but stint is looking great.
09:48:34FromGitter<kayabaNerve> Thanks
09:48:58FromGitter<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:08FromGitter<kayabaNerve> I had no idea Status used Nim
09:49:43FromGitter<mratsim> Currently Nim is for research on sharding and Proof of Stake.
09:49:53FromGitter<kayabaNerve> Awesome that they do. I have some SNT dust on my wallet.
09:50:05FromGitter<kayabaNerve> I used to run a SNT Gitter TipBot too
09:50:38*xet7 joined #nim
09:50:40FromGitter<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:49FromGitter<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:18FromGitter<kayabaNerve> Yeah. I sorted GitHub by the Nim language.
09:51:23FromGitter<kayabaNerve> Looking nice.
09:52:10FromGitter<mratsim> there will be more SNT bounties in the coming weeks for Nim devs
09:53:04FromGitter<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:21FromGitter<kayabaNerve> It's one of the larger and respectable Ethereum projects.
09:54:14FromGitter<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:21FromGitter<kayabaNerve> So about Stint: it's labelled as experimental. It is stable enough for use, and is unlimited precision?
09:56:43FromGitter<kayabaNerve> (not unlimited ofc. Nothing is unlimited. But it's not just up to 2048bits)
09:56:46FromGitter<mratsim> Yes it’s stable enough for use, it works only on devel
09:57:01FromGitter<kayabaNerve> Nim devel? Not even 0.19?
09:57:03FromGitter<mratsim> it depends on your stack size
09:57:09FromGitter<mratsim> 1) 18.1
09:57:15FromGitter<mratsim> from April at minimum
09:57:29FromGitter<mratsim> there is a required commit from March 21 iirc
09:57:53FromGitter<mratsim> you can use stuint[65536] if your stack is big enough
09:58:15FromGitter<kayabaNerve> I'm just trying to decide it or Boost :P
09:58:18FromGitter<kayabaNerve> Thanks for your help
09:59:16FromGitter<mratsim> it will be passed through a security audit before widespread use ;)
10:00:13FromGitter<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:38dom96ooh, a security audit. First Nim code to be put through that I guess :)
10:00:42FromGitter<kayabaNerve> (*already plan on using Boost)
10:00:59FromGitter<mratsim> no problem. Good luck, we had issue with C++ because often we got error when casting
10:01:05FromGitter<kayabaNerve> dom96 giving confidence to the success and security of Nim
10:01:13FromGitter<mratsim> “This type has a non-trivial destructor and cannot be …” ...
10:01:28dom96Does that mean they will need to audit the compiler too? :P
10:01:39FromGitter<kayabaNerve> SDL Nim also had destructor issues IIRC
10:01:45FromGitter<kayabaNerve> I wonder if it's a similar cause
10:02:00FromGitter<kayabaNerve> Likely not though as its C...
10:02:23dom96I guess you mean SFML?
10:03:56FromGitter<kayabaNerve> SFML Nim... Maybe.
10:04:10FromGitter<kayabaNerve> I rarely get the two wrong. Now that you mention it though, I think you're right
10:04:41FromGitter<kayabaNerve> I think the SFML lib was better and I got it to install properly (SFML installation can be a bitch)
10:04:46FromGitter<kayabaNerve> And SFML is C++
10:05:12FromGitter<kayabaNerve> But there is a C variant IIRC
10:06:36FromGitter<kayabaNerve> SFML is in C++ ⏎ CSFML is a C wrapper ⏎ Nim-CSFML is the library I used
10:06:41FromGitter<mratsim> Coming soon, crypto-unimcorn
10:06:49FromGitter<kayabaNerve> Unimcorn?
10:07:11FromGitter<mratsim> Unicorn + Nim ;)
10:08:47FromGitter<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:06FromGitter<kayabaNerve> Why I'm using it with my crypto
10:09:42FromGitter<kayabaNerve> I'm making my multi-coin wallet in Java/JS though
10:10:05FromGitter<kayabaNerve> ShapeShift bounty is quite big
10:11:04FromGitter<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:08superpyrinClient: 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:24FromGitter<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:01FromDiscord<crem> ```$ choosenim stable
10:16:01FromDiscord<crem> Info: Version 0.17.2 already selected```
10:16:05FromDiscord<crem> :-\
10:16:31FromDiscord<crem> update stable is what I needed. Sorry for the noise.
10:18:44*superpyrin left #nim ("Leaving")
10:20:30FromGitter<kayabaNerve> Fun. Just upgraded from 0.17 to 0.18 and broke my Base58 code
10:20:42FromGitter<kayabaNerve> @mratsim That doesn't mean I can't get it to work ;)
10:27:55FromGitter<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:44cremUh, I remember nothing about nim. Again.
10:35:36FromGitter<kayabaNerve> Thannks @mratsim
10:35:44FromGitter<kayabaNerve> For some reason, my strings have a space at the end
10:37:21FromGitter<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:11cremCan I make nimble build binary with dash in name?
10:41:32cremSorry, there will be lots of basic questions from me this weekend.
10:43:06cremAlso, 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:33cremI guess I won't start coding in the nearest hour, will be looking for ways to please nimble instead.
10:46:37crem:(
10:48:48cremThere is not a word about nim.nim at https://github.com/nim-lang/nimble..
10:52:50Araq--out option?
10:53:18cremIn nimble config?
10:54:16Araqswitch("out", "dash-y")
10:54:21Araqin the .nimble file
10:55:35cremIn random place?.. doesn't seem to work.
10:56:13cremAlso, is there a way to know the latest version of parsetoml without installing the package?
10:56:35cremBut that's later, first I have to understand the nimble files layout.
10:57:15Yardanicocrem, https://github.com/NimParsers/parsetoml/blob/master/parsetoml.nimble#L3
10:57:33cremThanks.
10:57:36Yardanicobut if a repo for a nim project has releases (tags) on github, nimble will use that instead
10:57:49Yardanicoit will use latest release (tag) by default AFAIK
10:58:33Yardanico"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:47Yardanicoso not a release, but a latest github/mercurial tag
11:00:03cremhttps://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:29Yardanicocomplains about nim.nim?
11:00:34Yardanicocan you give an error log?
11:03:11*Snircle joined #nim
11:03:25cremWarning: 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:35cremah!
11:03:39cremit's package nim!
11:04:13cremThat's confusing. I remember being confused about this last time.
11:04:35cremOk, so dashed binary would be nice to have, but not a major problem for now.
11:04:51Yardanicoso your lc0client is in the same directory as nim ? :)
11:05:36cremno, but probably as nim is listed as dependency, it complains about it.
11:05:52Yardanicoit didn't do that for me
11:06:05YardanicoI have nim as a dep in all my .nimble files
11:06:13cremI created an empty directory....
11:06:21cremI know what happened!
11:06:23Yardanicoe.g. requires "nim >= 0.18.0"
11:06:26cremI did 'nimble init'
11:06:49cremAnd by default it thinks that I'll create 'nim' package instead of asking for the name.
11:07:19cremor no
11:07:25cremit takes directory name..
11:07:30Yardanicoyes, it does
11:09:44cremOk, and about dash in binary?.. No way? "lc0-client" would be nice
11:11:09Yardanicodash or - ?
11:11:14Yardanicobecause dash is — :)
11:11:57cremminus
11:12:10cremhyphen
11:12:26cremhyphen-minus
11:13:25Yardanicocrem, why not _ ? but I think dom96 may know if it's possible to change output binary name with nimble
11:14:43cremUnderscore.. In binary names hyphen-minus is more common, I think.
11:15:00cremBetter without anything then.
11:15:01*dddddd joined #nim
11:15:20dom96crem: If you have ideas about how to make that warning better please let me know
11:15:27dom96I did my best to make it as useful as possible
11:15:47dom96Sorry, no dashes possible
11:16:07dom96You can always copy the resulting binary, but installation via Nimble won't work
11:16:34dom96task mybuild, "Build things my way": exec "nimble build"; cp "lc0_client", "lc0-client"
11:16:43dom96then run `nimble mybuild`
11:16:55Yardanicocrem, I think _ is much more common than -
11:17:05Yardanicowell, it depends
11:17:08dom96btw guys, feel free to ping me when users have problems with Nimble
11:18:18cremI 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:38dom96Perhaps "Package *with name* 'nim' has an incorrect structure." would help?
11:21:04dom96!eval import json; echo(%*{"foo": "ß"})
11:21:05NimBotCompile failed: <no output>
11:21:15dom96!eval echo("Hello?")
11:21:18NimBotHello?
11:21:51dom96That's strange. Anyway, shouldn't the ß be escaped in the JSON?
11:22:03Araqno.
11:22:10AraqJSON is unicode ready
11:26:27FromGitter<kayabaNerve> How can I wrap a C++ operator?
11:28:23FromGitter<mratsim> look here: https://github.com/status-im/nim-ttmath/blob/master/src/ttmath.nim # is your friend
11:28:49FromGitter<mratsim> #and @
11:28:56FromGitter<mratsim> \# and @
11:29:31FromGitter<mratsim> details are here: https://nim-lang.org/docs/manual.html#importcpp-pragma-importcpp-for-procs
11:29:53*FuntDobra joined #nim
11:35:39FromGitter<kayabaNerve> Thanks
11:37:12cremSo 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:55FromGitter<mratsim> src/lc0client/config.nim
11:38:11cremthanks
11:38:29FromGitter<mratsim> or lc0client.nim and lc0client/config.nim
11:42:25dom96or 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:38FromGitter<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:56FromGitter<kayabaNerve> @mratsim How does this work?
11:45:57FromGitter<kayabaNerve> proc initIntT (a: cstring): T {.importcpp: "'0(#)".}
11:46:13cremMaybe some nim fomatter appeared in last 8 months?
11:46:45FromGitter<kayabaNerve> That's the equivalent of TTMath::UInt<size> = "1", right?
11:46:49FromGitter<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:05FromGitter<kayabaNerve> ... that doesn't explain the 0
11:47:18FromGitter<mratsim> ‘0 matches with the type
11:47:20*Trustable quit (Remote host closed the connection)
11:47:22FromGitter<kayabaNerve> Or this module's lack of =
11:47:23FromGitter<kayabaNerve> Got it
11:47:31FromGitter<kayabaNerve> So it's a constructor call
11:47:36FromGitter<mratsim> so with T, the type of the result
11:47:43FromGitter<mratsim> yes
11:47:48dom96diegogub: kind of, you can specify --nimbleDir:<dir> and everything will be installed there
11:48:22FromGitter<mratsim> usually you can also put {.importcpp: "'0(#)”, constructor.} but it seems like we got away without it :P
11:51:23FromGitter<kayabaNerve> @mratsim So. It's trying to compile with gcc, not g++
11:51:26FromGitter<kayabaNerve> Idea on that?
11:51:32FromGitter<mratsim> nim cpp
11:51:33FromGitter<kayabaNerve> Thanks by the way
11:51:36FromGitter<kayabaNerve> Got it
11:53:40FromGitter<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:32Yardanicothere's nim c, nim cpp, nim js, nim objc if you didn't know btw :) @kayabaNerve
11:54:49FromGitter<mratsim> R.I.P. `nim php`
11:55:15FromGitter<mratsim> 2008-2018 `nim php` the unsung hero.
11:55:28Yardanico:D
11:57:16YardanicoAFAIK 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:42FromGitter<kayabaNerve> @mratsim You ever get this error?
12:16:43FromGitter<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:23FromGitter<kayabaNerve> Is this related to that GitHub commit not in stable yet?
12:17:24FromGitter<mratsim> Only when I tried to do inline assembly.
12:18:39FromGitter<mratsim> that’s not Nim, it’s assembly for x86_64 (movq) used with a 32-bit register (%edx) apparently
12:19:56FromGitter<arnetheduck> https://trends.google.com/trends/explore?date=all&q=restructuredtext,markdown
12:19:58FromGitter<mratsim> maybe you have to pass a -DX86_64 or some other define to the library you’re wrapping?
12:20:27FromGitter<mratsim> use {.passC: “-DYOUR_CUSTOM_DEFINE”.}
12:23:46*FuntDobra quit (Ping timeout: 264 seconds)
12:25:03FromGitter<kayabaNerve> I'm trying to convert a std::string to a char*
12:25:23FromGitter<krux02> std::string has a method for that
12:28:22FromGitter<kayabaNerve> .c_str()
12:28:23FromGitter<kayabaNerve> I know
12:28:25FromGitter<kayabaNerve> I'm using it
12:42:53*gokr quit (Ping timeout: 268 seconds)
12:45:21FromGitter<arnetheduck> hahaha: https://github.com/arnetheduck/nlvm/issues/1#issuecomment-390402510
12:46:03carterza[m]:D
12:46:03Yardanicohahah, 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:53Yardanicoof course having more backends is good, but we shouldn't hate other ones :)
12:51:24FromGitter<arnetheduck> no, but the t word was mentioned :)
12:51:53Yardanicoyeah, I saw it !!
12:52:11carterza[m]that's a trigger for some people round these parts
12:53:21Yardanicowell, why don't we call LLVM a transpiler?
12:53:41Yardanicoit "transpiles" your code to IR and then compiles this IR to machine code :)
12:54:51FromGitter<arnetheduck> well, I've already written one thing I used to call a transpiler: https://github.com/arnetheduck/j2c
12:55:14FromGitter<arnetheduck> I'm sure there's some important difference between the two :)
12:55:54carterza[m]well - I think you have to have a level of abstraction difference
12:56:01carterza[m]to technically be compiling
12:56:13carterza[m]if the targets share the same level of abstraction
12:56:15carterza[m]you're transpiling
12:56:18carterza[m]at least that's my understanding of it
12:57:13FromGitter<data-man> https://en.wikipedia.org/wiki/Source-to-source_compiler
12:57:22FromGitter<data-man> Nim in the list
12:57:27Yardanico"This article has multiple issues." :)
12:57:39carterza[m]https://github.com/zacharycarter/nim-playground - now has HMR
12:57:41Yardanico@data-man well, you know what wikipedia can be edited by anyone, right? :)
12:58:05FromGitter<data-man> Anyway Nim has more high level than C :-D
12:59:19Araqoh it's yet another transpiler vs compiler discussion.
12:59:37Araqso ... C is close to machine code and "compiled", right?
12:59:48FromGitter<data-man> @Yardanico: I don't want to become a Wiki warrior :)
12:59:53Araqhow does that work for the transpiler people?
13:00:42Araqsadly, my own term, transfinitiler hasn't taken off
13:02:46FromGitter<data-man> I always use Google Transpiler and Yandex Transpiler :)
13:04:36FromGitter<data-man> Because human langs have approximately the same level of abstraction :)
13:05:21Yardanicohahah
13:05:49*xcm quit (Remote host closed the connection)
13:06:53federico3Araq: are you being serious?
13:07:14Araqno.
13:12:04federico3try with "metapiler"
13:39:12*skrylar joined #nim
13:50:02CodeVance1C 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:56skrylarCodeVance1, i wasn't here for the context; guessing someone brought up the "not real language because just outputs C" trope?
14:15:50FromGitter<zetashift> someone posted on a nlvm issue where Nim's C target is so 1970ss
14:16:09skrylartechnically 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:18FromGitter<zetashift> haxe now also compiles to C
14:16:23skrylarit did before too
14:16:25skrylaractually they're greatful to be off the swf target
14:16:45skrylarpeople just like shitting on things that are different from what their useless education programs ground in to them
14:16:51FromGitter<zetashift> It did? I thought only C++; https://hashlink.haxe.org/
14:17:00skrylarit had a c target before, but it was well
14:17:13skrylarless than great
14:17:23FromGitter<zetashift> I bet if Nim had a Rust target it'd be revolutionary according to news sites he
14:17:34skrylarrust is illegible so its good
14:18:04FromGitter<krux02> but Haxe is not such a good language
14:18:10skrylari 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:24FromGitter<narimiran> hey @zetashift! have you seen my PM?
14:18:38FromGitter<zetashift> @krux02 haxe is nice, I think you just really really hate OOP :P
14:18:41FromGitter<zetashift> no I have not
14:18:47skrylarhaxe was ok.
14:18:50FromGitter<krux02> maybe
14:19:04FromGitter<krux02> was?
14:19:14dom96Haxe is the "compiles to everything" language AFAIK
14:19:25FromGitter<krux02> I takes more for a Programming language to take off than to be OK.
14:19:27FromGitter<zetashift> @narimiran I have now; this is why I hate gitter :D
14:19:40skrylaryou 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:45FromGitter<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:56FromGitter<krux02> dom96: basically yes
14:20:05FromGitter<zetashift> last few months it got a lot easier to use thanks to some improved editor plugins
14:20:35skrylarthis would be less annoying if the completion of said yak shaving came to the fruition of more than nonexistent fanfare (FLTK, Firebird)
14:20:42enthus1astany idea why recvfrom (<sys/socket.h>) ss_family/sa_family does not change for ipv4 or ipv6 udp?
14:20:45FromGitter<krux02> @data-man lol
14:21:07skrylarenthus1ast, why should it, the abstractions aren't different
14:21:18skrylarip6 and ip4 are addressing and tcp/udp are reliability layers
14:21:23FromGitter<data-man> So Nim cannot be called transpiler because the two languages are very different levels of abstraction. :)
14:21:46skrylardata-man: don't feel bad, your average coder is a hack fit only to write basic jquery scripts
14:21:57skrylarcitation: IBM study where most professionals failed to grasp binary search from spec
14:22:07FromGitter<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:19FromGitter<krux02> I vote for Araqs suggestion to call it transfinitiler
14:22:24FromGitter<zetashift> ^
14:22:26skrylarif they can't even grasp bsearch, how can they understand macros
14:22:37skrylarand if you can't understand macros, you've lost the point of why nim is useful
14:22:38skrylar:|
14:22:40skrylar</soapbox>
14:22:51FromGitter<krux02> @zetashift but Nim has these things, too
14:22:58FromGitter<krux02> (these problems)
14:23:24FromGitter<zetashift> Nim currently has the excuse of being pre-1.0 about those issues
14:23:29enthus1astskrylar: should it not be set to AF_INET6 for udp6?
14:23:31FromGitter<zetashift> and not having 1000 targets is a plus this time
14:24:00FromGitter<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:15FromGitter<zetashift> also honestly Nim has nice docs(book included) it just doesn't have great stuff for absolute beginners
14:24:20FromGitter<mratsim> and no OO forced down your throat.
14:24:24Araq"transpiling vs compiling" makes no sense to me, mapping C# to IL is easy
14:24:40Araqand the IL was kinda made for an OO language.
14:24:57FromGitter<mratsim> We should say that Nim transmogrify to C: http://calvinandhobbes.wikia.com/wiki/Transmogrifier
14:25:17dom96It makes some sense when you go by the Wikipedia definition: Nim -> C: Compiler, Nim -> JS: Transpiler
14:25:25FromGitter<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:36Araqit'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:55FromGitter<mratsim> > transmogrifier ⏎ > someone or something that can change or transform its appearance to something else
14:26:22Araqand everything that does lambda lifting is a compiler anyway.
14:26:26FromGitter<krux02> I feel entertained :)
14:26:40FromGitter<data-man> @mratsim 💯
14:27:03FromGitter<mratsim> I think we have an April’s Fool article :P
14:27:28AraqLL is a heavy transformation, indicating your target language is on a different abstraction level.
14:27:47FromGitter<krux02> I usually say "only hip people use the word transpiling"
14:28:49FromGitter<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:26dom96mratsim: Better written than any of our articles so far :D
14:29:35dom96submit it as a draft
14:29:39FromGitter<mratsim> lol
14:30:29skrylarwhat was that old quote, there are languages that people complain about and then there are languages that nobody uses
14:30:36skrylarand then someone jokingly tacked on "and somehow Go is both"
14:30:55CodeVance1Frankly I think compiling to C is better. I wish more langs would do it
14:31:51CodeVance1nim should compile to haxe then to C then to ASM then to bytecode XD
14:31:55FromGitter<krux02> CodeVance1: transmogrifies to C
14:32:02skrylarCodeVance1, it just depends
14:32:15skrylarChicken Scheme compiles to C, nobody seems to care that it does, although C is a bad fit
14:32:27skrylarthey had to do a lot of hackery to force a C target to support CPS and friends
14:32:48CodeVance1Haxe didn't have ide support last I checked
14:32:51FromGitter<data-man> The best transpilers - sed and awk :)
14:32:57FromGitter<mratsim> @dom96 here is the draft: https://gist.github.com/mratsim/1c0e5427e68015452726ae6badc61e20
14:33:08skrylarhaxe has a nimsuggest equivalent and some editors have plugins to use it
14:33:20*PMunch joined #nim
14:33:25skrylarthey did have a (windows-only) IDE, not sure if its still around
14:33:27CodeVance1krux02 I like metapiles more
14:33:29skrylarFlashdevelop?
14:33:46dom96mratsim: PR or create an issue with a link to this on the website repo
14:33:53CodeVance1skrylar: flashdevelop no worky last I checked.
14:33:59FromGitter<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:33skrylarCodeVance1, it worked for me but this was eight years ago
14:34:48PMunchflashdevelop used to be cross platform
14:35:00FromGitter<krux02> I think everything that a good proramming language needs a good support in widely adopted editors.
14:35:12PMunchBut they removed Linux support for some reason. It was based on Eclipse though, so not quite sure why
14:35:12FromGitter<arnetheduck> @krux02 nlvm does that now
14:35:17FromGitter<krux02> And I am sorry to tell this, nimsuggest is a bit crap.
14:35:23skrylargamedev on linux is well, not a thing
14:35:30skrylarand haxe was being used by gamedevs
14:35:43PMunchI remember writing Flash code in FlashDevelop under Windows Java installed under Wine
14:35:49FromGitter<krux02> After long time struggeling with it, I just disable it because the frustration isn't worth the benefit
14:36:12FromGitter<krux02> skrylar: I do gamedev on Linux
14:36:33PMunchGamedev is entirely possible on Linux
14:36:40skrylarpossible yes, pain in the ass very yes
14:36:43FromGitter<krux02> yes it is I am doing it
14:36:46PMunchIf you just use something that supports Linux
14:37:04FromGitter<krux02> I just had some interesting experiences with the opengl debugger
14:37:26skrylarKrita 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:38PMunchI developed a game/interactive display in Unity under Wine loading native MonoDevelop
14:37:48FromGitter<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:02FromGitter<krux02> in sort the tool support is a bit inconsistent.
14:38:23skrylarGodot however is still great and seems to have always been, so those guys are awesome
14:38:23PMunchAlso wrote an actual game in Nim on Linux :)
14:38:25PMunchUsing Vim
14:38:36PMunchYeah I've been meaning to check out Godot
14:38:49PMunchNot a huge fan of the monolithic engine/editor thing though..
14:39:00CodeVance1monolithic?
14:39:06CodeVance1its got plugins
14:39:08PMunchYeah, all-in-one
14:39:11skrylargodot is modular but they cram it all in the build
14:39:16FromGitter<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:26PMunchI know that it is modular
14:39:40CodeVance1the one plugin is too much?
14:39:42*hohlerde quit (Ping timeout: 256 seconds)
14:39:45CodeVance1like break it up
14:39:56PMunchI meant in general, not specifically Godot
14:40:02FromGitter<krux02> yea I also don't like the Enigine/Framework idea on it's own with plugins
14:40:07skrylargodot 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:17skrylarthe upside is that its very well made
14:40:19PMunchUnity, Unreal, and Godot are all shipped as editor/engine/framework combo package
14:40:43PMunchskrylar, oh yeah
14:40:49PMunchIt definitely has it's benefits
14:40:52FromGitter<krux02> PMunch: that is exactly what I don't linke
14:40:55skrylarone 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:07PMunchBut 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:25skrylari guess torque did too
14:41:30FromGitter<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:42PMunchExactly
14:41:59skrylargodot doesn't care if you edit in sublime tho
14:42:12skrylarhave 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:39FromGitter<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:01PMunchI'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:25federico3+1 PMunch
14:43:30*CodeVance1 is now known as CodeVance
14:44:01*CodeVance quit (Quit: Leaving.)
14:44:05FromGitter<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:25PMunchActually saw a guy writing about live coding in Nim
14:44:36PMunchBasically hot-loading .so files into his project
14:44:46FromGitter<krux02> well live coding isn't really hard
14:44:57PMunchSo it was looking for updates to files, and if they got updated it would recompile them and swap out the .so
14:45:20FromGitter<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:42FromGitter<krux02> depending on what you are working on this separation needs to be flexible
14:45:59skrylarkrux02: it's plenty useful in smalltalk land
14:46:06FromGitter<krux02> and really great tools that exist for the jvm can do that automatically for you
14:46:33FromGitter<krux02> yea in smalltalk it is basically like on a lisp machine
14:46:33*hohlerde joined #nim
14:46:57FromGitter<krux02> you work, live, edit and do stuff in the same universe
14:46:57FromGitter<mratsim> @dom96: https://github.com/nim-lang/website/issues/84
14:47:02FromGitter<krux02> and you never leave it
14:49:45PMunchHmm, who is it that now has push-rights to parsetoml?
14:49:50PMunchhttps://github.com/NimParsers/parsetoml
14:49:50FromGitter<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:54FromGitter<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:01PMunchAfter it moved to the NimParsers organization
14:50:06FromGitter<krux02> and in the end you just never look in the list of classes.
14:50:46PMunchI find vim marks more practical :)
14:50:54PMunchAnd just a regular search..
14:51:17FromGitter<data-man> @PMunch: yes. Do not want to move your parser repositories there? ;)
14:51:32PMunchWhich ones?
14:51:43PMunchbinaryparse and combparser?
14:52:06FromGitter<data-man> Maybe both.
14:52:11FromGitter<krux02> PMunch: I reccomend to bind a key to a project wide identifier search of the identifier under the cursor
14:52:17FromGitter<mratsim> I think that can be hacker news or r/programming worthy: https://github.com/nim-lang/website/issues/84 thoughts?
14:52:25PMunchI thought the idea behind the org. was to have parsers for specific formats
14:52:33PMunchI guess my pcap library could move there
14:53:01FromGitter<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:17skrylarkrux02: this is probably related to class browsers in non-smalltalk worlds being garbage
14:53:26skrylarthe smalltalk ones sort classes in to packages and methods in to categories
14:53:45skrylarthe 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:46PMunchUhm, "someone or something that can change or transform its appearance to something else"
14:54:16PMunchThat's the whole point of it being compiled, it changes more than just appearance
14:54:18skrylara package in smalltalk is purely organization material, there is no semantic "shit i moved this class now must edit all imports"
14:54:19FromGitter<krux02> skrylar: I don't know how smalltalk works, but I can only compare it to working with emacs.
14:54:25FromGitter<data-man> @krux02: I prefer finished this: https://github.com/universal-ctags/ctags/pull/401
14:54:44FromGitter<data-man> to finish :)
14:54:55FromGitter<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:14skrylarkrux02: 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:54skrylarSmalltalk class browsers are sorted semantically, most others are syntactically
14:56:13FromGitter<krux02> I never worked with tag files. I don't like that they can get outdated.
14:56:28FromGitter<krux02> and project wide read serach of a symbol is instant
14:56:42FromGitter<krux02> so the is also no performance benefit in tag files
14:58:19FromGitter<krux02> s/read/real/
14:59:13*FuntDobra joined #nim
14:59:37*leorize joined #nim
14:59:39FromGitter<data-man> I use https://github.com/cppit/jucipp It supports ctags like many other editors and IDEs.
15:00:47FromGitter<krux02> @data-man I am not trying out new text editors anymore.
15:01:03FromGitter<krux02> Basically every new editor fucked up keyboard support
15:01:17FromGitter<krux02> and supporting keyboards in an editor is not optional
15:03:17FromGitter<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:15FromGitter<data-man> And I have a choice problem: finish Nim's support for ctags or improve ```nim ctags``` command :)
15:05:38FromGitter<krux02> @data-man Nim is still a language under construction
15:05:41FromGitter<data-man> I thought the idea about new ```nim grep``` command
15:06:02*dddddd quit (Remote host closed the connection)
15:06:06FromGitter<data-man> Or ``` nim find```
15:06:06FromGitter<krux02> recently the func keyword was enabled to declare a function without side effects
15:06:21FromGitter<arnetheduck> just do it: https://langserver.org/
15:06:24skrylarkrux02: https://technabob.com/blog/wp-content/uploads/2010/08/supercoder_2000_binary_keyboard.jpg
15:07:40FromGitter<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:24PMunchI think langserver would be great to have in Nim
15:11:48FromGitter<arnetheduck> looks like a lot of languages on the langserver list have figured out a way to deal with it
15:13:13PMunchYeah if a languages like Clojure, Erlang, and Haskell can do it so can Nim :P
15:13:21PMunchOr RST and XML for that matter :P
15:13:34*BitPuffin joined #nim
15:14:01dom96It's not hard, it just requires time
15:15:47FromGitter<arnetheduck> less time than trying to solve it from scratch with nimsuggest + N editors..
15:19:43FromGitter<data-man> @skrylar: Why this keyboard does not have the backspace? :)
15:21:22PMunchdata-man, what do you need that for? Making mistakes?
15:22:11skrylarprofessionals never make mistakes. all things are easy mode
15:22:19skrylaror at least that's how they always act when i'm around
15:22:28PMunchAnd if you should need one just type 00001000
15:23:16carterza[m]I could use some help with PRE if anyone has a sec
15:23:35PMunchcarterza[m], just ask away :=
15:23:37PMunch:)*
15:23:57carterza[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:30carterza[m]I'm trying to grab the entire tree and replace it
15:24:34superbiahow would one use nim to write for fpgas
15:24:46carterza[m]so far I have - `cat README.rst | perl -00pe 's/^\s{4}\..*\r?\n(?:^\ +.*\r?\n)*/foo/'`
15:24:49FromGitter<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:11carterza[m]so not at all what I want...
15:27:31carterza[m]superbia: https://en.wikipedia.org/wiki/C_to_HDL - maybe start there?
15:28:47*leorize quit (Ping timeout: 276 seconds)
15:28:57PMunchcarterza[m], "cat readme | grep [│├└]"
15:30:02carterza[m]PMunch: right on - do you know of a way I can replace that match with some other text?
15:30:03carterza[m]that's my goal
15:30:17PMunchWhat do you mean?
15:30:49*CodeVance quit (Quit: Leaving.)
15:30:53miransuperbia: are you the same superbia from #manjaro ? :)
15:31:14superbiaask PMunch
15:31:33PMunchUhm, yes he is :P
15:31:50PMunchsuperbia, why should he ask me?
15:32:03*gokr joined #nim
15:32:13carterza[m]PMunch - I mean that I want to replace that section of my readme with another string
15:32:21carterza[m]basically replace the match grep produced with some other text
15:32:24PMunchOh, in the same readme?
15:32:30PMunchHmm
15:32:30carterza[m]mmhmm
15:32:46*FuntDobra quit (Ping timeout: 264 seconds)
15:32:46miranhaha, there seems to be some strange manjaro-nim connection, unexpectely high number of us use both
15:32:54carterza[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:00PMunchProblem with sed is that it is line based
15:35:18PMunchSo 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:39FromGitter<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:56PMunchThe name?
15:37:56*mgdelacroix joined #nim
15:38:04superbialike CEST
15:38:08superbiacentral european summer time ?
15:38:08FromGitter<sramsay> Right
15:38:42superbiatheres is a unix command that that does that
15:38:59*leorize joined #nim
15:39:04FromGitter<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:44dom96!eval echo getTime().local().timezone.name
15:39:46NimBotCompile failed: in.nim(1, 6) Error: undeclared identifier: 'getTime'
15:39:53dom96!eval import times; echo getTime().local().timezone.name
15:39:56NimBotLOCAL
15:40:02dom96lol
15:40:05superbialol
15:40:10FromGitter<sramsay> hmm
15:40:17dom96might work locally :)
15:40:22superbiahi dom96
15:40:47FromGitter<sramsay> Nope, prints LOCAL for me.
15:40:53FromGitter<sramsay> I mean, it's not wrong. ;)
15:40:54superbiadom96: mind a pm?
15:42:52FromGitter<zetashift> dom86 don't you need to use `now().utcOffset`?
15:43:21*FuntDobra joined #nim
15:43:49FromGitter<sramsay> Sorry, was I being asked about a pm? Totally fine.
15:44:29dom96superbia: go for it, but only if it really requires PM
15:44:56PMunchfederico3, have you tried Nim for FPGA?
15:45:33dom96sramsay: bug report I guess :)
15:45:35federico3no, and besides, how would Nim be used for an FPGA?
15:46:13PMunchI dunno, just a thought I had
15:46:29FromGitter<data-man> !eval import times; echo now().timezone; echo now().utcOffset
15:46:31PMunchcarterza[m], cat readme | sed -Ez 's/\n *[│├└]+[^\n]*/\nSomething else/g'
15:46:32NimBotLOCAL↵0
15:46:39PMunchfederico3, or rather superbia asked about it
15:48:08federico3I mean: running Nim on a CPU implemented on an FPGA or using Nim as an HDL?
15:48:32PMunchI dunno, ask superbia :P
15:49:19superbiafederico3: first is possible, i wondered about the second
15:49:50PMunchcarterza[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:06PMunchThat will replace the whole section with "This is the text we want to replace it with"
15:50:48PMunchOr 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:01PMunchThat grabs the dot as well
15:52:59FromGitter<mratsim> ugh, those regexp are completely mangled on Gitter
15:53:11PMunchOr all in one sed command: cat readme | sed -Ez 's/ *\.(\n *[│├└]+[^\n]*)+/\nThis is the text we want to replace it with/'
15:53:17PMunchmratsim, they are?
15:53:54FromGitter<data-man> Yes. :) Use ``````
15:54:00PMunchHaha, Gitter seems to try to make italics from parts of it
15:54:12federico3superbia: the second sounds very possible and easier than other languages but I guess it's a lot of work
15:54:19PMunchLike this: ```cat readme | sed -Ez 's/ *\.(\n *[│├└]+[^\n]*)+/\nThis is the text we want to replace it with/'```
15:54:50dom96I wonder how fast a Nim implementation of this would be: https://twitter.com/mnt_io/status/997411477572276224
15:56:22FromGitter<sramsay> The docs contain this example for the local proc:
15:56:26FromGitter<sramsay> doAssert now().timezone == local() ⏎ doAssert local().name == "LOCAL"
16:02:56PMunchdom96, are you trying to tease us into optimizing another benchmark? :P
16:03:08*sherjilozair quit (Remote host closed the connection)
16:03:12dom96sure :P
16:06:26FromGitter<data-man> https://github.com/JuliaLang/Microbenchmarks e.g.
16:07:56FromGitter<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:52superbiayou could get it from your public ip, or your lunix machine, or ...
16:11:24FromGitter<data-man> @PMunch: http://kaitai.io Is it interesting for you?
16:11:42*yglukhov joined #nim
16:11:45PMunchYeah someone linked me that earlier
16:11:55PMunchLooks like a more verbose version of my binaryparse library
16:13:00FromGitter<data-man> Compiler written on Scala.
16:13:39FromGitter<mratsim> @data-man I can destroy any language on integer matrix multiply.
16:14:04FromGitter<mratsim> I’m 10x faster than Julia, and 22x faster than Numpy on 1500x1500 matrices
16:14:15FromGitter<data-man> Just do it in Julia's repo! :)
16:15:27FromGitter<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:42PMunchYeah I though abut implementing that as an example
16:17:44PMunchOr PNGs
16:17:47*superbia quit (Quit: WeeChat 2.1)
16:19:27FromGitter<data-man> Maybe it's will be useful for Windows users (AFL port for Windows): https://github.com/ivanfratric/winafl
16:20:12FromGitter<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:53FromGitter<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:49FromGitter<data-man> Awesome!
16:26:10*sherjilozair joined #nim
16:29:37FromGitter<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:19FromGitter<data-man> Yet another persistent key/value storage engine (skiplist based): https://github.com/Softmotions/iowow
16:30:22FromGitter<sramsay> @GULPF Ah, I see. Thanks.
16:31:01FromGitter<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:07FromGitter<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:41kobihello
16:34:07FromGitter<data-man> Hi!
16:34:15kobi:)
16:34:36FromGitter<data-man> Bye? :)
16:34:50kobiI am porting an old framework I wrote,
16:35:24kobiBut I am not sure how some things are done in nim
16:35:30FromGitter<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:48FromGitter<data-man> @kobi: just ask
16:37:08kobiis there something like a 'dynamic' type in nim?
16:37:55kobiI am passing data where the receiving part decides the format
16:38:19kobiI can change that design though to pass tuples or something but want to have a general type in the library
16:39:23kobisomething like a general anonymous object, or a hashtable then the receiving part knows what it needs to extract from the information
16:39:43euantorCan anybody chime in here? https://github.com/euantorano/nixpkgs/pull/1#issuecomment-390414934
16:39:44FromGitter<data-man> @kobi: maybe https://github.com/yglukhov/variant ?
16:40:09euantorGot down to just a few failing tests now, hopefully they can be easily fixed :)
16:41:18Yardanicokobi, you can also just use json :D
16:41:22kobiI can have a hashtable of string -> object, but nim isn't really oo
16:41:56dom96kobi: create an object variant: https://nim-lang.org/docs/manual.html#types-object-variants
16:41:58kobiyes, json is a good idea. is there something akin to json without the parsing?
16:42:16kobihi dom96 and Yardanico
16:42:19dom96You can take a look at how the JsonNode is implemented too as an example (it's an object variant)
16:42:23Yardanicokobi, if you want hashtable - you can just use tables module
16:42:39Yardanicobut of course only if your values in a table have one type :)
16:42:47PMunchYeah I think that's his issue :P
16:42:50PMunchThey aren't the same type
16:42:57PMunchBut yeah, object variants is the way to go
16:43:12PMunchOr using a JSON object (which can be constructed in Nim without parsing text)
16:45:09kobiI 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:18dom96!eval import json; echo(%*{"key": {"foo": 4.2, "bar": 5.4, "baz": "string"}})
16:45:22NimBot{"key":{"foo":4.2,"bar":5.4,"baz":"string"}}
16:46:27kobican I pass types that are not in the basic list, for example a matrix or array of arrays?
16:46:46dom96try it :)
16:46:58kobi:)
16:48:35*endragor joined #nim
16:49:31kobidocs were faster, getInt, getFloat, getStr, and getBool. so I guess no.
16:50:11dom96"guess" != "know"
16:51:00dom96!eval import json; echo(%*{"list": [1,2,3]})
16:51:04NimBot{"list":[1,2,3]}
16:52:13kobimy nim fu is too weak :/
16:52:58kobi:-]
16:53:27kobiback to coding, silence is golden
16:56:47kobiawesome, nim-regex has named captures
16:58:24kobiWhat do you guys usually use for quick builds? I see 'nake' as a nice tool. any cons with it?
16:58:50skrylarnim c something?
17:02:02kobiah ok
17:03:56dom96You don't need makefiles for Nim
17:04:18kobibecause nim automatically adds the imported files right?
17:04:19*endragor quit (Remote host closed the connection)
17:04:33kobiold habits i guess
17:06:05kobiso, 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:31Yardanicokobi, you have nimble in nim
17:06:46Yardanicofor building, but really VSCode+ nim extension handles it :)
17:07:46kobido you mean that vscode checks for errors?
17:07:58FromGitter<mratsim> yes
17:08:11FromGitter<mratsim> you have errors highlighting
17:08:17kobiso the usual workflow doesn't require constant building, then?
17:08:37FromGitter<mratsim> building libraries will likely take 2 seconds at most
17:08:51kobiI meant manual building
17:09:08kobiok, wonderful
17:09:46FromGitter<mratsim> `nim c yourfile` is enough. but the syntax/error highlighting will give you errors without building the project.
17:09:58Yardanicokobi, nim c -r myfile.nim (-r will start it after compiling)
17:10:14FromGitter<mratsim> building is still useful for the stacktraces sometimes
17:10:14Yardaniconimble is used for separating different packages (so they can be added to the package repository)
17:11:01kobidoes nimble have a role in building?
17:11:24kobiI know that you can specify dependencies
17:11:33Yardanico"nimble build"
17:11:49FromGitter<data-man> There is ```nim check```
17:12:09Yardanicobut really for development you will use "nim c" almost always :)
17:12:09Yardanicohttps://github.com/nim-lang/nimble#nimble-build
17:12:45kobigood. thanks guys. now to dig for generics docs ...
17:17:32kobiwow, generics are really advanced in nim
17:17:45kobi(coming from c#)
17:19:47FromGitter<data-man> Nim has everything advanced :)
17:22:26federico3except its popularity
17:32:03*gangstacat quit (Quit: Ĝis!)
17:32:12dom96federico3: ouch
17:34:00FromGitter<tim-st> is there a best way to use a shared cache folder in nim like golang does?
17:34:15FromGitter<tim-st> (compiled binary cache)
17:36:11FromGitter<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:16kobihow do I define a type saying T where T is enum
17:36:36Yardanico@tim-st yes, you can have shared directory for all C files
17:36:47*endragor joined #nim
17:37:01Yardanicobut it'll be required to recompile them quite often
17:37:10FromGitter<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:11Yardanicobecause of dead code elimination\
17:37:16Yardanicothey can
17:37:26*gangstacat joined #nim
17:37:29YardanicoI mean they can share same nimcache folder :)
17:37:37*FuntDobra quit (Ping timeout: 256 seconds)
17:37:48FromGitter<tim-st> do they overwrite each other when needed?
17:38:45Yardanicoof course
17:39:03Yardanicobut it's not really useful because of dead code elimination
17:39:22FromGitter<data-man> Maybe ccache may help
17:39:23FromGitter<tim-st> but exactly this overwriting I wanted to avoid
17:39:33Yardanicowell, you can't currently AFAIK
17:39:53*endragor quit (Remote host closed the connection)
17:39:57kobiYardanico: can this somehow work?
17:39:59kobiimport json
17:39:59kobitype SimpleData* = tuple[part:enum,data:JsonNode]
17:40:05FromGitter<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:14Yardanicokobi, "enum" is not a concrete type :)
17:40:21kobienum is not in runtime, but when building it could be discovered what it is
17:41:06kobii can pass a set of strings, but ideally it could be constrained further
17:41:49kobithe user of the library makes the enum and the library allows any such T:enum
17:42:53kobinevermind, i'll just initialize in a way that spelling mistakes won't happen
17:43:00FromGitter<data-man> Let's rename Nim to Nemesidium :)
17:43:36federico3dom96: speaking of advanced, declarative cooperative tasks like https://en.wikibooks.org/wiki/Ada_Programming/Tasking could be very interesting
17:43:37kobidata-man, will that help the popularity factor?
17:44:10FromGitter<tim-st> no, popularity is got by good marketing
17:46:06FromGitter<data-man> @kobi: This will reduce the number of results in search queries :)
17:46:22FromGitter<tim-st> I always type `nimlang`
17:47:06FromGitter<tim-st> but there is not even a wikipedia article about nim in German, I think this is a bit weird
17:48:23Yardanicohttps://gist.github.com/Yardanico/96b252808798af7656d05f2412c0c489 my first Nim gist :D
17:50:05*xkapastel joined #nim
17:52:26FromGitter<data-man> @Yardanico: You saw it? https://eax.me/nim/
17:52:38*xkapastel quit (Disconnected by services)
18:00:03FromGitter<zetashift> I google translate'd that site, some really nice things about nim are being said
18:01:16FromGitter<data-man> @zetashift: https://habr.com/search/?q=Nim
18:01:20FromGitter<data-man> :)
18:01:25FromGitter<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:04Yardanico@data-man of course I did :)
18:02:09Yardanicoand that's 2015
18:03:46YardanicoNim 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:47FromGitter<data-man> @zetashift: lol replace "to pee" to "to write" :)
18:04:51FromGitter<tim-st> I still vote to change the example code on the nim website, that looks a bit difficult indeed
18:05:07FromGitter<tim-st> `for line in stdin.lines`
18:05:26Yardanicowell, I was 14 in 2014 and only had a little bit of python knowledge :D
18:06:13FromGitter<tim-st> btw has someone experience with building a minimal perfect hash function for a nim array?
18:07:57FromGitter<data-man> @tim-st: https://github.com/nitely/nim-unicodedb/blob/master/gen/min_perfect_hash.nim
18:09:09FromGitter<tim-st> looks interesting, thank you, I hope the lookup time is not much worse than direct indexing
18:10:31FromGitter<data-man> http://rosettacode.org/mw/index.php?title=Category:Nim&action=history :(
18:12:32cremHow can I get a directory where binary runs in?
18:13:02FromGitter<data-man> http://rosettacode.org/wiki/Category:Nim linked to http://nimrod-lang.org
18:13:32FromGitter<data-man> It's "very good tutorial." :)
18:13:45Yardanicocrem, getAppPath() ?
18:13:51Yardanicoah, sorry
18:14:04Yardanicoyou mean current dir or dir where binary is located?
18:14:11cremgetAppDir.
18:14:14cremThanks!
18:14:23cremNot current, that's what I need.
18:15:31cremNo code formatter for nim yet, right? I'm spoiled by using code formatter in all languages. :)
18:16:31PMunchUnfortunately not..
18:16:31Yardanicocrem, no, there's nimpretty, but it's far from being ready
18:17:15cremWhat do I do with "Warning: not GC-safe" warning?..
18:17:35Yardanicocrem, fix it ? :)
18:17:50Yardanicoor if your program is single-threaded, you can probably ignore it (but not always)
18:18:19cremhttps://gist.github.com/mooskagh/363c5a895a692ea92c53f9dd1aac2ec1 what makes it not GC-safe?
18:18:39FromGitter<data-man> @crem: try use nimfix from compiler/nimfix
18:18:57Yardanicoehm, I don't have that warning
18:19:26YardanicoWhat is your Nim version? and can you show full compiler output?
18:20:09cremAh, I start to remember it.. It's only shown by NimLime (sublime plugin)
18:20:29Yardaniconimcheck doesn't show it either
18:20:45Yardanico(and that's probably the thing NimLime uses for checking for warnings/errors before compilation)
18:24:08cremTrying to figure out how to get any debug info from nimlime
18:24:28FromGitter<data-man> Yes, NimLime uses ```nim check```
18:24:51Yardanicocrem, so what's your nim version?
18:25:12Yardanicohttps://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:43cremhttps://gist.github.com/mooskagh/5ec0e2d28bef562caf62da3868460471 if that's is of any help.
18:27:46Yardanicodo you use any compiler switches?
18:27:48Yardanicolike --threads:on
18:28:47cremNope. 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:39Yardanicowell, 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:28cremhttps://gist.github.com/mooskagh/363c5a895a692ea92c53f9dd1aac2ec1 is the entire file. But I can try to minimize it further.
18:32:56cremafk for some tens of minutes
18:34:45*yglukhov joined #nim
18:38:13Yardanicowell, I really don't get any of these errors neither on devel or on 0.18.0 stable
18:38:17Yardanico*warnings
18:38:36Yardanicocan 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:47cremIt said it already existed, reinstall didn't change anything.
18:58:01PMunchIs there a problem with parsetoml?
18:58:43dom96What's the exact warning you're getting?
18:59:40cremhttps://gist.github.com/mooskagh/5ec0e2d28bef562caf62da3868460471
18:59:42cremconfig.nim(26, 19) Warning: not GC-safe: 'parseFile(GetConfigFileName())' [GcUnsafe]
18:59:57*nsf joined #nim
19:00:47dom96line 26? Your file isn't that long
19:01:43cremhttps://github.com/Varriount/NimLime/issues/89 seems to be related.
19:02:01PMunchOh, it's only shown by NimLime?
19:02:02cremI didn't copy the GPL header comment.
19:02:06cremYes!
19:02:43PMunchI ran the file with both --threads:on and without. Never got the warning, so I'm not sure if that is related..
19:02:58cremUpdated https://gist.github.com/mooskagh/363c5a895a692ea92c53f9dd1aac2ec1 to include comment on top, so that lines match.
19:04:06dom96Varriount mentions verbosity, but AFAIK this warning does not disappear with different verbosities
19:04:56cremIt would be interesting to find which command line exactly nimline runs..
19:05:22dom96it probably uses nimsuggest
19:09:01cremnim check --verbosity:2 a.nim
19:09:15cremreproduces for me
19:09:42dom96oh, same
19:11:26cremIs it something I should care about?.
19:12:17dom96I skimmed parsetoml and it seems fine
19:12:21dom96dunno what Nim's issue is
19:12:42dom96make an issue about it in the Nim repo if you can
19:14:35cremIn nim repo or parsetoml?
19:16:13dom96Nim repo
19:17:05*xkapastel joined #nim
19:18:05FromGitter<xmonader> Good evening
19:24:50*yglukhov joined #nim
19:25:06FromGitter<zetashift> hello!
19:26:35*yglukhov quit (Read error: Connection reset by peer)
19:27:10*yglukhov joined #nim
19:45:42enthus1astcan one confirm? https://gist.github.com/enthus1ast/14016b538c0433c76287f83ea2309aa9
19:50:20dom96confirm what?
19:51:05dom96oh hrm
19:51:05enthus1astthat this is a bug
19:52:09federico3how can I get the type of an object as a string?
19:52:17dom96looks like a bug indeed
19:52:42enthus1astok i'll file it
19:53:26dom96that'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:55FromDiscord<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:16FromDiscord<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:40FromGitter<tim-st> how can I open a file in the same directory? it just wont work^^
20:03:54enthus1astgetAppDir()
20:04:20FromGitter<tim-st> this wont print the correct directory
20:04:30FromGitter<tim-st> like three dirctories below
20:05:25enthus1ast"same directory" like your executable?
20:05:54FromGitter<tim-st> yes
20:07:17FromGitter<tim-st> thanks, it works, now the directory is appropriate
20:07:24enthus1astvscode? :)
20:07:26FromGitter<tim-st> with getAppDir()
20:07:30FromGitter<tim-st> yes
20:07:44enthus1astyeah it acts a little strange with its dir's
20:08:09FromGitter<tim-st> the most worst thing with vscode is compiling in terminal always throws IOError
20:08:26FromGitter<tim-st> I think it is a problem with nim though, because gcc never fails only nim
20:08:50enthus1astare you on windows?
20:08:58FromGitter<tim-st> yes
20:09:30FromGitter<tim-st> (I prefer arch linux, but they dont prefer supplying drivers that work like on windows)
20:09:39enthus1astit might be your antivirus or the windows indexing
20:09:41FromGitter<tim-st> the battery is only 30%
20:10:01enthus1astbut im just guessing :)
20:10:10FromGitter<tim-st> No, someone had the same problem, I think it is known
20:11:20*nyeaa joined #nim
20:12:18FromGitter<tim-st> maybe it would be a good feature to allow loading files from same folder automatically
20:14:17dom96tim-st: there is an issue in VS code's issue tracker for this
20:14:25dom96So I'm pretty sure it's a VS code bug
20:15:14enthus1astvscode is not chdir into the appDir folder, but it executes nim with absolute path
20:15:51FromGitter<tim-st> yes, makes sense, so it actually would work
20:16:19*FuntDobra quit (Ping timeout: 260 seconds)
20:16:42FromGitter<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:26FromGitter<tim-st> it also only happens in terminal, not in vscode "run plugin"
20:17:30dom96it happens to python too IIRC
20:17:34*cavariux joined #nim
20:18:02enthus1asti know nobody believes me, but i hat such an error in the past, it was windows indexing or/and a hacked machine
20:18:05enthus1asthad
20:18:30FromGitter<tim-st> hacked machine?
20:18:58FromGitter<tim-st> should I install clean version xD
20:19:17FromGitter<zetashift> that IOError happens outside of Nim and only on Windows :(
20:19:58FromGitter<tim-st> but nims throws it, and gcc doesnt, and also only in terminal version not in silent (non terminal) mode
20:20:24FromGitter<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:58FromDiscord<awr> seems as if you're not the only one
20:20:59FromDiscord<awr> https://forum.nim-lang.org/t/3367
20:21:16FromGitter<zetashift> https://github.com/Microsoft/vscode/issues/36630
20:22:14FromDiscord<awr> so it's probably VS Code's fault and not nim's
20:22:19*FuntDobra quit (Ping timeout: 256 seconds)
20:23:51FromGitter<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:26FromGitter<tim-st> ok, the solution in the forum also works for me 👍 ; thanks
20:38:20cremHuh.. 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:11Araqmuhaha, used Mem: 94.06MiB time: 2.622s
20:47:42Araqsaved 40MB and 0.5s of the runtime
20:48:18FromGitter<data-man> @Araq: Nice! When can we try it too? :-)
20:50:08Araqthe JSON file is 200MB on my disc, btw
20:50:20Araqit compresses it down to 94MB
20:53:50FromGitter<data-man> Does Windows 10 support extended masks? Like ```a[b-l]*.txt```
20:54:10*nsf quit (Quit: WeeChat 2.1)
20:54:53Araqwho gives a ..., use nimgrep with its --filenames switch
20:55:52FromGitter<data-man> I need this info for right description of ```pathMatches```. :)
20:56:13Araqwhy not work on important things? :-(
20:56:44enthus1astidk dom96 but makes this assert sence here? if a fresh client always has 0 as fd? net.nim:793
20:56:51FromGitter<data-man> It's important!
20:57:01Araqfor whom?
20:57:09*miran quit (Ping timeout: 260 seconds)
20:57:29Araqdir/*.ext covers 99% of all use cases and os.nim is about the common cases
20:57:29cavariuxHi 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:32FromGitter<data-man> For upcoming other PRs.
20:58:27Araqcavariux, Nimscript is used in Nimble (and NimEdit) but until recently the API was pretty bad
20:59:26FromGitter<data-man> @Araq: Please, give me the list of important things. In PM, if possible.
20:59:29Araqthat is mostly fixed now
21:01:11cavariuxyes, 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:37Araqwell the work is ongoing on making the compiler free of global variables
21:03:43Araqthen we can document it better
21:04:39Araqand ideally we also make the API adhere to NEP1...
21:05:25cavariuxsounds great, can't wait for 1.0 (some day) you have been doing a great work
21:06:49Araqwell the "front/high level API" is stable in devel
21:06:59*gangstacat quit (Quit: Ĝis!)
21:06:59Araqso you might want to give a try already
21:08:49cavariuxit would come handy if you have a link to the src or some of the starting doc you where talking about
21:13:48Araqhttps://github.com/nim-lang/Nim/blob/devel/compiler/nimeval.nim (already outdated...)
21:14:06Araqthe real question is what do you want to do
21:15:51cavariuxwell, 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:39Araqok, game engine
21:17:26Araqthat requires clean hooks for implementing Nim procs outside of the VM and a way to turn the AST into the native representations.
21:17:44Araqthat all exists, but needs to be cleaned up
21:19:17cavariuxthat is all in the compiler code, right?
21:19:36*xkapastel quit (Quit: Connection closed for inactivity)
21:20:26Araqyep
21:20:45Araqbut Nimble uses all these things too, so it's a good example
21:20:51Araqof how to use the API
21:21:21cavariuxgreat, I will take a look into both projects and learn more about how nim compiler works
21:21:23FromGitter<data-man> @cavariux: there is https://github.com/Serenitor/embeddedNimScript
21:21:48cavariuxif I get more specific questions I will be bugging dom96
21:21:50cavariuxthanks Araq
21:21:59Araqno, ask me please
21:22:39cavariuxoh well, thanks Araq meanwhile I will check the link data-man gave and reading both projects
21:22:56Araqit's likely outdated
21:23:05Araqthe compiler API changed quite a bit recently
21:23:53cavariuxif I find that I can fix something while checking it, will make a PR to try to update it
21:24:07Araqthat's the spirit, thanks
21:24:31cavariuxsure, 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:27FromDiscord<crem> dom96: Araq closed the issue that you told me to file: https://github.com/nim-lang/Nim/issues/7847
22:34:08FromDiscord<crem> ```
22:34:08FromDiscord<crem> <dom96> make an issue about it in the Nim repo if you can
22:34:08FromDiscord<crem> <crem> In nim repo or parsetoml?
22:34:08FromDiscord<crem> <dom96> Nim repo
22:34:08FromDiscord<crem> ```
22:34:53dom96I reopened i
22:34:54dom96t
22:35:17FromDiscord<crem> Thanks. :)
22:39:52*yglukhov joined #nim
22:44:29*yglukhov quit (Ping timeout: 260 seconds)
22:46:18Araqseriously? you reopened it? It's just a forward decl in parsetoml that lacks the .gcsafe annotation
22:46:24Araqmost likely.
22:51:27Araq# Forward declaration
22:51:27Araqproc parseValue(state: var ParserState): TomlValueRef
22:51:38Araqdidn'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:57FromDiscord<awr> i wonder if anyone had ever tried to get nim working with WinRT
22:54:22FromDiscord<awr> via microsoft's C++/CX compiler thing
22:55:01dom96Araq: So you don't even need a test case ;)
22:55:09dom96This is just needlessly confusing
22:55:18dom96Why is it hidden behind --verbosity:2?
22:55:30dom96Why are forward declarations even not gc-safe?
22:55:41Araqbecause consistency
22:56:12Araqprocs have every possible effect and then you restrict them
22:56:22Araqwe don't have a .notGcsafe annotation either.
22:56:52Araqonce we removed forward decls the analysis will get smarter anyway
22:57:05Araqbut for now, it's what it is and the spec explains it
22:57:41dom96But why --verbosity:2?
22:58:05Araqbecause --verbosity:2 means "be more chatty"
22:58:22Araqand 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:55FromGitter<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:28Araqvarriount: btw your 'cmp' implementation is wrong, you only check for the minlengths
23:32:39Araqso ABC is equal to ABCDEF
23:32:45Araq(common prefix)
23:41:41FromDiscord<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:13FromDiscord<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:42Araqisn't winRT with windows' API?
23:59:00*xkapastel joined #nim
23:59:29FromDiscord<awr> winRT is its own API