<< 23-03-2017 >>

00:08:50*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
00:11:58*gokr quit (Ping timeout: 240 seconds)
00:22:45FromGitter<TiberiumPY> Compiling nim on android now :) via termux
00:23:38ftsf\o/
00:24:21FromGitter<TiberiumPY> Seems bad that there's no nim package in termux, I need to contribute to https://github.com/termux/termux-packages/
00:25:09*ftsf has never heard of termux before
00:25:59FromGitter<TiberiumPY> It' like an terminal emulator, but with its own repository
00:26:19FromGitter<TiberiumPY> it doesnt require root
00:26:21*BitPuffin|osx quit (Ping timeout: 260 seconds)
00:29:38jivank_TiberiumPY you could probably compile nim in termux with gcc
00:30:16FromGitter<TiberiumPY> Yeah
00:30:30ftsfi've just used ConnectBot in the past, quite nice.
00:30:45ftsfbut never really done local development on my android device
00:30:48FromGitter<TiberiumPY> But how can I pass custom options to build.sh?
00:31:08FromGitter<TiberiumPY> I need to add -landroid-glob
00:36:03FromGitter<TiberiumPY> Nevermind
00:36:13FromGitter<TiberiumPY> SUCESS
00:36:39FromGitter<TiberiumPY> Now I need to build nim using nim
00:38:06FromGitter<TiberiumPY> Oh no, koch complains
00:38:25FromGitter<TiberiumPY> CC: compiler_koch Error: unhandled exception: No such file or directory Additional info: Could not find command: '/bin/sh'. OS error: No such file or directory [OSError]
00:40:12*rauss joined #nim
00:41:53*chemist69 quit (Ping timeout: 256 seconds)
00:45:28*chemist69 joined #nim
00:48:02*ftsf quit (Ping timeout: 246 seconds)
00:51:41*ftsf joined #nim
00:51:48*yglukhov joined #nim
00:56:11*yglukhov quit (Ping timeout: 264 seconds)
01:10:07FromGitter<TiberiumPY> Wow, Nim also supports snake_case
01:10:40FromGitter<TiberiumPY> I find it useful: you can have snake case locally, but commit with camelCase
01:19:38ftsfi take it you got your nim running on android?
01:20:57FromGitter<TiberiumPY> Yeah, but I will contribute to Termux packages anyway
01:23:05FromGitter<TiberiumPY> Hmm seems it can't run
01:24:48FromGitter<TiberiumPY> The issue is that bash in Termux located in /data/data/com.termux/files/usr/bin/bash (because /bin/bash is root-writable only, and it's not easy to get root on some android phones)
01:39:13*NimBot joined #nim
01:52:56ftsfscripts looking for #!/bin/bash ?
02:10:10*def-pri-pub joined #nim
02:33:56*brson quit (Quit: leaving)
02:34:13*shashlick quit (Ping timeout: 260 seconds)
02:35:17*shashlick joined #nim
02:39:49*chemist69 quit (Ping timeout: 260 seconds)
02:53:48*chemist69 joined #nim
02:56:51*arnetheduck joined #nim
03:01:06*kunev quit (Ping timeout: 240 seconds)
03:02:05*kunev joined #nim
03:13:32*adeohluwa joined #nim
03:33:08*adeohluwa quit (Quit: leaving)
03:33:24*adeohluwa joined #nim
03:41:08*def-pri-pub quit (Quit: leaving)
05:01:54*rauss quit (Quit: WeeChat 1.7)
05:09:07*ftsf quit (Quit: :q!)
05:40:49*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
05:49:01*adeohluwa quit (Ping timeout: 256 seconds)
05:51:54*APT69 joined #nim
05:54:36*jackkv quit (Ping timeout: 240 seconds)
06:07:36*joebo quit (Ping timeout: 240 seconds)
06:08:06*literal quit (Ping timeout: 240 seconds)
06:12:48*literal_ joined #nim
06:12:48*BitPuffin|osx joined #nim
06:12:58*jackv joined #nim
06:13:39*joebo joined #nim
06:20:57*adeohluwa joined #nim
06:28:18*adeohluw1 joined #nim
06:31:35*adeohluwa quit (Ping timeout: 264 seconds)
06:33:03*nsf joined #nim
06:40:28*xet7 quit (Quit: Leaving)
06:47:59*adeohluw1 quit (Read error: Connection reset by peer)
06:50:11*Vladar joined #nim
07:03:28*NimBot joined #nim
07:18:27*vlad1777d joined #nim
07:43:02*bjz joined #nim
07:50:00*yglukhov joined #nim
07:57:22*tankfeeder joined #nim
08:12:36*APT69 quit (Ping timeout: 258 seconds)
08:15:24*kulelu88 joined #nim
08:30:16*couven92 joined #nim
08:32:26*Andris_zbx joined #nim
09:02:37*couven92 quit (Quit: Client disconnecting)
09:03:10*couven92 joined #nim
09:10:08*zachcarter joined #nim
09:16:27*vlad1777d_ joined #nim
09:17:33*vlad1777d quit (Ping timeout: 256 seconds)
09:56:16*kulelu88 quit (Quit: Leaving)
10:02:21*kulelu88 joined #nim
10:07:05*bjz_ joined #nim
10:08:29*bjz quit (Ping timeout: 240 seconds)
10:25:53*zachcarter quit (Quit: zachcarter)
10:29:10*kulelu88 quit (Quit: Leaving)
10:31:54*bjz joined #nim
10:32:47*bjz_ quit (Ping timeout: 264 seconds)
10:33:25*vlad1777d_ quit (Remote host closed the connection)
10:34:45*benido joined #nim
10:38:17*benido quit (Client Quit)
10:42:34*literal_ is now known as literal
10:56:25*sleepy998 joined #nim
10:57:23*vivus joined #nim
11:02:09sleepy998what does 'illegal capture' mean?
11:02:23*Snircle joined #nim
11:02:27sleepy998did the compiler go poaching?
11:04:34*krux02 joined #nim
11:05:41sleepy998i have a proc with object param (mc), used as a member function. mc.foo() the fn sets some members: mc.x = 3, etc. so, does the mc param need to be declared 'var'?
11:07:28sleepy998the compiler doesn't mind its absence.. is var just a static type checking thing, or can its absence lead to run time errors?
11:08:21sleepy998i assumed i didn't need it, and it's an {.async.} proc.. i added 'var' while chasing a bug and the compiler told me 'illegal capture'
11:09:27Araqit means it cannot translate 'var T' in an .async context
11:09:51sleepy998do i need the 'var'?
11:09:56Araqno.
11:10:06sleepy998ok
11:10:21Araqnot unless the compiler complains about mutablity issues
11:10:42FromGitter<vegansk> @Araq, I fixed https://github.com/nim-lang/Nim/pull/5580 on windows
11:23:00*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
11:23:31sleepy998why can i define procs with the same name and different params, but not the same name and different return type?
11:25:28Araqbecause 'let foo = overloadedProcHere()' would be ambiguous
11:25:54Araqand if your API design makes me write 'let foo: T = overloadedProcHere()', it's a stupid API design.
11:26:02sleepy998yeah but it would be so awesome if the compiler let me make it not ambiguous
11:26:10sleepy998why?
11:27:09sleepy998if the result already has a type defined, there's no need to specify.. if its not overloaded, theres no need to specify..
11:27:37Araqbut you want to overload it in this fashion.
11:27:54sleepy998only sometimes
11:28:01*couven92 quit (Quit: Leaving)
11:28:35sleepy998let foo = initT() vs let foo:T = init() not much different
11:28:49sleepy998and gives more versatility
11:29:49Araqhow do you define versatility when 'let foo = init()' is not even possible
11:30:17sleepy998only impossible if init is overloaded
11:31:08Araq"let's do A, it will only cause harm when it's actually used" is not an argument for me.
11:31:22sleepy998i suppose that could be a pain, adding an import to existing code, causing a new overload, breaks existing code.. hmm.
11:31:34stisaisn't overloading on return a planned feature? See https://github.com/nim-lang/Nim/issues/1070
11:32:26Araqit's definitely not gonna make it into v1 and I think it's a bad idea in general.
11:32:47Araqnote that I never said anything in this thread.
11:33:51Araqwe don't need more ways to write constructors. the initT vs newT is simple, already everywhere and flexible.
11:34:20Araqand it avoids the "factory" problem that's always overlooked by the alternative proposals.
11:37:53*zachcarter joined #nim
11:42:47*Tiberium joined #nim
11:44:16*bjz joined #nim
11:49:30zachcarterwhoa setting up cygwin and mingw-w64 is a PITA
11:49:39zachcarterI forgot why I hate developing on windows so much
11:50:43*Salewski joined #nim
11:53:07SalewskiAraq, nimsuggest highlight command seems to give no info for keywords or comments at all, and "<" is reported as a template.
11:53:20SalewskiThat may make text coloring not very easy.
11:53:47zachcarterDoes anyone in here use Windows for Nim dev?
11:54:33Salewskizachcarter: I think Araq does!
11:54:53*Tiberium quit (Remote host closed the connection)
11:55:06zachcarterno shit...
11:55:07cheatfatezachcarter, check appveyor.yml in Nim's github repo
11:55:08*Tiberium joined #nim
11:55:13zachcarterokay
11:55:20stisazachcarter I do, but I just download mingw w64, click install, add to path and it works. Maybe I'm doing simpler things than you
11:55:29cheatfateyou will obtain link, you will obtain what you must to do with PATH and you will get it
11:55:40zachcartergotcha thanks all
11:55:56zachcarterI’m trying to test out my game framework on all OS’s
11:56:08*byte512 joined #nim
12:01:48zachcartercheatfate: thank you for that link it’s perfect, question since you’re a contributor
12:02:21zachcarterI need to set up a CI solution for my project that has nim installed along with nimble and nake
12:02:30zachcarterwould you recommend staying away from Travis?
12:02:37zachcarterI’ve heard horror stories
12:02:43cheatfatewhy? Travis is one of the best
12:03:09zachcarterokay if it’s good enough for you guys it’s good enough for me then
12:03:26zachcarterI’ve just heard solutions like gitlab’s seem to be superior
12:03:33zachcarterand people often struggle hard with Tavis
12:03:35zachcarterTravis*
12:03:52cheatfateYou can ask Araq about gitlab :)
12:03:53zachcarterbut I don’t have a lot of first hand experience with either, minimal with both
12:03:56zachcarterahahaha okay
12:04:10zachcarterwe’re already on github anyway so we’ll go with Travis :P
12:04:10cheatfateTravis for Linux/MacOS and appveyor for Windows
12:04:17zachcarterokay thanks
12:04:35zachcarterI may be borrowing that appveyor script
12:04:37cheatfateand still looking for CI for BSDs
12:04:48zachcarterthank god I don’t have to support bsds
12:04:48*couven92 joined #nim
12:04:51cheatfatezachcarter, there other work based on appveyor.yml
12:05:16cheatfatehttps://github.com/nim-lang/Nim/wiki/BuildServices
12:05:31zachcarterahh thank you
12:05:42cheatfatebut this version uses `release` version of Nim
12:05:49cheatfatenot `devel`
12:05:56zachcarterokay
12:06:07zachcarteryeah I’ll definitely need devel
12:06:28zachcarterregardless thanks for pointing me to that I should be able to cobble together something
12:07:28*BitPuffin|osx quit (Ping timeout: 240 seconds)
12:07:43Araqsaleswski I don't remember how highlight works, sorry
12:07:57AraqI think VS Code uses 'outline' instead
12:08:20Araqoh and of course keywords and comments are not nimsuggest's business at all
12:08:21SalewskiAraq, do you not use it for your nimedit?
12:08:44Araqwe could support it now after my recent changes
12:08:58Araqbut in the past nimsuggest didn't touch the Nim lexer
12:09:09SalewskiOutline command seems to give only an overview.
12:09:18Araqso anything the lexer knows is lost in nimsuggest
12:10:19AraqI personally find highlighting that goes beyond the lexing step more confusing than helpful and editors can the lexing much faster than nimsuggest
12:10:22SalewskiI was thinking indeed about highlighting keywords locally, by using a hash table lookup. But it is not fully accurate.
12:11:42Araqhighlighting that reflects what the language does at the lexical level is helpful. highlighting that renders types different from vars (for example) means your highlighter conflated different language spec levels.
12:11:59SalewskiIndeed, the gtksourceview highlight is fine already. I just tested nimsuggests highlight just for fun.
12:14:10SalewskiDo you know how fast a highlight query is for nimsuggest? It transfers very many data, so it may take a more than a millisecond?
12:15:47Araqyup.
12:16:04Araqdon't run it on every single keystroke to highlight tokens
12:17:07SalewskiYes, I have to think about it. One single keystroke can change much in some cases...
12:17:19SalewskiI will do some testing, bye.
12:18:24*Salewski left #nim (#nim)
12:19:41*elrood joined #nim
12:20:03*krux02 quit (Remote host closed the connection)
12:20:46*krux02 joined #nim
12:28:37vivusin: https://nim-lang.org/docs/db_mysql.html should I use raw SQL statements to search for text in specific columns ?
12:32:18Araqnot sure what that means. use ? in your query and substitute the search term(s)
12:33:11vivusAraq: to clarify, should I use db.exec(sql()) to search or are there built-ins in the library ?
12:35:28FromGitter<brechtm> Is there something in Nim similar to Python's context managers (with statement)?
12:36:31Araqbrechtm: use a template with body: untyped as the last parameter
12:37:30Araqvivus: exec doesn't even return anything. use for x in theDb.fastRows(sql"select * from myTestTbl"):
12:37:30Araq echo x
12:37:45Araqwhich is part of the "Larger Example" on that very page you linked
12:38:08FromGitter<brechtm> Araq: that doesn't make much sense to me at this point :-) But it'll do as a starting point, thanks!
12:39:00Araqvivus: but point taken, we should have a "Retrieving data" section
12:39:27vivusAraq: that is good enough for me. will use that as a basis to understand more
12:47:49*zachcarter quit (Quit: zachcarter)
12:48:05*sleepy998 quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
12:48:17krux02I want to veryfy that visual studio code does not work properly with nim-include files, but I can't get the nim-plugin installying
12:48:31krux02I press install, but it just doesn't finish
12:48:49krux02is there a way, that I can see progress/log of the install of a visual studio code plugin?
12:49:05couven92krux02, Help -> Toggle Developer Console -> Console
12:49:46couven92or maybe it's Developer Tools, i'm not sure... but do a string.startsWith compare of all menu items and search for strings starting with Developer :P
12:50:29couven92Ah! It's "Toggle Developer Tools"
12:52:25krux02well I found it, and I have a German VSCode
12:52:46krux02but the console doesn't print anything from the install process
12:53:14krux02the button that was install is on 'installing' but it just doesn't finish
12:57:22couven92really? :O That's weird... I had some problems a while back (before I came up with vccexe)... But I could then clearly see my the erroneous configuration of system that led to the error
12:57:39couven92I'm uninstalling Nim from VS Code now... let's see...
12:58:16FromGitter<brechtm> What editor offers the most IDE-like experience (code navigation, debugger) for Nim at this moment?
12:58:28*djellemah quit (Remote host closed the connection)
12:59:02couven92@brechtm I'd say VS Code
12:59:04FromGitter<brechtm> I'm trying VSCode now, which looks promising. Haven't tried debugging yet.
12:59:19FromGitter<TiberiumPY> *really* I dream about good NIM plugin for IntelliJ IDEA. Yeah, IntelliJ IDEA is big, full-blown IDE with JVM
12:59:38FromGitter<TiberiumPY> But, for example in Python world PyCharm is the most used Python IDE
12:59:49couven92I have plans for NimVS for Visual Studio! But that may take some weeks... :P
13:00:03FromGitter<brechtm> Attempting to debug, I get these kinds of error messages: "undefinedBFD: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_macosx.a(arclite.o): unknown load command 0x2d"
13:00:05Tiberiumcouven92, sadly there's no Visual Studio for linux :(
13:00:17Tiberiumonly vscode
13:00:19FromGitter<brechtm> But I probably just need to build debug binaries
13:00:30couven92Tiberium, it's getting there though... Considering that we have VS for Mac
13:00:43Tiberiumcouven92, yeah, I believe there will be VS for linux too
13:01:10Tiberiumbecause if you want to choose a full-blown IDE for any popular language - it will be an IDE from JetBrains most of the time
13:01:17Tiberium(I mean on Linux)
13:02:19couven92I can see that... Well, I have the luxury that I have always developed on Windows and that I mainly program in C#... And I have to say: VS and C# on Windows is AWESOME!
13:02:49Tiberiumcouven92, btw, there's new C# IDE from JetBrains
13:03:21krux02well nim plugin for visual studio code is still installing
13:03:21couven92Yeah... I have seen it... Not thoroughly looked at it yet, though
13:03:25krux02doesn't seem to finish
13:03:57krux02I can tell you, when you develop enough, then a good idea becomes less important for you
13:04:27krux02on linux the best 'IDE's are still emacs and vim if you have configured them correctly
13:04:28couven92krux02, do you have nimsuggest in you path? what Nim version are you using?... I'm not really sure whether that is relevant, but let's find the easy reasons first... :P
13:04:37FromGitter<brechtm> Do I only need `--debuginfo` to build a debug binary?
13:04:49krux02i have nimsuggest in my path an nim in development branch build yesterday
13:04:55couven92hmm...
13:05:19couven92does it state the nim compiler headline in the devloper tools console?
13:06:04couven92Mine says sth like: Nim Compiler Version 0.16.1 (2017-03-01) [Windows: amd64]
13:06:04couven92 and so on...
13:06:25krux02well the plugin doesn't install, so no
13:06:34Tiberiumcouven92, wait, my VSCOde Nim plugin is working, but I don't have nimsuggest. If I install it, how can I add it to VSCode?
13:06:49krux02http://ix.io/pco
13:06:56couven92Tiberium, I think the Nim Plugin actually builds it's own nimsuggest
13:06:59krux02but that is command line
13:09:38krux02couven92, I hope not
13:09:49couven92Hmm... you're right... The install of the plugin is remarkably silent...
13:09:57krux02I have nimsuggest, and I don't want the plugin to use something else that my system nimsuggest
13:10:09couven92and my computer it just magically works... :/
13:10:17*djellemah joined #nim
13:10:59couven92krux02, maybe log an issue on https://github.com/pragmagic/vscode-nim
13:11:11krux02that is what I just wanted to do
13:11:32couven92Hmm... because I have no better idea
13:15:47*user0___ joined #nim
13:16:09Tiberiumhow can I add 'nake' to path if I installed it from nimble?
13:16:39couven92On Linux: export PATH=$HOME/.nimble/bin:$PATH
13:16:52Tiberiumcouven92, thanks
13:17:29FromGitter<brechtm> anyone debugging with gdb on macOS?
13:17:51couven92Tiberium, not that this will add ALL nimble package binaries into your PATH! :P (But yeah, you'd want that anyways)
13:17:57FromGitter<brechtm> Apple is making stuff diffuclt again...
13:18:00couven92s/not/note
13:18:01Tiberiumcouven92, I know it :)
13:18:09TiberiumI also installed latest Nim compiler and added it to path
13:18:15Tiberium(it fixed one nimx issue for me)
13:18:22chemist69Hi, does anyone know of a nim library to extract plain text from html?
13:19:06krux02ok, the issue is now submitted
13:19:07krux02https://github.com/pragmagic/vscode-nim/issues/47
13:19:23krux02chemist69, regular expressions?
13:19:50chemist69now I have two problems... ;-)
13:19:56couven92:D
13:20:04Tiberiumwait, nim supports path / path syntax?
13:20:09chemist69I had hoped for a slightly more higher level solution
13:20:18Tiberiumdir / filename
13:21:20krux02chemist69, maybe you can translate html with pandoc to txt
13:21:27krux02never tried it, but maybe that is what you want
13:21:45chemist69krux02: good idea, thanks.
13:22:04FromGitter<Jeff-Ciesielski> Tiberium: Yes. the `os` module provides a `/` proc which aliases joinPath
13:22:23FromGitter<TiberiumPY> @Jeff-Ciesielski wery nice
13:23:02Tiberiumhmm, I'm trying to install nimsuggest
13:23:04Tiberiumit fails
13:23:18krux02Tiberium, it should be bundled with nim
13:23:23FromGitter<Varriount> Isn't nimsuggest bundled with nim now?
13:23:32Tiberiumah I see
13:23:36couven92yup
13:23:38chemist69I thought nimsuggest is part of Nim nowadays, it is installed automatically.
13:23:46couven92@Varriount, yes it is
13:24:02FromGitter<Varriount> It's not installed with Nimble, it's just in ./tools
13:24:19couven92chemist69, no, it itsn't, you'll still have to run `koch tools` to build nimsuggest
13:24:41FromGitter<Varriount> Is `koch tools` documented?
13:24:51chemist69ok, right, yeah I have a script that does that every time I update Nim.
13:25:28Tiberiumhow can I install compiled nim system-wide?
13:25:51couven92@Varriount, well depends... If you run `koch --help` it says: `tools builds Nim related tools`
13:26:33couven92Tiberium, on Linux: `./koch geninstall && sudo ./install.sh`
13:26:52Tiberiumcouven92, thanks again :)
13:27:30krux02can I disable linenoise in nimsuggest?
13:27:47couven92(Proceed with caution though! Maybe split it it up into two commands, I am a Windows guy giving suggestion on how to do stuff on Linux!!! :P )
13:28:16couven92krux02, what's linenoise?
13:28:50krux02well that is a very poor library that lets you input a line on the command line
13:29:11krux02normally gnu readline is used, but for licensing issued, it was replaced by linenoise.
13:29:33krux02but linenoise doesn't even have basic file completion
13:29:56krux02would prefer to have no line editor and start nimsuggest with rlwrap
13:30:11krux02rlwrap is a shell script that wraps any program to use gnu readline
13:30:29krux02as long as it doesn't do anything on it's own to provide line editing
13:32:46couven92Hmmm... Ask Araq?
13:32:50couven92:P
13:33:11Tiberiumvery newbie question, but how to pass html from httpclient.getContent to parseHtml in htmlparse?
13:33:55FromGitter<brechtm> great, got debugging to work in VSCode!
13:34:28couven92@brechtm Cool! On Linux using the GDB integration?
13:34:48FromGitter<brechtm> @couven92 macOS using GDB
13:35:25onionhammernim has a gitter now!? :-O
13:35:37FromGitter<brechtm> Needed to codesign the gdb executable though (https://sourceware.org/gdb/wiki/BuildingOnDarwin)
13:35:41krux02well I can enable linenoise for "nim secret"
13:36:05krux02that means "rlwrap nim secret" is awesome
13:36:16FromGitter<brechtm> can't see any variables though...
13:36:18couven92Nice! :) I think step-by-step debugging using the VS Debugger in Windows is possible, but probably a long way down the road... I'll have to set aside time to write my MSc. as well I am afraid... :/
13:36:30demi-brechtm, i would highly recommend not using GDB
13:36:38demi-use LLDB instead
13:36:57*zachcarter joined #nim
13:37:10krux02brechtm: you can have some gdb support, when you put some python scripts
13:37:13couven92demi-, that uses LLVM?
13:37:16cheatfatedemi-, could i ask you for help
13:37:27cheatfate?
13:37:33FromGitter<brechtm> @demi- why, and how would I go about it (a webpage reference would be fine)
13:37:56krux02I don't think you want to fuzz with that stuff, but I one did something to get gdb know a bit more about nim, but very far away from being ready
13:37:57demi-couven92: yeah, GDB is not officially supported on OS X anymore, been that way for ages. LLDB comes with the xcode command line tools, which you presumably have for building nim and homebrew stuff
13:38:27krux02https://github.com/krux02/opengl-sandbox/blob/master/includes/nim-gdb.py
13:38:27couven92Hmm... interesting...
13:38:30demi-cheatfate: sure, what's up? (don't have much time atm but can answer what i can)
13:38:45krux02https://github.com/krux02/opengl-sandbox/blob/master/includes/debug.nim
13:38:56krux02the last file to embed the python script into the executable
13:39:05krux02does only work on systems with elf files
13:39:09cheatfatedemi-, i need your debugging skills on macos, to resolve coroutine's fail on tests/coroutines/twait.nim
13:39:17krux02I think that just excludes windows
13:39:47demi-heh, cheatfate if it is alright with you i might need to postpone that to a bit later, about to go look at some apartments so will be AFK for a bit.
13:40:00cheatfateok
13:40:13demi-but i'd be happy to help with what i can
13:40:56krux02apple is very fast at dropping support for things that basically everybody relies on
13:41:04FromGitter<brechtm> @demi- Nice, using lldb-mi in VSCode does list variables
13:41:17krux02flash, openGL, gdb, ...
13:41:35FromGitter<brechtm> thanks for the tip
13:42:14demi-krux02: apple hasn't officially supported GDB for like 10 years?
13:42:18FromGitter<brechtm> inspection of object attributes doesn't seem to be possible...
13:42:26demi-this isn't new
13:42:30cheatfatedemi-, thanks
13:42:42*yglukhov quit (Remote host closed the connection)
13:42:46Tiberiumhow can I make httpclient to output page body as utf8?
13:42:46krux02demi-, well the latest openGL version that apple supports is 7 years
13:42:53krux02whatever that means
13:43:18Tiberiumcyrillic text looks like this: � ������� �����������
13:43:38krux02Tiberium, what http client?
13:43:39*byyte512 quit (Quit: WeeChat 1.7)
13:43:42demi-brechtm, other thing i would suggest is ensuring you have debugging info enabled with the nim compiler
13:43:47Tiberiumkrux02, nim's httpclient
13:43:50Tiberiumsource code - http://pastebin.ca/3784890
13:43:56Araqhttpclient doesn't output text
13:44:04FromGitter<brechtm> @demi- `--debuginfo`?
13:44:12TiberiumAraq, not exactly httpclient
13:44:14*yglukhov joined #nim
13:44:19TiberiumAraq, http://pastebin.ca/3784890 how can I output utf8 text there?
13:44:26demi-you should be able to get everything as you would get it in C, variables object introspection, breakpoints in the nim code, etc
13:44:33demi-brechtm, yeah i believe that is it
13:45:50FromGitter<brechtm> @demi- no difference with or without `--debuginfo`... so I must be doing something wrong
13:47:13flyxTiberium: well the URL you query returns its data with header „Content-Type:text/html; charset=windows-1251“
13:47:14FromGitter<brechtm> But I'm building using a nakefile. I'll first try with a test file.
13:47:20Tiberiumflyx, ah
13:47:22demi-sorry i would need to have a better idea of what you are doing and what you expect, i'm not familiar with vs-code's lldb integration so i don't know what i can say about that; i have personally used it from the command line w/o issue
13:47:28Tiberiumflyx, so how can I decode it?
13:47:32Tiberiumand encode to utf8
13:48:02flyxTiberium: you can use the package encodings
13:48:17Tiberiumflyx, I found it on the forum already, thanks :)
13:49:27Tiberiumflyx, works, many thanks!
13:51:14couven92krux02, btw, are form Aachen? I couldn't help but notice the RWTH IP when you joined earlier...
13:51:42krux02yes I am in Aachen RWTH
13:51:53krux02why?
13:52:14couven92nice... I grew up there and did my Abitur in Aachen before I moved to Norway
13:52:16couven92:)
13:52:42krux02Well I live here since I made my Abitur :)
13:53:04flyxalthough arguably, this is a bug in htmlparser. parseHtml transforms entities to UTF-8-encoded characters, so it better transformed the rest of the content into UTF-8
13:53:07krux02but I never know that people would remember ip addresses and where thay are from
13:53:31couven92well for you it says: 178-169.eduroam.rwth-aachen.de
13:54:04couven92pretty obvious! :) And if you're a student things like eduroam automatically stand out :P
13:54:11krux02ok, that is obvious
13:54:49krux02I like eduroam
13:54:50flyxeduroam is also for scientists, not just for students ;)
13:55:01krux02I hated it in the beginning, because it was a pain the the ass to set up
13:55:07krux02especially on linux
13:55:11krux02it just always failed
13:55:25krux02but now it does work and it also works for example in Holland
13:55:54flyxmy university managed to fix the process for Linux, Windows and Mac. now we can just go on a website, download stuff and it works
13:55:57couven92yup... eduroam is nice! Especially here in Norway, where eduroam router are also setup at all kinds of public places... Every Airport in Norway has eduroam!
13:56:17FromGitter<brechtm> @demi- I'm seeing variables names T1_, T2_ etc.
13:56:26FromGitter<brechtm> (running lldb from the command line now)
13:56:38Tiberiumjust curious, is there telegram channel for Nim programming?
13:56:55couven92Telgram has channels? :O
13:57:34flyxwhy is it that people are so interested in having additional channels on other chat services
13:57:50couven92Yeah... IRC FTW!!! :D
13:59:17couven92PMunch and I (we're TAs here at UiT) try to push out students to use IRC... It's our official help and support channel in the subjects where we teach! :P Some students comply... :D
14:00:00flyxmy students just drop by at my office
14:00:16flyxor write Mails
14:01:06couven92well, ours do to... But there are times (usually around 2 a.m.) where we aren't in our office)
14:03:11Tiberiumflyx, because IRC isn't so popular right now :(
14:04:56*rauss joined #nim
14:06:38*themagician joined #nim
14:09:10*vlad1777d joined #nim
14:10:58flyxTiberium: we had that discussion and there's the Gitter room which is bridged here
14:11:08Tiberiumflyx, I know
14:11:11krux02yea irc is weird here and there
14:11:38krux02there is no thumb sized button to join the channel
14:11:51krux02you have to type /join #<channel-name>
14:13:11krux02and then you can't just use pictures in the chat
14:13:39FromGitter<brechtm> @demi- passing `--debuginfo` doesn't make a difference for me. In the global scope, all variables are named "T1_", "T2_", ... In the local scope, they have the name I assigned, but (ref) object's attributes cannot be inspected.
14:13:51krux02but emoji's do work, if the other side has the right font (which they don't)
14:14:09flyxkrux02: it's accessible. people with command-line clients see the picture's URL, people with fancy clients see the picture
14:14:33krux02what clients do support pictures?
14:14:39flyxTextual
14:14:48krux02I have hexchat
14:14:55flyxthe other fancy OSX client as well, though I don't remember the name
14:14:59flyxLinkinus, was it
14:15:51krux02I can't find those in the AUR
14:15:58flyxwell they are OSX only
14:16:10krux02well that does not help very much
14:16:25krux02I mean I sit in between two unused imacs
14:16:31FromGitter<brechtm> @demi- plain objects can be inspected though
14:16:38flyxI guess people wanting fancy IRC clients are expected to use Macs.
14:16:56flyxperhaps there are alternatives, but I don't know about them
14:18:14flyxanyway, we're going quite off-topic
14:18:20*lounge-user82 joined #nim
14:18:51lounge-user82krux02 here, trying out another client can you send me nude pics please?
14:19:48krux02lounge-user82, random image: https://raw.githubusercontent.com/wiki/ocornut/imgui/web/code_sample_01.png
14:20:04lounge-user82oh year it works, thank you
14:20:16*lounge-user82 quit (Client Quit)
14:20:25krux02yea sorry for spamming here
14:21:25*BitPuffin|osx joined #nim
14:21:39krux02Is there documentation about nimsuggest?
14:22:20TiberiumI know this is too much for a compiled language, but will be there some fancy formatting like f'{a+b}' in Python? so maybe these expressions will be unpacked at compile-time
14:24:17stisaThere's https://nim-lang.org/docs/nimsuggest.html
14:29:27stisaTiberium : like https://nim-lang.org/docs/strutils.html#%,string,openArray[string] ? your example would be " $1 " % [$(a+b)] I think
14:30:25Tiberiumstisa, oh, thanks, but something like "#{a+b}" looks cleaner :) anyway, as I said, it's too much for a compiled language
14:32:20flyxTiberium: you can write a macro to do something like that
14:32:28Tiberiumflyx, wow
14:35:37stisawell, $(a+b) would stringify the result of a+b, the problem is if you want "result: $(a+b)" you have to do "result:" & $(a+b) or something like that
14:43:31def-Tiberium: https://lyro.bitbucket.io/strfmt/
14:46:06*nhywyll joined #nim
14:47:08*nhywyll quit (Client Quit)
14:48:46federico3"interp" is really nice
14:50:52couven92krux02, Araq tasked med with re-writing the nimsuggest documentation the day before yesterday...
14:51:56couven92I'll get to it as fast as I can, meanwhile you can mind-merge https://nim-lang.org/docs/nimc.html#nim-idetools-integration and https://nim-lang.org/docs/nimsuggest.html to get a better understanding of what nimsuggest can do
14:53:34couven92otherwise go to nim-lang IRC logs and see Araq and me discussing nimsuggest on https://irclogs.nim-lang.org/21-03-2017.html#08:32:51
14:53:54krux02well from the command line I can actually get the correct output from nimsuggest for my file
14:54:05krux02it is just that the information I got was simply wrong
14:54:12AraqTiberium: f"{a+b}" is a macro away
14:54:32krux02I could not just pass the path of the project I needed to pass the exact root file of the project otherwise it did not work
14:55:07*brson joined #nim
14:55:25TiberiumAraq, but I'm a newbie, I think this will be too hard for me:)
14:55:34flyxTiberium: proof of concept: https://gist.github.com/flyx/21623fabc89e84f0dbc3dd7e225bc227
14:55:38krux02and when I press Ctrl+D in interactive mode, nimsuggest becomes weird
14:55:46Tiberiumflyx, wow
14:56:17Tiberiumflyx, wait, will this evaluate at runtime or at compile-time?
14:57:00Tiberiumit actually works like python's
14:57:08FromGitter<andreaferretti> tiberium, as others have mentioned, the macro was already written: https://lyro.bitbucket.io/strfmt/#how-interp-works
14:57:16flyxTiberium: the last line gets rewritten at compile time to `echo "$1 + $2 = $3" % [$a, $b, $(a + b)]` which will be evaluated at runtime
14:57:59krux02I also hava a macro like that: https://github.com/krux02/opengl-sandbox/blob/master/includes/macroutils.nim#L78
14:58:17vivusthe more time you spend here, the more you realize that nim is likely to move towards Pythons direction in terms of code simplicity
14:58:20*Nobabs27 joined #nim
14:59:07krux02well I do not only care about code simplicity, but I do also care about performance
14:59:24krux02and I do not like very much that the printing creates a lot of temporary strings
15:00:16def-flyx: no, interp is transformed to fmt and fmt is also evaluated at compile time: https://lyro.bitbucket.io/strfmt/#how-fmt-works
15:00:18couven92krux02, so you don't like format strings in C's printf either?
15:00:47flyxdef-: I am talking about my code
15:01:15def-flyx: ah, ok
15:02:37*couven92 quit (Quit: Client disconnecting)
15:02:53*couven92 joined #nim
15:03:23*tankfeeder quit (Quit: Leaving)
15:03:33flyxthis was more for showing how it's done. it obviously is not production-quality
15:08:07*nsf quit (Quit: WeeChat 1.7)
15:08:26Araqparseutils.interpolatedFragments
15:08:36Araqpity that nobody is aware of it ;-)
15:12:30*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
15:13:45krux02couven92, I think format strings in C are fine, because they work without temporary strings
15:14:13couven92hmmm...
15:14:14krux02all arguments of printf are passed as the argument itself, they are not first converted to a temporary string
15:14:17couven92I see...
15:15:26Araqkrux02: thats an argument for system.echof :-)
15:15:44krux02a lot of temporary strings consume time for allocation, and because they still are allocated on a garbage collected heap, they also consume time for the garbage collector
15:16:05krux02I have never used system.echof
15:18:11krux02I think the best string interpolation would accept a first argument for output channel
15:18:23Araqno, it's argument for having something like echof
15:18:36krux02the equivalent of sprintf and fprintf
15:18:39Araqthere is no echof in system right now.
15:18:51krux02Ah ok
15:19:06Araqoh sprintf is just addf
15:19:29krux02Araq: if it is the addf that I remember, then almost
15:19:39Araqonce concepts land in Nim, it can take a general 'sink' concept
15:19:45krux02addf creates temporary strings for all arguments
15:19:55Araqdoes it?
15:20:01Araqit shouldn't
15:20:27AraqI think we should optimize the array construction
15:20:35krux02https://nim-lang.org/docs/strutils.html#addf,string,string,varargs%5Bstring,%5D
15:21:11krux02from the documentation varargs[string, `$`], creates a temporary string for each argument
15:21:35Araqno it does $arg
15:21:50Araqand $ for strings is a nop
15:22:20Araqso ok, if you pass integers and floats, it's a bit bad and should be done as a macro then
15:22:23krux02for string it is nop, but for integers it is not a nop
15:22:49krux02and basically anything else than a string
15:23:48krux02it would be fancy if all `$` overrides could magically be used to create a string at the end of another string
15:24:29krux02but I doubt it, because the result variable is required to be initialized with at leat ""
15:25:06Araqyeah, that is in fact still in the planning phase
15:25:35Araqthe problem is that proc x(...; result: var string) can be easily transformed into proc x(...): string
15:25:44Araqbut not the other way round
15:26:27Araqturning void procs into expressions would be a superb rewrite rule
15:26:43Araqbut it has to be done in the language to be feasible
15:27:49krux02and it does not handle format parameters
15:28:41krux02I think about a general proc format(out: sink; format: stringview; value T)
15:30:11krux02then something like this could be possile stdout.echof("my matrix: \n%2.2$mymatrix \n TADA!!!")
15:30:53krux02sink is either `var string` or a stream like stdin/stdout
15:31:17krux02strigview is like openarray[char]
15:31:33krux02but with the difference that it can point into a string
15:32:02Araqas if I couldn't imagine
15:32:03krux02and in this case it would just be the "2.2" part for ``mymatrix``
15:32:35krux02yea you know, I already made a suggestion for the general pointer size pair
15:32:44krux02this would be a nice use case
15:34:31krux02And I don't need a concept would be necessary for this feature
15:36:09*Tiberium quit (Ping timeout: 240 seconds)
15:37:55krux02type sink = File | string
15:38:10*Tiberium joined #nim
15:43:15Tiberiumok, so I will start learning nim with rewriting my social network bot in Nim (originally it was written in Python)
15:44:06SentreenCould it be that the profiler module is broken? Just want to be sure I'm not doing something stupid before I submit an issue.
15:44:17Sentreen$ nim build -d:release --profiler:on --stackTrace:on dre
15:44:19Sentreenlib/system/profiler.nim(92, 23) Error: undeclared identifier: 'framePtr'
15:47:48Araqdo you import profiler?
15:47:53Araqcause you must not.
15:48:13SentreenNope, only nimprof
15:50:40SentreenIt seems to work for a minmal example though, so there might be something wrong in my nims file
15:52:05yglukhovthere's a bug in profiler.
15:52:29yglukhovits code should be wrapped into stacktrace:off, afair
15:53:07Tiberiumhow can I convert things like \u0414\u0430\u043D\u0438\u0438\u043B to normal string?
15:53:35Tiberiumah
15:53:39Tiberiumit's because of json
15:53:39Sentreenyglukhov: Any idea if I can work around this somehow?
15:55:57yglukhovi managed to fix it a couple of months ago, but never made a pr because it was done on my teammates machine. those changes are lost now. but they were rather trivial. but i dont remember exactly =))
16:02:08*yglukhov quit (Remote host closed the connection)
16:03:51TiberiumThat's the preferred paste service for this IRC channel?
16:04:59Tiberium*What's ?
16:06:04krux02def-, I just realized I talked a lot about stuff you aready linked too :/
16:06:28krux02that is pretty exactly what I want in the standard library for nim
16:06:37*couven92 quit (Quit: Leaving)
16:06:39def-Tiberium: gist.github.com or pastebin I guess
16:06:48*couven92 joined #nim
16:06:54TiberiumWhy this code throws an exception? http://pastebin.com/YbK1HPZ9
16:07:15TiberiumError: unhandled exception: node.kind == JObject [AssertionError]
16:08:01TiberiumI get an exception only if I'm trying to iterate over resp at lines 13 and 14
16:08:21def-Well node is probably not a JObject
16:08:31def-but some other JSON stuff
16:08:36Tiberiumah
16:08:38cheatfatekrux02, do you know that printf() has limitation on size of generated output? and this limitation can vary for any stdlib/os?
16:09:01*vlad1777d quit (Ping timeout: 260 seconds)
16:09:03cheatfatelast time i checked windows version is limited to something like 1024-2048 bytes
16:09:29krux02no I did not know that
16:09:39krux02why is that?
16:10:03cheatfatebecause most of printf() implementation has something like char buffer[2048]; inside of function
16:10:41krux02and the buffer can not be too big because recently someone told me the stack on windows is only about one MB in size
16:11:02*arnetheduck quit (Ping timeout: 268 seconds)
16:11:25cheatfatesomebody was wrong... stack of size depends on compiler/linker and information about stack size stored in PE header
16:11:28krux02at least i did not have a problem with that yet
16:12:34krux02cheatfate, that guy who told it actually knows a lot, but that doesn't protect from being wrong
16:12:43*nhywyll joined #nim
16:13:00krux02but he didn't say it like it was always the case, he was talking about the default
16:13:21krux02maybe it is just me who is reflecting it incorrectly
16:14:03cheatfateright now i have opened 3 PE executables and all 3 has different stack sizes
16:14:29cheatfateso if you need more you can get more stack easily
16:16:29krux02well I never managed stack size
16:16:38krux02I neven even looked up any stack size
16:16:44krux02it was always just enough
16:16:56krux02but I am on Linux, maybe that is a difference
16:17:35FromGitter<brechtm> Does Nim have an equivalent of Python's super()?
16:20:53krux02brechtm, I think you have to use cast ant proccall
16:21:29TiberiumHow to convert JSON object to Nim object? I want to create a library to work with website API
16:21:40krux02https://nim-lang.org/docs/system.html#procCall,expr
16:21:54raussTiberium: https://nim-lang.org/docs/json.html
16:22:27Tiberiumrauss, so I need to convert ALL fields manually?
16:22:38krux02Tiberium, json alone does not give you types
16:22:39raussNo idea, I just linked you to it
16:23:03Tiberiumkrux02, for example, I want to convert my json to object (so all json's fields will be strings)
16:23:16FromGitter<brechtm> @krux02 thanks, but that doesn't allow automatically determining the superclass's method?
16:23:22raussIt's a starting point for what you need, but you might need a light wrapper around it
16:24:26krux02there is the fields and fieldPairs iterator
16:24:41*vlad1777d joined #nim
16:24:49krux02so you can use that to set all fields of your types from json
16:25:21krux02brechtm, yes you still need to cast manually
16:25:45krux02brechtm, I guess you could write a macro that does super for you :P
16:29:39krux02macros.getTypeImpl and then in that tree you get you probably have a symbol to the parent object
16:31:09Tiberiumis there any examples of a libraries which do stuff with some JSON web api's?
16:38:37FromGitter<brechtm> @krux02 should be easy enough, since there is no multiple inheritance... but would I need to search the AST?
16:39:18flyxTiberium: you can convert JSON to Nim objects directly with nimyaml.org, look at the JSON example
16:39:30krux02just print the treeRepr of the type and then you will see if you can use something
16:41:20Tiberiumflyx, oh, very nice! and what about json like {"response":actual json data} ?
16:41:32Tiberiumsure I can remove it using slices
16:43:48flyxTiberium: you mean like, `actual json data` being some deep JSON construct?
16:44:00Tiberiumflyx, yeah
16:44:11Tiberiumsimplest example: {"response":[{"id":210700286,"first_name":"Lindsey","last_name":"Stirling"}]}
16:44:12flyxTiberium: define a matching type hierarchy in Nim
16:44:57flyxfor example, type Person = object ; id: int ; first_name: string ; last_name: string
16:45:14Tiberiumflyx, yeah I've done that
16:45:22flyxtype MyRoot = object ; response : seq[Person]
16:45:37flyxand then it just works
16:46:50*nsf joined #nim
16:47:00FromGitter<brechtm> @krux02 how do I get a NimNode from a type?
16:47:43demi-cheatfate: i'm back now
16:48:17flyxbrechtm: getType(int)
16:48:39krux02brechtm you have to implement super as a macro
16:48:51FromGitter<brechtm> thanks!
16:48:53flyxbrechtm: there's also getTypeInst and getTypeImpl depending on what you need
16:48:53krux02then you have already a nimNode in your argument
16:49:10krux02you should just use getTypeImpl in your case
16:49:43krux02getTypeInst is the generic expression of the type and getTypeImpl is the actual implemenation
16:49:51krux02and getType should be deprecated
16:49:55krux02in my opinion
16:50:00krux02no need to keep it
16:50:49FromGitter<brechtm> doesn't work on refs, I suppose...
16:50:53krux02and then you should get an ast that has somewhere a symbol
16:51:03krux02brechtm: it does
16:51:11krux02you need to have a typed macro
16:51:21FromGitter<brechtm> Error: request to generate code for .compileTime proc: treeRepr
16:51:46krux02yes I told you, you have to implement it in a macro
16:51:54krux02you can't operate on nimNode at runtime
16:52:05krux02NimNodes don't exist anymore at runtime
16:52:07FromGitter<brechtm> aha
16:52:45FromGitter<brechtm> down the rabbit hole...
16:52:59Tiberiumflyx, oh, thanks!
16:53:03krux02macro super(arg: typed): untyped = ...
16:53:15*couven92 quit (Quit: Client disconnecting)
16:53:31Tiberiumthanks god
16:53:37Tiberiumthere's JSON schema for this API
16:53:43Tiberiumso I can autogenerate all API types
16:56:17*Andris_zbx quit (Remote host closed the connection)
16:57:35flyxTiberium: you can also tell YAML to ignore parts of the JSON by calling ignoreInputKey(MyRoot, "response")
16:57:44flyxTiberium: if you don't need those values
16:57:56Tiberiumflyx, wow, thanks again! I'm not afraid now
17:00:49*Demos joined #nim
17:02:10FromGitter<brechtm> @krux02 I'm not sure what I'm doing here: macro super(typ: typedesc): untyped = echo treeRepr(getTypeImpl(typ))
17:03:07FromGitter<brechtm> The output produced by "super(Ship)" seems very simple: ⏎ ⏎ ```BracketExpr ⏎ Sym "typeDesc" ⏎ Sym "Ship"``` [https://gitter.im/nim-lang/Nim?at=58d3ffca01bcf42439a5c094]
17:04:12*brson quit (Quit: leaving)
17:04:16FromGitter<brechtm> I should read up on macro's...
17:09:26*Trustable joined #nim
17:16:13*Demos quit (Ping timeout: 240 seconds)
17:18:49*couven92 joined #nim
17:22:13*shashlick quit (Ping timeout: 240 seconds)
17:24:25*shashlick joined #nim
17:25:57krux02brechtm: http://ix.io/pcG
17:28:37FromGitter<brechtm> @krux02 thanks... doesn't give the same result with C = ref object ...
17:28:52krux02that's true
17:29:21krux02it might be that you have to write a bit of massage code, to handle ref type cases
17:30:10FromGitter<brechtm> @krux02 how could I change this to accept an object type name instead of an instance?
17:30:52krux02well try it,just try out a lot of stuff
17:31:03krux02and echo treeRepr
17:31:26krux02what is treeRepr when you pass a typedesc?
17:32:41FromGitter<brechtm> What I pasted above: BracketExpr / Sym Sym
17:33:03FromGitter<brechtm> I was thinking getImpl() might be useful here
17:33:12FromGitter<brechtm> But I'm not getting at the Sym yet
17:34:17krux02 echo typ.getTypeImpl[1].getTypeImpl.treeRepr
17:35:50FromGitter<brechtm> ah, got it
17:36:30FromGitter<brechtm> macro super(typ: typedesc): untyped = ⏎ ⏎ ``` var node = getTypeImpl(typ) ⏎ echo treeRepr(getImpl(node[1].symbol))``` [https://gitter.im/nim-lang/Nim?at=58d4079d01bcf42439a5c115]
17:37:10FromGitter<Varriount> Don't we already have a super() for methods?
17:37:25FromGitter<brechtm> ugh, your brackets didn't make it through the IRC-Gitter bridge
17:39:00dom96wow, that's weird. It turns it into a link to: https://github.com/sanctuary-js/sanctuary-def#NullaryType
17:39:03dom96BlaXpirit: ^
17:39:43FromGitter<brechtm> Running late... thanks for AST 101 krux02 ;-)
17:41:03FromGitter<brechtm> @Varriount no matches for "super" in the manual. Would love to hear about it though.
17:42:37FromGitter<Varriount> @brechtm Bah. Darn lack of documentation.
17:43:40FromGitter<Varriount> @Araq What's the Nim equivalent of 'super' for multi-methods?
17:43:55*Nobabs27 quit (Read error: Connection reset by peer)
17:44:11*Nobabs27 joined #nim
17:44:36dom96typeinfo.base I guess
17:45:10dom96I would suggest avoiding methods if at all possible
17:55:16FromGitter<brechtm> dom96 even if doing OOP? This isn't the first time I hear that recommendation. Why is the feature present?
17:57:40FromGitter<brechtm> @dom96 How would I use typeinfo.base in practise? Got an example?
17:59:01FromGitter<brechtm> Oh, nm, the base proc from the typeinfo module of course :-)
18:00:46FromGitter<Varriount> @brechtm Often, you can use templates/generics instead of the traditional OO mechanisms of inheritance and run-timte overloading.
18:00:50FromGitter<Varriount> *run-time
18:01:26FromGitter<Varriount> Also, the current typeinfo module has the defect that it gets the compile-time type of a value, not it's run-time type.
18:03:12FromGitter<Varriount> For example, if `ref Y` inherits from `ref X`, and you pass a `ref Y` value to a procedure expecting `ref X`, and that procedure uses typetraits to get the type of the parameter, the type will be `ref X`
18:03:52FromGitter<brechtm> I see. I'll have to explore templates/generics...
18:04:15FromGitter<Varriount> (Fixing/adding that to the typetraits module would probably be welcome)
18:07:02jivank_dom96: on jester's todo list, will sendFile be more efficient than readFile in terms of GC?
18:12:51krux02emacs nim-mode stoped working for me today, yay
18:13:18krux02I just created an issue about that, but can anybody help me to track that problem down?
18:13:40krux02https://github.com/nim-lang/nim-mode/issues/154
18:15:23dom96Varriount: brechtm: A more appropriate alternative would be object variants, not templates/generics.
18:15:37FromGitter<oprypin> gonna test this again
18:15:38dom96jivank_: I don't think so.
18:15:40FromGitter<oprypin> *<krux02>* echo typ.getTypeImpl[1].getTypeImpl.treeRepr
18:15:54FromGitter<oprypin> look, it's freakin gitter, not my bot
18:16:07FromGitter<oprypin> literally turns \[1\] into a random link
18:16:12FromGitter<oprypin> [1] [2] [3]
18:16:12dom96haha
18:16:29dom96Wait.
18:16:42dom96This seems oddly specific.
18:16:47demi-does gitter use markdown formatting?
18:16:51FromGitter<oprypin> yes
18:16:52demi-because that would do it
18:17:11BlaXpiritby the way i'm "oprypin" on github
18:17:14zachcarteris https://github.com/nim-lang/oldwinapi the windows API wrapper I should be using?
18:17:19dom96https://gist.github.com/dom96/f26a7c5ffacf10945449ab6d39060a71
18:17:25dom96GitHub doesn't turn it into a link
18:17:47zachcarteror is there a "newwinapi"
18:17:51BlaXpiritgitter has a totally different implementation
18:17:58*Tiberium quit (Remote host closed the connection)
18:18:04dom96Of course.
18:18:12*Tiberium joined #nim
18:18:43*Jesin quit (Quit: Leaving)
18:19:16dom96Looks like all it needs is a dot before or after the [1]
18:19:28krux02demi-, I just checked it in my gitter to irc bridge, and there the [1] just works fine
18:19:45krux02so it is the representation of the text on gitter, no in the bridge
18:20:42krux02if the [1] would have been eaten on the bridge, then I would not be able to see it when I bridge gitter back to irc
18:20:43FromGitter<oprypin> testing[1]
18:21:30FromGitter<oprypin> look, basically gitter has a kind of a vulnerability where if you type something\[1\] you get a random link from some previous message. i just typed that example.org link in another gitter channel
18:21:33dom96jivank_: Well, maybe, I think Jester just does readFile which is pretty bad when serving large files.
18:22:03jivank_dom96: i just tested downloading a 45MB file via public folder, ram went to 200MB. then i called a route that has GC_fullCollect, the ram went to 3MB
18:22:22dom96BlaXpirit: I got the "https://github.com/sanctuary-js/sanctuary-def#NullaryType" link again in another channel when doing .1.
18:22:26stisazachcarter : there's https://github.com/khchen/winim and I think winlean
18:22:37zachcarterah thank you stisa
18:23:20dom96*.[1].
18:24:54jivank_is there a way to set a ceiling for the GC?
18:25:05*Demos joined #nim
18:25:08dom96BlaXpirit: Guess I beat you to it? :)
18:25:14BlaXpiritye
18:26:08*Jesin joined #nim
18:31:39demi-does anyone want to make a nim wrapper for the github api so i don't have to?
18:33:29Tiberiumdemi-, make it please, it will be an example for me
18:33:40demi-:|
18:33:40TiberiumI want to create a wrapper for social network API
18:34:00demi-if you want an example, i wrote one for influxdb already
18:34:21Tiberiumdemi-, link please?
18:34:35demi-https://github.com/samdmarshall/influx.nim
18:38:06*krux02 quit (Quit: Leaving)
18:41:03*nhywyll quit (Quit: nhywyll)
18:42:03flyxso I heard demi- will make a nim wrapper for the github api
18:42:11demi-hahaha
18:42:29demi-it is so far down the list of things i have to do, but i want one
18:42:48flyxI am working on moving it further up your list right now.
18:43:01dom96lol
18:45:17demi-neat, so when do you want to sync up on taking over a bunch of my existing projects? :)
18:47:11flyxwe can do it right now. you just read the priority list of your projects to me and then I convince you that each one is worthless of your precious time. then in the end, only the github api wrapper remains.
18:47:23demi-hahaha
18:49:20rauss:D
18:50:42flyxI call this macro social engineering. instead of executing my plan, I explain it to you and that makes you do what would be the conclusion of my plan's execution, even though I didn't actually execute it.
18:56:09*nsf quit (Quit: WeeChat 1.7)
18:56:32*Trustable quit (Remote host closed the connection)
18:56:46*RPG joined #nim
18:57:09*RPG is now known as Guest10466
18:58:02*Guest10466 is now known as scriptum
18:58:34*scriptum quit (Client Quit)
18:58:53*scriptum joined #nim
19:06:30*handlex joined #nim
19:07:06*couven92 quit (Ping timeout: 240 seconds)
19:07:06chemist69Hi, I use VS Code for my Nim coding. For the first time I am looking into threads. I noticed that components from e.g. the channels module (which is implicitly imported) is not recognized by the linter. Does someone have a solution for this?
19:09:44dom96chemist69: Maybe putting --threads:on into a yourproject.nim.cfg file
19:10:24chemist69ah yes, should have thought of that. Thanks, dom96.
19:12:22Tiberiumchemist69, vscode uses nimsuggest under the hood
19:12:30Tiberium(for nim)
19:13:58chemist69yes, I know that. Linting works great for "normal" code. dom96 had the solution for the problem.
19:15:26chemist69on that occasion I also have to say that nimsuggest has greatly improved over the past weeks. Great job!
19:15:38*Jesin quit (Quit: Leaving)
19:24:18Araqchemist69: oh thanks :-)
19:25:55*Salewski joined #nim
19:26:57*Jesin joined #nim
19:28:14*Tiberium quit (Remote host closed the connection)
19:28:23SalewskiAraq, when my testfile imports opengl and compiles fine, which name should I give to nimsuggest from command line for checking opengl module? See
19:28:24*brson joined #nim
19:28:30Salewskilast post in https://forum.nim-lang.org/t/2829/1#17979
19:29:07Salewskichk opengl.nim:0:0 does not work
19:29:51SalewskiI think I also tried full path to opengl.nim, but was not working.
19:30:58SalewskiThis was related to issue https://github.com/nim-lang/nimsuggest/issues/55 -- I do not really use opengl currently, just testing nimsuggest.
19:32:46SalewskiWhen testing from within my editor I got that wrong recursive import message
19:34:02Araqsalewski: looking into it.
19:34:18Araqin theory you handle it the opengl module for checking the opengl module
19:34:33SalewskiThanks.
19:35:15*couven92 joined #nim
19:35:30*zachcarter quit (Quit: zachcarter)
19:36:00*zachcarter joined #nim
19:38:03*yglukhov joined #nim
19:38:19*handlex quit (Quit: handlex)
19:45:58jivank_i dont know much about the subject, but would using https://nim-lang.org/docs/asyncnet.html#send,AsyncSocket,pointer,int (send method that takes pointer) be better than the send proc that takes string? memory wise?
19:46:53jivank_dom96
19:47:41dom96Not significantly.But your problem is that the memory never gets deallocated, correct?
19:48:16jivank_well for example if i wanted to use arduino yun that has 64mb of ram, it wouldn't be able to serve a 45mb file
19:50:25demi-Araq: fwiw, i tried out the llvm thread sanitizer library and that worked out of the box with nim, afaik.
19:50:46jivank_dom96: ideally, if jester could serve files without going over ~10MB of RAM that would be ideal.
19:51:29dom96jivank_: I'll see what I can do for you :)
19:51:55jivank_dom96 :D
19:52:18*brson quit (Quit: leaving)
19:52:47jivank_i am working on a web filemanager, where you can easily share a folder from any device
19:53:48jivank_like python -m SimpleHTTPServer/http.server but little more fancier
19:57:29demi-having a lower memory footprint would be nice, my instance of jester is now at ~500MB after 4 days of serving content.
19:58:54*brson joined #nim
19:59:27*Matthias247 joined #nim
19:59:50def-demi-: that sounds like a bug
20:00:01def-if you don't keep growing some seq or something
20:00:19*user0___ quit (Quit: user0___)
20:00:31demi-i get a fair amount of traffic, right now it is only serving static content, so it shouldn't be doing anything like that
20:01:09*user0___ joined #nim
20:08:57*Trustable joined #nim
20:09:24jivank_what frontend js framework do you guys recommend?
20:09:36*brson quit (Ping timeout: 240 seconds)
20:09:51jivank_maybe that is somewhat inline with nim's values, if that exists
20:14:37*Salewski left #nim (#nim)
20:15:19*Matthias247 quit (Read error: Connection reset by peer)
20:16:45*Matthias247 joined #nim
20:17:13*zachcarter quit (Quit: zachcarter)
20:18:00*zachcarter joined #nim
20:20:03*bjz joined #nim
20:26:13*zachcarter quit (Ping timeout: 240 seconds)
20:33:10dom96Well, it still uses a rather large amount of RAM
20:33:18dom96But it is still much better
20:34:29BlaXpiritdom96, basically they know about that problem from earlier on gitter but haven't done anything about it in over a year[1]
20:36:06jivank_dom96, using buffer pointer instead of string?
20:36:16dom96no, using asyncfile
20:36:22dom96hrm, actually
20:36:33dom96I know why it still uses so much RAM
20:38:17jivank_:D why is that?
20:38:41dom96because the future stream buffer is being filled up faster than it is read from
20:38:57def-dom96: is that something new?
20:39:07dom96future streams? yeah
20:40:47dom96But unfortunately I don't have time to implement a storage limit mechanism for them
20:41:20dom96jivank_: If you want to try what I just implemented you will need jester (devel branch which I just created) and Nim (devel branch as well).
20:41:57jivank_alright ill give it a shot
20:42:39dom96But there is definitely a GC issue in here too
20:44:13dom96In case you or anybody else is interested in how I implemented it: https://github.com/dom96/jester/commit/6c6b49be2790816c4bde0042970974febacd6485
20:48:32jivank_nice i'm taking a look at it
20:49:04*brson joined #nim
20:53:42*user0___ quit (Read error: Connection reset by peer)
20:53:53*user0___ joined #nim
20:56:52*nsf joined #nim
21:12:36*libman joined #nim
21:15:22*Trustable quit (Remote host closed the connection)
21:21:52*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
21:26:28*Tiberium joined #nim
21:33:32*zachcarter joined #nim
21:33:57zachcarteryay frag works with windows now!
21:34:16zachcarterso the game framework now can target osx, linux, windows and android
21:34:38zachcarterdo I add iOS or go back to actually working on the game framework now :P
21:34:56Tiberiumzachcarter, latter :)
21:35:19zachcarter:) I think so too, I need to add texture atlases
21:38:55*user0____ joined #nim
21:38:55*user0___ quit (Read error: Connection reset by peer)
21:39:15Tiberiumwow, without any hassle - 12kb hello world, just used --opt:size -d:release, then strip -s test, and then upx test (without specifying level of compression)
21:51:53*rauss quit (Quit: WeeChat 1.7)
21:58:29FromGitter<brechtm> @dom96, @Varriount I'm of course biased since I'm new to the concepts of generics and object variants, but I have the impression that full OO using multi-methods is more powerful/versatile than those techniques. Why not use full OO if it's available. One reason could be performance, I assume. But I can't imagine dynamic dispatch ever being the bottleneck...
21:59:00*nsf quit (Quit: WeeChat 1.7)
22:02:17demi-not sure how you can have dynamic dispatch and type safety tho
22:06:16*Vladar quit (Quit: Leaving)
22:09:05*vlad1777d quit (Remote host closed the connection)
22:23:26FromGitter<brechtm> Are object variants also available in other languages?
22:24:15*brson quit (Quit: leaving)
22:34:26FromGitter<brechtm> @demi- because types can't be checked at compile-time?
22:35:16demi-if you want dynamic dispatch that badly, you can use dynamic languages, or there is swift that does both
22:40:22*yglukhov quit (Remote host closed the connection)
22:40:53*Tiberium quit (Remote host closed the connection)
22:41:06dom96While it's available it is not used as much. OO has its place but it often is overused because it's so prevalent.
22:41:49FromGitter<brechtm> @demi- it's just what I'm used to
22:42:05dom96Functional programming languages don't offer OO features and yet are pretty powerful and versatile.
22:42:24ldleworkI've come to learn OO is just a method of convient cache storage
22:42:37ldleworktake away the object and the automaticp passing of state
22:42:44ldleworkwell, doesn't mean you magically don't -need- to do that anymore
22:42:48ldleworkyou just have to do it manually now
22:43:05FromGitter<brechtm> I'll take this opportunity to learn about generics and object variants
22:43:15FromGitter<brechtm> I have used C++ templates before, but ... you know
22:43:55dom96Keep this in mind as well: https://en.wikipedia.org/wiki/Composition_over_inheritance
22:44:43FromGitter<brechtm> @ldlework "you just have to do it manually" - I can just go back to C and do everything manually, no?
22:45:20ldleworkI don't understand the question. Its phrased as if something I said is refuted by the idea that C doesn't have object services.
22:45:43ldleworkYes, you can use C and do manually the things that the C language does not do for you.
22:46:00*couven92 quit (Read error: Connection reset by peer)
22:47:56FromGitter<brechtm> @dom96 but it still makes sense using inheritance, no? It just depends on which problem you want to solve.
22:48:36dom96Sure. There are problems for which inheritance is a natural solution.
22:49:22FromGitter<brechtm> It is also often said that you should not use multiple inheritance. Yes, it can be very complex. But if used well it is very powerful.
22:49:39dom96Nim doesn't support multiple inheritance
22:49:51FromGitter<brechtm> I'm painfully aware :-)
22:50:01demi-neither does objective-c, and i can happily say i am very glad about this
22:50:31FromGitter<brechtm> @demo- you don't *have* to use it, if it had, you know :-)
22:52:15demi-i actually have a negative desire to even have it tbh
22:53:37FromGitter<brechtm> @demi- So you have bad experiences with it? In which language?
22:54:16demi-i have never experienced a time where i was solving a problem in code and said "you know what could have made this easier? multiple inheritance"
22:54:32demi-with that line of thought more often than not you are making things too complex
22:55:41FromGitter<brechtm> of course, the fact that you never use it may be a reason that you don't think of it...
22:57:20FromGitter<brechtm> I use it quite often in Python. Only now and then I do run into some confusion when using super().
22:57:25*user0____ quit (Quit: user0____)
23:04:41dom96What do you use it for?
23:05:09Araqpathlib.
23:05:59AraqI used to think a path is maybe a distinct string or a list of path components or just a string. Now I know it's a specialization of PosixPathLike and PathLike
23:06:10Araq:P
23:07:49Demosmultiple inheratance gets fairly complex to implement
23:08:54ldleworkThe only time I have used multiple inheritence on purpose is when a library provided a mixin
23:09:02ldleworkAnd it worked as designed, etc
23:09:28ldleworkI can conceive of its problems, but then again, Python despite its rounded corners is a language made for consenting adults as they say
23:09:51ldleworkfor better or worse!
23:10:43Demosit's different for python though
23:11:03Demoslike everything is a hashtable so multiple inheratance is more straightforward
23:11:16FromGitter<brechtm> @dom96 One example: https://github.com/brechtm/rinohtype/blob/master/src/rinoh/paragraph.py#L339 - I use classes to collect style attributes. The style of Paragraph combines the style attributes of a Flowable and Text (and adds some extra attributes).
23:12:20ldleworkDemos: interesting
23:12:54FromGitter<brechtm> The Style classes also make heavy use of metaclasses.
23:12:59federico3Demos: yet, the dynamic nature of Python tends to punish developers that abuse inheritane
23:13:52Araqonce I knew why dynamically typed languages even have inheritance.
23:13:58Araqbut I forgot it again.
23:15:01Araqany object can have any fields it needs already.
23:19:46*OnO_ quit (Quit: ZNC - 1.6.0 - http://znc.in)
23:24:47*zachcarter quit (Quit: zachcarter)
23:24:48FromGitter<Varriount> Here's an interesting thought - inheritance could be simulated through use of a hook (called on inheritence) and a macro.
23:29:17Araqthat's what Lua does.
23:29:26Araqor similar to what Lua does.
23:30:24FromGitter<Varriount> Araq: Did you ever consider using the same mechanism for Nim?
23:30:41FromGitter<Varriount> For one thing, it might allow insertion of things like vtables.
23:31:30DemosI don't see why you could'nt use macros to add vtbls to nim
23:31:53Araqmulti methods will turn into ordinary methods as soon as we can do it.
23:32:01Demos:(
23:32:04FromGitter<Varriount> Araq: how so?
23:32:05Demoswhy
23:32:19DemosI think multi-methods work nicely with UFCS
23:32:22AraqI have yet to see a use case for MM in practice
23:32:33Demosalthough tbh I don't use methods much at all in nim
23:32:48AraqUFCS is not affected by this change.
23:32:53Araqhardly anything is affected.
23:33:09Araqit's just that only the first param will be used for the dynamic dispatching
23:33:26FromGitter<brechtm> Why does this fail? https://glot.io/snippets/eo9rvc338f
23:33:48FromGitter<Varriount> Araq: Then will typetraits gain the ability to get the runtime type on an object?
23:33:54DemosI think MM is conceptually simpler, but then again I don't seem to reach for methods much in nim anyway
23:35:14FromGitter<Varriount> I'm in favor of keeping multimethods. Macros can't really replace them (at least, not without some sort of hook system)
23:37:47FromGitter<Varriount> Nim doesn't yet have a way of deferring custom generation of procedure/type implementations
23:38:35Demosdo you need that?
23:38:54FromGitter<brechtm> oops, that sample code is not complete
23:39:06AraqMM doesn't work well with generics
23:40:23Demosimo methods are only interseting with some kind of type erasure
23:40:36FromGitter<brechtm> https://glot.io/snippets/eo9s2glvoe
23:53:22FromGitter<Varriount> Araq: MM tends to be used quite a bit in places like GUI frameworks, and places where the user of the library supplies functionality to extend things.
23:53:51Araqhow so? no common programming language offers it.
23:55:26FromGitter<Varriount> Qt
23:55:36Demosdoes Qt have multimethods?
23:55:42FromGitter<Varriount> C++ has methods
23:55:52Demosc++ does not have multimethods
23:56:09FromGitter<Varriount> I'm not talking multimethods, so much as methods that dispatch on the true type of a reference/pointer
23:56:44Demosyeah I don't think anyone wants to get rid of those
23:57:43FromGitter<Varriount> Demos: Yes, but the only convenient/compact way to have runtime dispatch in Nim is through multimethods.
23:57:57*rauss joined #nim
23:58:16FromGitter<Varriount> Yes you can use procedure members or vtables, but the former takes up space in each object, and the latter is difficult to construct, even with macrosl.
23:59:15Demosprocedure members and vtables are pretty much the same thing
23:59:23Demossans closure