00:01:19 | * | luis_ quit (Remote host closed the connection) |
00:02:44 | * | noonien joined #nim |
00:03:19 | * | luis_ joined #nim |
00:04:03 | * | luis_ quit (Remote host closed the connection) |
00:09:44 | FromDiscord | <mratsim> @clyyber: here you go, I should have properly specced what I did so the backtrace should be good - https://github.com/mratsim/weave/issues/43#issuecomment-566308637 |
00:13:22 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
00:21:04 | FromDiscord | <Clyybber> thanks! |
00:36:36 | disruptek | arne is right; #12790 should really be built and stabilized first. |
00:37:18 | disruptek | disbot: hello? |
00:37:19 | disbot | yep. 😊 |
00:37:41 | disruptek | disbot: yeah, well less yepping and more issue retrieval. |
00:37:42 | disbot | on it. 👍 |
00:37:58 | disruptek | disbot: tell me about #12790. |
00:37:59 | disbot | on it. 👍 |
00:38:11 | disruptek | no, seriously. #12790. do it now. |
00:38:13 | disbot | https://github.com/nim-lang/Nim/issues/12790 -- 3Proposal: endinanness-aware I/O in stdlib streams ; snippet at 12https://play.nim-lang.org/#ix=24DQ |
00:38:40 | * | ng0 joined #nim |
00:38:41 | disruptek | good help is so hard to find. |
00:39:14 | * | ng0 quit (Client Quit) |
00:45:16 | FromGitter | <deech> When using ref-counting resource management is memory always released back to the OS? |
00:52:01 | * | u0_a215 joined #nim |
00:53:38 | * | ng0 joined #nim |
00:55:26 | FromDiscord | <mratsim> small items are not. Not sure if ARC changes anything regarding that |
01:00:06 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
01:02:01 | * | u0_a215 quit (Ping timeout: 268 seconds) |
01:02:55 | * | u0_a215 joined #nim |
01:10:35 | * | icebattle quit (Quit: leaving) |
01:16:26 | * | ponyride1 quit (Ping timeout: 276 seconds) |
01:29:00 | * | ponyride1 joined #nim |
01:30:33 | * | endragor joined #nim |
01:44:43 | u0_a215 | hello |
01:45:00 | * | u0_a215 is now known as kevinchau |
01:46:22 | kevinchau | I want to dev a gui app on linux which one is better : gintro & nigui? |
01:46:44 | disruptek | probably nigui |
01:47:09 | disruptek | !repos gui |
01:47:11 | disbot | https://github.com/yglukhov/nimx -- 9nimx: 11GUI library 15 573⭐ 54🍴 |
01:47:11 | disbot | https://github.com/trustable-code/NiGui -- 9NiGui: 11Cross-platform desktop GUI toolkit written in Nim 15 276⭐ 28🍴 |
01:47:13 | disbot | https://github.com/khchen/wNim -- 9wNim: 11Nim's Windows GUI Framework 15 105⭐ 4🍴 7& 27 more... |
01:49:44 | FromGitter | <gogolxdong> @shashlick where to change in nimgit2.nim to get source code in Nim? The command `nim c -r --hints:off nimgit2.nim > git.nim` you mentioned yesterday outputs ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5df834387ce7ea1e359907b4] |
01:50:50 | FromGitter | <gogolxdong> and what if the whole project is needed to be translated? |
01:55:40 | shashlick | You need to add `static: cDebug()` at the top for the stuff to get printed |
02:02:21 | FromGitter | <gogolxdong> oh,yes, it works. |
02:05:50 | * | kevincha1 joined #nim |
02:08:08 | kevincha1 | thanks all |
02:08:20 | * | kevincha1 quit (Client Quit) |
02:09:40 | * | kevinchau quit (Ping timeout: 248 seconds) |
02:14:18 | FromGitter | <gogolxdong> @shashlick , another question I've been conceived for a period to ask is Is it possible for something like nimterop to translate c/c++ projects into native Nim instead of FFI and how hard it is to achieve? |
02:14:28 | * | liam_ quit (Read error: Connection reset by peer) |
02:14:40 | * | liam_ joined #nim |
02:17:40 | shashlick | @gogolxdong - c2nim goes beyond what nimterop can do |
02:18:44 | shashlick | @gogolxdong I don't like the idea very much though since c/c++ are too complex and constantly evolving |
02:21:09 | * | endragor quit (Ping timeout: 265 seconds) |
02:21:36 | FromGitter | <gogolxdong> FFI also is not very elegant and it limits the power of macros , C++ is evolving, C is constant mostly. |
02:21:44 | shashlick | @gogolxdong there are definitely valid cases but when you have a dedicated team working on and maintaining an upstream lib, translating it seems wasteful and dangerous |
02:23:25 | shashlick | Some day we will have a supported compile time ffi |
02:24:18 | disruptek | i swear my brain is bleeding. |
02:24:24 | shashlick | For now we will have to compile it into a separate binary and use gorgeEx like toast in nimterop |
02:24:35 | disruptek | the code looks like it's written in comic sans. |
02:26:55 | FromGitter | <gogolxdong> Yes, it's a good point. Another thing is FFI requires addtional knowledge beyond what has been documented, it includes but not limited to C basic knowledge. |
02:27:26 | disruptek | you had me at knowledge. |
02:27:48 | disruptek | isn't it enough that i speak english? gah, no, no it's not. |
02:27:53 | disruptek | it's really not fair, is it. |
02:28:29 | shashlick | That is very true and part of my goal for nimterop |
02:28:48 | shashlick | Some day we can generate idiomatic Nim on top of wrappers |
02:29:03 | disruptek | how? |
02:29:07 | shashlick | I can dream, no idea if it is feasible |
02:29:17 | disruptek | c is too broadly underspecified, i think. |
02:29:45 | shashlick | Agree 100% but common stuff can be improved |
02:30:44 | shashlick | Can => could |
02:30:52 | * | mrgaturus joined #nim |
02:30:53 | disruptek | damnit. |
02:31:07 | disruptek | well, you can just maintain all the c code and patch it all. |
02:31:10 | disruptek | there. |
02:31:17 | shashlick | But I'd rather fix more bugs and add c++ support first |
02:31:18 | disruptek | you can go back to dreaming. |
02:32:30 | shashlick | You can give me some ideas from your usage of nimgit2 |
02:33:42 | disruptek | the main problem i have is with nimsuggest. |
02:33:53 | disruptek | basically, it's broken everywhere in nimph. |
02:34:50 | disruptek | the only other problem is that i can't be bothered to write a proper api over libgit. |
02:35:16 | disruptek | i just don't have a strong opinion on how it should look, yet. |
02:35:28 | disruptek | nimterop seems to work perfectly. |
02:36:26 | disruptek | doesn't it seem to work for you? |
02:36:26 | FromGitter | <gogolxdong> I think it's a C AST to Nim AST mapping, feasible with tree-sitter maybe. |
02:37:34 | mrgaturus | hi everyone, if a pass a ref object to a ptr object field (manually allocated) and i dealloc that ptr object, is the ref object still counted by that field? |
02:37:49 | disruptek | yes. |
02:38:16 | disruptek | you can manually ref-count refs, though. |
02:38:27 | disruptek | see the docs for the gc. |
02:40:39 | disruptek | the ref doesn't have an extra count for that field, if that's what you're asking. |
02:41:07 | mrgaturus | thanks, i want to pass a ref object from a x object to y object using a ptr object as channel |
02:41:55 | disruptek | it sounds like you might have feline leukemia. |
02:46:15 | mrgaturus | yeah, it sounds weird, i'm creating a simple gui toolkit and i have a queue using manually allocated objects and i use it for sending data from a widget to other |
02:46:39 | shashlick | disruptek: yes the nimsuggest problem is a difficult one now that gorge is blocked |
02:48:01 | shashlick | works great for me - here's a snippet for creating an rsa key wrapping libcrypto - http://ix.io/24zh/nim |
02:48:49 | shashlick | the C API is not too bad if you are familiar with C, but like @gogolxdong says, it is hard if you aren't |
02:51:05 | disruptek | i didn't choose nim to write c, but i did choose it to /use/ c. so i think it's par for the course, to some extent. |
03:05:29 | * | ponyride1 quit (Quit: WeeChat 2.6) |
03:17:01 | * | endragor joined #nim |
03:41:47 | * | rockcavera quit (Remote host closed the connection) |
03:52:28 | * | liam_ quit (Read error: Connection reset by peer) |
03:52:45 | * | liam_ joined #nim |
03:52:54 | FromGitter | <gogolxdong> @shashlick how to reference static function in git2 source code? |
03:57:18 | FromGitter | <gogolxdong> oh, it translates what's included in git.h. |
03:57:34 | FromGitter | <gogolxdong> git2.h |
03:57:56 | * | liam_ quit (Quit: Leaving) |
03:58:05 | disruptek | gogolxdong: plenty of examples in nimph. |
03:58:07 | disruptek | !repo nimph |
03:58:08 | disbot | https://github.com/disruptek/nimph -- 9nimph: 11a nim package hierarchy manager from the future 🧚 15 19⭐ 0🍴 7& 1 more... |
04:13:32 | shashlick | can someone tell me what this is - https://github.com/openssl/openssl/blob/master/include/openssl/txt_db.h#L43 |
04:13:49 | shashlick | (*qual) is a function pointer, what's (***qual) |
04:14:23 | FromGitter | <gogolxdong> pointer of function pointer |
04:14:35 | disruptek | the stars are in alignment. |
04:15:10 | shashlick | so `ptr proc(a1: ptr OPENSSL_STRING): cint {.cdecl.}` |
04:15:17 | disruptek | sometimes when a mommy pointer really loves a daddy pointer, they rub up against each other... |
04:15:20 | shashlick | does nim support a pointer to a proc? |
04:15:25 | disruptek | of course. |
04:16:49 | disruptek | nimph has an example of passing a nim pointer to a proc into libgit2, which calls it from c. |
04:18:23 | disruptek | see the treeWalk() proc. |
04:19:45 | * | liam_ joined #nim |
04:26:53 | * | chemist69 quit (Ping timeout: 250 seconds) |
04:29:06 | * | chemist69 joined #nim |
04:42:00 | * | liam_ quit (Read error: Connection reset by peer) |
04:42:22 | * | liam_ joined #nim |
04:49:26 | * | nsf joined #nim |
04:52:58 | * | liam_ quit (Quit: Leaving) |
05:28:23 | FromGitter | <gogolxdong> If qual is a function pointer, then (**qual) means pointer of pointer of function pointer. |
05:30:31 | FromGitter | <gogolxdong> @shashlick, how to translate the functions of .c files in libgit2? |
05:32:21 | FromGitter | <gogolxdong> I believed they are compiled into libgit2.a but not exposed from nimgit2.nim. |
05:33:53 | * | endragor quit (Remote host closed the connection) |
05:38:27 | * | mrgaturus quit (Quit: WeeChat 2.7) |
06:09:41 | * | narimiran joined #nim |
06:10:47 | * | endragor joined #nim |
06:13:17 | * | endragor quit (Remote host closed the connection) |
06:13:35 | * | endragor joined #nim |
06:26:38 | * | gour joined #nim |
06:47:25 | * | solitudesf- joined #nim |
07:04:11 | * | dddddd quit (Remote host closed the connection) |
07:34:53 | * | marmotini_ joined #nim |
07:35:25 | * | salewski joined #nim |
07:36:10 | salewski | https://irclogs.nim-lang.org/17-12-2019.html#01:46:44 |
07:36:51 | salewski | And probably nimbot is better than disbot :-) |
07:38:06 | salewski | If it is not clear, the point is both are very different! |
07:38:10 | * | salewski quit (Client Quit) |
07:39:44 | * | salewski joined #nim |
07:40:24 | salewski | and for the github stars, well vlang has more than nim, so is vlang better? |
07:40:48 | * | salewski quit (Client Quit) |
07:41:23 | Zevv | sure |
07:43:56 | * | Vladar joined #nim |
07:57:21 | * | PMunch joined #nim |
08:00:00 | * | gmpreussner quit (Quit: kthxbye) |
08:05:12 | * | gmpreussner joined #nim |
08:05:37 | * | ng0 joined #nim |
08:21:43 | * | jjido joined #nim |
08:33:31 | * | Tanger quit (Remote host closed the connection) |
08:37:05 | * | luis_ joined #nim |
08:38:05 | * | luis_ left #nim (#nim) |
08:39:51 | * | narimiran quit (Quit: leaving) |
08:41:12 | * | narimiran joined #nim |
09:01:46 | * | gour_ joined #nim |
09:03:18 | * | lmariscal0 joined #nim |
09:03:29 | * | bozaloshtsh_ joined #nim |
09:03:31 | * | akitoshi_ joined #nim |
09:03:33 | * | r4vi_ joined #nim |
09:03:38 | * | Ckatt joined #nim |
09:03:44 | * | npgm_ joined #nim |
09:04:22 | * | luis_ joined #nim |
09:04:57 | * | ehmry_ joined #nim |
09:05:37 | * | Yardanico_ joined #nim |
09:05:37 | * | d10n joined #nim |
09:05:38 | * | d10n quit (Changing host) |
09:05:38 | * | d10n joined #nim |
09:06:04 | * | livcd_ joined #nim |
09:06:05 | * | zedeus_ joined #nim |
09:06:10 | * | nixfreak_ joined #nim |
09:06:34 | * | golechwi joined #nim |
09:06:55 | * | gour_ quit (Quit: Leaving) |
09:07:12 | * | gour_ joined #nim |
09:07:14 | FromDiscord | <Rika> what does the importc pragma mean, like literal meaning |
09:07:50 | * | gour quit (Disconnected by services) |
09:07:54 | PMunch | Well it originally meant import from C |
09:07:54 | * | gour_ is now known as gour |
09:08:13 | PMunch | But you use it for JavaScript as well |
09:08:20 | * | marmotini_ quit (Remote host closed the connection) |
09:08:26 | FromDiscord | <Rika> yeah its confusing to see it in nim->js code |
09:09:00 | PMunch | Oh, apparently you're not supposed to do that any longer: "Note that this pragma has been abused in the past to also work in the js backand for js objects and functions." |
09:09:17 | PMunch | From here: https://nim-lang.org/docs/manual.html#foreign-function-interface-importc-pragma |
09:09:30 | * | Eyess joined #nim |
09:09:44 | * | jken_ joined #nim |
09:10:01 | FromDiscord | <Rika> whats recommended now for js? |
09:10:12 | * | mwbrown_ joined #nim |
09:10:16 | FromDiscord | <Rika> oh hey a misspelling |
09:10:24 | FromDiscord | <Rika> "backand" -> "backend |
09:10:45 | * | tobbez_ joined #nim |
09:10:45 | * | gangstacat quit (*.net *.split) |
09:10:45 | * | mwbrown quit (*.net *.split) |
09:10:45 | * | Ckat quit (*.net *.split) |
09:10:46 | * | nixfreak quit (*.net *.split) |
09:10:46 | * | zedeus quit (*.net *.split) |
09:10:47 | * | akitoshi quit (*.net *.split) |
09:10:47 | * | npgm quit (*.net *.split) |
09:10:47 | * | livcd quit (*.net *.split) |
09:10:47 | * | ehmry quit (*.net *.split) |
09:10:47 | * | bozaloshtsh quit (*.net *.split) |
09:10:47 | * | Yardanico quit (*.net *.split) |
09:10:48 | * | golechwi4 quit (*.net *.split) |
09:10:48 | * | tobbez quit (*.net *.split) |
09:10:48 | * | d10n_ quit (*.net *.split) |
09:10:49 | * | lmariscal quit (*.net *.split) |
09:10:50 | * | SunDwarf quit (*.net *.split) |
09:10:50 | * | r4vi quit (*.net *.split) |
09:10:50 | * | jken quit (*.net *.split) |
09:10:50 | * | EastByte quit (*.net *.split) |
09:10:50 | * | Ckatt is now known as Ckat |
09:10:50 | * | npgm_ is now known as npgm |
09:10:52 | * | mwbrown_ is now known as mwbrown |
09:10:53 | * | akitoshi_ is now known as akitoshi |
09:10:54 | * | tobbez_ is now known as tobbez |
09:11:05 | * | r4vi_ is now known as r4vi |
09:11:25 | PMunch | Yeah I saw that as well.. |
09:11:33 | PMunch | I guess importjs is the way you should do it |
09:15:52 | * | marmotini_ joined #nim |
09:16:20 | * | luis_ quit (Ping timeout: 248 seconds) |
09:16:52 | * | marmotini_ quit (Remote host closed the connection) |
09:17:16 | PMunch | Hmm, why isn't shl with negative numbers shifting right? |
09:17:40 | * | EastByte joined #nim |
09:17:47 | PMunch | Or rather, why is shl with negative numbers possible if it only empties the data? |
09:18:06 | FromGitter | <sheerluck> If it were possible to make a Qt5-bindings for Nim... That_Would_Be_Great.jpg |
09:18:21 | * | gangstacat joined #nim |
09:19:31 | * | gangstacat quit (Remote host closed the connection) |
09:19:39 | * | lritter joined #nim |
09:19:41 | PMunch | sheerluck: github.com/nim-lang/needed-libraries/issues/14 |
09:19:51 | * | gangstacat joined #nim |
09:22:41 | FromDiscord | <Rika> first time delving into nim->js, is there anything to note? is there a doc noting issues or so for js? |
09:23:23 | FromDiscord | <Rika> first time delving into nim->js, is there anything to note? is there a doc noting issues or so for js? |
09:23:53 | FromDiscord | <Rika> first time delving into nim->js, is there anything to note? is there a doc noting issues or so for js? |
09:24:29 | PMunch | Well it is quite different, some parts of the stdlib won't work for example |
09:25:16 | PMunch | Unfortunately I don't think there is a comprehensive document outlining all the differences |
09:26:02 | PMunch | But just ask away if there is anything you struggle with :) |
09:35:33 | * | clyybber joined #nim |
09:35:43 | * | clyybber quit (Client Quit) |
09:46:22 | * | zedeus_ is now known as zedeus |
09:47:24 | * | clyybber joined #nim |
09:50:28 | * | gour quit (Ping timeout: 248 seconds) |
09:52:04 | clyybber | Araq: Sup |
09:53:36 | * | gour joined #nim |
09:54:16 | clyybber | wdyt about introducing =weakSink and =weak ? |
09:54:41 | clyybber | It would be =sink and = respectively but without checking the previous location |
09:54:46 | clyybber | basically the section approach |
09:56:54 | FromDiscord | <Clyybber> @mratsim Do you think that eliding zero-mem initialization is a worthwhile optimization? Or are the C compilers smart enought to do it themselves? |
10:03:19 | PMunch | Clyybber, it used to make a huge impact in certain cases |
10:03:28 | PMunch | But I think those were fixed in the Nim compiler |
10:03:44 | FromGitter | <alehander92> Rika |
10:03:47 | FromGitter | <alehander92> you can ask here |
10:03:56 | FromGitter | <alehander92> what do you need to do |
10:04:14 | clyybber | PMunch: Ah yeah, probably due to genericReset and the like |
10:05:07 | PMunch | I think it was actually just that it realised that it didn't have to not initialise it in certain cases |
10:05:33 | PMunch | Uhm, that sentence came out weird.. But you get what I meant (hopefully) |
10:05:39 | FromGitter | <alehander92> hm, i wonder if i can practice my german in #nim-german-offtopic |
10:05:49 | FromGitter | <alehander92> hm, doesnt |
10:05:55 | FromGitter | <alehander92> the noInit thing work |
10:06:15 | FromGitter | <alehander92> iirc i used it for something |
10:06:16 | PMunch | There is a specific german offtopic channel? |
10:06:34 | FromGitter | <alehander92> not yet!! |
10:06:52 | FromDiscord | <mratsim> @Clyybber only if your structure is on the stack |
10:07:01 | livcd_ | wie gehts? |
10:07:07 | FromDiscord | <Clyybber> livcd: gut |
10:07:26 | * | livcd_ quit (Changing host) |
10:07:26 | * | livcd_ joined #nim |
10:07:42 | FromDiscord | <Clyybber> @mratsim Are they smart enough if its on the stack? |
10:07:52 | dom96 | guten morgen |
10:08:20 | FromGitter | <alehander92> ich wohne in einen wohnung |
10:08:30 | FromDiscord | <mratsim> yes because for local variable all the accesses are local so they can assume no aliasing and no concurrency issue |
10:08:45 | livcd_ | gruss gott dom96 |
10:08:47 | FromGitter | <alehander92> ah i need Datiw type chyecking |
10:09:16 | FromDiscord | <mratsim> on the heap, who knows who also hold a pointer to that memory region (unless you tag them "restrict") |
10:10:26 | FromDiscord | <Clyybber> @mratsim Ok so those assignments/calls that zero out a stack var generally don't end up in the asm? |
10:10:53 | FromDiscord | <Clyybber> alehander92: Wirklich aussergewoehnlich |
10:11:17 | livcd_ | Clybber: gesundheit |
10:11:28 | FromDiscord | <Clyybber> danke |
10:13:00 | FromGitter | <alehander92> Clyybber: das ist eine sehr lang worte |
10:13:02 | FromGitter | <alehander92> fur mich |
10:13:15 | FromDiscord | <Clyybber> deutsche sprache schwere sprache |
10:14:32 | dom96 | Every time I read German I just start singing Rammstein |
10:14:43 | FromGitter | <alehander92> ja, das Grammar ist interresant, alle Werben kommt im .. ende? |
10:14:43 | FromDiscord | <Clyybber> lol |
10:14:51 | FromGitter | <alehander92> oh i had that period |
10:14:54 | FromGitter | <alehander92> thankfully not anymore |
10:15:10 | FromGitter | <alehander92> actually german often sounds very soft to me when i hear native speakers |
10:15:21 | FromDiscord | <Clyybber> weil alle lallen |
10:15:22 | * | ehmry_ is now known as ehmry |
10:15:35 | livcd_ | es klingt nie leise |
10:16:10 | FromGitter | <alehander92> ok time to google translate |
10:16:27 | FromGitter | <alehander92> nah, es ist nicht wie Nederlandisch |
10:16:49 | FromDiscord | <Clyybber> ein bisschen schon |
10:17:00 | FromGitter | <alehander92> es ist weich mit alle h und o thingies |
10:17:02 | livcd_ | pipiwasser |
10:17:05 | FromDiscord | <Clyybber> not from the sound of the language |
10:17:38 | FromDiscord | <Clyybber> niederlandisch is like a very extreme german dialect |
10:18:44 | FromGitter | <alehander92> maybe it just sounds much more throaty |
10:18:46 | FromDiscord | <Rika> alehander92 im still trying to understand stuff okay |
10:18:50 | FromGitter | <alehander92> like ughhlgrlh |
10:18:54 | FromDiscord | <Rika> so ill ask when i actually have a question |
10:18:59 | FromGitter | <alehander92> and german more vowel-y |
10:19:06 | FromGitter | <alehander92> Rika kein Problem |
10:19:39 | FromDiscord | <Rika> are we whipping out the native languages now |
10:19:47 | FromDiscord | <Clyybber> alehander92: dutch sounds like you stretch the vowels until you hit a hard end (the consonants) |
10:20:07 | FromDiscord | <Clyybber> sounds like someone is talking backwards |
10:20:12 | FromGitter | <alehander92> Rika тъи хочиш говорить нет |
10:20:29 | FromGitter | <alehander92> Clyybber interesting |
10:20:36 | FromGitter | <alehander92> so do you understand what they talk about |
10:20:37 | FromDiscord | <Rika> > tfw native language doesnt have weird symbols |
10:20:39 | FromGitter | <alehander92> without learning it |
10:20:41 | * | abm joined #nim |
10:21:03 | FromGitter | <alehander92> come on even french has weird symbold |
10:21:05 | livcd_ | tfw when I had to google what's TFW |
10:21:09 | FromGitter | <alehander92> me too :D |
10:21:42 | FromGitter | <alehander92> Dieses Gefuhl Wehn |
10:21:48 | FromDiscord | <Clyybber> @Rika try icelandic |
10:21:59 | FromDiscord | <Rika> the weird symbols we have are ñ and ng |
10:22:10 | FromGitter | <alehander92> is that vietnameswe |
10:22:14 | FromDiscord | <Clyybber> @Rika what language? |
10:22:15 | FromDiscord | <Rika> filipino |
10:22:24 | FromGitter | <alehander92> nicee |
10:22:30 | FromDiscord | <Rika> we barely use ñ anymore though, left to names |
10:22:52 | FromDiscord | <Rika> we use "ny" instead for ñ |
10:22:53 | FromDiscord | <Clyybber> that n also is used in spanish isnt it? |
10:22:59 | FromDiscord | <Clyybber> nyaa |
10:23:04 | FromGitter | <alehander92> yeah but the ng sounds more like asian |
10:23:05 | FromGitter | <alehander92> to me |
10:23:12 | FromDiscord | <Rika> ñ is from spanish yes |
10:23:22 | FromDiscord | <Rika> we were colonized for over 3 centuries after all |
10:23:26 | FromDiscord | <Rika> (by them) |
10:23:45 | FromGitter | <alehander92> hm, we got 5 centuries |
10:23:51 | FromGitter | <alehander92> :( :D |
10:23:53 | livcd_ | Philippines ? |
10:24:15 | FromDiscord | <Rika> yeah |
10:24:19 | FromGitter | <alehander92> i remember there was a fringe movement for making philippines a us state in early 20th century |
10:24:21 | FromGitter | <alehander92> very fringe |
10:24:23 | FromDiscord | <Rika> are you filipino too? |
10:24:23 | FromDiscord | <Clyybber> either your smiley has a wierd beard or a weird hat |
10:24:32 | livcd_ | titi mo |
10:24:33 | livcd_ | nope |
10:25:01 | FromDiscord | <Rika> what about my |
10:25:02 | FromDiscord | <Rika> yeah |
10:25:04 | FromDiscord | <Rika> that |
10:25:06 | FromDiscord | <Rika> what about it |
10:25:11 | livcd_ | sorry i only know the bad stuff |
10:25:21 | FromGitter | <alehander92> noo |
10:25:40 | FromGitter | <alehander92> mahal ka namin |
10:25:49 | FromGitter | <alehander92> wow this sounds different than i thought |
10:26:00 | FromDiscord | <Clyybber> looks indian |
10:26:01 | FromDiscord | <Rika> its "minamahal" |
10:26:03 | FromGitter | <alehander92> yeah |
10:26:07 | FromDiscord | <Rika> minamahal ka namin |
10:26:14 | FromGitter | <alehander92> aaa |
10:26:17 | FromDiscord | <Clyybber> nivin ay kur chi pake rakh lah |
10:26:28 | FromDiscord | <Rika> wow, such great nim discussion |
10:26:36 | FromDiscord | <Rika> i dont mind though |
10:26:48 | FromGitter | <alehander92> btw we already have |
10:26:57 | FromGitter | <alehander92> the #nim-german-offtopic channel going |
10:27:02 | FromDiscord | <Clyybber> wth |
10:27:02 | FromDiscord | <Rika> w hat |
10:27:04 | FromDiscord | <Clyybber> lol |
10:27:05 | dom96 | There is literally some Nim discussion in #nim-offtopic lol |
10:27:05 | FromDiscord | <Rika> the fuck?? |
10:27:09 | livcd_ | ja genau |
10:27:17 | FromGitter | <alehander92> absolutely serious |
10:27:24 | FromDiscord | <Clyybber> sadly discord offtopic isnt linked to irc offtopic |
10:27:27 | FromGitter | <alehander92> i'd invite you but i am not good in irc |
10:28:11 | FromDiscord | <Rika> ok |
10:28:12 | FromDiscord | <Rika> so |
10:28:34 | FromDiscord | <Rika> id like to update/get an updated version of this https://github.com/oderwat/nim-screeps/ |
10:28:43 | FromDiscord | <Rika> buuuuuuuut i dont know what has changed since 4 years ago |
10:28:57 | FromDiscord | <Rika> so i dont know what is still needed in this module https://github.com/oderwat/nim-screeps/blob/master/src/jsext.nim |
10:29:19 | * | Vladar quit (Quit: Leaving) |
10:29:25 | FromDiscord | <Clyybber> @Rika does it compile? |
10:29:35 | FromDiscord | <Rika> ... |
10:29:37 | FromDiscord | <Rika> let me test that |
10:31:15 | FromDiscord | <Clyybber> @mratsim Btw, were you talking about old or new runtime? |
10:31:34 | FromDiscord | <mratsim> about zeromem? |
10:31:39 | FromDiscord | <Rika> the nimble file is too old haha |
10:31:39 | FromDiscord | <Clyybber> yeah |
10:31:42 | FromDiscord | <mratsim> it's always true |
10:32:23 | FromDiscord | <mratsim> compiler do not assume that they have exclusive access to parameters/global/heap memory unless you tell them with restrict |
10:32:24 | FromDiscord | <alehander42> hm not sure how to create / change channels |
10:32:25 | FromDiscord | <alehander42> here |
10:32:31 | FromDiscord | <alehander42> i'll just leave it at that |
10:32:37 | FromDiscord | <Clyybber> @mratsim Interesting, so gcc can optimize the zero-init away even though eqsink or eq would then access uninitialized memory. So it must specialize them internally somehow |
10:33:22 | FromDiscord | <mratsim> for local variables, calling zeroMem twice should be optimized away if the function is inlined in the module and so the compiler can see it's definition |
10:34:20 | FromDiscord | <mratsim> i.e. you need to condition: |
10:34:20 | FromDiscord | <mratsim> - The compiler must see that underneath zeroMem it's memcpy. |
10:34:20 | FromDiscord | <mratsim> - The compiler knows that the address is only in use by the current function |
10:34:24 | FromDiscord | <mratsim> 2 conditions* |
10:34:59 | FromDiscord | <mratsim> the first requires {.inline.} zeroMem. The second requires a local stack variable or {.restrict.} |
10:35:46 | FromDiscord | <Clyybber> Hmm, I wonder if =sink is inlined, thanks for the info, I'm gonna check it manually now |
10:36:43 | FromDiscord | <Rika> it builds now, but i cant say it works properly |
10:39:42 | FromDiscord | <Rika> wow, nim 0.14 |
10:39:46 | FromDiscord | <Rika> its pretty old |
10:43:34 | * | solitudesf- quit (Quit: Leaving) |
10:44:00 | * | solitudesf joined #nim |
10:47:29 | FromDiscord | <Clyybber> @mratsim checked manually.. Doesnt look like gcc is optimizing those zeroMems away with newruntime |
10:47:33 | FromDiscord | <Clyybber> as expected |
10:47:49 | FromDiscord | <Clyybber> know at least I know that what I'm doing is not entirely useless 😄 |
11:02:24 | Araq | it optimizes away 2 zeroMem in sequence though |
11:04:27 | clyybber | Yeah |
11:06:44 | clyybber | Araq: WDYT about introducing =weakSink and =weak ? They would be sink and asgn respectively, but without checking nor destroying the previous location |
11:07:11 | clyybber | If those are defined for a type then the compiler is allowed to do init elision on variables of that type |
11:07:13 | Araq | was about to suggest them as I cannot see sections working out as easily |
11:07:47 | Araq | on the other hand, we discussed it and it's copyMem |
11:07:51 | Araq | always |
11:07:57 | clyybber | But not for asgn |
11:08:18 | Araq | yeah but does it matter? |
11:09:11 | Araq | init + =sink pair --> copyMem |
11:09:18 | Araq | is the optimization |
11:09:42 | clyybber | Araq: Sure, =weakSink could just be made a copyMem |
11:10:29 | clyybber | Araq: It does matter, especially for the common pattern of initializing multiple variables to one value |
11:11:03 | clyybber | It's also more elegant having =weakSink and =weak as a typebound operation instead of hardcoding the transform to copyMem |
11:11:24 | * | jjido quit (Quit: Connection closed for inactivity) |
11:11:26 | clyybber | But of course we can make =weakSink just be a copyMem |
11:11:44 | clyybber | brb |
11:11:55 | * | clyybber quit (Quit: WeeChat 2.7) |
11:12:52 | * | clyybber joined #nim |
11:15:59 | Araq | ping rayman22201, if you read this and want to help out, use aync with --gc:arc and see if you can make it leak no memory by injecting strategic obj.field = nil assignments much like you inserted dispose() calls before |
11:17:02 | Araq | clyybber, any idea about #12899 ? |
11:17:09 | Araq | https://github.com/nim-lang/Nim/issues/12899 |
11:18:18 | clyybber | hmm, no idea |
11:18:26 | clyybber | maybe its related to cooldomes bug |
11:18:50 | clyybber | that some stuff doesn't get the transformation and that it depends on unrelated code wether that happens or not |
11:24:03 | Araq | well it's not the tuple unpacking, this time |
11:24:21 | Araq | damn this 'collect' thing is nice |
11:24:44 | clyybber | Araq: I'm referring to this: https://github.com/nim-lang/Nim/pull/12781#issuecomment-560779175 |
11:24:46 | disbot | ➥ arc devel |
11:25:56 | * | rockcavera joined #nim |
11:26:01 | Araq | yes I know |
11:26:09 | Araq | but I think he solved it in some PR |
11:32:26 | Araq | clyybber, btw we don't we move 'nil'? |
11:33:05 | Araq | ObjConstr(ownedRefField: nil) produced a weird error message |
11:33:33 | clyybber | why we dont move nil? |
11:33:53 | clyybber | we discussed that a long time ago, I forgot what the reasoning was |
11:36:08 | * | ng0 quit (Ping timeout: 260 seconds) |
11:36:22 | clyybber | hmm, I can't think of a reason now, but I knew there was one :D |
11:38:42 | * | ng0 joined #nim |
11:39:42 | * | jonafato- quit (Quit: ZNC - http://znc.in) |
11:39:52 | * | jonafato joined #nim |
11:54:13 | * | Vladar joined #nim |
11:56:23 | Araq | there was one for owned refs vs refs but good old ref = nil is not optimized to =sink |
11:56:29 | Araq | either |
12:07:52 | clyybber | hmm |
12:08:19 | * | nsf quit (Quit: WeeChat 2.6) |
12:28:55 | FromGitter | <alehander92> mratsim https://www.reddit.com/r/rust/comments/ebpzqx/do_not_stop_worrying_about_blocking_in_async/ |
12:29:00 | FromGitter | <alehander92> thats what i meant before |
12:29:18 | FromGitter | <alehander92> with checking for `blocking (or similar type/effect)` |
12:29:24 | * | solitudesf quit (Ping timeout: 248 seconds) |
12:33:02 | FromGitter | <alehander92> and yeah, one would try to somehow relate it to a value, so one can have different levels of blocking(limited to ~x cycles/time/other or "levels" of probable slowness or known vs unknown latency) |
12:34:05 | FromGitter | <alehander92> but i guess even just having 1-2 `blocking / maybeblocking` levels is good enough for most cases |
12:34:38 | FromGitter | <alehander92> sorry if offtopic, its more just an experimental langdesign idea, not very nim-related |
12:35:57 | Araq | blocking is annoying, more annoying is to put it into a language's type/effect system |
12:37:04 | FromGitter | <alehander92> well yeah, but maybe its not really annoying, e.g. if one can ignore it and mostly just annotate some primitives/infer everything else |
12:37:33 | FromGitter | <alehander92> it seems relatively similar to exception tracking to me |
12:37:33 | Araq | been there, done that, I think it's mostly a failure |
12:38:37 | Araq | in a larger code-base you start to annotate your functions explicitly until the error goes away and then once you undrestood the problem, you can go back and only annotate where it was really required |
12:38:53 | FromGitter | <alehander92> as one can imagine blocking as uncatchable "exception" and async as having a raise list without it (and everything else having list with umm combo of its callees) |
12:39:27 | FromGitter | <alehander92> hm, but why is that |
12:39:51 | FromGitter | <alehander92> the error message should probably show the chainf why a call "b" leads to certain effects |
12:41:10 | FromGitter | <alehander92> e.g. b might be A, because b calls a1 on <..> which calls a2 on <..> which takes a3 on <..> which has annotation `A` on <..> |
12:42:04 | FromGitter | <alehander92> (assuming the user doesnt need to see explicitly any inferred stuff except for error cases) |
12:42:56 | Araq | well non local error messages that span pages are not universally liked either |
12:43:54 | FromGitter | <alehander92> eh .. this message is as simple as most overload errors or stacktraces |
12:44:29 | Araq | it's exactly the same as function parameter type inference |
12:44:40 | FromGitter | <alehander92> non-locality is inherent complexity with inferrence |
12:44:52 | FromGitter | <alehander92> so the users would need to follow up this chain anyway |
12:45:00 | Araq | it works but the error messages are worse than when you have more redundancy |
12:45:39 | FromGitter | <alehander92> well, one can always have less and more verbose errors |
12:46:24 | Araq | well IME tracking down effect system error messages is worse than type mismatch errors in Nim |
12:46:39 | FromGitter | <alehander92> because in some cases the additional info is not redundant, but it makes the user spend seconds instead of minutes |
12:46:40 | Araq | now you can argue that's simply because the error messages are worse |
12:46:47 | FromGitter | <alehander92> which .. is the goal of most developer tools |
12:47:12 | Araq | but also the error messages are worse because it's a harder problem |
12:48:22 | FromGitter | <alehander92> probably, but i am not sure why such a form of an inferrence message would be worse |
12:48:31 | FromGitter | <alehander92> it might be harder to implement |
12:49:34 | Araq | it's not just that, you need to understand that you have a complexity budget, there is only so much your type/effect system can capture before it drags you down and you go back to Python |
12:50:01 | FromGitter | <alehander92> of course, i wouldn't want to overuse something like that |
12:50:14 | FromGitter | <alehander92> just trying to think of useful ways to use it |
12:52:12 | * | endragor quit (Remote host closed the connection) |
12:54:24 | Araq | it's also a problem of composability, "map does block iff the callback does", yay more parametrization, here we come |
12:55:41 | FromGitter | <alehander92> well, not sure whats the difference with the other inference cases |
12:55:57 | FromGitter | <alehander92> the compiler can infer that without making it an explicit part of the visible code |
12:57:24 | FromGitter | <alehander92> generally a does A iff its children calls does A seems as good enough general principle which doesnt need to be encoded explicitly |
13:10:25 | * | marmotini_ joined #nim |
13:15:35 | * | solitudesf joined #nim |
13:17:41 | * | Hideki_ joined #nim |
13:28:33 | * | gour quit (Remote host closed the connection) |
13:29:28 | * | gour joined #nim |
13:31:35 | * | Vladar quit (Remote host closed the connection) |
13:32:11 | * | clyybber quit (Quit: WeeChat 2.7) |
13:39:07 | madprops | having some trouble here using the indexes https://play.nim-lang.org/#ix=24G3 |
13:39:12 | madprops | "wrong number of variables" |
13:39:26 | * | clyybber joined #nim |
13:41:44 | * | nsf joined #nim |
13:46:14 | leorize | madprops: well you need to provide the full code if you want anyone to be able to help... |
13:46:56 | madprops | https://play.nim-lang.org/#ix=24G5 |
13:47:42 | solitudesf | splitLines returns only lines, not indexes |
13:47:44 | leorize | splitLines is an iterator that returns only one value |
13:48:23 | leorize | wrap it in toSeq if you want it to return a seq |
13:48:34 | leorize | although I would say having your own counter is much more efficient |
13:49:51 | leorize | the same thing with `items`, though you can switch to the `pairs` iterator which returns both index and value |
13:50:01 | FromGitter | <kayabaNerve> ```for x, line in input.splitLines().toSeq(): ⏎ for y, c in line:``` [https://gitter.im/nim-lang/Nim?at=5df8dd09f1cc6c27ea6580c9] |
13:50:11 | FromGitter | <kayabaNerve> Or just don't explicitly specify items. |
13:50:13 | FromGitter | <alehander92> ok this is |
13:50:16 | FromGitter | <alehander92> very valid question |
13:50:22 | FromGitter | <alehander92> Araq, ^ we dont have a for statement |
13:50:25 | FromGitter | <alehander92> section in the manual/spec |
13:50:37 | FromGitter | <alehander92> which is strange: i cant find the for index, element behavior |
13:50:39 | FromGitter | <alehander92> specified |
13:50:51 | FromGitter | <alehander92> i'd also expect the same as madprops |
13:50:56 | leorize | https://nim-lang.org/docs/manual.html#iterators-and-the-for-statement |
13:51:03 | leorize | alehander92: it has a huge section there? |
13:51:42 | FromGitter | <alehander92> ah its back there |
13:51:53 | FromGitter | <kayabaNerve> https://nim-lang.github.io/Nim/manual.html#iterators-and-the-for-statement |
13:51:53 | FromGitter | <alehander92> i expected its there with the other statements: sorry! |
13:51:59 | FromGitter | <kayabaNerve> leorize beat me to it :( |
13:52:13 | leorize | I typed the shorter url ;) |
13:52:40 | FromGitter | <kayabaNerve> No idea why I used the long form. Must've been in my history. |
13:53:07 | FromGitter | <kayabaNerve> But I assumed it would be with iterators yet searched every occurrence of `for` to be thorough :P |
13:53:18 | FromGitter | <alehander92> i see ok |
13:53:22 | FromGitter | <alehander92> yeah now it makes sense |
13:53:26 | leorize | I just ctrl-F "for statement" lol |
13:53:29 | FromGitter | <kayabaNerve> This was the 309th |
13:53:35 | FromGitter | <alehander92> yeah but i gave up after `while` |
13:53:36 | FromGitter | <alehander92> :P |
13:53:37 | FromGitter | <kayabaNerve> "for" here :P |
13:54:16 | FromGitter | <alehander92> so yeah basically for i, a is only a consequence of `pairs` indeed |
13:54:21 | FromGitter | <alehander92> i forgot how it works |
13:56:00 | * | clyybber quit (Read error: Connection reset by peer) |
13:56:05 | * | clyybber1 joined #nim |
14:05:31 | * | dddddd joined #nim |
14:13:44 | * | marmotini_ quit (Remote host closed the connection) |
14:15:23 | * | abm quit (Quit: Leaving) |
14:15:29 | FromGitter | <bung87> @zevv are you here? |
14:15:37 | * | marmotini_ joined #nim |
14:16:02 | * | Hideki_ quit (Remote host closed the connection) |
14:18:44 | * | endragor joined #nim |
14:23:41 | * | clyybber1 quit (Ping timeout: 268 seconds) |
14:23:59 | * | clyybber1 joined #nim |
14:28:00 | FromDiscord | <kodkuce> simple lazyman question, is there some tag or symbol when packing an object to json so it ommits out some fields? |
14:28:12 | FromDiscord | <kodkuce> or do i have to manualy do it |
14:30:08 | disruptek | see #11416 |
14:30:39 | disruptek | disbot: wake up. |
14:30:40 | disbot | on it. 👍 |
14:30:54 | disruptek | !pr pragmas json serialization |
14:31:04 | disruptek | !pull pragmas json serialization |
14:31:06 | disbot | https://github.com/nim-lang/Nim/pull/11416 -- 5`doNotSerialize`, `jsonName` pragmas for JSON serialization closes #8104, #10718, also fixes #11415 7& 1 more... |
14:31:42 | disruptek | i guess it never made it in. |
14:34:46 | * | endragor quit (Remote host closed the connection) |
14:37:18 | * | Romanson joined #nim |
14:37:51 | * | endragor joined #nim |
14:39:32 | * | lritter quit (Ping timeout: 248 seconds) |
14:40:27 | * | sealmove joined #nim |
14:40:29 | sealmove | https://www.slant.co/topics/6032/~systems-programming-languages |
14:40:33 | sealmove | Nim is #1 :D |
14:40:33 | disbot | https://github.com/nim-lang/Nim/issues/1 -- 5Trojan horse reported by avira free-av during the setup (installer) |
14:41:27 | PMunch | Haha, unfortunate link from disbot there :P |
14:41:49 | PMunch | But neat! |
14:42:55 | * | Hideki_ joined #nim |
14:44:06 | Zevv | bung87: a bit |
14:44:11 | * | lritter joined #nim |
14:44:25 | sealmove | btw why are people complaining for documentation? i never had issues with Nim documentation, it's decent. |
14:45:36 | blackbeard420 | its certainly not bad |
14:45:57 | FromGitter | <bung87> @Zevv the npeg just matching string , right ? can I capture it as object ? |
14:46:27 | PMunch | sealmove I think a lot of it is left from earlier versions |
14:46:33 | PMunch | It has improved a lot over the last year |
14:46:37 | sealmove | bung87: you can only capture are string, but then you can write code to convert it into object |
14:46:49 | Zevv | right |
14:46:58 | sealmove | as* |
14:47:05 | FromGitter | <bung87> ok , I ‘ll handle it myself. |
14:47:44 | * | Hideki_ quit (Ping timeout: 268 seconds) |
14:47:46 | sealmove | bung87: the code can run on capture, with the block argument (:) syntax |
14:47:57 | Zevv | get inspiration from misc/rod.nim, it's complex but it captures a AST for a real language |
14:49:17 | FromGitter | <bung87> misc/rod.nim? it ’s in which repo ? |
14:49:51 | Zevv | in npeg |
14:50:05 | Zevv | https://github.com/zevv/npeg/blob/master/misc/rod.nim |
14:51:22 | sealmove | eh, i have a neater example I think |
14:51:24 | sealmove | w8 |
14:52:12 | sealmove | https://github.com/sealmove/nimitai/blob/master/nimitai/private/ast.nim#L150 |
14:52:26 | sealmove | this parses a simple expression language |
14:53:56 | * | marmotini_ quit (Remote host closed the connection) |
14:56:15 | * | marmotin_ joined #nim |
14:56:15 | FromGitter | <bung87> cool, powerful lib! |
14:56:26 | sealmove | it's awesome <3 |
14:56:29 | FromGitter | <bung87> with good example. |
14:57:21 | sealmove | we should make a similar dsl for bnf, but i've fell in love with peg and don't have the motivation |
14:58:36 | clyybber1 | sealmove: Rather make a peg that parses bnf and converts it to peg :p |
14:58:48 | clyybber1 | or make a bnf frontend for npeg |
14:58:59 | sealmove | lol, what happened to clyybber0? |
14:59:34 | FromGitter | <alehander92> EIN |
15:00:05 | * | clyybber1 is now known as clyybber |
15:00:24 | FromGitter | <bung87> I just search for what BNF is …. |
15:00:51 | clyybber | sealmove: I guess thats what happens when power cuts off and you relog with the first one not disconnected yet (ping timeout is quite long) |
15:00:52 | * | marmotin_ quit (Ping timeout: 248 seconds) |
15:01:03 | clyybber | bung87: BNF is like a PEG |
15:01:15 | clyybber | but the disadvantage is that BNF can be ambigous |
15:01:42 | clyybber | since it is not limited to context free grammars |
15:02:00 | FromGitter | <bung87> first time I know peg is in Nim document |
15:02:03 | sealmove | bnf works with lexemes, which means you need a seperate lexing phase. peg does both lexing and parsing |
15:03:01 | sealmove | and well, the advantage is that it's a bit higher level, you don't deal with that many details while describing your grammar |
15:03:15 | * | ng0_ joined #nim |
15:03:58 | FromGitter | <bung87> barely touch this field, I mainly building website. |
15:04:24 | clyybber | but apparently you can construct non-context free grammars in peg too |
15:04:33 | clyybber | sealmove: Umm |
15:04:43 | clyybber | Actually that is not defined in BNF |
15:04:44 | * | ng0 quit (Ping timeout: 260 seconds) |
15:04:55 | clyybber | of course you can write lexem = '[' |
15:05:00 | clyybber | but its not required by bnf |
15:05:08 | clyybber | it describes a grammar |
15:05:16 | sealmove | hmm, maybe scanless/not scanless doesn't have to do with bnf? right sorry, i just see the 2 together a lot and misunderstood |
15:05:38 | clyybber | yeah, its easy to get caught up in the terminology |
15:06:17 | sealmove | so what's the main difference between bnf and peg? |
15:06:35 | disruptek | spelling. |
15:07:26 | clyybber | sealmove: PEGS are not ambiguous |
15:07:38 | clyybber | with BNF you could construct an ambiguos grammar |
15:08:10 | clyybber | also there may be some context-free grammars which PEGs are not able to parse, but this is purely theoretical and has not yet been proven |
15:09:00 | Zevv | https://github.com/zevv/npeg/blob/master/doc/papers/From_EBNF_to_PEG.pdf |
15:09:01 | sealmove | so they are flat-out better? |
15:09:07 | Zevv | let me know if you understand the |
15:09:10 | Zevv | that |
15:10:50 | Zevv | or this, while you're at it: https://github.com/zevv/npeg/blob/master/doc/papers/Left_recursion_in_parsing_expression_grammars.pdf |
15:11:22 | clyybber | sealmove: Well there are some things that PEGs cant parse, like X = '|' Y '|' | '|' |
15:11:34 | * | ng0_ is now known as ng0 |
15:11:42 | disruptek | they aren't flat-out better; they are better-suited to different uses. |
15:11:52 | clyybber | but to parse that is batshit hard |
15:12:06 | Zevv | clyybber: that parses just fine |
15:12:10 | sealmove | ok so which uses are bnf > peg? |
15:13:17 | Zevv | bnf is easier on the eyes because of whitespace |
15:13:23 | Zevv | whitespace is always a pain in pegs |
15:13:24 | clyybber | Zevv: Ah sorry, that Y should be and X |
15:13:39 | Zevv | clyybber: I know :) |
15:14:00 | clyybber | and npeg still can do that?? |
15:14:02 | Zevv | BNF allows left recursion, it breaks PEGs |
15:14:35 | Zevv | no, but it is "solved" with operator precedecne, which effectively limits left recursion |
15:14:43 | clyybber | ah, nice |
15:15:08 | clyybber | so is npeg able to count? |
15:15:22 | Zevv | one, three, alot |
15:15:42 | Zevv | count what? |
15:15:49 | clyybber | I mean like: identify wether a word consists of an even or odd amount of chars |
15:15:59 | clyybber | which is what the above does |
15:16:21 | clyybber | it is the language of all words that are an odd amount of '|'s |
15:16:42 | Araq | IMHO the lexer/parser split is almost always desirable and Pegs nudge you into the wrong direction by merging them |
15:16:53 | Zevv | *"||" * "|" |
15:17:21 | Zevv | Araq: sure |
15:18:13 | sealmove | I think you can still have a seperate lexing phase with peg? |
15:18:37 | clyybber | yeah |
15:18:51 | clyybber | Zevv: Ha, right. trickster |
15:18:53 | Zevv | the underlying mechanics allow for that. A character is just a token, and you build rules telling it the order of tokens |
15:19:52 | sealmove | also Zevv, I don't get your remark about whitespace. isn't that an npeg issue rather than a peg issue? :P |
15:19:54 | Zevv | I guess npeg itself could be used for lexing, and then invoke itself again on the lexed tokens |
15:20:10 | Zevv | sealmove: no, you need to be explicit about whitespace in pegs. |
15:20:46 | Zevv | npeg could maybe silently inject whitespace matches in your grammar, but it is impossible to make it do the right thing always |
15:21:11 | sealmove | ah, I thought you meant syntax |
15:21:19 | FromGitter | <alehander92> i think usually there is supposed to be an easy way to ignore whitespace nodes |
15:21:23 | sealmove | yeah sure, but that's again just the fact it does lexing too |
15:21:29 | FromGitter | <alehander92> in such trees maybe |
15:22:00 | Zevv | alehander: well suppose npeg had a mode where it would allow whitespace between any concat or choice operator |
15:22:08 | Zevv | then "foo" * "bar" would match "foo bar" |
15:22:17 | sealmove | ok so yeah, one can make 2 grammars, 1 for lexing and 1 for parsing. you want to use peg over regex anyway |
15:22:19 | Zevv | but that might or might not be what you want. so you need to be explicit now |
15:22:28 | * | PMunch quit (Quit: Leaving) |
15:22:33 | FromGitter | <alehander92> yeah i think its good to be explicit |
15:22:44 | Zevv | sealmove: right, that was the idea. |
15:22:53 | FromGitter | <alehander92> just that one can still say "those node kinds should be not constructed just matched" |
15:23:09 | clyybber | Araq: I think timothee forgot to remove that stdlib check: #12916 |
15:23:10 | disbot | https://github.com/nim-lang/Nim/pull/12916 -- 3Extending #12911 |
15:23:15 | Zevv | I do agree with Araq though. pegs are cool shit, but probbly not the right tool for your job |
15:23:28 | sealmove | but why not? |
15:23:50 | sealmove | i want to hear a disadvantage :P |
15:24:36 | Zevv | perforamance, noisy grammar |
15:25:22 | FromDiscord | <kodkuce> disruptek, sory was on discord and went to offtopick chanell wasted like an hour watching some dude troll indian scamers ower internet |
15:26:47 | clyybber | sealmove: Don't worry, Zevvs just searching for reasons to be lazy :p |
15:28:08 | sealmove | Lastly there are parser combinators, which was always mystical to me... |
15:28:41 | sealmove | have any of you worked with those? |
15:29:43 | Zevv | well, that is basically what npeg does internally |
15:30:07 | Zevv | you give it a pattern, and combine it with another pattern trough some operator, and the result is a larger pattern |
15:30:47 | FromGitter | <alehander92> parser combinators imo are the easiest way to do parsers |
15:30:53 | sealmove | oh hmm so if we made this "manual peg construction" interface, it would basically be a parser combinator? |
15:36:55 | * | Hideki_ joined #nim |
15:37:01 | * | letto quit (Quit: Konversation terminated!) |
15:37:35 | * | letto joined #nim |
15:40:36 | FromGitter | <bung87> (https://files.gitter.im/nim-lang/Nim/mQy2/Screenshot-2019-12-17-at-11.40.19-PM.png) |
15:40:55 | FromGitter | <bung87> Now I can parse this : ) |
15:41:09 | * | marmotini_ joined #nim |
15:41:19 | * | nsf quit (Quit: WeeChat 2.6) |
15:41:24 | * | Hideki_ quit (Ping timeout: 248 seconds) |
15:42:14 | clyybber | bung87: Nice |
15:43:27 | * | marmotini_ quit (Remote host closed the connection) |
15:47:29 | * | marmotini_ joined #nim |
15:47:38 | FromGitter | <bung87> 😃 |
15:50:43 | * | sammich quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
15:52:29 | * | sammich joined #nim |
15:54:46 | * | Hideki_ joined #nim |
15:56:00 | * | marmotini_ quit (Remote host closed the connection) |
15:56:39 | * | Yardanico_ quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
15:56:53 | * | Yardanico joined #nim |
15:58:05 | * | icebattle joined #nim |
15:58:41 | sealmove | hmm, i found a small bug in dumpTree/dumpLisp/dumpAstGen macros |
15:59:26 | * | Hideki_ quit (Ping timeout: 265 seconds) |
15:59:55 | * | clyybber quit (Quit: WeeChat 2.7) |
16:01:29 | * | clyybber joined #nim |
16:08:00 | * | endragor quit (Remote host closed the connection) |
16:16:21 | * | marmotini_ joined #nim |
16:17:54 | * | Sargun quit (Changing host) |
16:17:54 | * | Sargun joined #nim |
16:20:51 | FromDiscord | <Clyybber> disruptek: Apparently you can start wayfire in wayfire in wayfire in wayfire in wayfire in wayfire in wa.. |
16:21:15 | disruptek | now /that's/ what i've been missing. |
16:21:31 | clyybber | and its still buttery smooth |
16:21:38 | disruptek | well, that's wayland. |
16:21:49 | clyybber | well, that's awesome. |
16:21:59 | disruptek | yes. welcome to the party. |
16:22:21 | clyybber | what kind of music is playing? |
16:23:03 | * | marmotini_ quit (Remote host closed the connection) |
16:23:05 | * | endragor joined #nim |
16:23:22 | disruptek | i don't think you'd like it. |
16:24:36 | * | lbart quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
16:24:51 | clyybber | radiorock |
16:25:08 | clyybber | apparently theres a band named wayland |
16:25:46 | clyybber | and listening to them |
16:25:49 | clyybber | I think you are right |
16:25:59 | disruptek | tol' ya. |
16:26:27 | * | Hideki_ joined #nim |
16:26:38 | disruptek | so. remote branches. should nimph setup a remote for every local branch? to push it to origin? |
16:27:12 | disruptek | maybe there's a good reason not to but... i can't think of one. |
16:27:17 | * | marmotini_ joined #nim |
16:27:57 | * | endragor quit (Ping timeout: 265 seconds) |
16:31:19 | FromDiscord | <kodkuce> so since that doNotSerilaize dient get in how would you handle excluding stuff, my only logic is to create same types but whitout fealds i need then copying from one to other then jsoning it, kida sounds bad perfomace wise, option 2 would be to create a string myself with for loop |
16:31:33 | FromGitter | <alehander92> there are libs like |
16:31:34 | FromDiscord | <kodkuce> https://play.nim-lang.org/#ix=24HO |
16:31:40 | FromGitter | <alehander92> https://github.com/status-im/nim-json-serialization |
16:31:47 | FromGitter | <alehander92> which iirc support notSerialize / renames |
16:32:02 | FromGitter | <alehander92> and dont use intermediate json nodes |
16:32:53 | FromGitter | <alehander92> https://github.com/status-im/nim-serialization#custom-serialization-of-user-defined-types |
16:33:00 | rayman22201 | @Araq: pong. I just woke up. Still need me? Is gc:arc on devel for me to try? |
16:33:34 | Araq | who knows |
16:33:58 | FromDiscord | <kodkuce> alehander92: will it conficlt with normal JSON cuz would need to rewrite some stuff i guess |
16:34:01 | Araq | rayman22201: I think it's worth a try if you're on Unix |
16:34:24 | disruptek | kodkuce: no, you should use the status product. |
16:35:18 | clyybber | Araq: I like the naming of the cycle collector switch |
16:35:50 | rayman22201 | 👍 I will give it a shot Araq |
16:35:50 | Araq | it's the best thing about it |
16:35:58 | * | Hideki_ quit (Ping timeout: 252 seconds) |
16:36:19 | * | tane joined #nim |
16:36:30 | clyybber | nim is gonna conquer Rohan |
16:36:35 | * | coet-i3 joined #nim |
16:36:43 | rayman22201 | But first, morning coffee |
16:37:39 | * | krux02 joined #nim |
16:37:42 | coet-i3 | Hi all, I'm trying to install this library in unix https://github.com/danielecook/seq-collection using `nim c sc.nim`, but it throws the following error: seq-collection/sc.nim(5, 8) Error: cannot open file: argparse |
16:37:46 | coet-i3 | Any idea how to fix it? |
16:37:59 | coet-i3 | I don't have any experience with nim |
16:38:27 | Araq | nimble install it to also install its dependencies |
16:38:29 | coet-i3 | I'm using Nim Compiler Version 1.0.4 [Linux: amd64] |
16:40:36 | coet-i3 | Araq, thanks. How do I install it with nimble? |
16:40:42 | shashlick | how did you install it? If you `nimble install https://github.com/danielecook/seq-collection`, it will install it along with all its dependencies |
16:40:56 | clyybber | Araq: Can https://github.com/nim-lang/Nim/pull/12916 get the merge-when-green tag? |
16:40:57 | disbot | ➥ Extending #12911 |
16:41:02 | coet-i3 | shashlick, oh nice, I'll try that, thanks! |
16:41:12 | shashlick | seq-collection is not in the official packages, might want to ask the author to contribute it |
16:43:23 | coet-i3 | shashlick, I will report an enhancement to him to maybe recommend to install it with nimble, which doesn't give errors. |
16:43:53 | coet-i3 | Trying to run the `sc` tool though gives a new error (could not load: libhts.so), but that's outside the scope of this channel, I think :P |
16:44:08 | FromDiscord | <kodkuce> how to nimble install this nim-json-serialable form status |
16:44:38 | FromDiscord | <kodkuce> i tryed nimble install nim-json-serialization but got not found |
16:44:54 | FromDiscord | <kodkuce> do i need pass github url? |
16:45:44 | shashlick | coet-i3: might need to install it with your package manager |
16:46:10 | shashlick | kodkuce: what's the repo |
16:46:17 | Araq | clyybber: bug #12899 is so weird |
16:46:19 | disbot | https://github.com/nim-lang/Nim/issues/12899 -- 3ARC/newruntime memory corruption ; snippet at 12https://play.nim-lang.org/#ix=24HS |
16:46:23 | clyybber | yeah |
16:46:35 | Araq | change |
16:46:36 | Araq | let input = @["KXSC, BGMC => 7 PTHL", "PXFX => LBZJ", "WXRQ, ZSCZD => HLQM"] |
16:46:52 | Araq | to a seq with fewer elements and the bug disappears |
16:47:12 | FromDiscord | <kodkuce> shashilick: will try with statusim ifnront |
16:47:45 | FromDiscord | <kodkuce> same with nimble install status-im/nim-json-serialization |
16:48:17 | Araq | I'm running it under valgrind, is says we access freed memory, we free the memory in the seq's '=' operator |
16:48:27 | clyybber | hmm |
16:48:49 | clyybber | maybe a missing zero-mem? |
16:49:55 | FromDiscord | <kodkuce> beh just put nimble install https://github.com/status-im/nim-json-serialization and it works |
16:50:18 | * | nsf joined #nim |
16:50:25 | shashlick | ya you need the full path |
16:51:01 | shashlick | it is called json_serialization in the nimble repo |
16:51:15 | coet-i3 | shashlick, yes, a `sudo apt install libhts-dev` solved it finally :) |
16:52:24 | disruptek | isn't that fun? you require the packages list just to disambiguate symbols. |
16:55:51 | Araq | clyybber: not as far as I can tell |
16:57:32 | clyybber | Hmm, very weird |
17:01:05 | clyybber | thats the only explanation I would be able to come up with rn |
17:01:15 | clyybber | because that is one thing that is exclusive to newruntime |
17:01:33 | clyybber | as in that we check the dest in a `=` |
17:01:39 | clyybber | hmm, I wonder what else it could be |
17:04:28 | clyybber | bbl |
17:04:30 | * | clyybber quit (Quit: WeeChat 2.7) |
17:11:00 | FromDiscord | <kodkuce> hmm duno if i am retarded or blind but this status-im calling toJson on gives me undeclared routine: 'toJson |
17:11:24 | disruptek | hol' up. |
17:11:25 | FromDiscord | <kodkuce> *calling toJson on my instanced object |
17:11:30 | disruptek | you don't know if you're blind or not? |
17:11:49 | FromDiscord | <kodkuce> i have glasses xD |
17:11:49 | * | disruptek 🤯 |
17:11:51 | FromDiscord | <kodkuce> so i am half blind i guess |
17:12:07 | disruptek | maybe people put them on your face because your eyes creep them out. |
17:12:37 | FromDiscord | <kodkuce> lol why would my eys freek people out |
17:12:41 | FromDiscord | <kodkuce> i dont use drugs |
17:12:51 | disruptek | how do you know? |
17:13:30 | * | sealmove quit (Quit: WeeChat 2.6) |
17:13:59 | FromDiscord | <kodkuce> i imported like in test_serilazation.nim serialization/object_serialization, serialization/testing/generic_suite , hmm i can tell the difference |
17:14:18 | disruptek | do the tests work? |
17:16:16 | FromDiscord | <kodkuce> would need to gitclone it and try, meybe issue is i dident import ../json_serialization, ./utils, cuz it has ../ guessing directory back reference |
17:16:39 | FromDiscord | <kodkuce> or lol guess i can just import json_serialization |
17:16:52 | FromDiscord | <kodkuce> cuz probbaly thats how nimble handles it |
17:17:12 | disruptek | y'know, there's a package manager that works with clones. |
17:17:39 | FromDiscord | <kodkuce> dident know that |
17:18:04 | disruptek | the guy that wrote it is pretty good looking, too. |
17:18:18 | FromDiscord | <kodkuce> /home/me/.nimble/pkgs/stew-0.1.0/stew/shims/macros.nim(44, 28) Error: cannot get child of node kind: nnkNilLit |
17:18:22 | FromDiscord | <kodkuce> doom |
17:18:25 | disruptek | but, i guess that wouldn't matter to a blind person. |
17:18:29 | * | coet-i3 left #nim ("Leaving") |
17:18:39 | shashlick | gosh someone broke nimgrep |
17:18:43 | FromDiscord | <kodkuce> yep i am half doomed form start 🙂 |
17:18:44 | shashlick | what are the odds of that |
17:18:48 | disruptek | i'm told he has magic hands. |
17:18:56 | disruptek | !pull nimgrep |
17:18:58 | disbot | https://github.com/nim-lang/Nim/pull/12779 -- 6nimgrep improvements 7& 12 more... |
17:19:00 | disruptek | !repo nimph |
17:19:01 | disbot | https://github.com/disruptek/nimph -- 9nimph: 11a nim package hierarchy manager from the future 🧚 15 19⭐ 0🍴 7& 1 more... |
17:20:10 | shashlick | ya, they are missing a newline which breaks the output |
17:20:40 | shashlick | C:\Users\Test\nimcache\nimterop\nimpcre\buildcache\pcre.h1 matches |
17:23:11 | * | NimBot joined #nim |
17:26:44 | FromDiscord | <kodkuce> so this shims macro cry means i am doomed? |
17:32:07 | FromDiscord | <mratsim> @kodkuce check the generic sandwitch problem to make sure you're not affected |
17:32:56 | FromDiscord | <mratsim> workaround may be this: https://github.com/status-im/nim-serialization/issues/4#issuecomment-491307872 |
17:32:58 | disbot | ➥ [Beacon Chain] Undeclared identifier ReaderType ; snippet at 12https://play.nim-lang.org/#ix=24I4 |
17:33:36 | FromDiscord | <mratsim> `json_serialization` must be visible everywhere you use serialization, not just the serialization package |
17:34:23 | FromDiscord | <kodkuce> what you mean visiable evrywhere, i imported it |
17:34:47 | FromDiscord | <kodkuce> did import serialization/object_serialization, serialization/testing/generic_suite, json_serialization |
17:35:14 | FromDiscord | <kodkuce> i probbaly dont need serialization/testing/generic_suite |
17:37:52 | * | Romanson quit (Quit: Connection closed for inactivity) |
17:41:53 | FromDiscord | <kodkuce> only thing i dont like about nim is nothing works out of box xD |
17:42:03 | * | krux02 quit (Remote host closed the connection) |
17:51:36 | FromDiscord | <kodkuce> beh will just manual it |
17:53:20 | lqdev[m] | @kodkuce it works once you get used to it ;) |
17:55:24 | FromDiscord | <kodkuce> the box is huge from my perspective |
17:55:48 | FromDiscord | <kodkuce> or small duno am reaching brain melt |
17:56:55 | * | abm joined #nim |
17:57:27 | FromDiscord | <Fern & Simula (They/Them)> is there a way to get the current working directory from the js backend? |
17:57:55 | lqdev[m] | what do you mean "current working directory"? you mean the URL? |
17:58:55 | FromDiscord | <Fern & Simula (They/Them)> well that's the thing. the script isn't running in a browser |
17:59:14 | FromDiscord | <Fern & Simula (They/Them)> so it needs to be the current directory on the server |
18:03:55 | FromDiscord | <Fern & Simula (They/Them)> trying os.getCurrentDir() results in `Error: this proc is not available on the NimScript target; usage of 'getCurrentDir' is a user-defined error` |
18:06:21 | disruptek | no way to getCurrentDir at compile-time, either. |
18:06:37 | Araq | by design. |
18:07:03 | Araq | binaries that hardcode /home/yourname are super unportable |
18:07:53 | disruptek | who are you to decide what i want to do with data i get access to at compile-time? |
18:07:56 | FromDiscord | <Fern & Simula (They/Them)> alright. any way to get command line params in the js target? i tried os.commandLineParams but running it yells about it not being defined for the nintendo switch |
18:08:31 | FromDiscord | <Fern & Simula (They/Them)> `Error: Error: unhandled exception: paramCount is not implemented on Nintendo Switch [OSError]` |
18:08:42 | Araq | disruptek: the one who had a buggy nimble tool because it used getCurrentDir at compile-time |
18:08:52 | disruptek | i have legit reasons to want cwd at compile-time. |
18:09:25 | FromDiscord | <Fern & Simula (They/Them)> same. i just need it for this one test |
18:09:36 | disruptek | anyway, if you're looking for someone to defend nimble, you've come to the wrong place. |
18:09:37 | Araq | Fern & Simula: "current directory on the server" is not a thing in JS land, import it from nodejs if that's what you're using |
18:09:56 | FromDiscord | <Fern & Simula (They/Them)> alright, thanks |
18:10:35 | Araq | disruptek: I have legit reasons to design a language and library that are not as error-prone as e.g. C++ |
18:10:59 | disruptek | bump would use cwd at compile-time to correctly find the project's .nimble and fetch the version for use in other tools such as cligen, to offer a working --version. |
18:11:29 | Araq | bump can use other means to accomplish the same |
18:11:32 | disruptek | it's a major deficiency for other ct work like openapi and attempting to write outputs to somewhere useful. |
18:11:37 | disruptek | Araq: please elaborate. |
18:12:17 | shashlick | nimpcre now uses nimterop |
18:12:20 | shashlick | !repo nimpcre |
18:12:21 | disbot | https://github.com/genotrance/nimpcre -- 9nimpcre: 11PCRE wrapper for Nim 15 5⭐ 0🍴 |
18:12:45 | disruptek | Araq: i'm asking because i spent an inordinate amount of time trying to solve this problem "properly" and i could not. |
18:12:56 | disruptek | bump has a solution but it's not proper. |
18:13:31 | Araq | why does 'bump' need anthing like that? bump's own current directory is useless for its operation |
18:13:52 | disruptek | why do you think you should get to choose what my software library is useful for? |
18:14:28 | disruptek | there's no reliable way to find the project's .nimble at compile-time. bump offers this feature because the one that cligen came up with was insufficient. |
18:14:42 | disruptek | my feature is more brittle than it needs to be because you're stubborn. 🤣 |
18:15:14 | Araq | 1. I don't understand the context with cligen etc. at all. |
18:15:35 | disruptek | cligen offers a bit of a built-in for producing output for --version. |
18:15:45 | disruptek | sadly, this doesn't work reliably. |
18:15:56 | Araq | 2. I'm only against getCurrentDir, introduce a new staticGetCurrentDir and create a PR |
18:16:02 | disruptek | bump's version works /more/ reliably, but it's still too brittle. |
18:16:16 | disruptek | fair enough. |
18:18:42 | disruptek | i understand your question better now. it's not that bump uses its cwd, it's that it offers a compile-time proc to find/parse the version from the .nimble. |
18:18:59 | disruptek | which it finds by investigating the filesystem. |
18:21:01 | Araq | does that mean 'bump' is also a library? |
18:21:07 | disruptek | yes. |
18:21:15 | Araq | aha, that explains a lot :P |
18:21:23 | disruptek | you can't install it, can you? |
18:21:38 | disruptek | thank for nimble friends for that. |
18:21:40 | Araq | I was about to but --gc:arc keeps me busy |
18:21:47 | disruptek | s/thank for/thank your/ |
18:22:21 | Araq | I'll use bump on Karax anytime soon now |
18:23:02 | disruptek | i do kinda need you to give nimph a shot at some point because there's apparently some kinda use-case that you want and i cannot guess what it might be. 😁 |
18:25:29 | * | zyklon quit (Quit: Konversation terminated!) |
18:25:39 | * | zyklon joined #nim |
18:26:49 | Araq | lol |
18:27:02 | Araq | "apparently some kinda use-case" |
18:27:19 | * | icebattle quit (Quit: leaving) |
18:27:46 | Araq | just imagine Araq using project X, X wasn't written by Araq and he needs to randomly change X or one of its plentiful dependencies |
18:28:10 | Araq | in order to debug some Nim compiler regression |
18:28:42 | disruptek | yes, well i have a branch that lets you fork any dep, edit it, push it. literally that simple. |
18:29:21 | Araq | maybe good enough, maybe not. for example, I also need to use 'nim_temp' as the Nim compiler, not 'nim' |
18:29:34 | disruptek | nimph doesn't have anything to do with compilation. |
18:29:46 | disruptek | it doesn't build anything for you, ever. |
18:30:03 | Araq | ok, that's good |
18:30:05 | disruptek | you use `nim c some/file.nim` to compile stuff. or whatever. |
18:30:15 | Araq | yeah, understood. |
18:30:43 | * | uvegbot joined #nim |
18:30:46 | Araq | nimph also needs to understand to install deps into project/deps or anything like that |
18:31:00 | disruptek | yes, it does that. |
18:31:33 | * | zyklon quit (Ping timeout: 245 seconds) |
18:32:06 | Araq | sweet. Now my list of musthaves is empty |
18:32:38 | disruptek | mine, too. |
18:33:06 | * | Hideki_ joined #nim |
18:33:34 | disruptek | also `nimph upgrade`, `nimph tag`, `nimph fetch`, `nimph pull`... i've been busy. |
18:34:21 | stefantalpalaru | Why is {.compile: "file.c".} using gcc instead of g++ to compile this file when the C++ backend was selected with "nim cpp ..."? The args are the same as for g++, including "-fpermissive". |
18:36:23 | Araq | stefantalpalaru: because of the .c extension iirc |
18:37:33 | * | Hideki_ quit (Ping timeout: 246 seconds) |
18:37:52 | stefantalpalaru | But I want to detect, inside a .c file, Nim's backend. |
18:38:15 | stefantalpalaru | There's nothing else to help me, no Nim specific define. |
18:38:56 | Araq | defined(__cplusplus) ? |
18:39:39 | stefantalpalaru | Yes, that's what I want, but if you're compiling my .c file with gcc, I'm not getting it. |
18:39:43 | Araq | when defined(cpp): echo "nim cpp active" |
18:40:10 | stefantalpalaru | That's in Nim. I need it in C. |
18:40:18 | * | jjido joined #nim |
18:40:27 | Araq | and why is that Nim's problem then? |
18:41:03 | FromDiscord | <Fern & Simula (They/Them)> Araq: Thanks for the suggestion. I imported process.cwd from node and it works (almost) perfectly :) |
18:41:23 | stefantalpalaru | I'll set a define in passC from Nim. |
18:43:31 | * | icebattle joined #nim |
18:45:11 | Araq | ok |
18:45:23 | Araq | so ... I found the bug |
18:48:41 | * | marmotini_ quit (Ping timeout: 252 seconds) |
18:49:12 | disruptek | do tell. |
18:51:59 | disruptek | such a tease. |
18:54:38 | * | fredrik92 joined #nim |
18:54:55 | * | couven92 quit (Disconnected by services) |
18:55:01 | * | fredrik92 is now known as couven92 |
18:55:22 | * | fredrik92 joined #nim |
18:55:38 | Araq | it's a simple codegen bug |
18:55:52 | * | ofelas joined #nim |
18:56:07 | Araq | that also happens to answer the question of whether destructors need to reset the memory |
18:56:18 | Araq | the answer is: yes, they have to. |
18:57:11 | FromGitter | <Willyboar> Araq we want a christmas present |
18:57:27 | Araq | I know |
18:57:46 | Araq | I have 7 days left |
18:58:06 | FromGitter | <Willyboar> thats my boy |
18:58:15 | FromGitter | <Willyboar> dis where are you? |
18:59:12 | disruptek | right here, son. |
18:59:40 | FromGitter | <Willyboar> what you are working on today? |
19:00:12 | disruptek | last testing for |
19:00:19 | disruptek | !issue changes remotes tracking branches |
19:00:20 | disbot | no results 😢 |
19:00:23 | disruptek | !issue changes remotes |
19:00:25 | disbot | https://github.com/nim-lang/Nim/issues/8576 -- 5[git] rename git branch `devel` to `master` and `master` to `stable` 7& 1 more... |
19:00:34 | disruptek | !search changes remotes tracking |
19:00:35 | disbot | https://github.com/disruptek/nimph/issues/22 -- 3changes to remotes should also add missing tracking branches |
19:00:37 | disruptek | i'm dumb, too. |
19:01:25 | disruptek | what about you, mr. boar? |
19:03:55 | FromGitter | <Willyboar> study about web frameworks |
19:04:13 | FromGitter | <Willyboar> i found another worth to see project |
19:04:37 | disruptek | what is it? |
19:04:58 | FromGitter | <Willyboar> !repo whip |
19:04:59 | disbot | https://github.com/mattaylor/whip -- 9whip: 11Simple fast http server for nim based on httpbeast and nest for high performance routing 15 16⭐ 2🍴 |
19:07:24 | disruptek | i looked at it but iirc there were some blockers due to httpbeast. |
19:07:28 | leorize | I wouldn't recommend anything based on httpbeast for production usage :P |
19:07:38 | FromDiscord | <Fern & Simula (They/Them)> what's wrong with httpbeast? |
19:07:48 | leorize | it was made for benchmarks |
19:07:53 | FromDiscord | <Fern & Simula (They/Them)> ahhhh |
19:08:23 | FromGitter | <Willyboar> well there a lot of missing parts |
19:08:37 | FromGitter | <Willyboar> to create a mvc web framework |
19:08:45 | * | marmotini_ joined #nim |
19:12:30 | FromGitter | <Willyboar> nim forum doesn't using httpbeast? |
19:13:23 | Araq | httpbeast didn't exist when dom96 wrote the Nim forum |
19:14:00 | Araq | and http benchmarks are mostly detached from reality anyway IMHO, anything will do anyway, including PHP |
19:14:12 | leorize | also nimforum is shielded by a nginx server |
19:14:39 | FromGitter | <Willyboar> So you suggest to use std server? |
19:14:40 | Araq | it's better to focus on matrix benchmarks and things related to machine learning or gaming where speed can matter |
19:15:25 | Araq | things are different when you're Google though, then you might want to use Nim for its HTTP speed :D |
19:16:01 | * | rockcavera quit (Remote host closed the connection) |
19:16:13 | oz | ...or create your own programming language. :p |
19:16:15 | FromDiscord | <Lantos> I saw that nim performed well in the http framework bench mark |
19:17:00 | FromDiscord | <Lantos> https://www.techempower.com/benchmarks/#section=data-r18&hw=ph&test=json |
19:17:04 | FromGitter | <Willyboar> Araq are you still develop ormin? |
19:17:05 | leorize | I think dom96 made httpbeast the default in jester for that exact reason... |
19:17:10 | FromGitter | <Willyboar> or you suggest norm? |
19:17:24 | Araq | Lantos: It's important to be good in benchmarks but these techempower benchmarks are a new level of cargo cult |
19:17:44 | FromGitter | <Willyboar> yes httpbeast is the default jester server except of windows |
19:18:11 | Araq | "Omg, so many PLs and I can't decide and I also don't understand programming. I'll pick one that wins benchmarks" |
19:18:11 | leorize | I wouldn't say that it's a great idea outside of benchmarks :/ |
19:18:13 | FromDiscord | <Lantos> huh cargo cult? |
19:18:32 | FromDiscord | <Lantos> oh lol, well it matters to turn heads |
19:19:46 | leorize | @Willyboar: you can safely assume that any Araq's projects that is not Nim is no longer developed by him. |
19:20:03 | Araq | Willyboar: I don't know Norm so I cannot recommend it |
19:20:12 | FromDiscord | <Lantos> I've been using norm |
19:20:17 | Araq | hey! that's unfair, leorize. I'm trying my best |
19:20:41 | leorize | it's alright, I know you're busy making all of us happy :) |
19:20:47 | FromDiscord | <Lantos> It's pretty good, the repo owner is responsive. I |
19:21:15 | Araq | yeah, so pick Norm then. Hopefully it learns some tricks from Ormin |
19:21:24 | leorize | it... didn't |
19:21:32 | leorize | I'm tempted to try ormin because of that |
19:22:00 | Araq | there is nothing in Ormin's design that I regret fwiw |
19:22:33 | Araq | it asked the right questions and gave the right answers, it's underdeveloped though |
19:22:36 | FromDiscord | <Lantos> it works aside from a few features. I think he is adding obj referencing (fk). I was going to add a pooled connection but Need to learn more about nims metaprogramming. There is also a PR out for mongodb which is nice |
19:24:03 | disruptek | the only problem i see with ormin is the lack of documentation. |
19:24:40 | Araq | I wrote an article about it and it has examples. the only problem is that I haven't used it in production |
19:25:58 | * | seni joined #nim |
19:30:00 | FromGitter | <Willyboar> well both lacks mysql support |
19:32:39 | leorize | postgres support in ormin is incomplete iirc |
19:32:59 | FromGitter | <Willyboar> https://github.com/itsumura-h/nim-allographer |
19:33:06 | * | ofelas quit (Quit: shutdown -h now) |
19:33:30 | * | marmotini_ quit (Remote host closed the connection) |
19:33:48 | FromGitter | <Willyboar> i think the same is person developing a MVC Framework based on jester |
19:40:59 | FromDiscord | <Lantos> is this an old blog? |
19:40:59 | FromDiscord | <Lantos> https://nim-lang.org/araq/ |
19:41:08 | FromDiscord | <Lantos> or have you got another blog |
19:41:17 | leorize | that's his current blog |
19:43:19 | Araq | https://github.com/Araq/blog/blob/master/ormin.rst |
19:43:40 | Araq | note: I never released the article because back then websockets produced unreliable junk |
19:44:30 | Araq | better look at the raw version here: https://raw.githubusercontent.com/Araq/blog/master/ormin.rst |
19:46:28 | FromDiscord | <Fern & Simula (They/Them)> is there a way to use the push pragma to temporarily turn off style checks? |
19:47:25 | Araq | yes, look at posix.nim for an example of how to do that |
19:47:44 | FromDiscord | <Fern & Simula (They/Them)> thank you |
19:48:08 | FromDiscord | <Lantos> inteeresting |
19:49:55 | FromDiscord | <Fern & Simula (They/Them)> ah, i was hoping i could us it before an import to disable style checks for that import, but i guess not |
19:50:39 | FromDiscord | <Lantos> did you have in the pipeline the orm creating the schema? Or not something worth supporting from your point of view? |
19:51:58 | Araq | I had some ideas but Ormin's main idea is that |
19:52:11 | Araq | A) the model exists already and you want to interface to it |
19:52:14 | Araq | or |
19:52:35 | Araq | B) the module description is so full of vendor specific stuff that you don't want to generated from Nim type sections |
19:52:44 | Araq | *model description |
19:53:51 | Araq | I'm a DB guy, the DB and the data it holds are more important and usually outlast applications |
19:54:41 | Araq | a DB is not a dumb data store that you want to abstract over, that's only claimed by OOP amateurs. |
19:58:42 | shashlick | dom96: looks like you updated the choosenim CI with correct github API token but since it wasn't a tagged build, it didn't post any release |
19:59:42 | shashlick | dom96: probably just restart this build and it might work - https://travis-ci.org/dom96/choosenim/builds/612128753 |
20:01:13 | * | MightyJoe joined #nim |
20:03:48 | * | cyraxjoe quit (Ping timeout: 248 seconds) |
20:04:15 | salotz[m] | saw "ormin" and thought "has someone already implemented irmin for nim" |
20:04:27 | salotz[m] | alas no.. |
20:06:58 | FromDiscord | <Lantos> You'd hope that your db evolved with your objects though? |
20:08:02 | FromDiscord | <Lantos> seems also a similar approach that diesel.rs is taking |
20:08:11 | leorize | in real life things work the other way around from my experience |
20:10:08 | FromDiscord | <Fern & Simula (They/Them)> same. My db only evolves with objects in the very beginning phase of application development |
20:20:08 | * | nsf quit (Quit: WeeChat 2.6) |
20:27:44 | * | luis_ joined #nim |
20:27:48 | * | luis_ quit (Remote host closed the connection) |
20:28:59 | * | luis_ joined #nim |
20:29:02 | * | luis_ quit (Remote host closed the connection) |
20:29:45 | * | luis_ joined #nim |
20:38:49 | * | luis__ joined #nim |
20:39:53 | * | luis_ quit (Ping timeout: 245 seconds) |
20:50:07 | * | jjido quit (Quit: Connection closed for inactivity) |
20:52:22 | * | luis__ quit (Quit: luis__) |
21:01:55 | * | voltist joined #nim |
21:05:50 | * | voltist quit (Read error: Connection reset by peer) |
21:06:00 | * | voltist joined #nim |
21:13:58 | * | luis_ joined #nim |
21:14:03 | * | luis_ quit (Remote host closed the connection) |
21:14:42 | * | luis_ joined #nim |
21:14:44 | * | luis_ quit (Read error: Connection reset by peer) |
21:15:22 | * | luis_ joined #nim |
21:21:42 | * | luis_ quit (Remote host closed the connection) |
21:23:18 | * | luis_ joined #nim |
21:23:59 | FromGitter | <Milerius> Hey I'm looking for help in nim If someone can help me |
21:25:24 | disruptek | sure, but please don't make us guess. what seems to be the problem? |
21:25:53 | FromGitter | <Milerius> I try to compile an OpenGL C program on my Mac OS with nim, playing with the pragma |
21:25:55 | FromGitter | <Milerius> So far I got: |
21:26:03 | FromGitter | <Milerius> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5df947eb0dc628523e529d70] |
21:26:28 | FromGitter | <Milerius> But I still got the errors: error: `unknown type name 'GLuint'` |
21:26:53 | FromGitter | <Milerius> I don't really know if I'm doing something wrong. |
21:27:39 | disruptek | me neither; i've never written anything with opengl. |
21:27:45 | disruptek | were you unable to find an example? |
21:29:43 | FromGitter | <Milerius> Unfortunately I didn't find any example compiling OpenGL program in nim |
21:29:47 | FromGitter | <Milerius> With such a command line. |
21:30:11 | leorize | Milerius: have you import opengl? |
21:30:24 | leorize | the error you got is due to missing a type definition |
21:30:34 | leorize | not because you didn't link the right libraries (yet) |
21:30:40 | FromGitter | <Milerius> Yeah, I'm not using OpenGL nim library |
21:30:43 | FromGitter | <Milerius> I don't want to use them |
21:30:53 | FromGitter | <Milerius> I just want to compile a C file that use those library |
21:31:25 | leorize | do you have your the full version of your code somewhere? |
21:31:29 | * | luis__ joined #nim |
21:31:34 | leorize | it's easier than looking at a bunch of pragmas |
21:31:40 | lqdev[m] | you'll need a GL wrapper @Milerius |
21:31:53 | FromGitter | <Milerius> Why I will need a GL Wrapper ? |
21:31:55 | lqdev[m] | I can recommend https://glad.dav1d.de/ |
21:32:02 | FromGitter | <Milerius> I'm using Glut ^^' |
21:32:09 | lqdev[m] | because Nim can't wrap the GL library by itself |
21:32:12 | lqdev[m] | also, don't use glut |
21:32:20 | lqdev[m] | it's deprecated and severely outdated |
21:32:23 | * | luis_ quit (Ping timeout: 245 seconds) |
21:32:27 | FromGitter | <Milerius> Ok i will explain what I'm trying to achieve |
21:32:27 | lqdev[m] | unless you're using freeglut |
21:32:45 | * | luis__ quit (Remote host closed the connection) |
21:33:07 | FromGitter | <Milerius> At first I wanted to use the imgui wrapper of nimgl, however they do not meet my needs, because I need a feature that there is on a specific branch of imgui. |
21:34:11 | lqdev[m] | do you have an OpenGL window already? |
21:34:29 | FromGitter | <Milerius> I was planning to wrap my loader into a C library |
21:34:33 | FromGitter | <Milerius> and just call this function from nim. |
21:34:52 | FromGitter | <Milerius> like `init_my_stuff()` |
21:35:07 | FromGitter | <Milerius> So I try to compile whole imgui stuff on the fly |
21:35:50 | lqdev[m] | so what you need to do is use {.compile: "file.c".} to compile your .c file, then you need to wrap your C function using {.importc.} |
21:36:02 | FromGitter | <Milerius> It's exactly what I'm trying to do :O |
21:36:12 | lqdev[m] | do you have a header file with the function definitions? |
21:36:13 | FromGitter | <Milerius> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5df94a4de72656230160f53b] |
21:36:30 | FromGitter | <Milerius> Yeah |
21:36:32 | FromGitter | <Milerius> in the same folder |
21:36:44 | FromGitter | <Milerius> Just complaining about OpenGL type now |
21:37:19 | lqdev[m] | the type is undeclared in Nim, probably |
21:37:23 | lqdev[m] | is it declared in some header? |
21:38:37 | FromGitter | <Milerius> (No, the error is from clang in the command line) |
21:38:46 | lqdev[m] | huh, weird |
21:38:51 | lqdev[m] | then it's likely undeclared in C |
21:38:56 | FromGitter | <Milerius> `clang++ -c -w -framework OpenGL -framework GLUT -I/usr/local/include/SDL2 -D_THREAD_SAFE -I/usr/local/Cellar/nim/1.0.4/nim/lib -I/Users/romanszterg/Documents/make_ui_great_again/src -o /Users/romanszterg/.cache/nim/ui_d/imgui_impl_opengl3.cpp.o /Users/romanszterg/Documents/make_ui_great_again/src/imgui/private/imgui_impl_opengl3.cpp` |
21:39:25 | FromGitter | <Milerius> Maybe I miss something in the command line but |
21:39:33 | FromGitter | <Milerius> according to: https://stackoverflow.com/questions/23031740/how-to-use-opengl-with-gcc-on-mac |
21:39:36 | FromGitter | <Milerius> Should be ok |
21:39:47 | lqdev[m] | ah right, you're on mac os x |
21:40:05 | lqdev[m] | then we might have a problem |
21:40:11 | lqdev[m] | because apple stopped supporting OpenGL |
21:40:23 | FromGitter | <Milerius> AH. |
21:40:24 | lqdev[m] | I'm afraid I'm not able to help you in this case, since I don't own a mac to test this |
21:40:34 | FromGitter | <Milerius> No problem |
21:40:36 | FromGitter | <Milerius> tbh with you |
21:40:44 | FromGitter | <Milerius> i was so hyped to use nim to switch my c++ app |
21:41:37 | FromGitter | <Milerius> I have a really simple workflow for building GUI app. ⏎ ⏎ SLD2 + Imgui, that's all what I need but I need High-DPI support which works only with SDL2 right now |
21:42:04 | lqdev[m] | and it works when using C++? |
21:42:18 | FromGitter | <Milerius> (I'm using: https://github.com/rokups/imgui/tree/hdpi-support) |
21:42:20 | FromGitter | <Milerius> Yeah |
21:42:23 | FromGitter | <Milerius> It's work like a charm. |
21:42:27 | lqdev[m] | let's see |
21:42:52 | FromGitter | <Milerius> (https://files.gitter.im/nim-lang/Nim/wXhA/Capture_decran_2019-12-10_a_10.58.17.png) |
21:43:01 | FromGitter | <Milerius> So far I'm able to build stuff like that with my C++ workflow |
21:43:05 | * | lkw quit (Ping timeout: 265 seconds) |
21:43:09 | FromGitter | <Milerius> But, I'm in a big trouble with Multithread stuff |
21:43:14 | FromGitter | <Milerius> Because we have 0 multithreaded container |
21:43:24 | FromGitter | <Milerius> Such as ConcurentHashMap, no Channels, no Coroutine etc |
21:43:27 | FromGitter | <Milerius> I'm really suffering |
21:43:30 | leorize | it's now "easy" to make your own :P |
21:43:37 | leorize | we do have sharedtables for starters |
21:43:52 | leorize | Channels, yes we have |
21:43:55 | FromGitter | <Milerius> Yeah... |
21:43:56 | FromGitter | <Milerius> i know |
21:44:01 | FromGitter | <Milerius> I use nim |
21:44:05 | FromGitter | <Milerius> for all my scripting stuff |
21:44:14 | FromGitter | <Milerius> but now I convinced our company to use it |
21:44:30 | FromGitter | <Milerius> But I got so much trouble to setup the same workflow |
21:44:31 | lqdev[m] | you may wanna try https://github.com/nimterop/nimterop for wrapping the imgui fork |
21:44:55 | lqdev[m] | haven't tried the C++ interop, though |
21:44:58 | FromGitter | <Milerius> I tried c2nim at first |
21:45:02 | FromGitter | <Milerius> don't know about nimterop |
21:45:30 | * | narimiran quit (Ping timeout: 265 seconds) |
21:45:38 | leorize | !repo nimx |
21:45:38 | FromGitter | <Milerius> How work nimterop compared to c2nim |
21:45:39 | disbot | https://github.com/yglukhov/nimx -- 9nimx: 11GUI library 15 574⭐ 54🍴 7& 1 more... |
21:46:15 | FromGitter | <Milerius> I like only Immediate GUI stuff, much more easier to use |
21:46:17 | FromGitter | <Milerius> and natural |
21:46:18 | shashlick | wasn't there already an imgui wrapper? |
21:46:18 | leorize | ^ that's also a thing if you want immediate mode gui :P |
21:46:41 | disruptek | !repo nimgl |
21:46:42 | disbot | https://github.com/nimgl/nimgl -- 9nimgl: 11NimGL is a Nim library that offers bindings for popular libraries used in computer graphics 15 100⭐ 11🍴 7& 6 more... |
21:46:43 | * | clyybber joined #nim |
21:46:52 | FromGitter | <Milerius> I know nimgl |
21:46:54 | lqdev[m] | @Milerius you `import nimterop/[cimport, git]`, then you `static: gitPull(…)`, then you `cCompile` your files, and then you `cImport`. that's the usual way. there's another way though, and that's getHeader |
21:46:58 | FromGitter | <Milerius> but they don't have the high dpi support |
21:47:35 | FromGitter | <Milerius> There is 2 problem in nimgl: ⏎ ⏎ Glfw is broken with MultiViewport + High DPI with Imgui |
21:47:52 | FromGitter | <Milerius> not really nimgl fault, but since the features are on a specific branch |
21:47:59 | FromGitter | <Milerius> nimgl cannot use it |
21:48:03 | Araq | clyybber: why are globalDestructors destructed in-order-of-declaration? |
21:48:41 | FromDiscord | <Clyybber> Ugh |
21:49:00 | FromDiscord | <Clyybber> Because p iterates through them in-order-of-declaration |
21:49:06 | FromDiscord | <Clyybber> Araq: Is it a problem? |
21:49:08 | FromDiscord | <Clyybber> Oh |
21:49:13 | FromDiscord | <Clyybber> Yeah. |
21:49:20 | lqdev[m] | @Milerius, you may wanna take at an example nimterop-based wrapper if you wanna get into it https://github.com/liquid600pgm/rapid/blob/master/src/rapid/lib/freetype.nim |
21:49:26 | lqdev[m] | this is a wrapper for FreeType |
21:49:45 | FromGitter | <Milerius> how we add link flags ? |
21:49:46 | lqdev[m] | also the official repo has a bunch https://github.com/nimterop/nimterop/tree/master/tests |
21:50:06 | lqdev[m] | @Milerius .passL, like you did |
21:50:25 | clyybber | Araq: Hmm, I remember I inverted the order though |
21:50:28 | FromGitter | <Milerius> what is the difference between doing manual .compile and nimterop |
21:50:40 | FromGitter | <Milerius> ah it's because you can git pull etc I guess |
21:50:41 | leorize | lqdev[m]: https://github.com/nimterop/nimterop/wiki/Wrappers this is probably a better page |
21:50:57 | lqdev[m] | nimterop wraps the header for you, so you don't need to bombard your code with hundreds of proc declarations |
21:51:00 | * | voltist quit (Read error: Connection reset by peer) |
21:51:12 | lqdev[m] | @leorize thanks, I'll keep it in mind for the future |
21:51:31 | * | voltist joined #nim |
21:52:04 | FromGitter | <Milerius> :O |
21:52:17 | Araq | clyybber: you didn't patch globals apparently, but no worries, I'm fixing it |
21:52:32 | FromGitter | <Milerius> And this is not better that I just write a C library that will do my stuff, I compile it statically with what I need and then I import it in nim ? |
21:52:51 | shashlick | @lqdev - good reminder, just added a few more to that wiki page |
21:52:57 | lqdev[m] | what do you mean? |
21:53:02 | leorize | @Milerius: why write C when you can write Nim? :) |
21:53:12 | shashlick | added nimarchive, nimgit2 and nimpcre to that wiki page |
21:53:30 | lqdev[m] | @shashlick you should be thanking leorize :P |
21:53:33 | clyybber | Araq: I did: https://github.com/nim-lang/Nim/blob/devel/compiler/injectdestructors.nim#L758 |
21:53:38 | clyybber | Not sure whats wrong |
21:54:36 | Araq | Milerius: I appreciate you can now use Nim at work, please let me know how to make you suffer less ;-) |
21:54:42 | Araq | clyybber: g.globalDestructors.add c.destroys |
21:57:14 | shashlick | true that! thanks @leorize 🙂 |
21:59:26 | Araq | clyybber: now something else: can you confirm that turning 'lent T' into 'T' can't cause trouble? |
21:59:59 | Araq | because I'm about to do that and add 'sink' and 'lent' annotations to the stdlib |
22:00:09 | clyybber | annotations? |
22:00:24 | Araq | parameters |
22:00:28 | clyybber | ah |
22:00:44 | clyybber | Hmm, lent is only a return type, right? |
22:01:47 | clyybber | Araq: Why do you want to turn lent T into T and in what cases? |
22:02:22 | clyybber | I feel like I'm missing something, because clearly lent T is only lent, so the thing it is lent to is not allowed to destroy it |
22:02:30 | clyybber | Right? |
22:02:58 | Araq | hmmm |
22:03:10 | Araq | I want this to work: |
22:03:45 | Araq | proc getOrDefault(t: Table; key: K; def: V): lent V |
22:03:59 | Araq | but I haven't thought it through admittedly |
22:04:30 | clyybber | hmm |
22:05:18 | * | lkw joined #nim |
22:05:36 | Araq | returning a pointer into a parameter is obviously dangerous, so if we say 'lent T' is 'T' without its attached creation/destruction logic it could work out |
22:05:56 | clyybber | ah sure |
22:06:02 | clyybber | making lent T not pass by pointer |
22:06:04 | clyybber | that is fine |
22:06:14 | clyybber | but destroying a lent T is obviously wrong |
22:06:25 | Araq | not only 'fine' it's *required* for getOrDefault to work |
22:06:47 | clyybber | Its also more in line with sink |
22:07:04 | Araq | and with the usual parameter passing semantics |
22:07:24 | Araq | (pass by copy or pass by const& ) |
22:07:31 | clyybber | Yeah, I was just a bit confused because you said "turining lent T into T" |
22:08:12 | clyybber | Araq: Btw, I had an idea lately |
22:08:17 | Araq | we need a lifetime extension for this to work btw |
22:08:22 | clyybber | Araq: Yeah |
22:08:52 | clyybber | Araq: We can make the default for parameters a mixture between T and sink T |
22:09:07 | Araq | how so? |
22:09:22 | FromGitter | <Milerius> yeah just to let you know |
22:09:42 | FromGitter | <Milerius> https://atomicdex.io ⏎ ⏎ I'm building this desktop application, I would like to switch to nim ! |
22:10:04 | clyybber | Araq: Aaaaaah |
22:10:11 | FromGitter | <Milerius> Since I cannot compile my workflow correctly I have some question about transitioning from C++ |
22:10:17 | clyybber | I think I just discovered a problem |
22:10:30 | clyybber | Well anyways I'm still gonna spit out my idea: |
22:10:55 | Araq | Milerius: Nice! |
22:10:58 | FromGitter | <Milerius> If I send image, people from the IRC can see image or only code snippet ? |
22:11:13 | clyybber | The idea is to make proc(s: T) generate 'proc(s: T)' and 'proc(s: sink T)' conceptually |
22:11:16 | Araq | we can click on links |
22:11:39 | clyybber | and then at callsite call 'proc(s: T)' if we cant sink the arg |
22:11:49 | clyybber | and call 'proc(s: sink T)' if we can |
22:12:37 | FromGitter | <Milerius> So I have the following C++ function ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ I would like to know if there is such an equivalent in `nim` or even better maybe some Idiom that I should know ? [https://gitter.im/nim-lang/Nim?at=5df952d5e47fb31eb7cd9dc2] |
22:13:00 | FromGitter | <Milerius> Running such a recurrent task in an asynchronous way |
22:13:42 | FromGitter | <Milerius> every X seconds, run in background and save result into a ConcurentHashMap or the equivalent in Nim |
22:16:36 | Araq | times.nim can do time based calculations and you can send stuff to a channel |
22:16:49 | * | luis_ joined #nim |
22:17:00 | * | luis_ quit (Read error: Connection reset by peer) |
22:17:10 | Araq | and then in a background thread you can recv() from the channel and do what you need to do |
22:17:32 | FromGitter | <Milerius> Hmm interesting |
22:17:42 | FromGitter | <Milerius> I can read and write into an associative container ? |
22:17:55 | FromGitter | <Milerius> Basically I will have a GUI that will read infos, and thread that will write |
22:18:03 | * | luis_ joined #nim |
22:18:19 | FromGitter | <Milerius> GUI Every frame read into the concurrent associative container |
22:18:21 | Araq | via a SharedTable but it's currently messy, better is to use a channel and let the background thread own the hash table |
22:18:35 | clyybber | Araq: Probably a dumb idea, right? Theres not much of a difference between a normal arg and a sink arg with a copy? |
22:18:52 | FromGitter | <Milerius> How the GUI can read the information of the hash table ? |
22:19:31 | Araq | clyybber: what you said makes sense but I fear the code bloat through specialization and also we have no benchmarks that suggest it's a good idea |
22:19:41 | FromGitter | <Milerius> So far in c++ I got something like: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5df9547cac14cc652ca00136] |
22:20:01 | FromGitter | <Milerius> I can read/write from different thread however I want |
22:21:11 | Araq | Milerius: the background thread can send results to another channel that the UI thread peeks/polls (tryRecv) |
22:21:26 | FromGitter | <Milerius> @Araq :O |
22:21:31 | FromGitter | <Milerius> It's thread safe ? |
22:22:03 | Araq | well the compiler will tell you if it isn't |
22:22:06 | FromGitter | <Milerius> I must admit that would be really useful. |
22:22:19 | FromGitter | <Milerius> What ? I don't compile if I'm not thread safe ? |
22:22:20 | FromGitter | <Milerius> :OOO |
22:22:27 | FromGitter | <Milerius> That's sounds better than my TSAN xD |
22:22:52 | Araq | another option is to import the concurrent hash table into Nim land via .importcpp |
22:24:00 | Araq | but since you're unlikely to need its performance, Nim's channels should work fine, tryRecv() for a non-blocking receive use global variables for the queues and the threads |
22:24:11 | Araq | and don't forgot to initialize these things |
22:24:12 | FromGitter | <Milerius> I will not import this shitty map |
22:24:14 | FromGitter | <Milerius> they have data race |
22:24:33 | clyybber | Araq: Hmm, otoh the compiler can do it on demand at callsite |
22:24:33 | FromGitter | <Milerius> https://github.com/facebook/folly/issues/1280 |
22:24:35 | disbot | ➥ Data race in folly::ConcurentHashMap. ; snippet at 12https://play.nim-lang.org/#ix=24JG |
22:24:48 | FromGitter | <Milerius> wut |
22:24:58 | FromGitter | <Milerius> xD the bot |
22:25:04 | clyybber | Araq: And with this we wouldn't have to define sink variants for every proc. Which saves a lot of code bloat for the users |
22:26:16 | Araq | Milerius: well 'empty' or 'size' are pretty invalid operations to begin with for a concurrent hash map |
22:26:43 | FromGitter | <Milerius> @Araq how is implemented shared map in nim ? |
22:26:49 | FromGitter | <Milerius> Are you using HazardPtr ? |
22:27:06 | Araq | nah, we use a single lock iirc |
22:27:36 | FromGitter | <Milerius> Yeah but why they expose empty() and size() into a shared map if it's not thread safe |
22:27:39 | FromGitter | <Milerius> there is non sense |
22:27:55 | FromGitter | <Milerius> they claimed that it's safe to use them so... |
22:28:13 | FromGitter | <Milerius> I'm really excited about nim tbh |
22:28:15 | Araq | true |
22:28:18 | FromGitter | <Milerius> I do a lot of template in c++ |
22:28:24 | FromGitter | <Milerius> lot of stuff |
22:28:35 | FromGitter | <Milerius> There is stuff like static embedding data files that interest me a lot |
22:28:51 | FromGitter | <Milerius> Channels, Macros |
22:29:01 | FromDiscord | <Generic> https://github.com/nim-lang/Nim/issues/12785 I think I found the cause for this issue and would like to fix it myself |
22:29:02 | FromGitter | <Milerius> Speed of compilation |
22:29:15 | FromDiscord | <Generic> but I'm not entirely sure |
22:29:28 | FromGitter | <Milerius> There is a discord for nim ? |
22:29:32 | FromGitter | <Milerius> I would love to join :p |
22:29:36 | FromDiscord | <Generic> yep 🙂 |
22:29:36 | FromGitter | <Milerius> if there is a link |
22:30:03 | * | tane quit (Quit: Leaving) |
22:31:00 | FromDiscord | <Generic> https://discord.gg/7FNMf3 |
22:31:15 | FromDiscord | <Generic> the problem is here: https://github.com/nim-lang/Nim/blob/devel/compiler/ccgstmts.nim#L555 |
22:31:24 | * | leorize quit (Quit: WeeChat 2.6) |
22:31:36 | FromDiscord | <Generic> with newruntime enabled the let and var nodes are wrapped inside a stmtlist |
22:31:45 | FromDiscord | <Slyris> ah much better here :p |
22:31:54 | clyybber | Generic: Good catch! |
22:32:09 | FromDiscord | <Milerius> Nice. |
22:32:32 | FromDiscord | <Generic> is this a problem upwards? |
22:32:36 | FromDiscord | <Generic> or should this be fixed there? |
22:33:11 | Araq | Generic: fix it by creating a PR against the Nim devel branch |
22:33:18 | * | luis_ quit (Quit: luis_) |
22:33:20 | Araq | if that's your question |
22:33:34 | * | luis_ joined #nim |
22:33:39 | FromDiscord | <Generic> no, I mean should the nodes arrive wrapped inside a stmtlist? |
22:33:41 | clyybber | Araq: I feel really dumb rn, pls halp. Why do we have to reverse the destructors again? AFAICT I'm reversing c.destroys before adding it to g.globalDestructors?? |
22:34:09 | clyybber | Or does the problem only appear with multiple modules? |
22:34:11 | Araq | clyybber: 'c' is a context that get recreated |
22:34:21 | Araq | I think |
22:34:35 | * | Hideki_ joined #nim |
22:34:39 | Araq | but I'm very tired too, good night |
22:35:05 | clyybber | good night |
22:35:10 | nisstyre | I get this message trying to run something with the httpClient module, ' Compile with -d:ssl to enable'. I can't figure out how to add this to my .nimble file. Any idea what to do here? |
22:35:22 | * | ltriant joined #nim |
22:36:27 | FromDiscord | <Generic> so it is enough to just peek inside the first node of a stmtlist and see if it is a let or var section too? |
22:38:53 | zedeus | nisstyre: `--define:ssl` |
22:39:03 | * | Hideki_ quit (Ping timeout: 245 seconds) |
22:39:27 | nisstyre | zedeus: but how would I make it so I just have to run `nimble build` without worrying which flags to pass? |
22:39:31 | nisstyre | or is that possible some other way? |
22:39:41 | FromDiscord | <Generic> you can add a nim.cfg file |
22:39:42 | nisstyre | or maybe I should just have a build.sh that does it |
22:39:43 | zedeus | put it in config.nims |
22:39:50 | nisstyre | ok sounds good |
22:42:48 | nisstyre | yes, switch("define", "ssl") worked, thanks |
22:42:54 | * | luis_ quit (Ping timeout: 246 seconds) |
22:43:14 | Araq | Generic: unlikely, better remove the statement list in injectdestructors.nim |
22:43:18 | Araq | if it has only one child |
22:44:47 | clyybber | what if other problems like that crop up? |
22:45:04 | clyybber | IMO its better to make the backend robust against stuff like that |
22:45:55 | shashlick | so do we really need an imgui wrapper in nimterop? |
22:47:16 | * | pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
22:47:42 | * | gour quit (Remote host closed the connection) |
22:49:11 | * | pbb joined #nim |
22:51:26 | FromDiscord | <Generic> that was what I've been talking about |
22:51:48 | FromDiscord | <Generic> I also tried generating redundant statement lists with a macros |
22:51:56 | FromDiscord | <Generic> but these were flattened |
22:52:16 | clyybber | Generic: AFAIK thats because transf flattens them |
22:52:24 | clyybber | and injectdestructors is done after transf |
22:53:31 | FromDiscord | <Generic> hm, ok |
22:54:12 | clyybber | maybe we should do another flatten pass after injectdestructors |
22:54:40 | clyybber | or we make the backend more robust against stuff like that |
22:59:12 | nisstyre | Another question, where is the %* operator defined/documented? |
22:59:26 | * | lritter quit (Quit: Leaving) |
22:59:47 | FromDiscord | <Generic> https://nim-lang.org/docs/json.html#%25%2A.m%2Cuntyped |
22:59:48 | * | sealmove joined #nim |
23:01:30 | nisstyre | thanks |
23:01:58 | clyybber | gn8 |
23:02:08 | * | clyybber quit (Quit: WeeChat 2.7) |
23:02:32 | FromDiscord | <Generic> good night |
23:12:33 | sealmove | gn |
23:15:58 | * | pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
23:25:07 | * | solitudesf quit (Ping timeout: 268 seconds) |
23:59:17 | * | thomasross_ joined #nim |
23:59:17 | * | thomasross is now known as Guest34522 |
23:59:17 | * | Guest34522 quit (Killed (tolkien.freenode.net (Nickname regained by services))) |
23:59:17 | * | thomasross_ is now known as thomasross |