<< 14-07-2018 >>

00:00:10CodeVancetoif your lazy use converters if you aren't lazy then wrap the proc
00:00:27CodeVanceexelotl
00:01:40stefanos82Araq, out of curiosity: did you ever use OCaml? If yes, what role did it play to your coding as a programmer, let alone as a researcher?
00:04:27*dddddd quit (Remote host closed the connection)
00:05:22Araqnever really used it, its syntax was dynamite for me. However, I did use Standard ML
00:05:55stefanos82I have found many similarities to Nim's syntax in so many ways.
00:06:01stefanos82not all of them, but quite a few
00:06:14stefanos82so far Nim has the best syntax
00:06:26stefanos82I have even dare to say that Nim's syntax is way better than Python's
00:06:52Araqyay. :-)
00:07:17Araqthe similarities to ML are due to ML's Pascal heritage and Pascal influenced Nim too.
00:07:39Araqother stuff like 'f a' for 'f(a)' were later additions
00:07:45stefanos82I know that you used Pascal to build the first versions of it, isn't that correct?
00:07:51FromGitter<kayabaNerve> Araq: What would you think about implicit conversion support as long as it doesn't make it into the stdlib/compiler?
00:08:14AraqkayabyNerve we have lenientops in the stdlib.
00:08:18FromGitter<kayabaNerve> Meant to ask that since I'm working with a bunch of different representations of the exact same data.
00:08:19stefanos82no implicit conversions -_- explicit is always better than implicit
00:09:13Araqstefanos82: I agree but I think it's fair if it's an explicit module import that gives you implicit conversions
00:09:34FromGitter<kayabaNerve> I mean like this: ⏎ proc myProc(x: typeX) ⏎ ⏎ implicit proc (x: typeX, y: typeY) ⏎ ... [https://gitter.im/nim-lang/Nim?at=5b493f3e641ecc065fa1571c]
00:09:45FromGitter<kayabaNerve> Completely ignore the syntax on the second proc please
00:10:16stefanos82Araq: fair enough. Are they labeled or marked as "partially unsafe" though? Because an implicit conversion could open so many issues for you behind the scenes, without you realizing it
00:10:44FromGitter<kayabaNerve> That said, I have to go change something to SomeInteger. Couldn't find it earlier but now I have it. Thanks.
00:10:53stefanos82this brought back some early C days with implicit value rounding and type casts -_-
00:11:39FromGitter<kayabaNerve> BTW, the reason I'm thinking of this is just because I have three number bases and it's a pain to constantly call conversions... I don't actually want it in the standard or not. Just wanted to ask about it
00:12:26AraqkayabaNerve: are you looking for Nim's "converter" keyword?
00:13:12Araqstefanos82: sometimes one needs to hack though, esp when interfacing with C that had no type discipline
00:13:19FromGitter<kayabaNerve> Possibly
00:13:26Araqand then you reach for lenientops or similar
00:13:41stefanos82Araq: I know; that's why I mentioned above my C memories :/
00:14:18*krux02 quit (Remote host closed the connection)
00:16:29stefanos82Araq: btw, what is the actual objective or should I say, your ultimate mission with Nim's future? Faster compilation times or stabilizing the language by fixing its semantic design until 1.0's release?
00:17:04stefanos82of course feel free to replace 1.0 with NG (next generation) if you like
00:17:48FromGitter<kayabaNerve> Araq: TIL! That's exactly what I was talking about. Thank you!
00:18:18Araqstefanos82: please read the github milestones for the plan :-)
00:19:14stefanos82Araq: don't you have any TLDR; or something similar? Some terminologies are too advanced for my silly brain :/
00:19:44CodeVanceu can call it controlled implicit
00:20:22CodeVanceThere's also araq's musings @stefanso
00:20:26CodeVancestefanos82:
00:21:17stefanos82actually, thanks to Araq it's not implicit nor explicit; it should be considered as complicit!
00:21:29stefanos82because basically they are collaborating with you to do your job ;)
00:21:39CodeVancelol
00:21:46CodeVanceI didn
00:21:57CodeVancedidn't know of lenientops until now
00:22:05stefanos82me neither
00:22:12stefanos82but as you can see, I'm learning every day
00:22:26CodeVancenim isn't batteries included, It's super mech robot included
00:23:54AraqCodeVance: the musings are old though, I need to write new ones
00:24:20CodeVanceI mentioned it in relation to your 'vision'
00:25:42stefanos82Araq: I have just read about v2 milestone, about mapping the macro system to a compiler plug-in. Basically, will it work as a background service that will be communicating back and forth with the core, much like we do with RPC protocol??
00:26:04stefanos82weird...I inserted one "?" and printed 2
00:26:11FromGitter<rayman22201> Pegs module is awesome btw. Exactly what I wanted. Much more clear than regex for huge log file parsing that needed.
00:26:39Araqstefanos82: that's one way of thinking about it
00:27:07stefanos82Araq: that could increase the building process by orders of magnitude in my opinion
00:27:31FromGitter<kayabaNerve> Thanks again for converters.
00:27:57Araqwe'll see about that, stefanos82. it's all pretty cacheable.
00:28:47stefanos82I see a bright future for Nim. It goes to the right direction
00:29:11stefanos82the best thing you have decided to do with Nim is the whole metaprogramming concept that uses macros and templates
00:29:24stefanos82and generics, let's not forget those too!
00:30:26Araqgenerics should be mapped to macros :P
00:30:38Araqwe'll get there...
00:32:40stefanos82without knowing much about macros yet (I have just started reading the chapter about them), I was going to say the same thing since macros allow you to do pretty much everything
00:38:39FromDiscord<exelotl> CodeVance: thanks, I'll give that a try (I'm nearly at the metaprogramming chapter in the nim book, wasn't expecting to have to use it yet haha)
00:39:46CodeVanceexelotl that isn't meta programming yet
00:42:32CodeVanceTBH I don't see how generics can be mapped to macros. Unless you make every macro able to generate custom generics. Some kind of compile time hook?
00:43:25zacharycarterI think it's possible
00:43:56zacharycarterI mean - if they're possible without macros they should definitely be possible with macros
00:44:06zacharycarternot like generics need runtime info to function
00:44:39zacharycartermacros are already evaluated at compile time so
00:45:15FromDiscord<exelotl> wait using a nim template isn't metaprogramming?
00:45:24CodeVanceya you can get the same functionality of generics procs by using `any` param types and when statements
00:45:27stefanos82the objective of Araq's is to move the macro system as a background service.
00:45:56zacharycartertemplates are metaprogramming
00:46:18zacharycarterbut you'll see the difference between them and macros when you get to macros
00:46:19stefanos82so logically the macro system will be already warmed up for us *before* we start compiling actual Nim code
00:46:26zacharycarterI find templates much more usable than macros honestly
00:46:31stefanos82therefore it *should be* considerably fast
00:46:35zacharycarteror at least - I find myself using them way more often
00:46:36CodeVanceexelotl I said wrap. wrappers don't need templates. (though they might be cleaner)
00:46:49Araqno, not a "background" service. don't spread myths here.
00:46:58Araqbut I need to sleep, we can talk later
00:47:02Araqgood night
00:47:07stefanos82my apologies Araq, but when you said plug-in, that's how I interpreted it
00:47:13CodeVancenight
00:47:36CodeVanceI see templates as compiler copy paste
00:48:01*BitPuffin quit (Remote host closed the connection)
00:48:06FromDiscord<exelotl> oh right, yeah I could just wrap it in another proc of course, just wondered if there's a more idiomatic way to do it x)
00:48:40FromDiscord<exelotl> or maybe that *is* the idiomatic way
00:48:41CodeVancethere is not idiomatic. just domain specific.
00:48:55FromDiscord<exelotl> ah fair enough
00:48:59CodeVancenot for nim at least
00:50:25CodeVanceSo your target is to make the library easy to use. if there are a bunch of functions with 0 and 1 instead of true false then it would be easier to use macros
00:51:32FromDiscord<exelotl> I really like that philosophy but it makes learning difficult because you don't even know what possibilities are available to you until you have more experience with the language
00:51:49CodeVanceexelotl BTW go back and read "statement list expression" in the manual. Unless you have already done so. That explains how all the nim statements and expressions are laid out
00:52:03skrylarif you can get away with a tempmlate you should do so, because macros require effort :p
00:52:10skrylarand also suffer breakage with compiler updates
00:52:16CodeVanceno they don't. not really
00:52:27CodeVanceJust don't make a macro in a current project
00:52:34CodeVancemake a new file
00:52:39CodeVancethen compiling is much faster
00:53:08FromDiscord<exelotl> well, I'm aware that the common advice is to use the least powerful tool for the job when it comes to metaprogramming in nim
00:53:08skrylarwell in rebol you just invoke parse and splat out a DSL on the spot. in nim you have to sit there and dumpTree for a while and pick apart the ASTs you get (thus, effort)
00:53:37CodeVanceskrylar: hint reprAstGen
00:53:49skrylarand krux was literally talking earlier about said breakages =p
00:53:50CodeVanceastgenrepr
00:54:45FromDiscord<exelotl> but yeah I really want to make a game engine that leverages the power of macros but the macro system is really daunting to me, it's one of the main reasons I'm reading the book
00:54:48*ofelas joined #nim
00:57:05skrylarits handy but mysterious :\
00:57:13CodeVancehint astgenrepr. I don't think it gets easier. then hint repr result at the end of the macro. if it doesn't print its not valid
00:57:28skrylarit's too late to get it but it might have been nicer to just get the token stream instead inside a macro, because you can get weird shit
00:57:45CodeVanceBut like i said. depends on how many of the 0/1 true/false things there are
00:57:49skrylari had a prototype of a FSM generator and the compiler got picky about pseudo function parameter groups
00:58:25CodeVanceskrylar: psuedo function?
00:59:04skrylarit would accept foo(a, b, c: T, d: Y) but not foo(a, b, c: T; d: Y)
00:59:21FromGitter<rayman22201> you guys want a lisp reader macro system in Nim lol
00:59:47CodeVancerayman ther's already a list reader in nim . Nim itself XP
00:59:51CodeVancelisp
01:00:14CodeVance(echo 1,2,3,4)
01:00:21FromGitter<rayman22201> https://gist.github.com/chaitanyagupta/9324402
01:00:23FromGitter<rayman22201> no that
01:01:11FromGitter<rayman22201> It's a type of macro that operates on the lexer instead of the parser
01:04:10CodeVanceya. You'd have to change the import the compiler for that
01:04:13CodeVanceXD
01:05:18FromGitter<rayman22201> It would be a big change. I don't think Araq would go for it lol. Maybe in V2 when the compiler is all plugin based :-P
01:08:55*stefanos82 quit (Quit: Quitting for now...)
01:34:16FromGitter<kaushalmodi> exelotl: If you are somewhat familiar with Nim, you can skip to the last "9 Metaprogramming" section of the book. It starts out with very basics of templates and then macros. I happen to have just reached that section; currently on 9.4.1, 8% of the book to go (Kindle).
01:43:54*vivus quit (Quit: Leaving)
05:08:47*csgator joined #nim
05:10:48*lompik joined #nim
05:10:55*miran joined #nim
05:17:26*fastrom joined #nim
05:36:02*nsf joined #nim
05:51:14*donzx quit (Remote host closed the connection)
05:51:36*donzx joined #nim
06:01:20*csgator quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
06:25:14*donzx quit (Remote host closed the connection)
06:25:53*donzx joined #nim
06:25:53*donlzx joined #nim
06:26:26*donlzx quit (Client Quit)
06:26:30*donzx quit (Client Quit)
06:26:50*lompik quit (Quit: WeeChat 2.1)
06:26:54*donlzx joined #nim
06:36:32*Vladar joined #nim
07:11:10FromGitter<tim-st> Can someone confirm that devel nim cannot compile filenames with umlauts and just hangs forever?
07:11:26FromGitter<tim-st> @Araq I think this is the problem from yesterday
07:12:26*fastrom quit (Quit: Leaving.)
07:12:32FromGitter<tim-st> nim git hash: dd47013017d75a2b1a8c80e12f273e18e86f7d72
07:22:29FromGitter<bevo009> Just tried out the jester sample code, I get the same error on windows 10 and linux subsystem (Nim 0.18.0)...can anyone confirm? ⏎ .nimble\pkgs\jester-0.3.0\jester.nim(5, 38) Error: cannot open 'macrocache'
07:24:52*Trustable joined #nim
07:25:15FromGitter<tim-st> I think I read this requires devel
07:25:24FromGitter<bevo009> just read that
07:25:57FromGitter<bevo009> how do i downgrade to upgrade to v0.2.1
07:26:47FromGitter<bevo009> nimble install jester 0.2.1?
07:26:50FromGitter<Varriount> @rayman22201 I'll be merging in that PR soon. I just need to test it locally.
07:27:51FromGitter<tim-st> Hm, devel can compile files with umlauts, there must be another problem :\
07:28:01FromGitter<tim-st> really weird
07:32:30FromGitter<tim-st> Maybe the problem is: vscode+umlautsFilename; can someone try it?
07:34:08FromGitter<bevo009> well `nimble install jester 0.2.1` doesn't work, I still get 3.0...what's the correct command?
07:34:24FromGitter<tim-st> maybe ==0.2.1 ?
07:35:22FromGitter<tim-st> no
07:36:55FromGitter<tim-st> here is the example: nimble install nimgame@"> 0.5"
07:37:36FromGitter<tim-st> nimble install [email protected]
07:38:02FromGitter<bevo009> yep ta, `nimble install jester@"0.2.1"`
07:38:15FromGitter<bevo009> thanks Tim ;)
07:38:41FromGitter<bevo009> maybe I could have dropped the quotes as well
07:40:43FromGitter<tim-st> yes, seems only needed for `>` etc
07:43:43FromGitter<tim-st> but jester < 0.3.0 has security problems, only use this version for testing
07:53:15FromGitter<bevo009> now i get this error: `routes.nim(3, 1) template/generic instantiation from here ⏎ lib\core\macros.nim(384, 57) Error: undeclared identifier: 'Future'`
07:56:07FromGitter<kayabaNerve> How do I run the debug compiler (getting SIGSEGVs and no idea why)
07:56:37FromGitter<kayabaNerve> Well, to be honest, it's because I'm butchering Nim. That said, how do I run the debug compiler?
07:57:48FromGitter<kayabaNerve> By debug compiler, I mean, isn't there a way under koch to print a stack trace/line trace when a SIGSEGV occurs?
08:01:56*nsf quit (Quit: WeeChat 2.1)
08:02:01FromGitter<tim-st> compile in debug mode?
08:02:30FromGitter<tim-st> I think only in release mode information is missing
08:03:28FromGitter<bevo009> ay caramba, why doesnt this work?
08:03:40FromGitter<bevo009> maybe I should downgrade to 2.0 again
08:08:22FromGitter<bevo009> nope, that didn't work either
08:08:24FromGitter<bevo009> Shouldn't this sample code work on jester 0.2.1?
08:08:36FromGitter<bevo009> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b49af836534bc5d2e5a276c]
08:26:38FromGitter<bevo009> got it working, this is the correct example code for version 0.18.0 / 0.2.1 ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b49b3bd66c1e833a9e76134]
08:27:42AraqkayabaNerve: koch temp c foo.nim
08:28:07Araqproduces a debug version of the compiler, passes 'c foo.nim' to it and this debug version produces a stacktrace
08:34:02*xet7 joined #nim
08:36:13FromGitter<tim-st> Araq: I couldnt find out the problem, but there is definetly one, that for some code interrups compilation forever at devel
08:40:00FromGitter<tim-st> It seems if umlaut or ß or similiar in filename and something like this code, it fails: https://gist.github.com/tim-st/a7e4300a68e8c2b61381ff79ff71e1ca
08:40:36FromGitter<tim-st> when the filename is made normal, the same code echos 0
08:41:10FromGitter<tim-st> if not it compiles forever
08:45:00FromGitter<tim-st> I tried other source code with special filename like `echo 1` and it worked, both things filename and source code seems related to this thing
08:45:19FromGitter<tim-st> *special filename and source code `echo 1`
08:45:38*dorelix joined #nim
08:48:13Araqtim-st: which OS?
08:48:23FromGitter<tim-st> win7x64
08:48:39FromGitter<tim-st> gcc (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0
08:49:30FromGitter<tim-st> Nim Compiler Version 0.18.1 [Windows: amd64] ⏎ Compiled at 2018-07-13 ⏎ Copyright (c) 2006-2018 by Andreas Rumpf ⏎ ⏎ git hash: dd47013017d75a2b1a8c80e12f273e18e86f7d72 ... [https://gitter.im/nim-lang/Nim?at=5b49b91995e03e3d7b49a3ac]
08:52:24FromGitter<tim-st> I have deleted nimcache and used [Running] nim c --verbosity:0 --hints:off --opt:none -r
08:52:46*csgator joined #nim
08:53:08FromGitter<tim-st> the same source code with only-ascii filename works expected :\
08:54:07*csgator quit (Client Quit)
08:55:06FromGitter<tim-st> I remember there was a commit that allowed non-ascii filenames
08:59:07FromGitter<tim-st> this is a minimum not working code:
08:59:10FromGitter<tim-st> import re
08:59:11FromGitter<tim-st> let htm = "" ⏎ let m = htm.findAll(re"<P (.*?)</P>") ⏎ echo m.len
08:59:23FromGitter<tim-st> together with filename nonascii
09:00:38*donlzx quit (Remote host closed the connection)
09:01:04*donlzx joined #nim
09:01:40FromGitter<tim-st> with `regex` instead of `re`it works
09:02:04*ofelas quit (Quit: shutdown -h now)
09:02:08FromGitter<Lite5h4dow> ok, so i decided to dive into nuklear nim. however im having issues. i think im just dimb as fuck but i dont understand how binds work
09:02:19FromGitter<Lite5h4dow> do they change the format of the c commands?
09:02:46FromGitter<Lite5h4dow> because the source for nuklear nim liteally just includes the c srce and dependancies
09:02:59FromGitter<Lite5h4dow> yet nk_begin dosent even work
09:03:22FromGitter<Lite5h4dow> do i just have shit for brains or am i missing something here?
09:03:53*ofelas joined #nim
09:05:03FromGitter<kayabaNerve> Thanks Araq
09:05:38*donlzx quit (Remote host closed the connection)
09:06:05*donlzx joined #nim
09:06:40FromGitter<tim-st> @kayabaNerve are you on windows?
09:10:21*NimBot joined #nim
09:17:08*donlzx quit (Remote host closed the connection)
09:17:34FromGitter<bevo009> does jester have hot reload?
09:17:34*donlzx joined #nim
09:20:19*dddddd joined #nim
09:21:01*BitPuffin joined #nim
09:22:57FromGitter<Varriount> @Lite5h4dow What stage are you running into problems at? Compilation, or execution?
09:23:00*nsf joined #nim
09:23:38FromGitter<Varriount> @bevo009 For code, probably not. For static files, probably.
09:23:59FromGitter<bevo009> thanks
09:32:36FromGitter<Lite5h4dow> @Varriount writing. i keep getting linter errors saying this and that dosent exist
09:32:43FromGitter<Lite5h4dow> as a result it dosent even let me compile
09:33:06FromGitter<Lite5h4dow> (it does but it fails anyway)
09:34:56FromGitter<Varriount> @Lite5h4dow You are using some sort of IDE or build system?
09:35:19FromGitter<Lite5h4dow> atom with the nim addon and linter addon
09:35:51FromGitter<Varriount> Ok. And you are attempting to use https://github.com/zacharycarter/nuklear-nim?
09:36:31FromGitter<Lite5h4dow> correct
09:37:56FromGitter<Lite5h4dow> am i doing something wrong?
09:39:08FromGitter<Varriount> How did you install the package - through Nimble?
09:39:11FromGitter<Lite5h4dow> yes
09:39:24FromGitter<Lite5h4dow> `nimble install https://github.com/zacharycarter/nuklear-nim`
09:41:35FromGitter<Varriount> Hm, I'm wondering if Nimble checked out the sub module.
09:43:40FromGitter<Varriount> @Lite5h4dow Can you look in the Nimble directory and check if the nuklear submodule was downloaded?
09:44:02FromGitter<Lite5h4dow> hold on
09:44:34FromGitter<Varriount> Also, can you post a gist or paste on the errors that are being thrown during compilation?
09:44:44FromGitter<bevo009> nimble path nuklear-nim
09:47:04FromGitter<Lite5h4dow> `PS C:\WINDOWS\system32> nimble path nuklear-nim ⏎ ⏎ ``` Error: At least one of the specified packages was not found```` [https://gitter.im/nim-lang/Nim?at=5b49c698ba5f154b3b9e3f01]
09:47:15FromGitter<Lite5h4dow> but its installed
09:47:20FromGitter<Lite5h4dow> so im super confused rn
09:47:22*fastrom joined #nim
09:47:40FromGitter<bevo009> exact same name?
09:47:48FromGitter<Varriount> Try just "nuklear"
09:48:28FromGitter<Lite5h4dow> just the bind c file
09:48:37FromGitter<Lite5h4dow> didnt include the actual nuklear library
09:48:54FromGitter<Lite5h4dow> i take it i just need to download the nuklear source into that folder
09:49:25FromGitter<Varriount> No, you should just be able to do "nimble install nuklear"
09:49:55FromGitter<Lite5h4dow> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b49c742641ecc065fa23dd4]
09:51:07*fastrom quit (Client Quit)
09:53:00*fastrom joined #nim
09:55:28FromGitter<bevo009> Error: Specified directory (C:\Users\bevo\AppData\Local\Temp\nimble_17220\githubcom_vurtunnuklear\) does not contain a .nimble file.
09:55:45FromGitter<bevo009> Is that the problem?
09:56:09FromGitter<Lite5h4dow> how did you create that error
09:56:25FromGitter<Lite5h4dow> i want to try and replicate that to see ifd that is indeed the issue
09:56:37FromGitter<bevo009> I don't think there's a nimble file @ https://github.com/vurtun/nuklear
09:56:57FromGitter<bevo009> I ran this: nimble install https://github.com/vurtun/nuklear/
09:56:57FromGitter<Lite5h4dow> there wouldnt be
09:57:01FromGitter<Lite5h4dow> its a c livrary
09:57:25FromGitter<Lite5h4dow> im using https://github.com/zacharycarter/nuklear-nim
09:57:47FromGitter<Lite5h4dow> its a bind for the c library
09:57:51FromGitter<bevo009> fair enough, I thought it might depend on nuklear
10:00:19*PMunch joined #nim
10:02:11FromGitter<tim-st> anyone get this file compiled with the same filename: https://gist.github.com/tim-st/162abe7f0b498477ccd5391380d1fb55
10:02:45*Vladar quit (Quit: Leaving)
10:03:50FromGitter<kayabaNerve> @tim-st Yes, why?
10:04:17FromGitter<tim-st> on which os, nim version, compiler version?
10:04:23FromGitter<tim-st> for me it doesnt work...
10:04:40FromGitter<kayabaNerve> What doesn't?
10:04:56FromGitter<tim-st> it doesnt compile with filename `ää.nim`
10:05:01FromGitter<tim-st> only with `aa.nim`
10:06:06*nc-x joined #nim
10:06:15nc-x@tim-st doesn't compile for me on windows as well
10:06:33FromGitter<tim-st> nice, thanks!
10:06:42FromGitter<tim-st> so it's not my problem
10:06:43nc-xnim issues the following c command - gcc.exe -c -w -mno-ms-bitfields -IC:\Nim\lib -o C:\Users\alpha\AppData\Local\Temp\nimcache\ää\ää.c.o C:\Users\alpha\AppData\Local\Temp\nimcache\ää\ää.c
10:06:59nc-xin this command the path is wrong
10:07:04FromGitter<tim-st> nc-x: but try the same filename with just `echo 1` it works
10:07:05FromGitter<bevo009> gets to here then stalls: CC: ää
10:07:14FromGitter<tim-st> so the path isnt wrong
10:07:25FromGitter<tim-st> also when replacing by `import regex` it works
10:07:38FromGitter<tim-st> the problems is different, than just filepath
10:07:44nc-xyeah
10:07:52FromGitter<tim-st> really weird problem
10:08:22FromGitter<Lite5h4dow> @Varriount i downloaded the source and added it to the folder and it fixed it
10:09:15FromGitter<Lite5h4dow> wait no
10:09:16FromGitter<Lite5h4dow> nevermind
10:09:19FromGitter<Lite5h4dow> still broken
10:09:46FromGitter<Lite5h4dow> i wonder if @zacharycarter could shed some light
10:09:56FromGitter<kayabaNerve> I had working code; I spent 4 hours upgrading it; it doesn't work anymore.
10:10:15FromGitter<kayabaNerve> Never ever upgrade your code or change everything. Right now, I'm switch back to Ubuntu 8.04
10:10:32nc-xActually sorry. The path is not wrong. Windows cmd does not display unicode properly. After chcp 65001 I see correct path.
10:11:03FromGitter<tim-st> maybe @GULPF knows more about it ( https://github.com/nim-lang/Nim/issues/7897 )
10:11:38FromGitter<tim-st> of course I used devel version, where it should work
10:11:39nc-xCompiling with the gcc command gives a lot of errors
10:11:58FromGitter<tim-st> didnt see one error with verbosity:3
10:12:19nc-x`error: stray '\244' in program` and same for '\303`
10:12:42nc-x@tim-st Compile with --listCmd and then copy the gcc command and use it
10:12:47FromGitter<tim-st> but why does it work with other source code? is it `re` only problem?
10:13:45FromGitter<tim-st> --listCmd shows no error at all
10:13:55FromGitter<tim-st> just stays compiling
10:14:34nc-xcopy the gcc command and use it
10:15:02FromGitter<tim-st> oh, ok, I guessed verbosity:3 gave me this too
10:19:00FromGitter<Varriount> @Lite5h4dow I'm going to see if I can install that library
10:21:18nc-x@tim-st I tried with msvc. The compiler does not hang but give similar error to gcc. I think (all?) C compilers do not support unicode in identifiers.
10:22:03FromGitter<tim-st> but why does `ä.nim` -> `echo 1` work?
10:22:27FromGitter<tim-st> https://github.com/nim-lang/Nim/issues/8318
10:23:11nc-xBecause the problem is with name mangling. The function name findall from regex is getting the `ää` appended to it. And the C compilers are choking on that.
10:23:45FromGitter<tim-st> ah, ok, but it should work easily when escaping filenames by hex
10:23:50FromGitter<tim-st> filename.toHex
10:23:50*Vladar joined #nim
10:24:03FromGitter<tim-st> at least for special chars
10:27:56*xet7 quit (Quit: Leaving)
10:28:52FromGitter<Varriount> @Lite5h4dow I was able to install the package, do you have an example I could run?
10:30:38nc-x@Varriount the nuklear-nim repo contains an example - https://github.com/zacharycarter/nuklear-nim/blob/master/examples/nuklear_nim_examples/glfw3_opengl3.nim
10:31:20nc-xAnd it contains a nimble file as well.
10:31:35FromGitter<Varriount> nc-x: Yes, however that fails to compiler due to something with the opengl package.
10:32:36FromGitter<Varriount> nc-x: `nimble build` for that directory gives me `Error: Nothing to build. Did you specify a module to build using the `bin` key in your .nimble file?`.
10:33:04FromGitter<Varriount> And compiling manually gives me `opengl.nim(391, 28) Error: undeclared identifier: 'stmt'`
10:33:28Yardanicostmt/expr were removed from devel
10:33:44FromGitter<Varriount> :\
10:34:03Yardanicobecause they were deprecated a long time ago
10:36:28nc-xI get `opengl.nim(229, 23) Error: ordinal type expected`
10:37:34FromGitter<Varriount> nc-x: https://github.com/nim-lang/opengl/issues/56
10:41:31nc-xAnyways `nimble` does download nuklear src code as well. So it should technically work.
10:42:03*nc-x quit (Quit: Page closed)
10:50:29FromGitter<Varriount> Good night.
10:50:52FromGitter<kayabaNerve> @Varriount You going to bed or saying that to someone?
11:11:39*Perkol joined #nim
11:13:37FromGitter<Lite5h4dow> @Varriount there is an example in the Nuklear Library
11:13:47FromGitter<Lite5h4dow> im guessing he went to bed
11:19:17*dorelix quit (Ping timeout: 268 seconds)
11:35:58*dorelix joined #nim
11:37:23FromGitter<Vindaar> is it by design or a bug that I can't catch an `IOError` when writing a file in nimscript? Raising it manually works just fine
11:45:08*krux02 joined #nim
11:51:31*stefanos82 joined #nim
12:09:27dom96Hello everyone
12:10:29stefanos82greetings dom96
12:28:56*csgator joined #nim
12:30:16*csgator quit (Client Quit)
12:34:01FromGitter<kayabaNerve> So I have a Nimble library about some C files. All the files are in installFiles. I use importc for the functions. I don't do any header/passL/passC/compile pragmas. It compiles. It links. The .out crashes missing the symbol from my C file. The nimcache has file.c.o which is not any text file.
12:34:08FromGitter<kayabaNerve> Ideas on how to fix this?
12:36:18FromGitter<kayabaNerve> I used to have a compile/header pragma but I couldn't get the paths right in the Nimble package since it was handling it relative to the nimcache directory which isn't... usable AFAIk
12:41:22FromGitter<tim-st> I had this too, for me it turnt out I needed to compile an addtional c file
12:46:10FromGitter<tim-st> for me relative works with compile pragma perfect like `{.compile: "../a/b/file.c".}`
13:01:23FromGitter<kayabaNerve> Thanks @tim-st
13:11:21*Perkol quit (Remote host closed the connection)
13:14:17*find0x90 joined #nim
13:18:25*find0x90 quit (Ping timeout: 248 seconds)
13:22:39stefanos82is it possible to use Nim procs inside pragmas? For instance, like the aforementioned {.compile: ... .}, can we use something like {.compile: getCurrentDir() & "a/b/file.c".} ?
13:26:14*find0x90 joined #nim
13:33:27FromGitter<tim-st> stefanos82: yes, just safe it inside a const string before and make `{.compile: s & "a/b/file.c".}`
13:34:20FromGitter<tim-st> or if you need `var` then the var needs to be compileTime var
13:34:37FromGitter<tim-st> or static block
13:35:36dom96wow, just implemented HTTP pipelining in httpbeast
13:35:59dom96The more threads I give to `wrk` the more req/s
13:36:07Yardanicodom96, yay \o/
13:36:15dom96418k req/s with 32 threads and 64 connections
13:36:16FromGitter<tim-st> this means number one?
13:36:32dom96Doubt it :P
13:36:46FromGitter<tim-st> does mofuw has this too?
13:36:47dom96I don't have a lot of confidence in my skills, but we'll see
13:37:05Yardanicomofuw has multithreading too
13:37:14FromGitter<tim-st> ok
13:37:31dom96mofuw gets 100k req/s for the same settings on my machine
13:37:34Yardanicodom96, wow
13:37:44FromGitter<tim-st> interesting :O
13:37:48stefanos82dom96: beware with wrk's results though; you need to figure out its formula to produce your server's peak performance
13:38:22FromGitter<tim-st> yes, it doesnt behave like real requests
13:38:25dom96Yeah, I think there is a bell curve with the amount of threads I throw at it
13:39:41dom96Max I can get is 490k
13:39:58dom96If I ask for more threads I start getting: unable to create thread 64: Too many open files
13:40:16Yardanicochange ulimit :P
13:40:25dom96oh, 128 connections + 72 threads works
13:40:29dom96and got 600k req/s
13:40:30dom96lol wtf
13:40:50FromGitter<tim-st> but it needs to be stable
13:41:03dom96It's pretty stable so far
13:41:16FromGitter<bevo009> #dom96 https://phoenixframework.org/blog/the-road-to-2-million-websocket-connections
13:41:18FromGitter<tim-st> I think it depends much on how much files a system can open, I read rocksdb gets very unstable when too many files open
13:41:30FromGitter<tim-st> I think, lmdb doesnt have this open files problem
13:41:45FromGitter<tim-st> the more open files the easier the os gets unstable quickly
13:41:55dom96I'm planning on benchmarking frameworks on my RPI
13:42:02dom96I don't think anyone has done a comparison like that
13:42:16FromGitter<tim-st> which rpi?
13:42:19FromGitter<tim-st> 3?
13:42:27dom96So yeah, I could use some tips on how to get rid of the limits
13:42:29dom96yeah
13:42:35dom96Not the latest model
13:42:46dom96I could buy the latest model but I already have like 3 RPis lol
13:43:05Yardanicodom96, https://superuser.com/questions/433746/is-there-a-fix-for-the-too-many-open-files-in-system-error-on-os-x-10-7-1 for macos
13:43:06stefanos82dom96: there you go mate https://github.com/wg/wrk/issues/227
13:43:08krux02i used the rpi 3 today as well
13:43:11YardanicoAFAIK it works on macos sierra too
13:43:22FromGitter<tim-st> I only have rpi2, I think with my application in release mode a rpi3 can work as a server
13:43:22krux02(to play Tales of Phantasio on the PlayStation emulator)
13:43:32FromGitter<tim-st> hahaha
13:43:40dom96Yardanico: I went down this road already and it's annoying to set this on macOS
13:43:55dom96so meh
13:43:59Yardanicowell, it's pretty straightforward :)
13:44:03Yardanicojust two lines in a file
13:44:19dom96stefanos82: thanks
13:44:26dom96Yardanico: It's not
13:44:36dom96The later versions of mac make it more complex
13:44:48Yardanicodom96, IDK, this suggestion from SO worked for me on macOS Sierra
13:44:55Yardanico*high sierra
13:45:19FromGitter<tim-st> btw is it possible to limit the ram usage when many threads are enabled?
13:45:20*find0x90 quit (Quit: find0x90)
13:45:27FromGitter<tim-st> like set maximum to 75% ram?
13:45:28dom96Maybe, but it's pointless to benchmark on my mac anyway
13:45:41dom96I'd rather do it on my RPi
13:45:48dom96I even bought a nice SD card
13:48:05FromGitter<tim-st> krux02: maybe you know it: can I force my process to only use a max amount of ram?
13:48:17krux02yes you can
13:48:22FromGitter<tim-st> in nim?
13:48:37krux02I don't know if "in nim"
13:48:57FromGitter<tim-st> and what happens if it reaches a blocking state, because it needs more data in ram?
13:49:03FromGitter<tim-st> or waiting
13:49:18krux02In nim I would say, just allocate the maximum amount of ram you want to use and then don't allocate anything else anymor
13:49:36FromGitter<tim-st> yes, but if I do this, this memory would be shared
13:49:44FromGitter<tim-st> and I wanted to have multiple threads in one process
13:50:13krux02tim-st: I am not 100% sure what happens when a process reaches it's maximum allowed ram, but the usual think that happens it, the program crashes.
13:50:46FromGitter<tim-st> ok, thanks, the idea is good, I then have to look if different threads can access the same allocated memory in nim
13:51:12krux02when memory is allocated with malloc, but the process isn't allowed to get more memory, then malloc returns a null pointer. But almost no program checks for this possibility that malloc could return 0 and then you get a segmentation fault.
13:51:41Araqmalloc doesn't return null reliably on your favorite OS.
13:52:03krux02Araq: what do you mean?
13:52:07FromGitter<Vindaar> asking again, because more people around :): when writing a file with nimscript, is it normal that I cannot catch an `IOError`? My except is just ignored
13:52:07Araqbecause of memory overcommitment.
13:52:15FromGitter<tim-st> ok, just wanted to get sure, that when I have a server like dom96 said and it has so many requests that it should never reach more than 80% memory
13:52:42Araqand memory overcommitment was invented to hack around fork()s inherent design flaws.
13:53:44krux02I have no idea what overcommitment is nor do I know the inherent design flaw of fork()
13:54:41stefanos82Araq: did you see Alexandrescu's video that explains how flawed free() is? I honestly didn't know that and gave me goosebumps :S
13:54:56krux02I did see it
13:55:09krux02but I almost forgot everything
13:55:13Araqstefanos82: nope, but let me guess. it doesn't take a 'size' parameter?
13:55:19stefanos82lol bingo
13:55:24stefanos82C++ fixed it
13:55:29stefanos82at least that's what he said
13:55:38krux02not really
13:55:43Araqyeah, I noticed that long ago too. ;-)
13:55:48krux02delete [] doesn't get a size parameter
13:55:57stefanos82it returns it for you behind the scenes
13:56:43stefanos82blimey, it's so hot that I want to GET TO DA CHOPPAAAA and fly away from here!
13:57:11krux02stefanos82, what is returned behind the scenes?
13:57:20stefanos82the size of the allocated memory
13:57:40krux02well the size of the allocated memory is what you pass to malloc
13:57:51krux02it isn't returned
13:57:59krux02also not behind the scenes
13:58:19krux02it is just stored in a table to manage the chunks of allocated memory blocks
13:59:37stefanos82well, they fixed it; https://en.cppreference.com/w/cpp/memory/new/operator_delete
13:59:40krux02or wait, do you mean the rounded up size of the allocated memory to block size?
14:01:35Araqstefanos82: https://github.com/nim-lang/Nim/blob/devel/lib/core/allocators.nim#L13 ;-)
14:02:14stefanos82Araq: no need for extra convincing that Nim is a beauty man, I already know :P
14:06:07Araqoh Nim is far from perfection, but I take some pride in the fact that most of its mistakes are all new. ;-)
14:09:34stefanos82Nim could gain traction if it had OCaml's quick compilation. I have no idea how they have implemented the language, but it's scary. You just say, for instance ocamlc -o fib fib.ml and boom; you have right in front of you a binary file ready for use
14:10:18stefanos82overall Nim is a beauty
14:10:33*find0x90 joined #nim
14:10:40stefanos82it has a bright future
14:11:02zacharycarterNim does have pretty quick compilation
14:11:12zacharycarterBut it's going to be based on the compiler speed of whatever backend you're targetting
14:11:58zacharycarterNim can also do a lot of things OCaml can't
14:12:47zacharycarterGC for instance
14:13:24zacharycarterOcaml has incremental m&s
14:13:26zacharycarterit will stop the world
14:13:53Araqwhy? did they add multi-threading finally?
14:14:15Araqit used to be thread local like Nim's iirc.
14:15:09zacharycarterI may be incorrect - but I was reading - https://v1.realworldocaml.org/v1/en/html/understanding-the-garbage-collector.html
14:15:20stefanos82Araq: I know of this http://ocamllabs.io/doc/multicore.html
14:15:41Yardanicofrom ocaml.org: "The OCaml GC is synchronous. It doesn't run in a separate thread, and it can only get called during an allocation request.
14:15:42Yardanico"
14:16:11Yardanicoah, that's not the relevant info
14:16:16FromGitter<Bennyelg> Why I can't do something like that? ⏎ ⏎ ```proc shouldRun*(o: Job): bool = ⏎ now() > o.nextRun``` ⏎ ⏎ both now() and nextRun are DateTime type [https://gitter.im/nim-lang/Nim?at=5b4a05af26aa91065e93c412]
14:16:31zacharycarterI think if completion of the NLVM backend becomes possible / a reality, Nim will outshine most of its competitors
14:16:38Yardanicozacharycarter, why so?
14:16:57Yardanicoas Araq said before, NLVM doesn't have any real advantages over C/C++ backends
14:17:06zacharycarterbecause that opens the door for real WASM suppoert
14:17:07zacharycartersupport
14:17:12zacharycarterw/o emscripten / binaryen
14:17:45FromGitter<Yardanico> @Bennyelg you can?
14:17:53FromDiscord<awr> NLVM could be interesting in the future if it ever supported MCJIT
14:18:09FromGitter<Bennyelg> @Yardanico I can't I convert it now to Time and now its working
14:18:24FromGitter<Bennyelg> Datetime is not covered too , I 'll have to re check the manual
14:18:38FromGitter<Yardanico> ```code paste, see link``` ⏎ ⏎ works for me [https://gitter.im/nim-lang/Nim?at=5b4a063d73026160f5a08135]
14:19:05zacharycarter```
14:19:06zacharycarterWebAssembly initially focuses on C/C++, and a new, clean WebAssembly backend is being developed in upstream clang/LLVM, which can then be used by LLVM-based projects like Emscripten and PNaCl.```
14:19:17zacharycarterugh why did it copy / paste like that
14:19:25zacharycarter```WebAssembly initially focuses on C/C++, and a new, clean WebAssembly backend is being developed in upstream clang/LLVM, which can then be used by LLVM-based projects like Emscripten and PNaCl.````
14:19:35Yardanicozacharycarter, are you sure it will have any advantages over C+emscripten?
14:19:42zacharycarterwhatever - that's the idea
14:20:21zacharycarteradvantages? doubtful - but languages like Rust have this and you'll always get criticisms about how Nim doesn't have direct wasm support but Rust does
14:20:23zacharycarterblah blah blah
14:20:39Yardanicothis is not really "direct"
14:20:46Yardanicobecause you still generate LLVM IR ;)
14:20:48zacharycarterI mean, having done some Nim -> wasm I know it's rather trivial once you know what you're doing
14:21:01zacharycarterhaha well
14:21:08stefanos82hmmm...should I drink a milkshake or drink a milkshake? -_- there is a third option of drinking a milkshake. Any suggestions?
14:21:11zacharycarteryou don't have to use something like emscripten I guess is the point
14:21:24zacharycarterinject that shit into your bloodstream
14:21:30zacharycartergo hard
14:21:56FromDiscord<awr> are there any plans to enhance the way inference works for generic procs
14:22:00stefanos82it's a homemade man therefore I will push it bloody hard into my veins!
14:22:01FromDiscord<awr> https://glot.io/snippets/f2wd7w3lbf
14:22:50Yardanicoyou can do "var n = newSeq[int](5)" so you won't have to specify "int" tiwce
14:22:51Yardanico*twice
14:22:54zacharycarterAraq: I'm looking at karax and trying to figure out where to attach this callback - would it be a good idea to allow buildHTML to take in a function pointer and when the VNode gets created, when it's first attached as a dom node - invoke it then?
14:23:28zacharycarterfor now I've done this
14:23:58FromDiscord<awr> i'm not talking about combined declaration and initialization
14:24:06*zacharycarter sent a long message: < https://matrix.org/_matrix/media/v1/download/matrix.org/kQsoxWpeKpaNlazTcSmHMyxo >
14:24:41*zacharycarter sent a long message: < https://matrix.org/_matrix/media/v1/download/matrix.org/veTNwPHKyTBcZwFgnvWErocU >
14:25:17Araqawr: there is an RFC for that, accepted and won't require a language change.
14:25:25zacharycarternot sure if that makes sense or not though - or if there's a better approach
14:25:31FromDiscord<awr> cool!
14:25:44Araqzacharycarter: setRenderer() should just take yet another callback
14:26:25Araqdon't mess the DOM creation events etc. Karax exposes these already but they are a PITA. wait for my new components prototype.
14:26:35zacharycarterokay
14:28:22FromGitter<Bennyelg> @Yardanico your code not work for me
14:28:26FromGitter<Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b4a088973026160f5a085f8]
14:28:40FromGitter<Yardanico> oh maybe you're not on devel ;)
14:28:45FromGitter<Yardanico> there's a lot of fixes in devel as always
14:29:07FromGitter<Yardanico> there's no real reason to use stable Nim versions before 1.0 IMO
14:29:48FromGitter<Bennyelg> :/
14:29:54FromGitter<Bennyelg> going to switch devel
14:30:01FromGitter<Yardanico> just compile devel every week, it's easy with choosenim
14:30:34FromGitter<citycide> can you not do imports for `runnableExamples`? would like to show some path joining in there
14:32:10FromGitter<Bennyelg> @Yardanico so every week you bin/nim c koch ?
14:32:39YardanicoI run it almost every day (when there's any significant fixes to the codegen/language features), or maybe once in 3 days :)
14:32:44FromGitter<tim-st> does the following `bin/nim c koch` also work as `bin\nim c koch` on linux/mac?
14:32:54FromGitter<Bennyelg> mac
14:32:56FromGitter<tim-st> on windows only second works
14:33:14FromGitter<tim-st> from here: https://github.com/nim-lang/Nim
14:33:26zacharycarterunix filepaths vs windows filepaths
14:33:32FromGitter<Bennyelg> yea Iknow
14:33:33zacharycarterwindows uses backslashes
14:33:33zacharycarterunix uses forward slashes
14:33:34FromGitter<Bennyelg> almost finished
14:33:49Yardanico@tim-st you should use stdlib to join paths :)
14:33:51FromGitter<tim-st> I just ask to have a valid tutorial for all os
14:34:07FromGitter<tim-st> this is a nightly version tut from nim page
14:34:12zacharycarterbin\nim c koch does not work on osx
14:34:17FromGitter<tim-st> which doesnt work out of the box for windows
14:34:21FromDiscord<awr> that's interesting that choosenim doesn't use git to clone the repo
14:34:24zacharycarterbin/nim c koch does
14:34:33FromDiscord<awr> https://github.com/dom96/choosenim/blob/master/src/choosenim/download.nim
14:35:04FromGitter<tim-st> zacharycarter: ok, thanks
14:35:32Yardanico@awr https://github.com/dom96/choosenim/issues/12
14:37:11FromDiscord<awr> hah
14:37:56FromDiscord<awr> i just have a cloned repo and i pull from devel and manually compile every once in a while
14:38:01zacharycarternp
14:38:35Yardanico@awr me too
14:39:14*find0x90 quit (Quit: find0x90)
14:39:36FromDiscord<awr> there's some bodges i have made in the nim stdlib that I should make issues for but i'm lazy
14:39:56FromGitter<Bennyelg> works like charm thanks @Yardanico
14:42:18dom96https://github.com/dom96/httpbeast/commit/ecc7edecfe285c1359ba732ca8c2b3bbf0575127 :D
14:44:00Yardanicodom96, you're using "likely"?!
14:44:52dom96Of course
14:44:59dom96Optimising to the max
14:48:53PMunchWhat is this likely stuff?
14:49:03PMunchA hint to the branch predictor?
14:49:06zacharycarterif a branch is more likely to be taken?
14:49:09zacharycarterin a conditional?
14:49:09dom96yep
14:49:15PMunchCool
14:49:26zacharycarterI suggested doing that one time in Nim and someone told me it wasn't worth it
14:49:27dom96No idea how much of a difference it actually makes
14:49:39zacharycarterbut I don't remember who suggested that / how to actually benchmark it
14:49:50Araqprobably me... :-)
14:49:52dom96It'd be interesting to check how the asm differs
14:49:59zacharycarterhaha maybe
14:50:01AraqI don't believe in 'likely' ;-)
14:50:05*donlzx quit (Ping timeout: 276 seconds)
14:50:28PMunchHmm, interesting concept: http://www.toccata.io/2017/10/No-Booleans.html
14:50:34PMunchA language without booleans
14:50:42FromGitter<tim-st> no one knows what it does
14:51:10PMunch(The linked article is also interesting
14:51:11PMunch)
14:51:16*PMunch quit (Quit: leaving)
14:51:27FromDiscord<awr> likely feels like it should be a pragma if anything
14:51:31FromGitter<tim-st> it's likely just a call to c's likely and also in c noone knows
14:51:54stefanos82Araq, I wanted to ask you: when someone says about using REPL, do they mean they have to depend on a bytecode mechanism or not?
14:52:41dom96https://stackoverflow.com/questions/109710/how-do-the-likely-and-unlikely-macros-in-the-linux-kernel-work-and-what-is-t
14:53:58FromGitter<tim-st> ok, that's good, but still noone calculated the probability number at which it makes definetly sense to use it
14:54:17FromGitter<tim-st> independent on the cpu
14:54:47zacharycarterhttps://github.com/hnes/libaco
14:56:17FromGitter<Lite5h4dow> @zacharycarter did you see my previous posts
14:56:32zacharycarterI didn't
14:56:35zacharycarterI havne't been as active lately
14:56:37stefanos82dom96: I guess your article should be combined with this one too https://stackoverflow.com/questions/11227809/why-is-it-faster-to-process-a-sorted-array-than-an-unsorted-array
14:56:38zacharycarterwhat were they about?
14:56:51FromGitter<Lite5h4dow> i cant get you bindings for nuklear to work
14:56:58zacharycarteroh
14:57:05zacharycarterwhat issue are you having?
14:57:24zacharycarterI haven't compiled them in a while - I need to set up CI jobs for all my bindings I plan on actually using / think others might use
14:57:30FromGitter<Lite5h4dow> after i installed it the compiler cant see any of the functions of vulcan
14:57:46FromGitter<Lite5h4dow> but nuklear is a valid package
14:57:56zacharycarterwell - I don't have a vulkan implementation for a nuklear backend
14:57:58zacharycarterthat's something you'd have to write
14:58:11FromGitter<Lite5h4dow> so ¯\_(ツ)_/¯
14:58:14zacharycarternuklear is graphics API agnostic - so if you want to use it with Vulkan - you need to provide all the drawing code
14:58:15FromGitter<Lite5h4dow> nuklear sorry
14:58:21zacharycarteroh
14:58:33zacharycarterlet me try to compile / run them - give me a few
14:58:38FromGitter<Lite5h4dow> tyty
14:58:42FromDiscord<awr> if you're going to do anything with vulkan i noticed a few bits of the vulkan nim package are broken
14:58:55FromGitter<Lite5h4dow> i misstyped
14:58:57FromGitter<Lite5h4dow> i meant nuklear
14:59:05zacharycarterI suggest anyone wanting to do graphics work at this point use BGFX
14:59:35zacharycarterif opengl deprecation hasn't proved something like BGFX is worth it - I don't know what will
15:00:17FromGitter<Lite5h4dow> damn ok
15:00:20FromGitter<Lite5h4dow> ill give that a go
15:00:26FromGitter<Lite5h4dow> i hadnt heard of BGFX
15:00:37FromDiscord<awr> there's also the vulkan portability subset thing
15:00:43zacharycarterthere are bindings out there for it already - they're probably out of date, but I'll be updating mine once I start on my next graphics engine project
15:00:50FromDiscord<awr> https://www.khronos.org/vulkan/portability-initiative
15:07:04FromGitter<krux02> zacharycarte: OpenGL isn't deprecated.
15:07:20zacharycarterit is on osx
15:07:30FromGitter<krux02> There is a difference between deprecation and abandonment. Deprecation can only be done on something that you own.
15:07:40zacharycarterwell whatever
15:07:44FromGitter<krux02> Apple isn't entitled to deprecate OpenGL
15:07:55zacharycarterI agree with you - but that's how they phrased it
15:08:32FromGitter<krux02> That is true. But that doesn't make it right.
15:08:34zacharycarterI guess they're deprecating their support for opengl
15:08:36zacharycarteris the better way to word it
15:09:20zacharycarterLite5h4dow: the nuklear nim bindings are compiling / running fine for me on OSX
15:09:44FromDiscord<awr> apple "abandoned" openGL long before they made that annoucement imo
15:09:45FromDiscord<awr> https://support.apple.com/en-us/ht202823
15:09:48FromGitter<krux02> well support can not be deprecated
15:09:49zacharycartermake sure you run nimble install in the examples/nuklear-nim-examples
15:09:53zacharycarterand run the examples from that directory
15:10:03FromDiscord<awr> they're all 4.1
15:10:32zacharycarteralso do a nimble install in the root of the project too
15:10:40FromGitter<krux02> yes, it is locked to version 4.1, because on never versions you could get better performance, but then metal wouldn't be that much of an improvement anymore.
15:11:03FromGitter<krux02> OpenGL is locked to version 4.1 to make Metal "shine"
15:29:05mirancan a dictionary/table contain functions as values?
15:29:38Yardanicoafaik yes
15:31:36zacharycarterfunction pointers sure
15:31:45zacharycarterprocs - I don't think so
15:31:48zacharycarterbut I could be wrong
15:32:06mirani'm trying to do `Table[string, (int, int) -> bool]`
15:32:25Araqmiran: that works but might cause trouble in a compiletime context
15:32:52miranso it looks something like `{"less": `<`, "le": `<=`}`
15:33:08Araq`<` are not real procs
15:33:34stefanos82Araq: what inspired you to design the {. .} for pragmas? I'm curious.
15:34:03miranAraq: ok, then i won't force that style. i already have the alternative solution....
15:34:51Araqit was clear to me the 3 different bracket kinds () [] {} wouldn't do and so I came up with (. .) [. .] {. .}
15:35:37Araqfor a systematic way of how to extend the brackets
15:36:04Araqbut only {. .} are used for anything
15:37:02Araqand devel added [: ] because [. .] is not sexy enough :P
15:38:57Araqand (. .) can't be used because somebody said these look like boobs
15:39:09Yardanicolol
15:39:31Yardanico( . ) khm
15:39:38Yardanico!vanish
15:40:20miranwhat is the probability that we'll see pattern matching in nim?
15:41:27stefanos82Araq: I don't know whether it was coincidence or not, but Ocaml's flags are the same lol
15:42:08stefanos82sorry, ocamlbuild's tags
15:44:39stefanos82Araq: now I realized what they meant with boobs; I didn't see it at first ^_^
15:52:22dom96https://github.com/TechEmpower/FrameworkBenchmarks/pull/3933
15:52:33dom96I expect Jester to be rather slow
15:52:40dom96I have some ideas on how to fix that though
15:53:23FromGitter<Bennyelg> whats wrong? ⏎ ⏎ ```let t1 = Job(nextRun: now(), lastRun: now()).every(10).seconds().friday()``` ⏎ ⏎ Traceback (most recent call last) ... [https://gitter.im/nim-lang/Nim?at=5b4a1c731c0f906b1452a026]
15:53:39FromDiscord<awr> nim needs < > everywhere just like C++ /s
15:57:35*Trustable quit (Remote host closed the connection)
15:59:12FromGitter<Bennyelg> https://github.com/2vg/mofuw wonderful
15:59:21Yardanico@Bennyelg look at httpbeast too!
16:00:15dom96:D
16:00:50FromGitter<Bennyelg> Heheh Digging now, Looks so promising Nim is improving like hell and all thanks to you guys.
16:02:57FromGitter<Bennyelg> @dom96 any bentchmark ready ? for the httpbeast ?
16:03:38dom96https://irclogs.nim-lang.org/14-07-2018.html#13:35:36
16:03:48*csgator joined #nim
16:04:19Araqmiran: pattern matching is not scheduled for v1, but there are nimble packages that implement it
16:05:30miranAraq: oh, yeah, i forgot about patty! haven't tried it yet, i might give it a chance
16:05:52FromGitter<Bennyelg> @dom96 freaking crazy
16:06:08FromGitter<Bennyelg> lol
16:17:59*donlzx joined #nim
16:28:31FromGitter<Bennyelg> how can I call any proc from a function? ⏎ e.g ⏎ proc a(func: proc()) = func
16:28:52FromGitter<Bennyelg> I want to wrap a procedure which receive procedure and run it
16:29:12FromGitter<Bennyelg> I tried something like ⏎ ⏎ ```proc exec*(o: var Job, fun: untyped) = ⏎ fun``` [https://gitter.im/nim-lang/Nim?at=5b4a24d866c1e833a9e84b68]
16:29:24FromGitter<Bennyelg> but I dont have actually any idea
16:32:19dom96func()
16:32:52Yardanicodon't use "func" btw, it's a keyword
16:33:06FromGitter<Bennyelg> but if my func is need parameters ?
16:33:17FromGitter<Bennyelg> ok
16:33:24dom96oh yeah, good point
16:33:40FromGitter<Bennyelg> and func is a keyword for?
16:33:44FromGitter<Bennyelg> to be replace proc someday ?
16:33:45Yardanicofor "func" :)
16:33:52Yardanico@Bennyelg - just call it like func(arg1, arg2)
16:33:56FromGitter<Bennyelg> but proc is func ? :O
16:35:16FromGitter<Bennyelg> i want to run something like this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b4a2643b5efcd5aeefccd9b]
16:36:54*donlzx quit (Quit: Leaving)
16:37:10FromGitter<Bennyelg> another way which will be even better is : ⏎ ⏎ ```exec(helloworld, args1, arg2, arg3)``` [https://gitter.im/nim-lang/Nim?at=5b4a26b5b5efcd5aeefcce78]
16:41:47FromGitter<Vindaar> You can do it with templates like this for example (if I understand you correctly :) ): ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b4a27ca897d514b3c4e731d]
16:42:35FromGitter<Bennyelg> looks good, what was the magic here? just pass fun as an untyped instead of func ?
16:42:38FromGitter<Bennyelg> proc *
16:43:19miran@Bennyelg you can do it without templates, just by using procs
16:43:24FromGitter<Vindaar> it's template magic ;) replaces it at compile time. If you wanted to do it with a proc, you'd need to give the correct signature of the procs you need to wrap (although generics might help here too?)
16:43:49miran@Bennyelg @kaushalmodi has written about it couple of days ago
16:44:27FromGitter<Bennyelg> works like charm
16:44:42*csgator quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
16:44:48FromGitter<Bennyelg> you were right procs also work I forgot to remove discard word in the begining of my request
16:45:18miranhere it is: https://scripter.co/notes/nim/#lambda
16:46:50FromGitter<Bennyelg> every day I am amazed by how nim is so elastic.
16:47:05FromGitter<Vindaar> it never stops. I still get the same feeling :D
16:47:22FromGitter<Bennyelg> :D
16:47:38FromGitter<Vindaar> (ok, I only started using Nim ~Oct 2017)
16:48:05FromGitter<Bennyelg> around my time but I am doing some fun with it My guys at work don't want to switch they afraid.
16:48:17FromGitter<Bennyelg> we are using go and I want to leave. looking now for another job
16:48:18FromGitter<Bennyelg> lol
16:48:25*skrylar is attempting to make some of that switching pain lessened
16:48:35FromGitter<Bennyelg> but No jobs on nim currently :(
16:48:42skrylarwe at least have (albeit an ugly) GUI for instance ;p
16:49:07FromGitter<Vindaar> I can imagine. I'm only at Uni, but my colleagues aren't too keen on using my code so far either (let alone using Nim themselves..). But I'll get them to eventually :P
16:49:28skrylaractually i know fltk is ugly and doesn't port to mac well, but its functionality is really solid :( never had to deal with bugs and screwy event dispatch likei gtk
16:50:00*skrylar has had gtk flat out refuse to move objects in a box layout, despite using the API calls to do so
16:50:51FromGitter<alehander42> is `func` working now :O
16:51:04miran@Vindar i was sure you had more nim experience!!
16:51:25miran@alehander42: yeah, i'm using `func` regularly now (in v0.18.1)
16:52:16FromGitter<Vindaar> @miran: well, since then I've been coding in Nim almost daily, since I switched (almost) completely, haha. But thanks :)
16:52:55mirani should step up my game
16:52:59FromGitter<Vindaar> :D
16:58:30FromGitter<kaushalmodi> miran: Cool, now I need to play with func vs proc :)
16:58:41skrylarquestion: do we have a preferred way of running background tasks in nim (a.k.a. setTimeout)
16:59:14*dddddd quit (Remote host closed the connection)
16:59:47miran@kaushalmodi: it's easy, just change every proc to func, and then try to see why it doesn't work at some places :)
17:00:22miranthat helped me to refactor some of my code to make it more elegant
17:00:23*fvs joined #nim
17:01:27*endragor joined #nim
17:07:56*Ven`` joined #nim
17:08:08FromGitter<Bennyelg> @kaushalmodi what is the different
17:08:17FromGitter<Bennyelg> between func and proc :d
17:08:44FromDiscord<exelotl> I would also like to know
17:10:31Yardanico func is {.noSideEffect.}
17:12:08FromDiscord<exelotl> ah I see, so that could be useful for optimisation reasons or just for clarity/intent?
17:13:15FromGitter<kaushalmodi> @Bennyelg I don't know. That's why I'll need to play with those.
17:13:59miranjust clarity
17:14:07Yardanicoas I said, the only difference now is just that func is {.noSideEffect.}
17:14:11Yardanicolike real "function" in maths
17:14:34miranbut it is nice to be "just" clearer :)
17:17:53FromGitter<kaushalmodi> miran: Oh, that means no echoes in there.
17:18:14skrylardebugEcho exists
17:18:21*endragor quit (Remote host closed the connection)
17:18:26skrylarit does an echo while pretending not to have side effects, for that very reason
17:18:30miranand no globals (except for `const`)
17:18:40FromGitter<kaushalmodi> TIL. Thanks
17:19:31skrylardom96, Araq is there already a timer system for async stuff
17:19:56*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:21:45Araqskrylar: yeah, there is, but I never used it :-) see eg. asyncSleep()
17:23:11skrylarhttps://nim-lang.org/docs/asyncdispatch.html#sleepAsync, hm
17:23:26skrylarthese might work, will have to see
17:23:55skrylarbacon.js has this thing where you can make event streams either from timeouts or that take the value of a property on a timeout; looking in to what nonsense is required to support that nimside
17:28:29*develooper joined #nim
17:28:48develooperhello nim
17:29:37*develooper quit (Client Quit)
17:30:12Yardanicolol
17:35:01FromGitter<Vindaar> procrastination is strong in me again. problem: texlive is missing packages. solution: write nim program to compile tex file over and over again, parse output for missing package error and call `tlmgr` to install appropriate package. It worked, so I guess... yay?
17:42:43*Perkol joined #nim
17:44:25miran@Vindaar don't let the latex-haters to hear that!!
17:44:45miranbtw, what packages did miss?
17:46:30FromDiscord<exelotl> lol that's a brilliant solution
17:47:03AraqVindaar: :-)
17:47:11Araqmiran: too late, I heard it.
17:47:31miran:)
17:47:46FromGitter<Vindaar> @miran: haha :D it was missing random stuff like mchem, siunitx etc. Freshly installed void linux, installed texlive 2018 from the repos. That only installs ~280 packages
17:48:16FromGitter<Vindaar> I mean I could have simply checked the header of the tex file and just parsed those or something :D this was a somewhat *inefficient* solution :D
17:48:20mirancant you install also all those texlive-xyz packages?
17:49:12FromGitter<Vindaar> In void linux there's only a minimum texlive package. I could have installed texlive-full manually of course
17:49:38miranbut you're right - it is weekend - we need to make use of that extra free time :D
17:50:55FromGitter<Vindaar> It's not like next week is gonna be crazy again, haha (gonna reinstall our detector at our experiment at CERN starting Monday + I need to give a talk on Thursday. ughh)
17:52:17mirani just checked - in manjaro linux, you have huge amount of texlive packages, i thought the situation is the same in other distributions
17:55:33FromGitter<Vindaar> I think you're right for many distributions (although e.g. on Ubuntu these packages tend to be so old, that I always installed texlive manually anyways)
17:55:53FromGitter<Vindaar> but tbh `tlmgr` isn't such a bad tool actually :)
17:58:37miranyeah, old packages (and then using PPAs) is one of the reasons why i decided to leave linux mint (it is based on ubuntu LTS), and try my luck with manjaro
18:00:35*Trustable joined #nim
18:01:11FromGitter<Vindaar> hehe, same here. my desktop is still running mint 17 (too scared to do a `dist-upgrade` :P it works, so I'm happy...)
18:10:58stefanos82@Vindaar: under Windows at work, I used to use TeXnicCenter which had the option to automatically fetch missing packages for me
18:13:10*find0x90 joined #nim
18:17:20FromGitter<Vindaar> stefanos82: that's handy!
18:20:42skrylari hope heaps of closures don't cause issues xD
18:21:25miranstefanos82: MikTeX has the same ability
18:22:58*find0x90 quit (Quit: find0x90)
18:24:05*endragor joined #nim
18:24:12*endragor quit (Remote host closed the connection)
18:28:56stefanos82miran: it's an IDE with MikTeX behind the scenes
18:29:04miranoh!
18:29:34FromGitter<Vindaar> https://gist.github.com/Vindaar/9ed80ee38faff8b6f3d3ce174d729f70 :D
18:29:39stefanos82I don't remember whether TeXworks offers this option or not
18:40:32*find0x90 joined #nim
18:46:14*Perkol quit (Remote host closed the connection)
19:18:36skrylarnothing stupid happens if i delete a seq entry during an iterator right
19:21:17FromGitter<Vindaar> you mean an element of the seq you iterate over?
19:24:01skrylaryeah it doesn't work
19:27:41skrylarits easy enough to replace because only the 'current' element can get deleted
19:27:59skrylarimplementing something like bacon.js (functional reactive programming / FRP) to nim because eeeh
19:30:37skrylari remember a few years ago reading somebody's demo that was suggesting FRP is really useful for event chains
19:30:48skrylarRust has adopted the primitives for iterators
19:33:55YardanicoI should use "cast[ptr int](addr(arg))[]" to get address of `arg` as int?
19:34:12Yardaniconot to interface with C, just to get address
19:35:35krux02Yardanico, you want the addr as int?
19:35:38Yardanicoyes
19:35:53krux02then you should do ``cast[uint](arg.unsafeAddr)``
19:35:55skrylaraddr(someint) will already be `ptr someint`
19:36:06Yardanicokrux02, ok, thanks
19:36:30krux02you know when unsafeAddr is ok to use?
19:36:48skrylar~~never~~ during moments of extreme magic :b
19:36:57Yardanicokrux02, I won't modify any memory by that address
19:37:03YardanicoI just need to get addr :P
19:37:06krux02yes
19:37:32krux02skrylar, unsafeAddr isn't any different than addr, it just compiler more often
19:37:54skrylaraddr does a sanity test to see if you can write to the addr, unsafeaddr doesn't
19:38:07skrylaralthough either keyword should probably be in your "block and force an audit" list in phabricator ;)
19:38:14krux02and when you have to use it it either means you did not get your types correct, or you just write wrapper code
19:38:49krux02well I like to use addr, but I am very happy that in Nim I just don't need to do it
19:39:21krux02passing parameters by reference implicityly really saves me using the `addr` operator.
19:39:37krux02it is a simple and yet so powerful feature of the Nim programming language.
19:39:48skrylari'm not anti addr (or even goto) ;p
19:39:56skrylarit's just a warning sign is all
19:40:10krux02ok, then we don't need a discussion :P
19:40:18Araq"force an audit" nails it.
19:41:09skrylarAraq, phabricator actually has (if you make everyone use arc) the ability to auto-reject pushes based on conditions and alerts some maintainer to go/no-go it. there is a version that does it without arc but the commits still go through w/ a warning
19:41:12skrylarits neat
19:41:20Araq'cast', 'ptr' and 'addr' are Nim's unsafe features. and everything else that is currently unsafe must be made safe :-)
19:42:50skrylarthe sheer amount of closures being made by this module is giving my anneurisms :X
19:43:15Araqugh, ticks in my leg
19:56:07FromDiscord<exelotl> ow that's not good, be safe
20:03:40Araqlol thanks, got a pair of tweezers
20:15:53skrylarfirst successful event piped through a filter :^)
20:16:31skrylararaq.filter(proc(x:thing): bool = return x.kind != tkTick)
20:16:47skrylarwell, `keep`, but meh
20:26:00FromDiscord<exelotl> item_t* items = get_items(); // ptr to first item
20:26:04FromDiscord<exelotl> item_t* foo = &items[5]; // ptr to 6th item
20:26:10FromDiscord<exelotl> what's the equivalent in nim?
20:26:21FromDiscord<exelotl> let items:ItemPtr = getItems() # ptr to first item
20:26:27FromDiscord<exelotl> let foo = ????
20:27:44FromDiscord<exelotl> (where ItemPtr and getItems are imported from C)
20:35:11skrylarhttps://github.com/Skrylar/cobweb/blob/master/cobweb.nim :D
20:39:06FromGitter<tim-st> skrylar: regarding your iterator question I found this in `re` docs: `Note that since this is an iterator you should not modify the string you are iterating over: bad things could happen.`
20:39:44skrylartim-st: if the length of a seq changes length, there is an assertion error (debug mode?)
20:39:57skrylarchanged it for a while loop with conditional increment
20:40:05FromGitter<tim-st> I dont know, sry
20:40:54skrylarwasn't a question. wrote a test :)
20:41:12FromGitter<tim-st> btw it seems `re` is much faster than `regex` unfortunately :\
20:44:40FromGitter<tim-st> is it normal that this regex matches from <P to </P> ? `(?s)<P .*?#0007'>(.*?)</P>`
20:44:59FromGitter<tim-st> I assumed only in brackets matches
20:46:51krux02tim-st: I am not sure about nim regular expressions, but if you want to match the actual character <, it might be that you have to escape it.
20:47:02*miran quit (Ping timeout: 244 seconds)
20:47:05krux02but it depends on the regular expression library/mode
20:47:27FromGitter<tim-st> no I want to match (.*?) but it matches already at <P
20:47:35FromGitter<tim-st> I tried re and regex...
20:48:09krux02originally regular expressions have some characters that you had to escape and some you did not. that was a bit confusing, so it got changed, kind of. Now there are more regular expression modes around.
20:48:19*miran joined #nim
20:48:26krux02. is any character
20:48:47krux02\w is [0-9a-zA-Z_]
20:48:47FromGitter<tim-st> yes, I use it like in python and it always worked until now
20:49:09krux02well the python regular expressions are quite ok
20:49:42FromGitter<Vindaar> @tim-st can you clarify an example string you want to match and your regex?
20:50:08FromGitter<tim-st> it's a rtf converted to htm by word or something
20:50:11FromGitter<Vindaar> in general though, I find www.regex101.com super helpful
20:50:26FromGitter<tim-st> yes, thanks, I try it there
20:50:33krux02I recommend the emacs commend re-builder that lets you interactively build a regular expression and see what it matching within an entire file.
20:50:33FromGitter<tim-st> also used this before
20:50:42krux02command not commend
20:50:45FromGitter<Vindaar> if he uses emacs I second that :)
20:51:00FromGitter<tim-st> I dont touch emacs and vim and things
20:51:11FromGitter<rayman22201> https://regexr.com/
20:51:21FromGitter<rayman22201> super nice interface for building regex
20:51:35FromGitter<rayman22201> If you like huge JS apps in your browser that is :-P
20:52:31FromGitter<tim-st> krux02: there was indeed an unescaped character, funny that it matched though quite fitting
20:52:32krux02I wonder whis this this is so huge, regex is built into javascript and then there is text.
20:52:40FromGitter<data-man> @tim-st: There is nothing unexpected, PCRE has a long history of optimizations (decades!)
20:53:16FromGitter<tim-st> yes, I know, I also didnt expect it, just hoped gcc makes some magic and it's like 2 times slower only
20:53:22FromGitter<tim-st> but it seems like ten times
20:53:28FromGitter<tim-st> (guessed)
20:53:41krux02gcc doesn't do magic
20:53:48krux02don't expect the compiler to do magic
20:53:51krux02compilers can't do that
20:53:58*find0x90 quit (Quit: find0x90)
20:54:10krux02and the programmer is resposible to get the program run fast, not the compiler programmer.
20:54:12skrylarexcept stalin, who brutally optimizes
20:54:30FromGitter<tim-st> ok
20:56:58krux02rayman22201: somehow RegExr seems to be weird. Neither \< nor < match the beginning of a word
20:57:12krux02both just match the < character
20:58:08FromGitter<rayman22201> I don't think that is supported by JS regex
20:59:34FromGitter<rayman22201> I've actually never seen the `<` character used as a regex anchor. Is that a PCRE extension or something?
21:00:08FromGitter<Vindaar> skrylar: github.com/skrylar/*cobweb* -> stalin -> https://github.com/barak/stalin -> link in description: http://*cobweb*.ecn.purdue.edu/~qobi/so… -> full circle. I see what you did there :P (or maybe just a fun coincidence :D)
21:02:45krux02rayman22201: I don't know where the < character got introduced, but it is one of the most important charactors that I use in regular expressions
21:02:56krux02searching for word boundaries is very handy
21:03:15FromGitter<rayman22201> I can't even find it on google. there is the `\b' for word boundry?
21:03:42krux02just do ``man grep``
21:03:46krux02on the terminal
21:03:48FromGitter<tim-st> < is for matching groups I think, and ^ and $ are anchors
21:03:55krux02and everything is explaind to you
21:04:16krux02tim-st: no () is for matching groups
21:04:18skrylarVindaar: well, cobweb was originally a dataflow thing (think Excel equations, or lisp 'cells')
21:04:28krux02but depending on the engine it can be \( \) or just ( )
21:04:30FromGitter<tim-st> krux02: named groups
21:04:37krux02no not names group
21:04:46FromGitter<Vindaar> skrylar: ahh, I had no idea :)
21:04:55skrylarVindaar: i rewrote it so its now baconjs in native nim, but the whole point is to replace spaghetti code or GUI events and whatnot with a cobweb :p
21:05:07FromGitter<rayman22201> @krux02 That is interesting. Super non-standard
21:05:09FromGitter<tim-st> https://stackoverflow.com/questions/10059673/named-regular-expression-group-pgroup-nameregexp-what-does-p-stand-for
21:05:52krux02Just to make sure we are talking about the same thing here, when I talk about regular expressions I mean the ones that you can use in vim, sed, grep, pearl and all other unix tools, I am never talking about javascript.
21:06:12FromGitter<tim-st> this is pcre
21:07:11FromGitter<rayman22201> It sure as hell isn't in the PCRE man page: https://pcre.org/pcre.txt
21:07:52FromGitter<rayman22201> I believe you. It's in the grep man page. It's just something I haven't seen before, and I have done a lot of PCRE stuff
21:07:53FromGitter<tim-st> it is:
21:07:54FromGitter<tim-st> There are several different ways of writing back references to named ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b4a662ad1428e5aefe8a38d]
21:08:45krux02rayman22201: I am not 100% sure what you mean by non-standard, it works across vim emacs sed and grep. I tested them all.
21:08:59FromGitter<rayman22201> I consider PCRE the standard
21:11:07FromGitter<rayman22201> I'm not dogmatic about it though. I'm just surprised. It's super weird to me that all of these standard unix utilities have it but PCRE does not.
21:12:23FromGitter<rayman22201> It's also surprising to me that I can't find any history of it on google. (But I could just be googling the wrong things)
21:12:55krux02I try to find the specification of the pcre
21:13:01krux02but that document is just the C api
21:14:35*krux02 quit (Read error: Connection reset by peer)
21:15:01FromGitter<rayman22201> I did find this in the pcre man page on Ubuntu: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b4a67d46534bc5d2e5ba12b]
21:15:12*krux02 joined #nim
21:17:55*miran_ joined #nim
21:18:24FromGitter<tim-st> the regex doesnt work, although I tested it on the regex tester site
21:18:27*miran quit (Ping timeout: 240 seconds)
21:18:37FromGitter<tim-st> it always matches the full block
21:18:53FromGitter<tim-st> I use re.findAll(...)
21:19:39FromGitter<data-man> @krux02: https://www.pcre.org/original/doc/html/pcresyntax.html and https://www.pcre.org/current/doc/html/pcre2syntax.html
21:20:11*miran_ is now known as miran
21:21:47FromGitter<rayman22201> @tim-st do you have an example string?
21:22:11krux02aparently I am in the gnu regular expression land
21:22:17FromGitter<tim-st> yes, wait a moment I try it in python first, I trust pythons re
21:22:58FromGitter<rayman22201> lmao @krux02 you have been drinking too much Richard Stallman toe tea :-P j/k
21:23:09FromGitter<tim-st> `re"(?s)<P .*?#0007'>\s*(.*?)\s*<\/SPAN.*?<\/P>"` is my regex
21:23:26krux02https://www.gnu.org/software/grep/manual/html_node/The-Backslash-Character-and-Special-Expressions.html#The-Backslash-Character-and-Special-Expressions
21:23:27FromGitter<tim-st> this should only match the thing in brackets in the middle?
21:23:59FromGitter<tim-st> but it matches from <P to </P>
21:24:34*miran quit (Ping timeout: 260 seconds)
21:24:50*nsf quit (Quit: WeeChat 2.1)
21:24:55krux02tim-st python is not gpl, so I doubt it has gnu regular expressions
21:25:27FromGitter<tim-st> I'm using pcre in nim
21:25:50FromGitter<tim-st> `This module is implemented by providing a wrapper around the PRCE (Perl-Compatible Regular Expressions) C library.`
21:26:07Araqre.nim ?
21:26:12FromGitter<tim-st> yes
21:26:16FromGitter<tim-st> import re
21:26:35Araqmy stuff is unkillable :P
21:27:11FromGitter<tim-st> here is the target string: https://gist.github.com/tim-st/be9441b3c1065797a6ce16a7baca6035
21:27:44Araqshould have used my HTML parser ;-)
21:28:07FromGitter<tim-st> this is "htm" some weird ms office format
21:29:33*Jesin quit (Quit: Leaving)
21:29:51FromGitter<Vindaar> @tim-st it's working fine on my end, as far as I can tell?
21:30:07FromGitter<Bennyelg> how to sort list of elements by specific key
21:30:24FromGitter<tim-st> @Vindaar what's your output?
21:31:12FromGitter<Vindaar> oh, you said you're using `findAll` no?
21:31:33FromGitter<tim-st> which one are you using?
21:31:41krux02I think regular the use expressions is a sign of hackyness. But the fact that the regular expression library is just stable and dosn't need constant revisions and improvements is really showing how well the software works.
21:32:15FromGitter<tim-st> I want the same like pythons re.findall()
21:32:58krux02continue where you left off?
21:33:28FromGitter<Vindaar> `data` is your thing up there, `reg` your regex from above: https://gist.github.com/Vindaar/b555e2a347d6c1fb8fe3f4199f80d3fa
21:33:44Araqkrux02: which library do you mean?
21:33:53FromGitter<Bennyelg> how to do something like this ? ⏎ ⏎ ```sortedByIt(s.listOfJobs, s.listOfJobs.atTime)``` [https://gitter.im/nim-lang/Nim?at=5b4a6c41897d514b3c4efd21]
21:34:58krux02Araq: I am referring the the pcre library.
21:35:15FromGitter<tim-st> @Vindaar lol, that doesnt work for me...
21:35:21krux02tim-st: I looked at re, and there is a re.findAll
21:35:37krux02what is the problem with that?
21:35:58FromGitter<tim-st> for match in htm.findAll(re"(?s)<P .*?#0007'>\s*(.*?)\s*<\/SPAN.*?<\/P>"): ⏎ echo match
21:36:21FromGitter<tim-st> echos full block not like the result from Vindaar
21:36:50FromGitter<Vindaar> as you see, `findAll` also does that for me. But using the `=~` template (or `match` manually) works fine
21:37:05FromGitter<Vindaar> no idea what the difference is with `findAll`
21:37:11krux02ah, you are right. a find should return a Match, not a string
21:37:31FromGitter<tim-st> @Vindaar ah, now I see it you had two echos^^
21:37:38FromGitter<tim-st> so this is a bug?!
21:37:48FromGitter<tim-st> findall gives wrong result
21:38:15krux02That is a valid criticism on the regular expression library.
21:38:37FromGitter<tim-st> no, pythons does it too, it's ok for findall
21:38:40AraqfindAll does what its docs say it does
21:38:51krux02Araq: that is not the problem
21:39:05Araqkrux02: well PCRE version 10 has a new API and we should port re.nim to use that...
21:39:09krux02the problem is that a match as subpatters that one might want ot access
21:39:20krux02yes
21:39:52FromGitter<tim-st> oh, ok, so it doesnt care if I use brackets or not
21:39:55Araqit also uses a JIT
21:40:07Araqand the pure Nim implementation doesn't
21:40:15FromGitter<tim-st> then it's not possible to solve this problem with `re`
21:40:44Araqtim-st: try Nim's scanf :-)
21:41:20FromGitter<tim-st> ok, thanks, will have a look
21:41:33krux02tim-st. This is a real problem that is solvable. You could try to improve the situation by porting the API over.
21:42:09FromGitter<tim-st> that's too time consuming
21:42:44krux02well it is doable
21:42:53FromGitter<tim-st> I currently implement a perfect lmdb version in nim, that's more important since nim only supports the 20 years old sqlite
21:43:12krux02what is lmdb?
21:43:24FromGitter<tim-st> kv database
21:43:59FromGitter<tim-st> 700k random reads per second on my laptop in debug mode
21:44:03Araq20 years old sqlite is still unmatched.
21:44:32FromGitter<tim-st> no, the author of lmdb implemented sqlite using lmdb and it's 20 times quicker
21:44:35*chopzwei joined #nim
21:44:45FromGitter<tim-st> and additonally lmdb is much easier to use like hashmap
21:50:51*Trustable quit (Remote host closed the connection)
21:53:25FromGitter<data-man> @Araq: should PCRE2's wrapper and nre2 (for e.g.) had the same API as re/nre?
21:54:09Araqre.nim should use pcre2.nim but its API shouldn't change
21:54:24FromGitter<Vindaar> @Araq is there a specific reason why `strutils.removePrefix/Suffix`only offer in place versions? Less bloat? It's trivial to implement for me, sure
21:57:00FromGitter<rayman22201> @tim-st ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b4a71ac582aaa63076ab726]
21:57:07FromGitter<data-man> @Araq: do you have PCRE2 on Windows?
21:58:37AraqVindaar: removeSuffix can be mapped to setLen() and so has an efficient inplace version. removePrefix follows removeSuffix for consistency.
21:58:51FromGitter<tim-st> @rayman22201 yes, it yields the very same text
21:59:07FromGitter<rayman22201> Is that what you want?
21:59:09Araqexpression based variants are not available because we don't want to have two versions for every text handling proc
21:59:11FromGitter<tim-st> no
21:59:16krux02Vindaar: don't ask questions about strutils. Many people had many ideas how that library should look, and now it is a mess.
21:59:30FromGitter<rayman22201> what is your goal then @tim-st ? I think I missed that part
21:59:55Araqkrux02: it's not that bad. we only have remove 50% of the procs in there
22:00:03FromGitter<tim-st> I wanted only the content inside `(.*?)`
22:00:17*dddddd joined #nim
22:00:24Araqhowever, I need to figure out why I *always* need to import strutils.
22:00:37Araqsomething in there must be super useful.
22:00:48FromGitter<Vindaar> @Araq: ah, that makes sense :) ⏎ @krux02: haha :D
22:00:57FromGitter<tim-st> about strutils: the best way is to overload all to be in place and return new string with the same proc name, and this is always secure for the compiler to find out, but some people dont want this
22:01:26FromGitter<tim-st> like `a.strip; let b = a.strip`
22:01:43FromGitter<tim-st> first in place, second return new
22:01:55FromGitter<rayman22201> @tim-st that gives me only the inside content?
22:02:11krux02Araq: I think the super usefull stuff of strutils could be moved to system. I mean when it is used anyway all the time it could be available all the time.
22:02:25krux02moving things from strutils to system also doesn't really break something.
22:02:26FromGitter<tim-st> @rayman22201 I wanted this but it didnt work for me :(
22:04:01FromGitter<rayman22201> what version of Nim is running on the Nim playground? does anybody know?
22:04:11FromGitter<tim-st> echo NimVersion?
22:04:27FromGitter<tim-st> dunno how to start nim bot
22:04:29FromGitter<Vindaar> pretty sure it's 0.18.0
22:04:46FromGitter<rayman22201> duh. thanks @tim-st. Yeah, it's 0.18.0
22:04:47Araqkrux02: no, system is too bloated already
22:05:18FromGitter<rayman22201> I think it's a regression. On Nim playground the regex works. On my machine with a nightly devel, it gives the whole string.
22:05:23Araqalso, we need to find the useful parts first.
22:05:31FromGitter<tim-st> ah, I have nightly too
22:05:34FromGitter<tim-st> maybe this is the thing
22:05:46FromGitter<tim-st> or because of windows?
22:06:06FromGitter<tim-st> I also get whole string
22:06:10FromGitter<rayman22201> Well, I am Ubuntu, and it gives me the whole string
22:06:23Araqprobably just toLower/toUpper, replace, replaceWord and `%`
22:06:29*Vladar quit (Quit: Leaving)
22:06:36FromGitter<rayman22201> I think it's a regression on devel. I will have to verify
22:06:57FromGitter<tim-st> Araq: contains
22:07:08FromGitter<tim-st> and maybe a few others
22:07:28Araqthe rather uninspired allCharsInSet :-)
22:08:06FromGitter<tim-st> also I thought about some procs for strutils and sequtils should be the same
22:08:26FromGitter<tim-st> some time ago I wanted to concatenate seqs but there wasnt away
22:08:47FromGitter<tim-st> I think nearly everything from strutils can be used in sequtils too
22:09:16FromGitter<Vindaar> @tim-st https://nim-lang.org/docs/sequtils.html#concat,varargs[seq[T]] ?
22:09:37FromGitter<tim-st> when was this added?
22:09:41FromGitter<tim-st> :D
22:09:54FromGitter<Vindaar> ages ago I think. Ever since I've been using Nim it's been available afair
22:10:04FromGitter<tim-st> well, why is it called `concat` and not `add`
22:10:23FromGitter<tim-st> it's a problem in nim that every module introduces own styles
22:10:32FromGitter<tim-st> like sets -> `incl`
22:10:39FromGitter<tim-st> every `add` has an own name
22:11:25FromGitter<rayman22201> wow, 0.18.0 is showing the entire string as well... weird
22:11:31FromGitter<rayman22201> on my machine
22:11:39FromGitter<rayman22201> Nim Playground does the right thing though...
22:11:43FromGitter<Vindaar> because adding is something different from concatenating. `add` would add something to an existing `seq` in place, while `concat` concatenates different seqs to a new one?
22:11:44FromGitter<tim-st> yes, thought so, it's a compiled dll that does the work
22:11:59krux02there is strutils and sequilts and algorithm
22:12:05FromGitter<rayman22201> so maybe different PCRE version
22:12:14krux02I relly don't get the distinction between algorithm and sequtils
22:12:50FromGitter<tim-st> @Vindaar but I wanted `add` and it doesnt exists
22:12:50krux02maybe those two can be joined
22:13:20FromGitter<tim-st> this is actually the proc that was missing, now we found it
22:14:39FromGitter<Vindaar> `add` like this? https://nim-lang.org/docs/system.html#add,seq[T],openArray[T]
22:17:05FromGitter<tim-st> now I remember^^ it was `find` xD
22:17:28FromGitter<tim-st> I needed to see if a subseq is inside the seq and if so find the index
22:18:57FromGitter<tim-st> so find and contains are missing in sequtils
22:20:21FromGitter<Vindaar> ```let s = @[@[1, 2], @[2, 3], @[3, 5]] ⏎ let inS = @[2, 3] ⏎ ⏎ echo s.find(inS) ⏎ # 1``` [https://gitter.im/nim-lang/Nim?at=5b4a772466c1e833a9e8f38c]
22:20:27FromGitter<Vindaar> works just fine
22:20:46FromGitter<tim-st> no, you have seq[seq]
22:20:55FromGitter<tim-st> I'm talking about same seq types
22:21:17FromGitter<tim-st> @[1,2,3] in @[1,2,3,4] ? -> true
22:21:21FromGitter<Vindaar> ahhh!
22:21:43FromGitter<tim-st> I really needed this proc to build my super fast unicode collation algorithm
22:21:49FromGitter<tim-st> I ended up writing it myself
22:22:22dom96Reminder: answer our community survey here: https://goo.gl/forms/t2gWWBEDC1walw6s2
22:22:39FromGitter<Vindaar> I mean that is quite specific, no? not *everything* has to be in the stdlib after all
22:23:08FromGitter<tim-st> yes, but also sequtils is specific as whole module
22:27:12FromGitter<Vindaar> @dom96 since you're around: `nimble path` seems to show the location of the package installation *including* what's specified as `srcDir` in the nimble file. Although that location doesn't actually exist in the corresponding `.nimble` folder. Is it supposed to be like that?
22:28:22FromGitter<Vindaar> already answered the survey :)
22:29:05FromDiscord<exelotl> uh, this is annoying https://cdn.discordapp.com/attachments/239878713016188939/467819715394535440/unknown.png
22:29:47FromDiscord<exelotl> now any time I try to print a `cint`, it uses the `$` I defined for the `Version` type
22:30:06dom96Vindaar: It shouldn't be like that.
22:30:28FromDiscord<exelotl> I was hoping I could just define $ for the subtype and not have it affect the base type
22:30:31FromGitter<tim-st> just use cint.int
22:30:47FromGitter<Vindaar> ok, thought so! I could try to fix that in a few days
22:30:51FromGitter<tim-st> or distinct
22:31:31FromDiscord<exelotl> yeah I don't want to mess up cint for other code, but distinct is so annoying because I have to explicitly pull in all the operations I could ever want to use
22:32:03FromGitter<tim-st> hm^^
22:32:18skrylarlmdb sounds interesting
22:33:12FromGitter<tim-st> it is, but it has downside: the database size is not growing automatically, you can resize on closed db or when no transaction is open, but I cannot find out for sure if no transaction is open
22:33:25FromDiscord<exelotl> oh wait you're right it's not too bad, in this case I can just do e.g. `proc error*(v:Version):bool = v.cint < 0`
22:33:40FromGitter<tim-st> I implement all procs to find out loadfactor and resize to do it manually
22:34:49*jamesroseman joined #nim
22:39:48*NimBot joined #nim
22:45:49*NimBot joined #nim
22:46:49*jamesroseman quit (Ping timeout: 260 seconds)
22:46:59*jamesroseman joined #nim
22:51:45*NimBot joined #nim
22:57:41*NimBot joined #nim
23:03:35*NimBot joined #nim
23:09:42*NimBot joined #nim
23:10:20*brainpro1 is now known as brainproxy
23:15:44*NimBot joined #nim
23:21:31*NimBot joined #nim