00:03:44 | AlexMax | OH |
00:03:54 | AlexMax | I think I traced it back to the for loop |
00:04:45 | AlexMax | I can't take an address of the iterated value in a for loop unless I make it mutable |
00:04:50 | AlexMax | that's....smart as heck |
00:05:04 | AlexMax | Preventing me from shooting my foot off |
00:05:19 | AlexMax | ...I think? |
00:05:43 | AlexMax | I guess the iterated value changes every loop, and holding the address to that memory location is dangerous? |
00:16:26 | * | ldlework quit (Remote host closed the connection) |
00:17:28 | * | ldlework joined #nim |
00:37:29 | * | a__b__m quit (Ping timeout: 255 seconds) |
01:05:33 | * | endragor joined #nim |
01:07:09 | * | pwntus quit (*.net *.split) |
01:07:09 | * | zacharycarter[m] quit (*.net *.split) |
01:07:09 | * | sg-james[m] quit (*.net *.split) |
01:07:15 | * | heinrich5991 quit (*.net *.split) |
01:07:30 | * | heinrich5991 joined #nim |
01:07:44 | * | pwntus joined #nim |
01:07:44 | * | zacharycarter[m] joined #nim |
01:07:44 | * | sg-james[m] joined #nim |
01:10:18 | * | endragor quit (Ping timeout: 268 seconds) |
01:11:09 | * | zachcarter quit (Read error: Connection reset by peer) |
01:11:21 | * | zachcarter joined #nim |
01:11:33 | FromGitter | <bung87> question:how to write a method that needs to be implemented by end developer? |
01:15:25 | AlexMax | you mean like an interface? |
01:15:52 | AlexMax | i've wondered that too |
01:16:27 | FromGitter | <bung87> yes , like python's method that may raise not implement error |
01:18:31 | AlexMax | yeah I don't know |
01:19:03 | AlexMax | Since nim only has single inheritance I'm not sure you can emulate interface objects like in C++ |
01:33:24 | Tanger | AlexMax, bung87: You can declare types inheritable with the {.inheritable.} pragma. You can also create methods with the {.base.} pragma, to indicate that they're a base class. |
01:34:07 | Tanger | If you put an assert into the base methods, you can force it to be implemented |
01:34:42 | FromGitter | <bung87> how to check it |
01:35:54 | Tanger | Check what, sorry? |
01:36:38 | FromGitter | <bung87> check it implemented |
01:37:37 | Tanger | bung87: https://github.com/Tangdongle/nimobserver/blob/master/src/nimobserver.nim https://github.com/Tangdongle/nimobserver/blob/master/tests/nimobserver_tests.nim |
01:38:01 | Tanger | The test file implementes onNotify for a subclass of the BaseObserver defined in the first link |
01:38:13 | Tanger | Porbably not the best example sorry, but the one that I can explain best ;) |
01:44:13 | FromGitter | <bung87> inheritable pragma included in nim 0.18.1? |
01:46:17 | * | Xe quit (*.net *.split) |
01:46:33 | FromGitter | <bung87> Error: attempting to call undeclared routine: 'inheritable' |
01:46:41 | * | syntonym[m] quit (*.net *.split) |
01:46:43 | * | stisa[m] quit (*.net *.split) |
01:46:44 | * | bitstoppa[m] quit (*.net *.split) |
01:46:48 | * | mr_yogurt quit (*.net *.split) |
01:47:11 | * | syntonym[m] joined #nim |
01:47:21 | * | bitstoppa[m] joined #nim |
01:47:31 | * | stisa[m] joined #nim |
01:47:31 | * | mr_yogurt joined #nim |
01:49:57 | * | vqrs quit (Ping timeout: 240 seconds) |
01:51:43 | * | vqrs joined #nim |
01:54:19 | FromGitter | <bung87> never mind, let read your code first. |
01:58:11 | Tanger | bung87: It should be fine with 0.18.0 |
02:00:34 | FromGitter | <bung87> ah ,I see , just overwrites `onNotify ` yeah it's what I need thank you! |
02:01:02 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
02:02:35 | * | Lord_Nightmare joined #nim |
02:03:29 | * | Xe joined #nim |
02:05:36 | Tanger | bung87: https://nim-lang.org/docs/manual.html#multi-methods |
02:05:46 | Tanger | Further reading for reference |
02:07:59 | FromGitter | <bung87> thanks! helpful, ah it just `quit "to override!"` when not overrited |
02:28:44 | * | syntonym[m] quit (*.net *.split) |
02:28:45 | * | msmorgan_ quit (*.net *.split) |
02:28:46 | * | macsek1911[m] quit (*.net *.split) |
02:28:47 | * | Miguelngel[m] quit (*.net *.split) |
02:28:48 | * | hogeland quit (*.net *.split) |
02:28:48 | * | thor77 quit (*.net *.split) |
02:28:49 | * | mal`` quit (*.net *.split) |
02:28:50 | * | voiceftp quit (*.net *.split) |
02:30:01 | * | syntonym[m] joined #nim |
02:30:01 | * | msmorgan_ joined #nim |
02:30:01 | * | macsek1911[m] joined #nim |
02:30:01 | * | Miguelngel[m] joined #nim |
02:30:01 | * | hogeland joined #nim |
02:30:01 | * | thor77 joined #nim |
02:30:01 | * | mal`` joined #nim |
02:30:01 | * | voiceftp joined #nim |
02:30:57 | * | m712 quit (Ping timeout: 240 seconds) |
02:31:56 | * | Widdershins quit (*.net *.split) |
02:31:58 | * | couven92 quit (*.net *.split) |
02:32:00 | * | EastByte quit (*.net *.split) |
02:32:00 | * | oprypin quit (*.net *.split) |
02:32:00 | * | beatmox quit (*.net *.split) |
02:32:00 | * | GaveUp quit (*.net *.split) |
02:32:00 | * | Death916 quit (*.net *.split) |
02:32:00 | * | avsej quit (*.net *.split) |
02:32:03 | * | craigger quit (*.net *.split) |
02:32:04 | * | ven473 quit (*.net *.split) |
02:32:05 | * | awal quit (*.net *.split) |
02:32:14 | * | avsej joined #nim |
02:32:19 | * | EastByte joined #nim |
02:32:20 | * | craigger joined #nim |
02:32:31 | * | GaveUp joined #nim |
02:32:31 | * | beatmox joined #nim |
02:32:34 | * | Widdershins joined #nim |
02:32:37 | * | oprypin joined #nim |
02:33:07 | * | awal joined #nim |
02:34:15 | * | avsej is now known as Guest46449 |
02:41:44 | * | awal is now known as Guest98929 |
02:42:21 | * | Guest46449 quit (Changing host) |
02:42:21 | * | Guest46449 joined #nim |
02:44:50 | * | nathancahill joined #nim |
02:49:18 | * | Death916 joined #nim |
02:49:34 | * | nathancahill quit (Ping timeout: 272 seconds) |
02:49:57 | * | m712 joined #nim |
02:50:04 | * | couven92 joined #nim |
02:50:21 | * | m712 is now known as Guest78962 |
02:54:15 | FromGitter | <gogolxdong> How can I open mysql database in multi Channel[TMsg] task? |
02:54:50 | * | yuken joined #nim |
02:55:50 | yuken | Has anyone - if it's possible - made an OS in Nim yet? Not a Windows competitor obviously, but something that boots, has file management and can run some built-in programs (such as cd/rm/mkdir equivalents)? |
02:56:19 | FromGitter | <gogolxdong> https://github.com/dom96/nimkernel |
03:00:14 | yuken | Nice. |
03:00:34 | * | ldlework quit (Quit: co'o ro do) |
03:00:39 | FromGitter | <gogolxdong> build it up from ground. |
03:05:12 | * | dddddd quit (Remote host closed the connection) |
03:05:50 | * | bitstoppa[m] quit (*.net *.split) |
03:05:50 | * | arecaceae quit (*.net *.split) |
03:05:52 | * | thomasross quit (*.net *.split) |
03:05:52 | * | dom96 quit (*.net *.split) |
03:05:52 | * | Amun_Ra quit (*.net *.split) |
03:05:53 | * | shodan45 quit (*.net *.split) |
03:05:53 | * | leorize quit (*.net *.split) |
03:05:53 | * | shadowbane quit (*.net *.split) |
03:05:53 | * | qwertfisch quit (*.net *.split) |
03:05:53 | * | Rush quit (*.net *.split) |
03:05:53 | * | livcd_ quit (*.net *.split) |
03:05:54 | * | Connor[m]1 quit (*.net *.split) |
03:05:55 | * | JStoker quit (*.net *.split) |
03:05:55 | * | subsetpark quit (*.net *.split) |
03:05:58 | * | mr_yogurt quit (*.net *.split) |
03:05:59 | * | heinrich5991 quit (*.net *.split) |
03:05:59 | * | Jesin quit (*.net *.split) |
03:05:59 | * | captainkraft quit (*.net *.split) |
03:05:59 | * | odc quit (*.net *.split) |
03:05:59 | * | Entropic quit (*.net *.split) |
03:06:01 | * | shashlick quit (*.net *.split) |
03:06:01 | * | Araq quit (*.net *.split) |
03:06:02 | * | nathanj quit (*.net *.split) |
03:06:03 | * | Calinou quit (*.net *.split) |
03:06:03 | * | SunDwarf quit (*.net *.split) |
03:06:04 | * | zielmicha[m] quit (*.net *.split) |
03:06:04 | * | TheManiac[m] quit (*.net *.split) |
03:06:36 | * | bitstoppa[m] joined #nim |
03:06:36 | * | arecaceae joined #nim |
03:06:36 | * | thomasross joined #nim |
03:06:36 | * | dom96 joined #nim |
03:06:36 | * | Amun_Ra joined #nim |
03:06:36 | * | shodan45 joined #nim |
03:06:36 | * | leorize joined #nim |
03:06:36 | * | shadowbane joined #nim |
03:06:36 | * | qwertfisch joined #nim |
03:06:36 | * | Rush joined #nim |
03:06:36 | * | livcd_ joined #nim |
03:06:36 | * | Connor[m]1 joined #nim |
03:06:36 | * | JStoker joined #nim |
03:06:36 | * | subsetpark joined #nim |
03:06:39 | * | ldlework joined #nim |
03:07:04 | * | thomasross quit (Max SendQ exceeded) |
03:07:31 | * | thomasross joined #nim |
03:07:57 | * | mr_yogurt joined #nim |
03:07:57 | * | heinrich5991 joined #nim |
03:07:57 | * | Jesin joined #nim |
03:07:57 | * | captainkraft joined #nim |
03:07:57 | * | odc joined #nim |
03:07:57 | * | Entropic joined #nim |
03:07:57 | * | shashlick joined #nim |
03:07:57 | * | Araq joined #nim |
03:07:57 | * | nathanj joined #nim |
03:07:57 | * | SunDwarf joined #nim |
03:07:57 | * | Calinou joined #nim |
03:07:57 | * | zielmicha[m] joined #nim |
03:07:57 | * | TheManiac[m] joined #nim |
03:08:01 | * | shashlick quit (Excess Flood) |
03:08:58 | * | thomasross quit (Max SendQ exceeded) |
03:09:26 | * | thomasross joined #nim |
03:09:58 | * | Cthalupa quit (Ping timeout: 260 seconds) |
03:10:44 | * | Cthalupa joined #nim |
03:10:56 | * | thomasross quit (Max SendQ exceeded) |
03:11:24 | * | thomasross joined #nim |
03:12:54 | * | thomasross quit (Max SendQ exceeded) |
03:13:22 | * | thomasross joined #nim |
03:14:26 | * | kapil____ joined #nim |
03:14:39 | * | thomasross quit (Max SendQ exceeded) |
03:15:11 | * | thomasross joined #nim |
03:21:57 | * | yuken quit (Ping timeout: 240 seconds) |
03:25:24 | * | cornfeedhobo quit (Quit: ZNC - https://znc.in) |
03:32:46 | FromGitter | <gogolxdong> As I access mysql database from multi channel task , got ⏎ `[Warning] Aborted connection 39142 to db: 'cmp' user: 'root' host: 'localhost' (Got an error writing communication packets)` |
03:39:25 | * | NamPNQ joined #nim |
03:40:44 | Tanger | gogolxdong: How are you storing your connection? Is it a global connection that's shared between threads? |
03:41:32 | * | cornfeedhobo joined #nim |
03:42:49 | FromGitter | <gogolxdong> ```type ⏎ TaskType = ref object ⏎ db : DbConn ⏎ cfg: JsonTree``` [https://gitter.im/nim-lang/Nim?at=5b7f7eb94be56c591889e32e] |
03:43:11 | FromGitter | <gogolxdong> pass task into thread handler. |
03:44:28 | FromGitter | <gogolxdong> but due to DbConn is ptr effectively, threads race one single connection. |
03:45:02 | FromGitter | <gogolxdong> probably we need a thread pool version of mysql. |
03:45:47 | FromGitter | <gogolxdong> any idea? |
03:46:50 | * | nathancahill joined #nim |
03:47:10 | Tanger | You could try and implement a lock/guard for it, so your threads have to block on the DB being ready? |
03:48:05 | Tanger | Oooh, or use multiple connections? Not sure how to implement that though gogolxdong: https://forum.nim-lang.org/t/3660 |
03:48:32 | Tanger | Actually, even better, maybe take a look at this package? https://github.com/wiml/nim-asyncmysql |
03:49:09 | FromGitter | <gogolxdong> It doesn't work. |
03:49:51 | FromGitter | <gogolxdong> We tried half a year ago. |
03:50:10 | Tanger | Ah, right |
03:50:11 | Tanger | Lame |
03:50:35 | FromGitter | <gogolxdong> and seems undead. |
03:53:31 | FromGitter | <gogolxdong> spawn can access but was suggested not to use. |
03:54:10 | * | nathancahill quit (Ping timeout: 272 seconds) |
03:56:01 | FromGitter | <gogolxdong> problem is spawn doesn't work with --gc:regions which cause our production machines runs out of memory. |
04:11:09 | * | ven473 joined #nim |
04:11:54 | * | stefanos82 joined #nim |
04:32:44 | * | endragor joined #nim |
05:04:34 | * | nathancahill joined #nim |
05:06:45 | * | smidlers0 joined #nim |
05:08:18 | * | smidlers0 quit (Remote host closed the connection) |
05:11:35 | * | nathancahill quit (Quit: nathancahill) |
05:17:36 | * | nathancahill joined #nim |
05:25:39 | * | leorize quit (Ping timeout: 252 seconds) |
05:29:04 | * | nathancahill quit (Quit: nathancahill) |
05:29:05 | * | nsf joined #nim |
05:31:15 | FromGitter | <gogolxdong> Can secp256k1 be used for encryption and decryption? |
05:40:14 | * | nathancahill joined #nim |
05:40:41 | * | Guest98929 is now known as awal |
05:47:27 | * | zachcarter quit (Ping timeout: 240 seconds) |
05:53:04 | * | leorize joined #nim |
05:56:21 | * | zachcarter joined #nim |
06:17:15 | * | kapil____ quit (Quit: Connection closed for inactivity) |
06:19:42 | * | NamPNQ quit (Remote host closed the connection) |
06:23:16 | * | nathancahill quit (Quit: nathancahill) |
06:38:31 | FromGitter | <mratsim> @gogolxdong what do you mean? |
06:40:25 | FromGitter | <mratsim> You can use ECIES to encrypt/decrypt data with any elliptic curve |
06:40:33 | FromGitter | <gogolxdong> to encrypt message and decrypt. |
06:41:16 | FromGitter | <mratsim> doesn’t seem like the bitcoin-core libsecp256k1 expose ECIES though |
06:42:55 | FromGitter | <gogolxdong> I want to encrypt and decrypt message , how do I do? |
06:43:39 | FromGitter | <gogolxdong> have nim-secp2561k and nodejs secp2561k |
06:44:21 | FromGitter | <mratsim> nim-secp256k1 is based on bitcoin implementation which does not implement ECIES primitives, somthing like https://github.com/status-im/nim-milagro-crypto/blob/master/src/milagro_crypto/generated/ecdh_BLS381.h#L84-L116 |
06:46:07 | FromGitter | <gogolxdong> Does this mean encryption and decryption with ECC is unavailable for now? |
06:46:22 | FromGitter | <gogolxdong> Then I have to find another way. |
06:47:11 | FromGitter | <mratsim> In nim, you will only have the nim-milagro-crypto lib I linked |
06:47:50 | FromGitter | <mratsim> for now there is only BLS12-381 supported but secp256k1 is also available in the original library I’m wrapping. |
06:49:53 | FromGitter | <mratsim> you might find this paper interesting btw: https://blog.coinfabrik.com/wp-content/uploads/2016/06/some_comments_on_the_security_of_ecies_with_secp256k1.pdf |
06:50:51 | FromGitter | <mratsim> @gogolxdong maybe try that for ECIES using secp256k1: https://github.com/bitchan/eccrypto |
06:50:58 | FromGitter | <mratsim> it’s Node though |
06:51:52 | FromGitter | <mratsim> and implemented manually, so I’m not sure the code is audited |
06:55:07 | FromGitter | <Bennyelg> So, does anyone can help me implement a Type which get a value of an undefined proc which will be later execute? I tried various of things but I couldnt get it |
06:58:27 | FromGitter | <gogolxdong> @mratsim thanks for guiding. |
06:59:15 | FromGitter | <mratsim> @Bennyelg https://github.com/mratsim/nim-rmad/blob/master/src/autograd.nim#L41-L53 |
07:00:42 | FromGitter | <mratsim> Alternatively look here: https://github.com/status-im/nimbus/wiki/Interpreter-optimization-resources |
07:01:11 | FromGitter | <mratsim> For the full code for ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b7fad37c53ee54c1895ff5f] |
07:01:20 | FromGitter | <gogolxdong> Is it out of security aspect of secp256k1 when you said don't like secp256k1 expose to ECIES? |
07:01:53 | FromGitter | <mratsim> no, it’s because bitcoin only needs to sign messages, it doesn’t need to encrypt them |
07:02:13 | FromGitter | <mratsim> so unneeded —> not implemented :P |
07:02:57 | Tanger | Bennyelg: Something like this? https://pastebin.com/GNckt9c4 |
07:03:30 | Tanger | So you define the proc signature as a property of the TestType object, then when you initialise the object, you set the proc to that instance |
07:03:31 | FromGitter | <gogolxdong> ok, misread . |
07:03:32 | FromGitter | <mratsim> @Bennyelg those 2 examples give you both the closure and the nimcall way, nimcall is faster (it’s a pointer), closure is more flexible because you can “save” data/environment that will be used in the future call |
07:04:21 | FromGitter | <Bennyelg> yes something like that but with an unkwon signature every time. |
07:04:42 | FromGitter | <mratsim> Nim is a static language, signature must be known. |
07:04:57 | FromGitter | <Bennyelg> yea i know |
07:05:06 | FromGitter | <mratsim> but if you use nimcklls, you can cheat by only storing proc () and casting to the signature you want later |
07:05:15 | Tanger | Bennyelg: You might be able to do it if you proc accepts a pointer |
07:05:21 | FromGitter | <mratsim> but it must be known at compile-time or at least dispatched via a case statement |
07:06:08 | FromGitter | <mratsim> at this point it might be easier to use methods instead of reimplementing dynamic dispatch |
07:06:21 | FromGitter | <mratsim> or use templates, because they accept untyped proc |
07:06:26 | FromGitter | <Bennyelg> yea |
07:06:31 | FromGitter | <Bennyelg> thanks |
07:07:12 | FromGitter | <mratsim> This is an example of template accepting untyped proc with different signatures: https://github.com/status-im/nim-ethash/blob/master/src/proof_of_work.nim#L147-L226 |
07:08:22 | FromGitter | <mratsim> the file is self contained if you’re curious about: calc_data_set_item(cache, p) |
07:08:40 | FromGitter | <Bennyelg> yea |
07:09:28 | * | dadabidet joined #nim |
07:09:38 | FromGitter | <mratsim> the Python spec is here it’s a bit shorter because they cheat with dynamic dispatch: https://github.com/ethereum/wiki/wiki/Ethash#main-loop |
07:10:32 | FromGitter | <mratsim> it’s probably similar to what you are trying to do: ⏎ ⏎ hashimoto(header, nonce, full_size, lambda x: calc_dataset_item(cache, x)) ⏎ ⏎ and ... [https://gitter.im/nim-lang/Nim?at=5b7faf6894f8164c17914cea] |
07:21:38 | FromGitter | <Bennyelg> what does it means when I get the message: ⏎ "but expected one of: ⏎ proc (): Mirror{.closure.}" |
07:23:42 | * | PMunch joined #nim |
07:24:02 | FromGitter | <Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b7fb292e5b40332abef0c2c] |
07:24:50 | FromGitter | <mratsim> tag everything {.nimcall.} or {.closure.} both the type and the parameter passed |
07:25:14 | FromGitter | <mratsim> inference for procvar is not working properly |
07:25:48 | FromGitter | <mratsim> if you can use nimcall (meaning result depends only on arguments) |
07:26:37 | FromGitter | <Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b7fb32d4be56c59188b01ee] |
07:30:10 | FromGitter | <mratsim> You should report a bug >_> ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b7fb402fd3c641b0600e5f6] |
07:30:51 | FromGitter | <Bennyelg> :/ |
07:32:27 | FromGitter | <Bennyelg> I must understand deeper the concept of all those pragmas and how & when to use |
07:34:17 | FromGitter | <mratsim> it should not be needed |
07:34:26 | FromGitter | <mratsim> but the semantic check is broken here |
07:36:13 | FromGitter | <mratsim> oh no |
07:36:24 | FromGitter | <mratsim> you name your template the same name as a field |
07:36:35 | FromGitter | <Bennyelg> :| |
07:36:50 | FromGitter | <mratsim> if you rename it works |
07:38:14 | FromGitter | <Bennyelg> what a rookie mistake |
07:38:29 | FromGitter | <Bennyelg> I also exclude all the {.nimcall.} |
07:38:32 | FromGitter | <Bennyelg> no need them |
07:41:31 | FromGitter | <Bennyelg> anyway to get the procname ? |
07:41:49 | FromGitter | <Bennyelg> if I want to print details of what is going to be run |
07:42:31 | * | floppydh joined #nim |
07:45:59 | FromGitter | <mratsim> you can use a macro at the moment, otherwise: https://github.com/nim-lang/Nim/issues/8212 |
07:46:46 | FromGitter | <mratsim> `macro printProcName(x: untyped): untyped = echo x.astToStr` or maybe even `echo $x` |
07:47:27 | FromGitter | <mratsim> you can add x.expectKind(nnkProc) if you want |
07:49:52 | FromGitter | <Bennyelg> thanks, I'll play with that |
07:51:36 | FromGitter | <Bennyelg> when Im using the macro with x.astToStr ⏎ Im getting ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b7fb90860f9ee7aa4841c66] |
07:54:28 | FromGitter | <Bennyelg> macro printProcName(x: untyped): untyped = astToStr(x) ⏎ ⏎ will return x as the name of the proc |
07:56:05 | FromGitter | <mratsim> maybe you need to add `result = newStmtList().newTree(nnkDiscard)` so there is at least a “result” |
07:58:11 | FromGitter | <Bennyelg> why i cant do something like this ⏎ macro printProcName(x: untyped): string = ⏎ dumpTree: ⏎ ⏎ ```x``` [https://gitter.im/nim-lang/Nim?at=5b7fba92e5b40332abef3c90] |
07:59:42 | FromGitter | <mratsim> always use untyped as macro result, that will solve a lot of issue, and dump tree is similar to echo, you can’t do `let foo = echo “something”` that’s void. |
08:04:41 | * | gmpreussner joined #nim |
08:04:59 | FromGitter | <Bennyelg> how can I travel on the ast |
08:05:09 | FromGitter | <mratsim> take a rocket :P |
08:05:12 | FromGitter | <Bennyelg> StmtList ⏎ Ident "echoMax" |
08:05:20 | * | gmpreussner_ quit (Ping timeout: 256 seconds) |
08:05:21 | FromGitter | <Bennyelg> heheh |
08:06:03 | FromGitter | <mratsim> echo foo\[1\] # echoMax |
08:06:15 | FromGitter | <mratsim> with a $ |
08:06:25 | FromGitter | <mratsim> you just use indexing like an array |
08:06:57 | FromGitter | <Bennyelg> apparently no. ⏎ I tired it. |
08:07:11 | FromGitter | <Bennyelg> index out of bounds |
08:07:50 | FromGitter | <mratsim> oh because those are not at the same level |
08:08:02 | FromGitter | <mratsim> there is no indent on your message |
08:08:21 | FromGitter | <Bennyelg> yea |
08:08:25 | FromGitter | <mratsim> so it’s \[0\] |
08:08:53 | FromGitter | <Bennyelg> no. the same error |
08:09:07 | FromGitter | <Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b7fbd23cff55e561753000f] |
08:10:36 | * | TheLemonMan joined #nim |
08:10:49 | FromGitter | <Araq> `echoMax` is an atom, it doesn't have a 0th element inside |
08:11:19 | FromGitter | <Bennyelg> just wanted to echo the procName :/ |
08:11:21 | FromGitter | <mratsim> ```code paste, see link``` ⏎ ⏎ @Bennyelg, really use untyped return value for macros [https://gitter.im/nim-lang/Nim?at=5b7fbda9d8d36815e581ad23] |
08:11:38 | * | Guest78962 quit (Changing host) |
08:11:38 | * | Guest78962 joined #nim |
08:11:47 | FromGitter | <Bennyelg> lib/system.nim(2807, 7) Error: unhandled exception: false Invalid node kind nnkDotExpr for macros.`$` |
08:12:30 | FromGitter | <Bennyelg> usage ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b7fbdeef86b741b05b6b43a] |
08:13:59 | * | Guest78962 is now known as m712 |
08:17:55 | FromGitter | <Bennyelg> the problem is its not showing the variable value which is proc |
08:18:54 | FromGitter | <mratsim> the snippet I posted showed how to implement getName |
08:27:17 | FromGitter | <Bennyelg> what snippet |
08:27:50 | TheLemonMan | hmm, are custom pragmas on skVar supposed to be working? |
08:32:35 | * | abm joined #nim |
08:49:00 | FromGitter | <Araq> I'm not sure :-) |
08:57:34 | TheLemonMan | I believe we're just throwing away the pragma AST in that case so I guess they aren't :) |
08:57:54 | TheLemonMan | I'd just restrict custom pragmas to {skField,skProc,skFunc,skType} and call it a day |
09:00:02 | * | SenasOzys quit (Remote host closed the connection) |
09:00:37 | * | leorize quit (Ping timeout: 268 seconds) |
09:04:42 | * | SenasOzys joined #nim |
09:05:38 | FromGitter | <Araq> 1) skConverter, skMethod |
09:06:16 | FromGitter | <Araq> that's the problem with a big language, compiler dev's keep forgetting about existing features... |
09:07:51 | FromGitter | <timotheecour> this is a bug, correct? https://github.com/nim-lang/Nim/issues/8759 `a => counter+=1` parsed as `(a => counter) += 1` |
09:08:11 | FromGitter | <Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b7fcafa38a12915e4ec14c3] |
09:10:08 | FromGitter | <Araq> @timotheecour violations of the spec are bugs, yes. |
09:12:31 | * | byte512 joined #nim |
09:13:18 | FromGitter | <gogolxdong> How to write this regex to re ? ⏎ \\".*? |
09:13:27 | FromGitter | <gogolxdong> `\\".*?` |
09:13:43 | FromGitter | <Araq> #violates spec: `^` should have higher precedence than += (regardless of `^` being right-associative) |
09:14:05 | FromGitter | <Araq> ^ I don't think that's the case, all assignment-like operators have the same precedence |
09:17:37 | FromGitter | <mratsim> @Benny, this snippet: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b7fcd31c53ee54c1896c03e] |
09:18:15 | FromGitter | <mratsim> @Bennyelg ^, sorry mistyped your name |
09:19:08 | FromGitter | <Bennyelg> @mratsim the problem is when assigning it to special type ⏎ apparently the code above i published which assigning function to a type variable is crying because it has not initialize or something |
09:20:16 | FromGitter | <Bennyelg> ```code paste, see link``` ⏎ ⏎ is not assigning ⏎ ⏎ the function properly i guess [https://gitter.im/nim-lang/Nim?at=5b7fcdd094f8164c1791fa3f] |
09:21:26 | FromGitter | <mratsim> use untyped instead of typed for fun maybe? |
09:23:57 | FromGitter | <Bennyelg> nop. |
09:24:07 | FromGitter | <Bennyelg> something related to the Mirror intialization |
09:24:31 | FromGitter | <Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b7fcecef5402f32aa84ae97] |
09:26:13 | FromGitter | <Bennyelg> The question is Why I can't initialize variable of some Type after when it's proc |
09:28:29 | * | ftsf joined #nim |
09:28:56 | * | Vladar joined #nim |
09:29:06 | FromGitter | <Bennyelg> as I suspected. ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ not assign the fun to the actionBeforeMove variable [https://gitter.im/nim-lang/Nim?at=5b7fcfe2d8d36815e58216db] |
09:30:31 | FromGitter | <Bennyelg> change it to ⏎ ⏎ `````` [https://gitter.im/nim-lang/Nim?at=5b7fd0371d3a5711b68f7b6e] |
09:31:22 | FromGitter | <Bennyelg> ```proc beforeMove*(m: Mirror, fun: proc ()): Mirror = ⏎ m.actionBeforeMove = fun ⏎ m``` ⏎ ⏎ did the trick since the proc will always return void and wil always be without params [https://gitter.im/nim-lang/Nim?at=5b7fd069d8d36815e5821954] |
09:38:34 | FromGitter | <timotheecour> @araq, any chance we can merge https://github.com/nim-lang/Nim/pull/8682 ? it’s green |
09:46:44 | * | gibril_ quit (Remote host closed the connection) |
09:48:14 | FromGitter | <Bennyelg> how can I get the untyped name I passed and not the function name: ⏎ for example: ⏎ template(c: untyped) ⏎ ⏎ instead of getting c as the function name i want the actual function name [https://gitter.im/nim-lang/Nim?at=5b7fd45e4be56c59188bd0a2] |
09:55:54 | FromGitter | <mratsim> but the code I posted doesn’t work? |
09:56:33 | FromGitter | <mratsim> if fun is untyped, and you pass a proc $fun should give the the ident, i.e. the proc name |
10:19:33 | * | abm quit (Ping timeout: 268 seconds) |
10:20:30 | FromGitter | <gogolxdong> How to have httpserver.server on TLS? |
10:23:24 | * | seni joined #nim |
10:23:31 | FromGitter | <gogolxdong> backend cannot get requests after setting https. |
10:24:31 | * | krux02 joined #nim |
10:30:22 | euantor | Put it behind Nginx or something as a revers proxy and let it handle TLS |
10:31:16 | * | ftsf quit (Ping timeout: 268 seconds) |
10:52:29 | FromGitter | <gogolxdong> Does nim backend need to do anything? |
10:58:45 | PMunch | Nope |
10:58:53 | PMunch | I set up a reverse proxy with Apache |
10:59:29 | PMunch | It handles the whole SSL/TLS thing and httserver via Jester only serves it's content locally to Apache |
10:59:30 | FromGitter | <gogolxdong> we use Golang Echo framework, is it an issue? |
11:00:21 | FromGitter | <Bennyelg> @mratsim not it's not working. its working only if you pass directly the proc name. |
11:00:37 | PMunch | Shouldn't be, you can try something like this to set it up: https://echo.labstack.com/cookbook/reverse-proxy |
11:00:47 | FromGitter | <mratsim> ah, you need it for the field |
11:01:03 | FromGitter | <mratsim> but after attached to the field it becomes an anonymous proc and it’s discarded |
11:01:18 | FromGitter | <Bennyelg> :/ |
11:01:23 | FromGitter | <mratsim> the only thing you can print is the C name I think with emit |
11:01:44 | FromGitter | <mratsim> it’s in the RFC I linked at the beginning of the day by timotheecour |
11:04:35 | FromGitter | <gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b7fe64360f9ee7aa4851715] |
11:05:21 | FromGitter | <gogolxdong> It has a middleware to redirect http request to https, shouldn't this work? |
11:16:55 | * | SenasOzys quit (Ping timeout: 252 seconds) |
11:21:25 | * | SenasOzys joined #nim |
11:22:08 | * | narimiran joined #nim |
11:24:26 | * | narimiran left #nim (#nim) |
11:24:59 | TheLemonMan | hmm, does -d:release imply -O3 ? |
11:32:12 | dom96 | Araq: Can this be reverted? https://github.com/nim-lang/Nim/commit/effe2fd812b6f60f27c9c2396c8ec21ee65e19f1#comments |
11:32:33 | dom96 | I did fix it in this PR https://github.com/nim-lang/Nim/pull/8750 |
11:37:31 | FromGitter | <bung87> @gogolxdong you go program does which can be simply by using nginx. |
11:40:00 | PMunch | TheLemonMan, use --listCmd to see what Nim passes to your compiler |
11:54:39 | FromGitter | <gogolxdong> yes, I am aware of that, can trying, but still have reason to get it right. |
11:57:00 | FromGitter | <gogolxdong> don't want to introduce more tools, since we have introduced Golang stack. |
12:01:58 | FromGitter | <mratsim> @TheLemonMan, yes |
12:02:07 | FromGitter | <mratsim> it’s defined in the nim.cfg iirc |
12:03:54 | * | leorize joined #nim |
12:10:37 | FromGitter | <gogolxdong> want to clarify one question, is it necessary to use Nginx or Apach for https server? Is web framework enough for most occasion? |
12:11:32 | PMunch | gogolxdong, as it says in the documentation for httpserver, it is not properly securied and should always be run behind a reverse proxy in a production environment |
12:11:53 | PMunch | It doesn't require Apache or Nginx, but you should always run it behind a reverse proxy, https or not |
12:27:30 | FromGitter | <gogolxdong> yes, read the comment, helpful. |
12:34:55 | FromGitter | <mratsim> is there a hidden reply? It’s a the top of the forum for some reason: https://forum.nim-lang.org/t/1207 |
12:35:43 | dom96 | yep |
12:35:46 | dom96 | Moderated user replied |
12:35:46 | dom96 | fixed |
12:38:48 | dom96 | mratsim: Wanna become a mod? :) |
12:39:50 | FromGitter | <mratsim> if it’s just that yeah sure :P |
12:49:59 | dom96 | mratsim: okay, you're now a mod. |
12:50:16 | dom96 | Should be fairly self explanatory how to change people's status |
12:55:42 | * | captainkraft quit (Ping timeout: 264 seconds) |
12:59:29 | * | noonien joined #nim |
13:01:22 | stefanos82 | dom96: how much traffic does the forum get? is it on a cloud service, like Google platform or a VPS on DigitalOcean or AWS? |
13:06:30 | euantor | It's all on DigitalOcean I believe. They gave the project a bunch of credits not too long ago |
13:15:42 | FromGitter | <DanielSokil> @gogolxdong You can also use Caddy |
13:17:41 | dom96 | Yep, Digital Ocean |
13:20:00 | stefanos82 | dom96: I just registered and haven't received any email yet |
13:20:06 | stefanos82 | is everything alright? |
13:20:10 | FromGitter | <DanielSokil> @gogolxdong https://github.com/caddyserver/examples/tree/master/httpsproxy |
13:20:11 | dom96 | Check spam folder? |
13:20:44 | stefanos82 | dom96: nothing, it's empty |
13:21:17 | FromGitter | <DanielSokil> @gogolxdong https://whatbox.ca/wiki/Caddy_Server_Reverse_Proxy |
13:21:19 | dom96 | I can activate your account for you |
13:21:26 | stefanos82 | cool |
13:21:35 | dom96 | what's your nick? |
13:21:37 | stefanos82 | PM me for further details dom96 |
13:29:26 | * | kapil____ joined #nim |
13:30:12 | stefanos82 | I wonder how much traffic the forum can handle, since it's implemented in Nim. Do we have any type of graphs or benchmarks somewhere? |
13:35:51 | euantor | I would imagine the only bottleneck would be SQLite really, and it's pretty fast |
13:37:28 | * | dddddd joined #nim |
13:38:19 | FromGitter | <Araq> dom96: huh? https://github.com/nim-lang/Nim/pull/8750 used to be red and that suggested to me the test is still flaky |
13:38:50 | dom96 | Araq: I was still working on it |
13:39:29 | TheLemonMan | mratsim, I've just finished implementing cycle counting (and colors!) |
13:39:35 | * | captainkraft joined #nim |
13:40:05 | FromGitter | <mratsim> cool! |
13:40:58 | TheLemonMan | here's the sample output https://github.com/LemonBoy/criterion.nim#example |
13:42:28 | * | ng0 quit (Read error: Connection reset by peer) |
13:45:50 | stefanos82 | euantor: SQLite could be hardly a bottleneck if it gets configured and used properly. |
13:45:59 | stefanos82 | especially with its latest features, it can work wonders |
13:48:25 | FromGitter | <DanielSokil> @dom96 Any Idea About? https://github.com/dom96/jester/issues/156 |
13:49:36 | dom96 | Should be a simple fix |
13:49:59 | dom96 | Araq: In any case, it should be solid now. |
13:50:17 | dom96 | Araq: I'll rebase and remove the disabled line you introduced |
13:50:53 | FromGitter | <Araq> k |
13:51:07 | euantor | @stefanos82: Unfortunately the db_sqlite module in the Nim stdlib doesn't expose too many options |
13:51:25 | stefanos82 | euantor: eventually it will ;) |
13:51:58 | euantor | Yep, I've been planning on making some PRs to improve it to use prepared statements and expose some more options |
13:52:19 | euantor | Ideally there should be a connection pool too, not a single connection - that's what I think would bottleneck the forum right now |
13:52:31 | euantor | https://github.com/nim-lang/Nim/blob/master/lib/impure/db_sqlite.nim#L305 |
13:53:12 | euantor | And this is what I really want to fix: https://github.com/nim-lang/Nim/blob/master/lib/impure/db_sqlite.nim#L115 |
13:54:53 | stefanos82 | isn't WAL enabled? |
13:56:00 | dom96 | the forum is running single-threaded and in debug mode |
13:56:07 | dom96 | And I've never seen any speed problems :P |
13:56:37 | stefanos82 | dom96: why gravatar though? why not a default image for all new users and let them upload their own image? |
13:57:52 | dom96 | Isn't it obvious? |
13:58:10 | TheLemonMan | to add some delay? |
13:58:13 | stefanos82 | but I don't have a wordpress.com account nor I want to have one |
14:02:13 | livcd_ | dom96: why not to try to run in multithreaded with something else than sqlite maybe that would also drive the improvement for those libs |
14:02:24 | stefanos82 | dom96: I have resized an image of mine to 150x113 and it's only 12.7kb which could be easily uploaded as my profile image. |
14:02:41 | stefanos82 | I don't think it would have been much of a fuss to have such standard behavior |
14:02:42 | dom96 | stefanos82: PRs welcome :P |
14:03:09 | stefanos82 | dom96: when I will figure out all the details from the documentation, I will PR lots of things, have no worries |
14:03:25 | dom96 | FWIW gravatar is far more convenient |
14:03:28 | dom96 | and much easier to implement |
14:03:50 | dom96 | I'd rather every website used gravatar so that I don't have to update my avatar everywhere |
14:05:02 | stefanos82 | so, in other words we are forced to use a service we don't want to use? |
14:05:45 | euantor | (and if you don't want to reveal you email publicly, don't use it on the forums) |
14:06:06 | euantor | I can't remember if signing up to the forum needs an email addres or not |
14:07:41 | stefanos82 | my email is not visible |
14:07:55 | stefanos82 | no one is by default I would say |
14:08:06 | * | ng0 joined #nim |
14:09:31 | euantor | If you use Gravatar, it is. The email is passed as an MD5 hash in the URL for Gravatar images |
14:09:43 | stefanos82 | ah you meant the gravatar? |
14:09:44 | stefanos82 | I see |
14:11:22 | euantor | yeah |
14:12:19 | * | PMunch quit (Quit: Leaving) |
14:14:32 | * | endragor quit (Remote host closed the connection) |
14:15:01 | * | endragor joined #nim |
14:16:29 | FromGitter | <mratsim> @TheLemonMan, why emit then asm instead of asm directly? https://github.com/LemonBoy/criterion.nim/blob/master/src/criterion/cycles.nim#L6, for volatile? |
14:16:54 | TheLemonMan | mratsim, yep |
14:17:34 | TheLemonMan | I don't know if that's patch-worthy since asm is rarely used |
14:18:05 | FromGitter | <mratsim> probably not, people using asm are probably aware of emit. |
14:19:23 | TheLemonMan | the windows version is completely untested btw, if anybody is brave enough to try it out let me know if it works |
14:19:42 | * | endragor quit (Ping timeout: 264 seconds) |
14:20:33 | FromGitter | <mratsim> it should work with mingw but for vcc it probably won’t work because all ASM is basically forbidden :P |
14:21:21 | FromGitter | <mratsim> oh there is an intrinsics check that: https://helloacm.com/the-rdtsc-performance-timer-written-in-c/ __rdtsc() |
14:21:26 | TheLemonMan | yep, I used the intrinsics there |
14:23:46 | * | stefanos82 quit (Quit: Quitting for now...) |
14:28:57 | * | endragor joined #nim |
14:33:27 | * | endragor quit (Ping timeout: 252 seconds) |
14:35:41 | FromGitter | <Araq> speaking of which ... can we remove the 'asm' keyword? shouldn't this have been a pragma like .emit? |
14:36:22 | TheLemonMan | yeah, makes sense |
14:36:42 | * | nsf quit (Quit: WeeChat 2.2) |
14:44:29 | * | ftsf joined #nim |
14:47:04 | FromGitter | <mratsim> yeah I agree |
14:48:44 | * | abm joined #nim |
14:50:32 | FromGitter | <tim-st> is it expected: ```nim |
14:50:45 | FromGitter | <tim-st> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b801b44f5402f32aa869c33] |
14:51:22 | TheLemonMan | tim-st, sadly it is |
14:51:31 | FromGitter | <mratsim> the VM doesn’t respect smaller types |
14:51:46 | FromGitter | <mratsim> pretty sure there is an issue open by Timothée on that |
14:51:50 | FromGitter | <tim-st> ok, thanks both |
14:52:00 | TheLemonMan | ...and a PR that tries to fix that :) |
14:52:32 | TheLemonMan | but winlean relies on the vm conversion being too lenient |
14:55:39 | * | smt joined #nim |
14:55:53 | * | a_b_m joined #nim |
14:56:35 | * | Trustable joined #nim |
14:57:29 | * | skrylar joined #nim |
14:59:31 | * | abm quit (Ping timeout: 268 seconds) |
15:03:09 | * | dadabidet quit (Quit: Leaving) |
15:20:43 | FromGitter | <Araq> oh yeah thanks for reminding me... |
15:20:49 | FromGitter | <Araq> btw voting time: https://github.com/nim-lang/Nim/pull/8757 |
15:21:14 | FromGitter | <Araq> dots vs colons. bikeshed ahead. |
15:22:20 | * | gpd_ joined #nim |
15:23:03 | FromGitter | <kaushalmodi> @Araq Can you install this Polls app in the Nim repo?: https://github.com/apps/polls |
15:24:27 | FromGitter | <kaushalmodi> You can then create polls in Github issue comments like this: |
15:24:28 | FromGitter | <kaushalmodi> (https://files.gitter.im/nim-lang/Nim/FUGc/image.png) |
15:24:52 | FromGitter | <Araq> we have thumbs up/down though on github without an app |
15:25:22 | FromGitter | <kaushalmodi> well, this app allows what exactly we are thumbing up in a clearer fashion |
15:25:50 | FromGitter | <Araq> and call me outdated but I don't see the value in turning 2 or 3 numbers into barcharts |
15:26:33 | FromGitter | <kaushalmodi> I don't have a strong opinion.. was just sharing what I liked seeing elsewhere |
15:26:40 | FromGitter | <DanielSokil> Charts = Big numbers |
15:26:57 | * | a_b_m quit (Ping timeout: 252 seconds) |
15:34:42 | FromDiscord_ | <deech> Are there any benchmarks on Nim vs. Go specifically for asynchronous execution? eg. `goroutines` vs. `asyncdispatch`. |
15:40:56 | FromGitter | <Araq> check that techpower benchmark thing. you're rich before the speed differences become any real issue IMHO and there are more interesting criteria for choosing your programming environment |
15:42:03 | FromGitter | <Araq> `httpbeast` got superb benchmark results though. |
15:43:04 | FromGitter | <Varriount> You'll usually have other bottlenecks in your code before the underlying IO framework becomes an issue. |
15:47:17 | dom96 | Yep, httpbeast is a beast :) |
15:47:26 | dom96 | Sadly the techempower website is broken |
15:47:37 | * | ftsf quit (Ping timeout: 268 seconds) |
15:51:23 | livcd_ | i thought mofuw got superb results |
15:52:08 | FromGitter | <ephja> was --foo:bar chosen for reasons of parsing simplicity? |
15:55:28 | livcd_ | dom96: will you make httpbeast work with Windows as well ? |
15:56:50 | dom96 | Maybe someday |
15:57:14 | dom96 | Don't think there is much point though |
15:57:15 | FromGitter | <ephja> if so, will it work on Vista too? think of the 0.1% :p |
15:57:31 | dom96 | Who actually hosts web apps on Windows nowadays? |
15:58:07 | FromGitter | <DanielSokil> Microsoft? |
15:58:47 | livcd_ | dom96: uh many people :) |
15:59:06 | leorize | doesn't Azure use Linux? |
15:59:10 | dom96 | Who? |
15:59:21 | dom96 | Microsoft doesn't count |
16:00:15 | FromGitter | <ephja> nvm. "This has been discussed before and non-ambiguous command line parsing is not NIH" |
16:00:25 | FromGitter | <ephja> yeah, I prefer the Nim syntax |
16:00:57 | livcd_ | dom96: idk like everyone :| |
16:01:02 | FromGitter | <kaushalmodi> @Araq The example in https://forum.nim-lang.org/t/4154#25866 does not work for me. I thought there was an internal variable or function that returned the Nim library path.. what was that? |
16:01:37 | dom96 | livcd_: You don't know but you think it's everyone? |
16:02:21 | livcd_ | dom96: i do know that it is in fact many fortune500 companies |
16:02:33 | * | gpd_ quit (Quit: Page closed) |
16:02:52 | * | floppydh quit (Quit: WeeChat 2.2) |
16:04:18 | * | SenasOzys quit (Ping timeout: 244 seconds) |
16:05:37 | FromGitter | <kaushalmodi> I found this: https://github.com/nim-lang/Nim/blob/964f1ff7a77e0cc1c73f12d02969421c36d32e1c/compiler/nimeval.nim#L78-L90 |
16:05:53 | FromGitter | <kaushalmodi> but how do I use the findNimStdLib directly in my code? |
16:06:14 | FromGitter | <DanielSokil> In fact most fortune500 comp us Linux (: |
16:08:18 | FromGitter | <Bennyelg> How can I do something like this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b802d71a491f4591795f878] |
16:08:19 | livcd_ | sure but most if not all big companies run on myriad of things |
16:14:53 | FromGitter | <mratsim> dot and colon are overrated, I’m with team equal like @kaushalmodi. Plus, consistency is with me :D |
16:15:53 | * | iffy joined #nim |
16:17:06 | * | dorelix joined #nim |
16:18:26 | dom96 | colon is in my muscle memory |
16:18:33 | dom96 | Therefore too late to change it :P |
16:18:54 | iffy | I'm struggling to define the body of a posix.onSignal handler. Snippet: http://codepad.org/Jccckcki I'm getting the error: Error: illegal capture 'p' because ':anonymous' has the calling convention: <noconv> |
16:19:37 | iffy | also what is that `onSignal(...):` syntax called? |
16:28:13 | * | SenasOzys joined #nim |
16:29:50 | * | Vladar quit (Remote host closed the connection) |
16:31:29 | iffy | oh, it's a template |
16:31:37 | FromGitter | <Bennyelg> why its so complicated to return a connection by selected one ? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b8032e958a3797aa3af31b3] |
16:32:28 | FromGitter | <Araq> because there are 3 different DbConn types. and again, check how Ormin does it, you're reinventing it. |
16:32:58 | FromGitter | <Bennyelg> I'll check. ⏎ I know there are 3 different types |
16:34:57 | FromGitter | <ephja> runtime string checking? pfft :-P |
16:45:16 | iffy | so, templates are cool... but how do I do something useful inside posix.onSignal? |
16:47:04 | * | nathancahill joined #nim |
16:47:18 | TheLemonMan | you shouldn't capture any variable in the signal handler |
16:48:55 | iffy | TheLemonMan: the compiler agrees with you :) What alternatives do I have? |
16:49:21 | * | seni_ joined #nim |
16:49:28 | TheLemonMan | globals, trampolines, the sky's the limit! |
16:51:33 | iffy | hrm... searching "nim trampoline" only returns actual trampolines for sale. I'll look into globals |
16:51:45 | * | seni quit (Ping timeout: 268 seconds) |
16:52:23 | TheLemonMan | introduce a function that calls another function, that's a trampoline :) |
16:53:54 | iffy | TheLemonMan: like this? http://codepad.org/PAZAy59P That's not allowed either (for the same reason p isn't allowed in) |
16:56:25 | TheLemonMan | works fine here, can you post a compilable/runnable snippet? |
16:58:19 | iffy | K, let me make a sscce |
16:59:58 | iffy | ahh... it works if that code is in the global scope, but I'm doing all this from within a proc, like this: http://codepad.org/DWBA3qmt |
17:02:00 | * | thomasross_ joined #nim |
17:02:33 | TheLemonMan | yep, you can't pass a closure to a C procedure |
17:03:12 | * | thomasross quit (Ping timeout: 244 seconds) |
17:03:29 | iffy | TheLemonMan: so how do I change that code so that var p:Process is still declared inside main? |
17:03:51 | iffy | Right now I only have one p per program, but I'd like to handle multiple subprocesses eventually |
17:05:37 | TheLemonMan | you can "lift" the whole doKill closure to the global scope but it feels dirty |
17:19:31 | * | zachk joined #nim |
17:20:15 | * | zachk quit (Changing host) |
17:20:15 | * | zachk joined #nim |
17:42:14 | * | Jesin quit (Quit: Leaving) |
17:47:19 | * | Jesin joined #nim |
18:00:18 | * | nsf joined #nim |
18:09:08 | * | iffy left #nim (#nim) |
18:16:17 | FromGitter | <timotheecour> @araq we posted at the same time in https://github.com/nim-lang/Nim/pull/8757 |
18:17:29 | FromGitter | <timotheecour> this is a bit of a flaw in nim cmd line, i’d much rather it be explicit : eg ⏎ `nim —confvar:gcc.exe` |
18:18:03 | FromGitter | <Araq> I don't consider it important enough to be solved |
18:18:26 | FromGitter | <Araq> and as I said elsewhere, I don't want a hierarchy of switches, I want fewer switches |
18:18:39 | FromGitter | <timotheecour> well then the way i did it in this PR is the only sane way |
18:21:44 | FromGitter | <timotheecour> > and as I said elsewhere, I don't want a hierarchy of switches, I want fewer switches ⏎ ⏎ that’s a separate discussion to this PR, but we already have a lot of switches, and a hierarchy would make it easier to find/guess/use these; eg, `git`, `docker` etc have a ton of flags, but it scales because they’re not all at top-level which would make it un-manageable |
18:27:41 | * | Jesin quit (Quit: Leaving) |
18:38:31 | * | nathancahill quit (Quit: nathancahill) |
18:40:15 | * | tzekid joined #nim |
18:40:31 | tzekid | Hey :) |
18:40:45 | tzekid | Can Nim variables be nilable (like in Crystal) ? |
18:41:23 | FromGitter | <Araq> no but you can use Option[T] |
18:42:39 | FromGitter | <Araq> > git, docker etc have a ton of flags, but it scales because they’re not all at top-level which would make it un-manageable. ⏎ ⏎ dunno, if I have a problem with these I google for it and Google is superb because it lets me enter text without paying attention to any hierarchies it may use under the hood |
18:42:49 | tzekid | Araq: thanks :) |
18:44:50 | FromGitter | <Araq> hierarchies have never been proven to work effectively, it's just something programmers feed good about. |
18:45:40 | * | thomasross_ quit (Read error: Connection reset by peer) |
18:46:01 | * | thomasross_ joined #nim |
18:47:15 | FromGitter | <timotheecour> I use `git help log` `git help diff` to search `log` or `diff` related commands. Likewise with `brew help list` etc. It just makes everything easy. ⏎ ⏎ > hierarchies have never been proven to work effectively ⏎ ⏎ that’s the reason we have modules instead of 1 giant namespace. [https://gitter.im/nim-lang/Nim?at=5b8052b2ac25fd11b58c9e65] |
18:49:53 | FromGitter | <Araq> yeah, I disagree and as I said, it hasn't been proven |
18:50:50 | FromGitter | <Araq> `git help log` already assumes you know about `log` and that it's not called `hist` or `history`. |
18:50:52 | FromGitter | <timotheecour> Except that all new sufficiently complex software tools with a cmd line interface use a hierarchy: ⏎ brew, git, docker, |
18:51:02 | FromGitter | <Araq> and when I used GDB I just read *all* of its commands. |
18:52:52 | FromGitter | <Araq> and if you are interested in effective human-machine interactions you don't study "sufficiently complex cmd line interfaces", you should study computer games. |
18:53:44 | FromGitter | <timotheecour> > `git help log` already assumes you know about `log` and that it's not called `hist` or `history`. ⏎ ⏎ that’s because `git help`shows (by default) only top-level entries (not nested ones), and it shows: ⏎ ⏎ ```code paste, see link``` ... [https://gitter.im/nim-lang/Nim?at=5b80543860f9ee7aa487bebd] |
18:54:38 | * | nathancahill joined #nim |
18:55:11 | FromGitter | <Araq> don't lecture me, it's not been proven and it fails often enough to be highly critical of this whole idea |
18:55:46 | FromGitter | <Araq> and Google has more users than git anyway. |
19:00:11 | FromGitter | <timotheecour> if what you’re saying is “hierarchies” are not better than “tags” I agree; but that’s orthogonal issue to what I was suggesting (and not incompatible) |
19:02:14 | FromGitter | <Araq> it's about *design*. I know one thing about design, it's called "don't make me think" |
19:03:03 | FromGitter | <Araq> you want to cut Google's userbase down to a fraction of it current size? make them navigate through a hierarchy before they can enter the search query. |
19:04:22 | * | tzekid quit (Remote host closed the connection) |
19:04:32 | FromGitter | <kayabaNerve> search |
19:04:34 | FromGitter | <kayabaNerve> dogs |
19:04:36 | FromGitter | <kayabaNerve> cute dogs |
19:04:42 | FromGitter | <kayabaNerve> cute golden dogs |
19:04:46 | FromGitter | <kayabaNerve> cute golden retreivers |
19:05:02 | FromGitter | <kayabaNerve> I'd use it. 10/10 UI |
19:05:04 | FromGitter | <kayabaNerve> Very clear |
19:05:16 | FromGitter | <kayabaNerve> No one else would though :( |
19:05:47 | FromGitter | <timotheecour> noones arguing that search should go back to old altavista days, that’s completely unrelated to having a hierarchy of flags. `nim —fullhep | grep bar` is always there for that |
19:07:07 | FromGitter | <Araq> but since `nim —fullhep | grep bar` is superior, why waste time and effort on the hierarchy... |
19:08:51 | FromGitter | <kayabaNerve> `--fullhep` |
19:08:59 | FromGitter | <kayabaNerve> Is that the actually flag? |
19:09:08 | FromGitter | <kayabaNerve> Petition to make it the actual flag? |
19:12:23 | FromGitter | <timotheecour> ease of use / remembering and consistency etc without searching everytime. `—hint[foo]` and —warning[foo]` is a better design than the other flags (modulo what I’m fixing in https://github.com/nim-lang/Nim/pull/8757) , and a number of other flags could be handled in the same way (`—listCmd` should be a hint; `--nilChecks:on`(etc) should be `—checks[nil]:on` and so forth) |
19:13:20 | FromGitter | <timotheecour> @kayabaNerve it is; it’s called `—fullhelp` (was a typo) |
19:13:21 | FromGitter | <ephja> you would prefer to use something other than a hierarchical file system, right? are there examples of that? would filenames and tags be enough? |
19:13:53 | FromGitter | <Araq> I would use them and would never look back indeed. |
19:14:11 | FromGitter | <Araq> but I haven't ever used one, so take it with lots of salt |
19:15:37 | FromGitter | <ephja> @kayabaNerve probably meant full*help* :p |
19:15:56 | FromGitter | <timotheecour> in google, distributed file system we used was actually built on top of a flat set of files; the hierarchy was exposed by higher level API’s. |
19:17:07 | FromGitter | <ephja> all of you typed --full*hep*? :p |
19:17:36 | * | Trustable quit (Remote host closed the connection) |
19:17:45 | FromGitter | <Araq> autocorrection of command line options would be awesome btw :-) |
19:17:59 | FromGitter | <kayabaNerve> @timotheecour Won't be a typo after my petition |
19:18:12 | FromGitter | <kayabaNerve> @ephja Won't be a typo after my petition |
19:18:12 | * | Trustable joined #nim |
19:18:28 | FromGitter | <kayabaNerve> I think @timotheecour typed it and Araq typed or copy/pasted |
19:18:31 | FromGitter | <kayabaNerve> @Araq Fuck |
19:18:52 | FromGitter | <kayabaNerve> https://github.com/nvbn/thefuck/issues/519 |
19:19:09 | FromGitter | <kayabaNerve> Sorry. "The Fuck" |
19:19:35 | FromGitter | <kayabaNerve> That's just the best issue ever created on GH/the one f*** link I had bookmarked. |
19:21:36 | FromGitter | <Araq> interesting, reminds me of my `cff` tool |
19:22:06 | TheLemonMan | hey, no swearing, this is a Christian IRC server |
19:22:20 | FromGitter | <Araq> `cff tt tfoo.nim_` --> `tt tests/bar/tfoo.nim` |
19:27:20 | * | noonien quit (Quit: Connection closed for inactivity) |
19:29:42 | FromGitter | <kayabaNerve> TheLamonMan: It's the name of the program. I did star out my last mention as it was superfluous. |
19:29:53 | FromGitter | <kayabaNerve> @Araq That;s awesome |
19:30:15 | FromGitter | <kayabaNerve> TheLemonMan: I'll pay you a lot of crypto if you make a Nim-REPL in Brainfuck. |
19:30:45 | FromGitter | <kayabaNerve> Or Nim to Brainfuck Transpiler/Compiler backend/I'm not trying to enter this debate, I just don't know the best term |
19:31:05 | TheLemonMan | trancepiler |
19:31:07 | FromGitter | <kayabaNerve> I think, last time I saw it, it was stated Nim to C was compiled, Nim to JS was arguably transpiled... |
19:33:09 | FromGitter | <kayabaNerve> BTW. Get "The F***" on a production server and set`require_confirmation = True` to false. You should always bring your best tools with you to production, and production tools must be fast! Human confirmation is slow. |
19:33:21 | FromGitter | <kayabaNerve> *will stop the offtopic conversations :P * |
19:41:22 | * | dorelix quit (Remote host closed the connection) |
19:49:46 | FromGitter | <kayabaNerve> I have a Test that just compiles every code to make sure that any changes I make didn't break something else; I deleted an object days ago but left the definition in so this code has been broken for days and I didn't catch it... |
19:55:43 | Calinou | hi, is it possible to override the .nimble path using an environment variable? |
19:56:00 | Calinou | I'm working on creating a Scoop package for choosenim, so people with Scoop installed can just do `scoop install choosenim` to use it :) |
19:56:22 | Calinou | and it's better if it's self-contained (although it's not a strict requirement) |
20:00:11 | dom96 | Only via config file |
20:09:31 | Calinou | dom96: thanks, I should be able to get it working without changing it anyway |
20:10:51 | Calinou | the only issue is that installation fails if there's a 64-bit GCC in path (which is the case if you install the `gcc` package) though… It's possible to install 32-bit GCC using Scoop even if on 64-bit (by passing `-a 32bit`), but it's not possible to have both installed at the same time |
20:15:52 | * | shashlick joined #nim |
20:17:57 | shashlick | test |
20:19:00 | Calinou | nimble/nimgrep are missing some libraries though :( |
20:19:07 | Calinou | I can extract them manually as a workaround |
20:22:57 | * | nathancahill quit (Quit: nathancahill) |
20:27:45 | FromGitter | <timotheecour> @Araq can you please PTAL at https://github.com/nim-lang/Nim/pull/8555 (doAssert, assert now print full path of failing line on error) ; I’ve now completely removed the FAKEFILE feature |
20:27:52 | * | nathancahill joined #nim |
20:30:58 | FromGitter | <kayabaNerve> Is there no way to join a seq? |
20:31:50 | FromGitter | <kayabaNerve> mySeq.join(" ") #Calls $ on each element and joins them with the string. @[1, 2, 3, 4, 5] would return "1 2 3 4 5". |
20:31:56 | FromGitter | <kayabaNerve> Not in sequtils 0_o |
20:33:24 | FromGitter | <kayabaNerve> That's just how JS would do it. This is a seq[string] |
20:33:24 | TheLemonMan | uhh, look in strutils |
20:33:41 | FromGitter | <kayabaNerve> OpenArray; thanks |
20:34:10 | TheLemonMan | I was looking for a way to merge two seq[T] some time ago and found none (iirc) |
20:37:02 | * | rockcavera quit (Ping timeout: 268 seconds) |
20:38:13 | FromGitter | <kayabaNerve> I split a string into a seq among delimiters; I was then serializing the data back into a string; a simple substr wouldn't work. I could copy the seq, delete the unnecessary data, and rejoin though.... |
20:43:53 | * | rockcavera joined #nim |
20:43:54 | * | rockcavera quit (Changing host) |
20:43:54 | * | rockcavera joined #nim |
20:52:29 | FromDiscord_ | <exelotl> is there a way to to uniquely identify a type, e.g. if I wanted to use types as keys in a hash table? |
20:53:13 | * | yuken joined #nim |
20:56:04 | * | nsf quit (Quit: WeeChat 2.2) |
20:56:21 | TheLemonMan | convert it to string? :3 |
20:56:33 | TheLemonMan | s/3/P/g |
21:03:37 | FromDiscord_ | <exelotl> I guess? |
21:03:57 | FromDiscord_ | <exelotl> I'd have to include the module path |
21:04:31 | FromDiscord_ | <exelotl> but surely there must be a 'correct' way to do this |
21:04:38 | FromDiscord_ | <exelotl> that doesn't involve building strings |
21:09:39 | FromDiscord_ | <exelotl> ideally I'd like something that works both at compile time and at runtime |
21:11:12 | FromGitter | <kaushalmodi> Unicode experts, anyone wants to look into this bug: https://github.com/nim-lang/Nim/issues/8768#issuecomment-415882765 |
21:12:18 | FromGitter | <kayabaNerve> IDK why, but the past week or two, I've gotten more SIGSEGVs then ever before |
21:12:50 | nathancahill | maybe a silly question, but is it possible to pass an openarray as parameters ala python's func(*[arg])? |
21:13:30 | FromGitter | <kayabaNerve> It's not a matter of updating. It's been the same version for a couple weeks. |
21:14:14 | FromGitter | <kayabaNerve> But I've never gotten destructors to work in a place I need them (Nim compiler has an issue with tables and says recompile with koch temp) |
21:14:19 | FromGitter | <kayabaNerve> *specific place |
21:14:31 | FromGitter | <kayabaNerve> And then other times I randomly get SIGSEGV and no output |
21:17:26 | Calinou | dom96: I got a decent implementation now, but it still conflicts with 64-bit GCC in PATH so I'll leave it in my fork for now |
21:17:37 | Calinou | (I could look at fixing this in choosenim) |
21:18:25 | FromGitter | <kayabaNerve> And the last line before the SIGSEV is `Hint: random [Processing]` lol |
21:18:59 | Calinou | the installation itself is working at least :) I tested by compiling an hello world |
21:20:37 | * | jakeprem joined #nim |
21:25:28 | nathancahill | the opposite of varargs basically |
21:26:35 | TheLemonMan | is [arg] known at compile time? |
21:26:56 | nathancahill | yes |
21:27:05 | FromGitter | <Araq> macros.unpackVarargs |
21:28:47 | * | kapil____ quit (Quit: Connection closed for inactivity) |
21:30:23 | nathancahill | Thanks Araq |
21:30:55 | * | dyslexicat joined #nim |
21:31:03 | * | dyslexicat left #nim (#nim) |
21:32:00 | dom96 | I might be immature, but I just saw this in my C source code: `T12_ = pathInfo_jizz5V2XF9beBz2Bebd71lg((&(*colonenvP_).request2));` |
21:32:12 | dom96 | Is Nim generating identifier names with `jizz` on purpose? :P |
21:32:57 | nathancahill | That looks perfect for procs. But I didn't think my problem all the way through.. i'm actually using htmlgen macros and not procs, so that doesn't work.. |
21:33:20 | nathancahill | i've got `tr(@[td(), td(), td()])` and I want tr(td(), td(), td()) |
21:35:35 | nathancahill | i'm creating that array of td() beforehand in a for loop, want to stick it in a tr() |
21:37:08 | * | seni_ quit (Quit: Leaving) |
21:38:14 | FromGitter | <Araq> everything after the _ is not on purpose |
21:39:09 | FromGitter | <Araq> it's not for procs, it's a simple syntactic rewrite |
21:40:57 | FromGitter | <kayabaNerve> Should we have a list of naughty words Nim promises not to put in its generated code? |
21:41:16 | FromGitter | <kayabaNerve> Reminds me of https://github.com/danielmiessler/SecLists/pull/155 |
21:42:24 | FromGitter | <Araq> alternatively, don't put generated code into your git repos |
21:42:49 | FromGitter | <ephja> nice list |
21:42:52 | FromGitter | <kayabaNerve> I don't. Could you decompile a release and find these symbols though? |
21:46:39 | nathancahill | maybe i'm using it wrong: tr.unpackVarargs([td(), td()]) |
21:49:39 | Calinou | dom96: https://github.com/Calinou/scoop/commit/216104f6b119d95c805cc768693defb4f0389303 |
21:49:59 | Calinou | I did some extra work to handle edge cases (bundled MinGW, removing .choosenim when uninstalling, etc) |
21:52:01 | FromGitter | <Araq> "Helmholtz noted that when one is confronted with an orthographic stimulus (e.g., HOUSE), the ⏎ stimulus automatically triggers a conscious representation of the phonological form of the ⏎ word (i.e., /haus/). Seldom in everyday life is it appreciated that, in this situation, the ⏎ visual stimulus triggers a conscious content that is very different in nature from that of ⏎ the environmental stimulation that brought |
21:52:02 | FromGitter | ... the content into existence: The conscious ... [https://gitter.im/nim-lang/Nim?at=5b807e01d8d36815e5862e8f] |
21:52:37 | FromGitter | <timotheecour> can anyone merge this or give feedback ? https://github.com/nim-lang/Nim/pull/8682 ; it enables users to use nims instead of nimcfg in their .config |
22:01:18 | * | nathancahill quit (Ping timeout: 252 seconds) |
22:02:35 | * | nathancahill joined #nim |
22:04:08 | * | Trustable quit (Remote host closed the connection) |
22:05:29 | * | nathancahill_ joined #nim |
22:06:53 | dom96 | Calinou: Cool. Why disabling analytics? |
22:07:00 | * | nathancahill quit (Ping timeout: 244 seconds) |
22:07:11 | Calinou | dom96: installation should work unattended |
22:07:17 | Calinou | so I just opt-out of analytics (I also do that in CI) |
22:08:30 | * | nathancahill joined #nim |
22:09:33 | dom96 | hrm, okay |
22:09:42 | dom96 | So this is a weird bug https://github.com/nim-lang/Nim/issues/8773 |
22:10:06 | * | nathancahill_ quit (Ping timeout: 264 seconds) |
22:29:58 | * | gb00s quit (Remote host closed the connection) |
22:37:29 | * | wildlander joined #nim |
22:38:53 | * | TheLemonMan quit (Quit: "It's now safe to turn off your computer.") |
23:03:33 | * | bung joined #nim |
23:04:18 | * | nathancahill quit (Ping timeout: 272 seconds) |
23:08:48 | * | nathancahill joined #nim |
23:14:59 | * | oprypin quit (Quit: Bye) |
23:15:12 | * | oprypin joined #nim |
23:15:56 | * | FromGitter quit (Remote host closed the connection) |
23:15:56 | * | oprypin quit (Client Quit) |
23:16:25 | * | FromGitter joined #nim |
23:16:25 | * | oprypin joined #nim |
23:28:07 | * | nathancahill quit (Ping timeout: 244 seconds) |
23:51:44 | * | yuken left #nim ("Leaving") |
23:55:18 | * | burnout_ joined #nim |
23:58:20 | * | burnout_ quit (Remote host closed the connection) |