<< 16-04-2020 >>

00:00:23*Tyresc quit (Quit: WeeChat 2.7-dev)
00:01:04*ftsf joined #nim
00:20:10*endragor joined #nim
00:36:00FromDiscord<Skaruts> doesn't nim support this: `echo "$1" % [10]`
00:36:27FromGitter<zetashift> I have no idea what that is
00:36:28FromDiscord<Skaruts> I'm getting `undeclared identifier: '%'`
00:36:33Yardanicoimport strutils
00:36:39Yardanicoand 10 needs to be a string so use $10
00:36:41Yardanicoor just use strformat :)
00:36:58Yardanico!eval import strutils; echo "$1" % [$10]
00:37:01NimBot10
00:37:13FromDiscord<Skaruts> oh thanks
00:37:26FromGitter<zetashift> huh I've always used strformat's fmt and &
00:37:29Yardanicolol
00:37:39YardanicoI remember the old times when we didn't have strformat :P
00:37:55Yardanicothere was strfmt but I didn't really use it, I only remember that nimbench depends on it
00:37:57FromGitter<zetashift> you're at the stage you can have nim nostalgia huh
00:38:32Yardanicowell even though I don't do nim stuff that often, I've been around for like 3 years :D
00:40:21FromDiscord<Skaruts> what does !eval do?
00:40:35Yardanicoexecutes nim code via nim playground and shows output
00:41:07Yardanicohttps://github.com/nim-lang/nimbot/blob/master/src/nimbot.nim#L98
00:41:10Yardanico!lag
00:41:10NimBot88ms between me and the server.
00:41:12Yardanico!ping
00:41:12NimBotpong
00:41:23FromDiscord<Skaruts> 🙂
00:41:44FromDiscord<Skaruts> !eval import strutils; echo "$1" % [$10]
00:41:46NimBot10
00:41:53FromDiscord<Skaruts> oh I see
00:41:56FromDiscord<Skaruts> lol
00:42:20Yardanico!eval proc b(x:int):int=(result=5;(if x>5:(if x<3:(if x==0:(echo x;echo x-1)))elif x==0:(echo 0;echo 5)else:return 5))
00:42:21NimBot<no output>
00:42:56Yardanicofrom https://forum.nim-lang.org/t/5858 if someone's wondering
00:43:40FromDiscord<Skaruts> !eval echo "I'm a nice bot!"
00:43:42NimBotI'm a nice bot!
00:43:56YardanicoIt's literally same as on https://play.nim-lang.org/ :)
00:45:21PrestigeI'm having an issue exporting iterators and calling it from another module, is there something I'm missing? https://play.nim-lang.org/#ix=2iej
00:46:06Yardanicoyou can't get a value from an iterator like that
00:46:09Yardanicoyou need to use a for loop
00:46:19Yardanicolike "for event in eventpoller.nextXEvent(display): stuff"
00:47:08Yardanicoalso "continue" on line 11 is unneccesary since you don't have any other code in a while loop anyway
00:47:33PrestigeThanks!
00:48:10Prestigewas a little confused looking at the bottom of https://nim-by-example.github.io/for_iterators/
00:48:34Yardanicothe bottom example is a proc returning an iterator
00:48:45*hoffentl1chja joined #nim
00:48:52Yardanicoso "let next = countTo20()" doesn't get a value from an iterator, it gets an iterator itself
00:49:01Prestigeah
00:50:04Yardanicosadly you can't have next() like in Python in nim currently, but there's https://github.com/nim-lang/Nim/pull/11992
00:52:06*hoffentlichja quit (Ping timeout: 256 seconds)
00:52:38*gmpreussner quit (Ping timeout: 265 seconds)
00:54:38PrestigeHopefully I can learn this language well enough to start contributing soon
00:56:27Yardanicowell you can always start with simpler stuff like finding typos or contributing more docs :)
00:57:09PrestigeI'll keep an eye out :P It's been a fun few days so far
00:57:13*chemist69 quit (Ping timeout: 272 seconds)
00:57:47*chemist69 joined #nim
01:00:15*gmpreussner joined #nim
01:09:54*chemist69 quit (Ping timeout: 246 seconds)
01:12:04*chemist69 joined #nim
01:24:32*lritter quit (Ping timeout: 265 seconds)
01:24:58*lritter joined #nim
01:32:06YardanicoI'm reading crafting interpreters book, and after making a scanner (it's pretty simple, I've mostly same stuff in my nim-mathexpr lib, but in there it's just single-pass so there's no separation between scanning and evaluation passes) the creator now wants to use "metaprogramming" by making a Java program which will generate Java classes for different AST node types
01:32:17Yardanico(I'm doing it in Nim though, I don't want to touch java xD)
01:32:27Yardanicoand I don't think I'll need this "metaprogramming" hack either
01:35:53Yardanicoi'll use object variants instead just how I did with the scanner/lexer/tokenizer (I guess these all mean roughly the same nowadays) :P
01:36:35YardanicoI just checked and Nim AST uses object variants too of course
01:36:47Yardanicohttps://github.com/nim-lang/Nim/blob/devel/compiler/ast.nim very interesting to look at of course
01:44:43shashlickI agree the ast is very well designed
01:59:22*krux02_ quit (Remote host closed the connection)
02:03:20*bunbunbunbunny quit (Ping timeout: 256 seconds)
02:10:39Yardanicowait I can do nested object variants? amazing
02:14:25PrestigeI was trying to find something like a map/dictionary in nim and came across this: https://nim-lang.org/docs/options.html#map%2COption%5BT%5D%2Cproc%28T%29 but I'm confused about its use
02:14:40Yardanicoyou mean a hash table?
02:14:42PrestigeCouldn't you just invoke saveDouble(a) without calling map?
02:14:44PrestigeYeah
02:14:46Yardanicohttps://nim-lang.org/docs/tables.html
02:14:48leorizetables
02:15:15PrestigeThanks - my question about map is unrelated though (I realized it was a different thing)
02:16:46PrestigeDon't understand what its use case would be
02:17:05Yardanico"Applies a callback function to the value of the Option, if it has one."
02:17:20Yardanicobasically "do something on an Option object if it has a value"
02:17:21*ryan__ joined #nim
02:17:42Yardanicoit's literally 2 lines of code, just to make your life simpler and code shorter :)
02:17:52Yardanicohttps://github.com/nim-lang/Nim/blob/version-1-2/lib/pure/options.nim#L239
02:18:08Yardanicodon't fear the stdlib, most of the code in stdlib is really nice and understandable
02:18:09Prestigeah so it's checking if it has a value, cool
02:20:01*ryan_ quit (Ping timeout: 264 seconds)
02:20:15*opal quit (Remote host closed the connection)
02:21:26*opal joined #nim
02:21:44PrestigeWould there by any performance differences/advantages to passing a pointer rather than its dereferenced value?
02:22:15Yardanicowell it depends on the size of objects you operate on I guess
02:22:20*muffindrake quit (Ping timeout: 246 seconds)
02:22:22Yardanicoand also if you need to modify them
02:22:34leorizeit doesn't depend on the size fwiw
02:22:47leorizenim do pass by reference if obj > 3x float size
02:22:49Yardanicooh
02:23:19PrestigeThey're just xevents so they should just be read
02:24:47*muffindrake joined #nim
02:32:52FromDiscord<KingDarBoja> Woah, just finished reading the whole stack of messages
02:33:00FromDiscord<KingDarBoja> Too sad to know the vscode nim plugin is doomed :c
02:33:06Yardanicowdyn?
02:33:08Yardanico*wdym?
02:33:52YardanicoI mentioned that vscode nim plugin is the most "complete" one == the best
02:34:04Yardanicoalthoug nimlsp is getting there so maybe I should search for other editors with LSP support :)
02:35:17*dddddd quit (Ping timeout: 258 seconds)
02:35:38FromDiscord<KingDarBoja> I didn't saw your comment D:
02:35:53Yardanicowhat did you mean then?
02:37:41FromDiscord<KingDarBoja> Oh I got it wrong
02:37:45FromDiscord<KingDarBoja> It says: "VSCode's syntax highlighting is just broken in all sort of ways"
02:37:57Yardanicowell it's not perfect but it works fine
02:38:10Yardanicooh I see where that was
02:38:54*hoffentlichja joined #nim
02:39:30FromDiscord<KingDarBoja> Btw, in my case, it is annoying to save some file and then move into another file that uses the previous saved module as saving trigger errors on it
02:39:47Yardanicowell how would you want it to work instead? :P
02:39:56Yardanicouse autosave maybe
02:40:53FromDiscord<KingDarBoja> Usually the file I work on, trigger the errors on the same file without relying on another different file save for checking it.
02:40:57FromDiscord<KingDarBoja> I didn't know it was the supposed behaviour 😆
02:41:24Yardanicowell vscode nim plugin doesn't "rely on another different file save" itself
02:41:27Yardanicoit uses nim check for checking files
02:41:28*hoffentl1chja quit (Ping timeout: 256 seconds)
02:41:42Yardanicoand "nim check" needs, well, to read the file from the disk in order to check it for errors :)
02:42:28Yardanicovscode nim plugin uses "nim check" for different kinds of highlights, nimsuggest for code completion, and syntax highlighting is built into the plugin itself
02:44:18FromDiscord<KingDarBoja> So it only find errors after checking the whole file by using another file in my case?
02:44:37Yardanicowell, "nim check" is just nim compiler but without the actual "compile to binary" step
02:44:39FromDiscord<KingDarBoja> Arrrgh sorry if it sounds weird, it is better if I provide some recording
02:44:45Yardanicoit imports modules as the nim compiler does
02:45:09Yardanicoso if the file you want to check uses an unsaved module "nim check" will use the older source because that's what is available on the disk
02:45:28FromDiscord<KingDarBoja> I always save the file first
02:45:38FromDiscord<KingDarBoja> The errors usually comes while writing the test file and saving it
02:45:40*bunbunbunbunny joined #nim
02:45:52FromDiscord<KingDarBoja> Like, some proc I wrote seems okay, I hit save and no errors
02:46:38FromDiscord<KingDarBoja> Then go to tests folder, create some test suite and hit save, then the first module shows some errors like "dude, you forgot to cast this thing"
02:46:46FromDiscord<KingDarBoja> Something like that is what it happens to me
02:46:46Yardanicobecause nim has dead code elimination :)
02:46:51Yardanicoand it's always enabled
02:47:08Yardanicobut it will show errors for stuff like proc anyways
02:47:13Yardanicobut not for templates or macros for example
02:47:29Yardanicoif you have incorrect code in a template or generate incorrect AST in a macro you'll only know that when you use it
02:47:33Yardanicothat's how the language works :P
02:48:12FromDiscord<KingDarBoja> I see, well I am using proc everywhere so...
02:48:29FromDiscord<KingDarBoja> Didn't know it was the "cause"
02:48:54FromDiscord<KingDarBoja> Maybe because the languages I have use aren't statically typed and all that stuff (Python I am looking at you)
02:49:55FromDiscord<KingDarBoja> In the meantime, I didn't noticed I opened a issue pretty much like this one -> https://github.com/pragmagic/vscode-nim/issues/107
02:50:07Yardanicooh yeah that's very old
02:50:17Yardanicovscode nim plugin doesn't properly parse .cfg and .nims files
02:50:51FromDiscord<KingDarBoja> https://github.com/pragmagic/vscode-nim/issues/107
02:50:55FromDiscord<KingDarBoja> Yeah, closing mine right now
02:52:57*bunbunbunbunny quit (Quit: leaving)
02:53:17FromDiscord<KingDarBoja> Dang, I have lost my desire to keep coding these days due to my job lol
02:54:23Yardanicowhat's your job? coding? :P
02:55:49FromDiscord<KingDarBoja> Yes
02:55:55FromDiscord<KingDarBoja> "FullStack Dev" lol
02:55:57Yardanicowell yeah that's understandable
02:56:12FromDiscord<KingDarBoja> But even thought one of my projects is awesome
02:56:32FromDiscord<KingDarBoja> The new one is pretty much like styling components using CSS (Tailwind)
02:56:45FromDiscord<KingDarBoja> And ofc I am more biased to handle logic and coding than UI/UX stuff
03:06:45*audiofile quit (Quit: Going offline, see ya! (www.adiirc.com))
03:07:05Yardanicobtw, I wonder what's better for AST: object variants or methods, guess object variants for performance (since Nim itself uses them), methods for shorter code?
03:07:57Yardanicoi just hope we get ability to use fields of same name in object variants (if they hold the same type at least)
03:08:03YardanicoAFAIK there's a PR for that
03:09:13FromDiscord<KingDarBoja> I wished for that too
03:10:05*waleee-cl quit (Quit: Connection closed for inactivity)
03:11:02FromDiscord<KingDarBoja> So I could get rid of this
03:11:17Yardanicodont do big pastes
03:11:40FromDiscord<KingDarBoja> https://github.com/KingDarBoja/Phosphate/blob/master/src/language/ast.nim#L194
03:11:51FromDiscord<KingDarBoja> I know bro, calm down 😄
03:11:58Yardanicowell
03:12:04Yardanicoyou can do your code with object variants
03:12:12Yardanicoyou'll just do stuff like "boolVal: bool"
03:12:15Yardanico"floatVal: float"
03:12:20Yardanicoso fields are of different names
03:12:34Yardanicoalso btw you can have multiple types in one "type" block, you don't need it for each type separately
03:13:07Yardanicolike https://play.nim-lang.org/#ix=2ieO
03:13:08FromDiscord<KingDarBoja> I haven't got deeper with the port but I feel like the value is gonna be needed with that name somewhere else
03:13:28FromDiscord<KingDarBoja> Oh, yeah, I have that on my TODO list
03:13:48Yardanicowell with object variants you do a big "case" statement in your type declaration
03:14:05Yardanicoand then in code which handles different token types you do stuff like "case tok.kind of Literal: do stuff with literal" etc
03:14:15Yardanicoyou can put that into separate procs too of course
03:15:01FromDiscord<KingDarBoja> Yeah, it was the earliest KingDarBoja when asking for that and I went into full mode inheritance 😆
03:15:26FromDiscord<KingDarBoja> I will do a quick check to see if I really need to maintain the same prop name for things like that
03:15:43Yardanicoyou can always live without it, it just depends on how much code you'll need to change
03:15:47FromDiscord<KingDarBoja> like "value: float" for one type and ""value: int" for another
03:16:11FromDiscord<KingDarBoja> Let me check... IntValueNode
03:16:47Yardanicoso you'll have a single "Node" type with a kind field (of ASTKind)
03:17:26YardanicoJust fyi - nim standard style guide prefers to write abbreviations like Www or Http for easier typing and stuff :)
03:17:42Yardanicobut it's styling and nim doesn't enforce you for a single style, so you can write like you want
03:17:51Yardanicohere https://nim-lang.org/docs/nep1.html
03:17:58PrestigeCan someone tell me what's wrong with this? https://play.nim-lang.org/#ix=2ieQ
03:18:10PrestigeGetting a type mismatch on the last line
03:18:49FromDiscord<KingDarBoja> That tip was because?
03:18:55FromDiscord<KingDarBoja> The Node names?
03:18:57YardanicoPrestige: "const" -> "var
03:19:04Yardanico"const" is compile-time only
03:19:09Prestigeah thanks
03:19:15Yardanico"let" is runtime immutable, "var" is runtime mutable
03:19:39Prestigeso is there no way to declare it as let? I thought that would be okay
03:19:42Yardanicono
03:19:55Yardanicowell you actually can if you use "newTable", but there's no reason to really
03:19:59Yardanico"let" itself is immutable, but in case of ref objects the underlying value is mutable but the reference (ref object meants a reference to an object) is immutable, so you can't point it to another object after assigning
03:20:23FromDiscord<KingDarBoja> https://github.com/search?q=org%3Agraphql-python+parse_int&type=Code Yardanico
03:20:27Prestigety ty
03:20:32Yardanico@KingDarBoja so?
03:20:39YardanicoI mean if it's a 1:1 port it's ok
03:20:39FromDiscord<KingDarBoja> I find the lack of code uses disturbing
03:20:42FromDiscord<KingDarBoja> LOL
03:21:03FromDiscord<KingDarBoja> Now I need to check the source of the source, the JavaScript Implementation
03:21:12*FromDiscord <KingDarBoja> I need answers
03:21:47Yardanicoi'm reading craftinginterpreters.com book, and the author uses Java for first implementation so heavy use of interfaces and classes (for Visitor pattern and AST nodes), I prefer object variants so I write it like this
03:21:55Yardanicohttps://play.nim-lang.org/#ix=2ieT
03:22:10Yardanicoit would actually be less lines than Java code anyway
03:22:22FromDiscord<KingDarBoja> Seems clever
03:22:29FromDiscord<KingDarBoja> By the way Yardanicco-sensei
03:22:40Yardanicowat
03:23:01FromDiscord<KingDarBoja> https://github.com/graphql/graphql-js/search?q=parseInt&unscoped_q=parseInt Looks like I have no issues with properties names as those are only used to pass value
03:23:04FromDiscord<KingDarBoja> Nothing else it seems
03:23:45Yardanicowell I'm just saying that in case of AST trees it's always possible to replace inheritance with object variants :)
03:23:58Yardaniconim compiler itself uses object variants for AST so ...
03:24:02FromDiscord<KingDarBoja> Nvm, I found a possible need of value name
03:24:07FromDiscord<KingDarBoja> Yeah, I know what you mean
03:24:11YardanicoI didn't say you can't keep value name
03:24:16Yardanicoyou can keep it
03:25:09FromDiscord<KingDarBoja> I know, but would be awesome If I could use object variants AND same property names across several kinds
03:25:12FromDiscord<KingDarBoja> Like the PR
03:25:36FromDiscord<KingDarBoja> If that get's merge, I would rewrite it for sure 😄
03:25:58FromDiscord<KingDarBoja> But I would like to have some good example between each approach advantage and cons
03:26:03FromDiscord<KingDarBoja> pros and cons*
03:26:32Yardanico@KingDarBoja i'll try to find that PR but you with that PR you won't be able to use same name for fields of different types
03:27:06FromDiscord<KingDarBoja> WAT
03:27:09Yardanico?
03:27:11FromDiscord<KingDarBoja> https://github.com/nim-lang/RFCs/issues/19
03:27:18Yardanicoyes
03:27:32Yardanico"And while we are at it, should it also be possible to have attributes of the same name but with a different type depending on the branch? No."
03:27:34FromDiscord<KingDarBoja> Ohhhh right, they can't use different type
03:27:37FromDiscord<KingDarBoja> 🤦
03:28:00Yardanicothere's my own comment in that issue too btw
03:28:37FromDiscord<KingDarBoja> "Allowing to do this would allow much nicer type definition and usage for types (in some cases)"
03:28:38FromDiscord<KingDarBoja> Oh yes
03:30:31FromDiscord<KingDarBoja> `I mean if it's a 1:1 port it's ok` ❤️ Quote of the day
03:43:37FromDiscord<Rika> Hi
03:43:43FromDiscord<KingDarBoja> ❤️ hi
03:44:40FromDiscord<Rika> So I stopped porting some calculation code for my osu library project, and started creating a PEG to replace my manual parsing instead for some reason
03:46:28*zacharycarter quit (Ping timeout: 256 seconds)
03:47:36Yardanicouse npeg
03:48:12Yardanicoalso i created a git repo to follow my progress for some reason https://github.com/Yardanico/nim-lox
03:48:13FromDiscord<KingDarBoja> So weird, I thought I had a note explaining the diff between object variant and type inheritance
03:48:36Yardanico@KingDarBoja object variants are just mapped to C's union types :P
03:48:51Yardanicofor JS backend it's different though
03:49:18FromDiscord<Rika> yardanico i am already
03:49:58FromDiscord<KingDarBoja> So pros and cons between each approach? Just to copy into my notes? 🙈
03:50:11FromDiscord<KingDarBoja> I have zero knowledge of C 😄
03:50:25FromDiscord<KingDarBoja> I mean, only the very basic knowledge which means zero hahaha
03:51:49*muffindrake quit (Quit: muffindrake)
03:52:57*muffindrake joined #nim
03:53:49Yardanicowell to be honest I can't really answer that question, I've just always used object variants because I feel that they're more "idiomatic" in Nim :)
03:54:26Yardanicomaybe object variants are a bit faster at runtime, I'm not really sure
03:54:26FromDiscord<Rika> you cant use object variants if 2 kinds share only certain fields
03:54:30FromDiscord<KingDarBoja> Makes sense to me
03:54:40Yardanico@Rika you can, just name these fields differently
03:54:54FromDiscord<KingDarBoja> The idiomatic reasoning I mean
03:54:56FromDiscord<KingDarBoja> 😋
03:55:07FromDiscord<Rika> defeats the purpose imo
03:55:59FromDiscord<KingDarBoja> What's the main purpose ? Not just bring all kinds into a shared Main Kind, in this case, a root Node Type?
03:56:20FromDiscord<KingDarBoja> And use the case stmt to specify certain fields?
03:57:07PrestigeYardanico: does this look correct? Was having trouble getting it to compile (it's compiling now) https://play.nim-lang.org/#ix=2ieZ
03:57:48FromDiscord<Rika> example: i have 3 kinds, only 2 kinds share this one field, and all kinds have unique fields, what do i do aside from naming the shared field differently per kind?
03:57:49PrestigeAlso I was at first trying to call listenerMap[theType].add(listener) but it seemed to be trying to call a different add method
03:58:02Yardanicowell, 1) nim seqs nowadays are initialized by default, 2) you don't need to explicitly use "system.add"
03:58:03Yardanicohmm
03:58:32Yardanicoit works for me just fine though
03:58:38Prestigewell add(...) works but listenerMap[theType].add(listener) wasn't
03:58:44Yardanicoit works for me too :P
03:58:47Yardanicoalso in nim you don't have to specify "void" return type
03:58:50FromDiscord<Rika> also `if not listenerMap.hasKey(theType):` can be `if theType notin listenerMap:` no?
03:58:50Prestigehm
03:58:52Prestigeoh neat
03:58:57Yardanicohttps://play.nim-lang.org/#ix=2if0
03:59:05Yardanicoah sorry you were checking for the key
03:59:12Yardanicoah actually no
03:59:17Yardanicoyou can remove it, yes
03:59:37FromDiscord<Rika> no i dont think you can
03:59:56Yardanico@Rika the original code was checking if a key already exists
03:59:57FromDiscord<Rika> you're adding to a key that isnt created
04:00:01Yardanicoah yeah
04:00:06Yardanicoso keep it :P
04:00:12FromDiscord<Rika> lol
04:00:42YardanicoPrestige: https://play.nim-lang.org/#ix=2if2
04:00:43Prestigeah Yardanico I was having the issue when declaring - let listeners = listenerm
04:00:59Prestige1 sec
04:01:11Yardanico"a notin b " is just sugar over "not (a in b)"
04:01:25Yardanicoand tables have "contains" proc defined so "notin" and "in" just work for them (TM)
04:01:56Prestigehttps://play.nim-lang.org/#ix=2if3 <- was having issues with this particular setup actually
04:02:06Prestigeif I declare listeners then try listeners.add(listener)
04:02:14Yardanicoyes
04:02:23Yardanicobecause "let" is for immutable stuff
04:02:32Yardanicoand you are trying to modify an immutable variable :P
04:02:40Prestigeah I thought that was just for assignment, mb
04:04:12FromDiscord<KingDarBoja> Rika: I don't see any other use case for objects variants
04:04:13Yardanicohttps://narimiran.github.io/nim-basics/#_immutable_assignment
04:04:20YardanicoPrestige: ^
04:04:30PrestigeThanks :)
04:04:32Yardanicothat book generally covers most of Nim
04:04:50Yardanicowell, the simpler stuff
04:05:21FromDiscord<Rika> i think object variants work best if you can make them work
04:05:23Yardanicoit doesn't cover macros/iterators/templates/converters/generics/etc, it's for people who are relatively new to Nim or to the programming in general
04:05:30FromDiscord<KingDarBoja> Or maybe I got your example wrong
04:05:35FromDiscord<Rika> otherwise youre stuck with inheritance i assume
04:06:02*supakeen quit (Quit: WeeChat 1.9.1)
04:06:03FromDiscord<KingDarBoja> Yeah, inheritance is way more familiar for newcomers that are used to it.
04:06:22YardanicoI wasn't really used to inheritance when I (re)discovered Nim in 2017 :P
04:06:25YardanicoI was using Python at the time
04:06:43Yardanicoalso I mean (re)discovering because I vaguely remember visiting (then) Nimrod's website in 2014
04:06:45FromDiscord<KingDarBoja> Python inheritance is kinda weak
04:06:46*supakeen joined #nim
04:06:59Yardanicowith old design
04:07:00Yardanicooh yesss
04:07:02Yardanicothe old crown
04:07:55FromDiscord<KingDarBoja> As everything in Python is an object, You couldn't trust at all with inheriting from a base type
04:08:23FromDiscord<KingDarBoja> But object protoyping in Javascript is way weird IMO
04:08:32FromDiscord<Rika> i want more ways to identify whether some type adheres to container mechanics, i guess i just want better concepts no?
04:08:43Yardanicoconcepts are for compile-time only
04:08:44FromDiscord<KingDarBoja> So better look at Java for these examples hahahs
04:08:49Yardanicolike you can't store "concepts" in a sequence
04:08:56Yardanicoconcepts are not interfaces
04:09:00FromDiscord<Rika> i never needed to
04:09:10Yardanicootherwise concepts can be quite cool
04:09:11FromDiscord<Rika> i dont think ive needed it for runtime
04:09:26YardanicoI've (re)discovered Nim by pure chance - was having a heated argument with a guy on a social network about languages and stuff, and he mentioned Nim
04:09:28FromDiscord<KingDarBoja> Don't tell me concepts is another Num stuff
04:09:50Yardanicoit is
04:09:58Yardanicoit's an "experimental" feature since some version though
04:10:03Yardanicoone of the simplest examples is https://github.com/Yardanico/nimpylib/blob/master/src/pylib.nim#L10
04:10:05FromDiscord<KingDarBoja> Nim*
04:10:14YardanicoYou "describe" what a type should have
04:10:25Yardanicoand then you can make proc which accept any object which matches with a concept
04:10:44Yardanicohttps://nim-lang.org/docs/manual_experimental.html#concepts
04:11:02Yardanicoalso there are term-rewriting macros in Nim too :P
04:11:25FromDiscord<KingDarBoja> I got tempted to use that but preferred to do it on my own
04:12:13Yardanicohttps://nim-lang.github.io/Nim/manual_experimental.html#term-rewriting-macros
04:12:21Yardanicoreally neat stuff
04:12:36Yardanicoarraymancer actually uses them to apply some optimizations
04:12:47Yardanicohttps://github.com/mratsim/Arraymancer/blob/532f45a6/src/tensor/optim_ops_fusion.nim#L53-L74
04:13:14Yardanicoah yeah I remember a very funny example
04:13:25FromDiscord<KingDarBoja> By looking at that iterable
04:13:58FromDiscord<KingDarBoja> Does that means I can pass a tuple or sequence as those are the "same" type
04:14:10FromDiscord<KingDarBoja> By same I mean, iterables
04:14:13FromDiscord<Rika> oh yeah i remember someone writing a string obfuscator with them term rewriting macros
04:14:28Yardanicoit wasn't with term rewriting macros was it though? if you mean xor it's just macros
04:14:30Yardaniconot term rewriting macros
04:14:45Yardanicohttps://forum.nim-lang.org/t/1305
04:14:56Yardanicoah nvm found https://forum.nim-lang.org/t/338
04:15:03FromDiscord<Rika> yup
04:15:05Yardanicohttps://forum.nim-lang.org/t/338#1767 idk if that works rn though
04:15:10FromDiscord<Rika> the one where you dont need to invoke the macro on the string
04:16:35Yardanico@KingDarBoja it won't work for tuples because they don't have an "items" iterator
04:17:29FromDiscord<KingDarBoja> Gotcha
04:18:20FromDiscord<KingDarBoja> Still I do better feel using pure Nim code to get away of Python lazyness
04:18:24FromDiscord<KingDarBoja> From*
04:18:33Yardanicowell this is nim code
04:23:37FromDiscord<Yardanico> @KingDarBoja @Rika term-rewriting templates/macros are very "fun" https://play.nim-lang.org/#ix=2if5 😄
04:23:47FromDiscord<Yardanico> run it
04:24:36Yardanicowell, the compiler shows hints when a term-rewriting pattern was applied
04:25:17PrestigeHm this is weird, is HashSet not in hashes?
04:25:28Yardanicohttps://nim-lang.org/docs/sets.html
04:25:47Yardanico"hashes" is for, well, hashes themselves
04:25:56Yardanicolike get a unique hash of a string or of a number
04:32:33FromDiscord<KingDarBoja> Loool
04:32:41FromDiscord<Rika> ? lol?
04:32:53FromDiscord<KingDarBoja> Brainf"ck with that rewrite
04:32:57Yardanicopower of nim :PP
04:33:14FromDiscord<Rika> imagine how many people you can fuck over with term rewriting macros...
04:33:21FromDiscord<Yardanico> @Rika compiler shows hints tho 😦
04:33:23FromDiscord<Yardanico> ah wait actually
04:33:24FromDiscord<Yardanico> HAHHAHA
04:33:31FromDiscord<KingDarBoja> Imagine someone putting that on someone code 😋
04:33:58FromDiscord<KingDarBoja> That's a new level of trolling hahshsh
04:34:04FromDiscord<Rika> who the fuck reads hints 😛
04:34:26FromDiscord<KingDarBoja> X2
04:34:56FromDiscord<KingDarBoja> I am on bed right now listening some OSTs
04:35:09Yardanico@Rika, that term rewriting macro for encrypting string actually worked btw
04:35:14Yardanicoworks*
04:35:32Yardanicoi'm adapting it to the encryption used in https://forum.nim-lang.org/t/1305
04:36:22FromDiscord<Rika> nice, id like to see the code once youre done 😄
04:38:56shashlickyay for varargs support
04:39:16Yardanicoshashlick: really? you actually did it? :D
04:40:03shashlickyep - i can push a branch, want to test?
04:40:06Yardanicoyeah
04:40:29FromDiscord<Yardanico> @Rika https://play.nim-lang.org/#ix=2if9 maybe it can be simplied a bit but it works and no recursion at compile-time
04:40:53FromDiscord<Yardanico> and the binary will contain "\xB2\xBE\xA8\xA9\xA9" bytes for "hello"
04:41:19FromDiscord<Yardanico> actually on each recompile the values will change because the key uses compilation time and date
04:41:57FromDiscord<Yardanico> of course it won't save you from professional reverse-engineers, but will certainly help to hide some info from the less experienced "users" 😛
04:42:36shashlickYardanico: pushed a varargs branch for nimterop
04:42:49FromDiscord<Rika> something that would save from amateur reverse engineers would be a per string key
04:42:58FromDiscord<Yardanico> ehm
04:43:02FromDiscord<Yardanico> this code has a different key for each string
04:43:28FromDiscord<Rika> ah its a counter
04:43:30FromDiscord<Rika> not a key
04:43:31FromDiscord<Rika> 👀
04:43:45FromDiscord<Yardanico> it's a compile-time counter yeah, the resulting binary will only contain generated keys
04:43:46FromDiscord<Rika> so string order influences bytes too
04:44:09*nsf joined #nim
04:44:22Yardanicoshashlick: testing now
04:46:12FromDiscord<Rika> is +% and *% saturated arithmetic?
04:46:12Yardanicohow do I enable debug mode for this build?
04:46:31YardanicoI got "/home/dian/.nim/lib/core/macros.nim(1827, 31) Error: undeclared identifier: 'vlc_object_t'"
04:46:51Yardanico@Rika https://nim-lang.org/docs/system.html#%2B%25%2Cint%2Cint
04:47:03FromDiscord<Rika> yardanico: i read that
04:47:13FromDiscord<Rika> in one ear, out the other
04:48:19FromDiscord<Rika> `The result is truncated to fit into the result` this fooled me
04:54:39shashlickUse -d for flags
04:54:46shashlickIf you need it of course
04:54:47Yardanicoit's already there
04:54:58YardanicoI just get "/home/dian/.nim/lib/core/macros.nim(1827, 31) Error: undeclared identifier: 'vlc_object_t'"
04:55:08shashlickOk, where is vlc_object_t defined
04:55:17shashlickIn the headers
04:56:06*narimiran joined #nim
04:56:10Yardanicoah it was my fault
04:56:18Yardanicoseems like the old nimterop backend just ignored that type (?)
04:56:28Yardanicoit's in "vlc_common.h" which I did not import before
04:56:43Yardaniconow I get "Error: unhandled exception: getters.nim(109, 14) `name[0] != '_' and name[^1] != '_'` Identifier 'vlc_value_t:_Bool' (nskType) contains leading/trailing underscores '_' [AssertionError] [AssertionError]"
04:57:19Yardanicofixed that by adding another "elif" to onSymbol
04:58:05Yardaniconow I get a different assertion error, will get the output
04:58:19*thomasross quit (Ping timeout: 250 seconds)
04:59:26Yardanicoshashlick: it's quite long https://gist.github.com/Yardanico/313b472a16fdf39b4b4603dae12845c8
04:59:43Yardanicoseems to fail on vlc_callback_t
05:00:03Yardanicohttps://git.videolan.org/?p=vlc.git;a=blob;f=include/vlc_common.h;h=222ce81bc40185031f69c2d8985c7decbc7c31bb;hb=HEAD#l490
05:01:33shashlickYa added nested struct support yesterday
05:02:46shashlickMust be comments throwing it off
05:03:12Yardanicohow can I modify a header and say to nimterop to not re-fetch?
05:03:50shashlickIt won't refresh unless you -f
05:03:57shashlickRefetch
05:04:26Yardanicowell it seems to revert old file state, I have "-f:ast2 -d" flags
05:06:17shashlickWell it does git reset at the beginning
05:06:27shashlickIt could be the void *
05:06:35Yardanicoyeah I thought that too
05:06:42Yardanicothat's just "pointer" in Nim right?
05:07:30shashlickMost likely the char const *
05:07:48shashlickUgh, the gift that keeps giving
05:07:54Yardanicoyeah it's pretty complex
05:08:04YardanicoI would've only used the "libvlc" headers but they refer to VLC headers :/
05:08:08shashlickTry skipping that proc for now, I'll fix it
05:08:15shashlickWhat else breaks
05:10:39*rockcavera quit (Remote host closed the connection)
05:11:01Yardanicowait I think I can just ignore these headers if I skip vlc_log_t
05:11:14Yardanicoso I can only use libvlc headers
05:12:24Yardanicoah no I can't :/
05:12:46Yardanicocan I just get a few functions from the header?
05:13:03Yardanicolibvlc seems to need "vlc_log_t" from vlc_messages.h and nothing more
05:13:50shashlickNope it just pulls everything unless skipped
05:13:57FromDiscord<Varriount> Hm, I tried using term-rewriting macros to automatically rewrite type declarations, but it didn't work (unfortunately).
05:15:59shashlickI might have a simple fix, let me see
05:17:55PrestigeRandom question, why do sets use incl and excl instead of add/remove?
05:18:15Yardanicofor what?
05:18:32*Jjp137 quit (Read error: Connection reset by peer)
05:18:40Prestigeadding and removing elements
05:18:43*Jjp137 joined #nim
05:19:01Yardanicoin where? :P
05:19:09narimiran`add` in strings, seqs, etc. adds *to the end*, which is not the case for sets
05:19:12Prestigein sets, like a HashSet
05:19:23Yardanicothey don't have "add" anyway
05:19:26shashlickYardanico: will check back in the morning, quite late now, thanks for testing again
05:19:32Yardanicoit's more of a mathematical notation I guess
05:19:35Yardanico"include in the set"
05:19:45Prestigeah
05:19:54Prestigejust used to other languages I suppose haha
05:20:07FromDiscord<Varriount> shashlick: https://play.nim-lang.org/#ix=2ifm
05:20:21Yardanicomaybe you wanted to reply to me instead? :P
05:22:35FromDiscord<Varriount> Yardanico: Do you know if there's a way to do what I'm trying to do?
05:23:19*icebattle quit (Ping timeout: 260 seconds)
05:23:25Yardanicoyeah I'm trying, although I'm not really experienced with term rewriting macros :P
05:26:05FromDiscord<Yardanico> @Varriount with this it calls the macro "macro foo{a}(a: typed{nkTypeDef}): NimNode ="
05:26:16FromDiscord<Yardanico> but there's an error for some reason "Error: invalid expression: Foo = int"
05:26:29FromDiscord<Varriount> "this"?
05:26:40FromDiscord<Yardanico> I mean change macro definition to this
05:26:47FromDiscord<Yardanico> the code in quotes I sent 😛
05:28:12FromDiscord<Yardanico> ah you need nnkTypeSection maybe?
05:28:33FromDiscord<Varriount> Yeah, I was just trying that
05:29:39*Intensity quit (Read error: Connection reset by peer)
05:30:54*Intensity joined #nim
05:31:21FromDiscord<Varriount> So that code, along with a `--include` or `--import` argument to the compiler, would provide a (probably hacky/half-baked) way of automatically generating run-time type information.
05:32:11FromDiscord<Varriount> @Yardanico I also don't know if term-rewriting macros affect code generated by regular macros.
05:32:35FromDiscord<KingDarBoja> https://github.com/vcg-uvic/viper
05:47:53*hpyc9 quit (Killed (Sigyn (Stay safe off irc)))
06:04:48*mal`` quit (Quit: Leaving)
06:17:02Yardanicowhat's the best way to copy a ref object instance?
06:17:07Yardanicoso it'll work with --gc:arc and whatnot
06:17:51*solitudesf joined #nim
06:21:33FromGitter<sheerluck> 17000 commits in devel
06:24:32*xcm quit (Remote host closed the connection)
06:26:42*xcm joined #nim
06:26:51*mal`` joined #nim
06:27:08leorizeYardanico: obj[] = another[]
06:27:13Yardanicothanks :)
06:27:23Yardanico@sheerluck yay!
06:27:35Yardanico16999 though XD
06:27:43Yardanicowho will make the 17000th commit
06:28:30FromDiscord<Rika> ara q ofc
06:28:38FromDiscord<Rika> i kid
06:30:09*PMunch joined #nim
06:38:11leorizeforum is down for me
06:38:13leorize504 :(
06:42:17narimiransame here
06:42:20narimirandom96: ^
06:59:11*xcm quit (Remote host closed the connection)
07:00:00*gmpreussner quit (Quit: kthxbye)
07:01:16*xcm joined #nim
07:04:48*gmpreussner joined #nim
07:12:06narimiranleorize: now seems to be ok for me....
07:12:34PMunchMight've just been something on CloudFlares side (I think that's still used)
07:15:51leorize[m]the systemd service probably auto restarted :p
07:17:23PMunchOr that, of course .P
07:17:48PMunchHmm, this is a bit worrying: https://forum.nim-lang.org/t/4932. So Nim will always occupy it's peak memory usage..
07:18:06leorize[m]nim does release memory
07:18:24PMunchWell, looking at this quote: "Fix nim's GC so that it returns memory back to the OS more reliably. It's not that hard, we can give it a shot." it seems like it releases memory sometimes, possibly, maybe
07:18:40leorize[m]the reuse pool is around 8MiB
07:19:15PMunchWhy does treeform have issues with it using 15Gb then?
07:19:28leorize[m]logical leak
07:20:26PMunchMeaning?
07:22:54*mwbrown quit (Ping timeout: 240 seconds)
07:25:25*mwbrown joined #nim
07:30:28*mwbrown quit (Ping timeout: 256 seconds)
07:30:49FromDiscord<Varriount> Yardanico: I feel like term-rewriting macros could be used for more things, they just aren't well known.
07:30:56Yardanicoyeah, that's true
07:31:01Yardanicoand they have a lot of bugs probably too :P
07:32:16*mwbrown joined #nim
07:32:21ZevvPMunch: returning memory is hard because of fragmentation
07:32:49ZevvYou get a huge chunk from the os, you need to return it as a huge chun. But if even one tiny little object lives on that chunk, it can't be returned
07:33:31Zevvit's a very common probplem and by no means specific to nim. In practice it is not as bad as it sounds, because these pages end up stale and will be swapped out under memory pressure.
07:34:11*hax-scramper quit (Read error: Connection reset by peer)
07:34:29*hax-scramper joined #nim
07:34:56livcd"Fix nim's GC so that it returns memory back to the OS more reliably. It's not that hard, we can give it a shot."
07:36:34*mwbrown quit (Ping timeout: 240 seconds)
07:37:58*mwbrown joined #nim
07:41:12Zevvwell, I'm interested in how that would work!
07:43:30*hax-scramper quit (Ping timeout: 256 seconds)
07:44:07*hax-scramper joined #nim
07:53:48PMunchWell you could have a pager in the Nim GC
07:54:10PMunchSo that if you request 15Gb of data it would allocate it in chunks so that it could free chunks of it later
07:58:28*Vladar joined #nim
08:04:03*ftsf_ joined #nim
08:05:42Zevvsure, that's basically how it works. But the problem is that a chunk needs to be 100% unused
08:05:56Zevvso imagine you slurp 15Gb of json and keep 1% of the nodes referenced
08:06:00Zevvthese are spread all over the heap
08:06:12Zevvso now all these chunks have 1% of them used and the rest unused
08:06:15Zevvstill you can not return
08:06:18Zevvwe do not have a moving GC
08:06:23*ftsf quit (Ping timeout: 250 seconds)
08:07:09Araqlivcd, Zevv with -d:useMalloc is outside of our domain though
08:07:20Araqand once again we should focus on ARC, IMO
08:09:19YardanicoI forgot, "use" got removed from Nim?
08:09:30Yardanicoah, seems so
08:24:26Araqwhat's "use"?
08:34:35YardanicoAraq: ah, sorry, I meant "using"
08:34:54Yardanicooh wait it's still there
08:34:54YardanicoXDD
08:38:20Yardanicooh yess amazing I love it
08:38:33Yardanicowhen you have 15+ procs which take the same first type "using" is good
08:46:47AraqYardanico, please fix the docgen so that it understands 'using' ;-)
08:47:17Yardanicoto expand types from "using"?
08:47:18YardanicoI'll try
08:48:36*dwdv joined #nim
08:49:21dadada? get's recognized as Prefix, but I want it to be treated like a command, can achieve this by using `?`, but I'd like to teach Nim that ? should always be assumed to be `?`
08:53:23PMunchThat's unfortunately not possible
08:54:28*liblq-dev joined #nim
08:55:14PMunchHuh in the manual under lexical analysis -> other tokens it mentions [: being a token (but not :]). What is this used for?
08:56:10YardanicoPMunch: [: is for specifying generic instatiations with UFCS
08:56:19Yardanicolike if you have proc test[T](a: Interpreter, b: T)
08:56:39*Vladar quit (Quit: Leaving)
08:58:06Yardanicoyou can call it as myinterp.test[:int](5)
08:58:26PMunchAaah, that's how you do that!
08:58:31Yardanicoit's in https://nim-lang.org/docs/manual.html#procedures-method-call-syntax
08:58:37Yardanicoin the end of that section
09:02:18Yardanico@zetashift did some stuff today https://github.com/Yardanico/nim-lox
09:02:26PMunchIs this a new thing?
09:02:57FromDiscord<Recruit_main707> it would be so cool writing a python interpreter in nim
09:03:24Yardanicoit's not hard to write a *minimal* one with a subset of Python
09:03:26Yardanicolike RPython
09:03:39Yardanicobut if you will implement all features it'd be harder :P
09:04:04AraqIMHO it's easier than you think to simply copy compiler/vmdef|vm|vmgen.nim and mutate it heavily
09:04:13Yardanicowell yeah that too
09:04:22*dddddd joined #nim
09:04:45Araqto give you a VM for Python
09:04:48PMunchHaha, that would be a fun project indeed. Not sure why you'd want that for anything though :P
09:05:14AraqI cringe every time I see people write new stack based VMs in Nim
09:05:27*narimiran quit (Ping timeout: 260 seconds)
09:05:37FromDiscord<Recruit_main707> lmao
09:06:10PMunchWell, I guess as a way to embed PythonScript® in a Nim project
09:08:24FromDiscord<Recruit_main707> i dont get the point of embeding python in nim
09:08:29*Ven`` joined #nim
09:08:35Yardanicoyeah lua is better for an embedded language
09:08:38Yardanicoor NimScript even better :P
09:08:43FromDiscord<Recruit_main707> id like to do it the other way around
09:09:14FromDiscord<Recruit_main707> basically being able to use autoswig with nim or something
09:14:30FromDiscord<Recruit_main707> has someone tried running some of this tools with nim's generated c/c++ code??
09:14:35Yardanico?
09:14:49FromDiscord<Recruit_main707> pybind11, autoswig...
09:14:59FromDiscord<Recruit_main707> all those things
09:17:16*ryan_ joined #nim
09:17:19*ftsf_ quit (Read error: Connection reset by peer)
09:17:45*narimiran joined #nim
09:19:24PMunchHmm, is there a way to get Nim to generate a .h file for the exported symbols and types in a module?
09:19:42*ryan__ quit (Ping timeout: 258 seconds)
09:20:26FromDiscord<Recruit_main707> --header?
09:20:40FromDiscord<Recruit_main707> i think thats exactly what you want
09:21:00Araq--header is not supported
09:21:11PMunchYeah it's not in the manual, or in --fullhelp..
09:21:24Araqthe code generator simply wasn't designed for this and Nim is not a transpiler ;-)
09:21:34dadadaso the only path I see to do what I was going to do is to write a preprocessor for nim files that converts occurances of ? to `?`, obviously that's complicating things a lot and introducing an imcompatibility with regular Nim code
09:21:39FromDiscord<Recruit_main707> wdym? ive used it
09:22:11Yardanicodadada: there's that thing...
09:22:13Araqdadada, why is it so important though? instead of ? x you can use 'q x'
09:23:53FromDiscord<Recruit_main707> i dont understand why do you say --header is not supported
09:23:54dadadaAraq: technically yes, want to use ? because it's much easier to grasp what the code is intended to do
09:24:07Yardanicoyou can do it with https://nim-lang.org/docs/filters.html
09:24:12Yardanicobut please don't
09:25:47Araqdadada, what is it intended to do?
09:27:03*neceve joined #nim
09:28:31dadadaAraq: I'm experimenting with creating a concise syntax as a drop in replacement for if-else ladders, from past experiences in this channel I know that things like this aren't always welcomed here, so let me stress that this is my personal fun project, not more, not less, and I'd this to be respected
09:28:43Yardanicowhat's wrong with if: a else: b
09:28:55Yardanicoa little more characters but much more consistent
09:29:37Araqdadada, it's fine and I'm sorry that this channel can be unwelcoming
09:29:40dadadaYardanico: I just KNEW, this was going to instanstly be the response here, hence my last sentence, it's just so annoying to be criticized for every single thing you might try
09:29:50PMunchdadada, when did people hate on stuff like that? As long as it's for fun it's cool :P
09:29:50YardanicoI don't criticize you
09:29:54YardanicoI just don't understand why
09:30:11PMunchFor fun!
09:30:27dadadaPMunch: exactly, a couple of times, and I've only been here for a few months
09:30:38Araqx ? y ! z # like so?
09:30:44PMunchI've sometimes tried to see just how far I can stretch the syntax, even though I know it's a bad idea to actually use it for anything :P
09:30:47FromDiscord<Recruit_main707> look at me! i am supporting nim for a framework, and no one else is gonna even use it!
09:31:34PMunchdadada, I don't think people are really criticising it, they just don't understand why you'd want to do it that way. It's just genuine curiosity
09:31:42dadadaYardanico: the thing is, I'm in search for the technical solution to this in general, even if it wasn't about if-else-alike, I'd still want to know how to do such things, so I could solve similar issues in the future, so the usefulness of my idea is partly beside the point
09:31:47PMunchRecruit_main707, what framework?
09:31:56FromDiscord<Recruit_main707> rlbot
09:32:26PMunchCool!
09:32:46PMunchdadada, do you have a syntax sample of what you want?
09:32:51PMunchI might have an idea
09:33:43FromDiscord<Recruit_main707> sadly, after a few days trying to wrap the flatbuffer headers needed, it seems like nimterop is still not ready, so i will wait for sockets i guess...
09:35:03*Vladar joined #nim
09:36:06*tane joined #nim
09:38:37dadadaAraq: no, it's the same structure like if-else-elif, but just more concise... if no one ever uses it besides myself, it'd be okay for me. The basic idea is that if becomes ? and elif/else both become L. Because the plural of L has the exact same sound as else. I did experiment with this syntax, and it grew on me fast, saves some column space to, and it's nice that all if-else parts are aligned vertically
09:38:43dadada(while traditionally if-else have different lengths, so it's not possible), saves some column space too
09:39:45PMunchSo do you have a syntax sample?
09:40:49dadadaPMunch: took some random Nim code from github (MIT), and applied it there: https://play.nim-lang.org/#ix=2ign
09:41:42Yardanicowhy not just use "F: " for "if" part then? :P
09:41:43dadadaof course you'd also be able to do var foo = ? someTest: "hello" L: "bye"
09:41:59Yardanicooh you want without the : hmm
09:42:08dadadaYardanico: because I don't think it'd be half as intuitive
09:42:21YardanicoI wouldn't exactly call "?" intuitive but ok :P
09:43:07dadadaYardanico: if you can't admit that an if statement resembles a question (is this true?), then you're not honest
09:43:46Yardanicoit's not "is this true?", it's "if this is true, do:"
09:44:02Yardanicoat least for me
09:45:45PMunchA source code filter works, but it replaces all occurrences of ?: https://play.nim-lang.org/#ix=2igp
09:47:06dadadaPMunch: already have a solution for the L part.
09:47:11PMunchPart of your problem is that if/else is one block
09:47:14PMunchWait, how?
09:47:22dadadaPMunch: and a solution for the ? part, but it only work when it's written with `?`
09:47:28YardanicoPMunch: template?
09:47:48PMunchI mean this works: https://play.nim-lang.org/#ix=2igr
09:47:52PMunchFor ?
09:50:01dadadaPMunch: my solution is a bit hacky, but I like it nevertheless, I'm using an empty macro for L, that simply replaces the L blocks with nothing. but the clue is in the ? part, it uses lineinfo to learn where the after-part (what comes after the ? block) is and reads only L blocks following it (not anything else because it'd be wrong), then converts it to NimNodes using parseStmt/parseExpr, and then converts
09:50:06dadadathe whole thing to a regular if-elif-else
09:50:34dadadaso the `?` macro reads the L blocks directly from the source
09:50:37PMunchOoooh
09:50:42PMunchThat's hacky :P I love it!
09:50:54PMunchHow do you determine if it is after?
09:51:14PMunchWith lineinfo you only get a line number, do you go by indentation from there?
09:51:50dadadaagain it's easy to find out where the ? is using lineinfo, and you can use idention rules to know the rest, indention is not hard to code
09:52:11dadadabasically you look for the next line where the L starts in the same column as the ? did
09:52:20dadadas/line/lines
09:54:07dadadalineinfo gives you not only the line number, but also the filename of the source, so you can directly read the source files
09:54:20PMunchYeah I know
09:56:00*krux02 joined #nim
09:56:19dadadathe source filters are too aggressive
09:56:29FromGitter<alehander92> Yardanico
09:56:37FromGitter<alehander92> yeah writing a python vm might be cool
09:56:43FromGitter<alehander92> you can even directly load the bytecode there
09:56:48FromGitter<alehander92> without going through parsing etc
09:56:51dom96ooh, this is cool https://github.com/wltsmrz/nimler
09:56:52dadadait'd be nice if you could define that it should only replace stuff that comes first in a source line, or directly (not counting whitespace) a =
09:56:55FromGitter<alehander92> this way you can support much more of python
09:57:07FromGitter<alehander92> as the bytecode isn't complicated i'd say
09:57:16FromGitter<alehander92> but what would you do about c extensions is another question
09:57:28FromGitter<alehander92> Araq i dont agree with that, people need to write their own code to learn
09:57:53FromGitter<alehander92> reading the compiler/vm source is of course very useful to learn as well
09:57:55supakeenYou would likely only support it trough CFFI, alehander92. It's the 'general' recommended way in Python to interface with C nowadays if you're note mbedding.
09:58:36FromGitter<alehander92> thank you, but how easy would it be to simulate that in a custom vm is what i dont know
09:58:59FromGitter<alehander92> as i am not sure how does cpython encode the "ffi" invocations
09:59:02Araqalehander92: writing a stack based VM isn't "learning", it's repeating well documented mistakes :P
09:59:12FromGitter<alehander92> ahhh so its about stack vs register
09:59:36FromGitter<alehander92> well the cpython vm opcodes are stack-based already ..
09:59:54FromGitter<alehander92> of course here one can just parse python to his own custom register-based bytecode
10:01:22Araqbut the industry is on your side, so now we can reinvent .NET as webassembly. Learning from .NETs mistakes like actually having a type system in the IR or supporting non-reducible control flow. Hmmm
10:01:44dom96cool, looks like I fixed openssl problems in Nimble with my patch https://github.com/nim-lang/nimble/issues/792#issuecomment-614516847
10:02:32FromGitter<alehander92> @dom96 cool !
10:03:33FromGitter<alehander92> Araq i feel you are ironic, but why is it bad to have types in the IR
10:03:51Araqnothing, it's great. .NET has it and wasm doesn't.
10:04:22Yardanico@dom96 I feel I should retry my attempt at cross-compiling a nim binary with statically linked libressl to arm
10:04:30Yardanicoit was crashing with SIGILL too 🤔
10:04:43FromGitter<alehander92> Araq so what about https://webassembly.github.io/spec/core/syntax/types.html
10:04:59FromGitter<alehander92> (i dont really know honestly , just searching for docs)
10:05:02dom96Yardanico, go for it, but note that my patch fixed dynamic linking specifically
10:05:20dom96alehander92: what are you suggesting?
10:06:30Araqalehander92: well yeah, it has this poor excuse of a type system
10:06:41FromGitter<alehander92> @dom96 i am not suggesting anything , sorry, just discussing vm-s
10:07:25dom96Ahh.
10:07:38FromGitter<alehander92> Araq but isn't having a too specific type system in IR making it harder to target from 20 languages
10:08:04FromGitter<alehander92> @dom96 i am going to push fixes to my async PR
10:08:21dom96I'm going to suggest something: can we start writing a wasm backend iteratively? i.e. allow me to mark procs with {.wasm.} and have Nim automagically compile them to wasm and integrate them with the existing code generated by the JS backend? :)
10:08:36Araqwell yeah but you can look at .NET or LLVM for type systems that work for a range of languages. or you can base the design on the previous Emscripten hacks.
10:08:48Yardanico@dom96 nlvm has wasm support via LLVM already btw :P
10:08:50Araqwasm is about the latter.
10:09:06dadadadom96: why isn't Nim -> C -> WASM sufficient?
10:09:14dom96Yardanico, is it mature enough for production?
10:09:23FromGitter<alehander92> @dom96 interesting, but how much is the overhead for wasm<=>javascript
10:09:33Yardanicowell a new backend wouldn't be so mature for production either
10:09:34dom96dadada, I tried it but couldn't figure out how to fix the segfaults
10:09:59Araqdom96: it runs 95% of our test cases iirc, so I suppose it works good enough. never used it though.
10:10:05dom96alehander92: doesn't matter, I would use it in key areas of my code base to make sure communication between JS and wasm is minimal
10:10:12dadadaalehnader92: very little overhead, I read some blogs on it, and that stuff is highly optimized, basically javascript/wasm share the same vm, in many cases there 0 overhead
10:10:22dadadathere's
10:10:36PMunchdadada, something like this? https://play.nim-lang.org/#ix=2igy
10:10:39FromGitter<alehander92> dadada yeah but there was some problems with e.g. writing wasm to call javascript to access the dom etc
10:10:47FromGitter<alehander92> but they might have changed that
10:10:54FromGitter<alehander92> i might be wrong
10:11:13FromGitter<alehander92> dom96 yeah we've also thought about that for our electron app IIRC?
10:11:17dom96Araq, how hard would it be to get {.wasm.} started for simple procs?
10:11:25dom96Have you got any experience with wasm?
10:11:36FromGitter<alehander92> but it's probably easier to that in nlvm in this case
10:11:46FromGitter<alehander92> as it already should have both wasm and javascript support
10:11:50Araqdom96: my knowledge is outdated, now it has "Table Types"
10:12:00Araq(a step in the right direction)
10:12:21PMunchdom96, what's the benefit of nimler over just importing C functions?
10:12:25dom96Araq, I bet I could follow the same approach I took with my asm adventures (way way back)
10:12:35Araqbut when I looked at it, it was bad all around
10:12:38dadadaPMunch: pretty much, note that this only works, because you're not using infixes in your condition, (I thought it would be easy like this at first, but it isn't), as soon as you do something like x or y, "or" x and y, you must strope ? to get it parsed
10:12:45dom96PMunch, no idea, I just saw Erlang and NIm and love that people are making such packages
10:13:16FromGitter<alehander92> dom96 can you build your game with nlvm?
10:13:42Araqdom96: it's very hard because wasm is a moving target and you have to emulate so many features on top of it
10:13:44dom96alehander92: I might give it a try tonight. But I'm doubtful it'll work.
10:13:55FromGitter<alehander92> but the problem is
10:14:08FromGitter<alehander92> how would you do it in the compiler to use two backends for two functions
10:14:26YardanicoAraq: do parameters created with "using" have an actual type somewhere in PNode fields? so far I couldn't find it
10:14:27dom96dunno, I'm sure there is a way :P
10:14:30FromGitter<alehander92> maybe it should be easy
10:14:46dom96Araq, yeah, guess it would be a lot to bootstrap everything, in particular the GC.
10:14:47FromGitter<alehander92> just somehow detecting it in the last stage and redirecting to TargetGenPass
10:15:12Araqalehander92: you can create a new "pass" in the compiler or you hack it into an existing pass, that part is easy (but maybe a bit ugly)
10:15:15dadadaPMunch: but apart from that, really nice implementation!
10:15:58Araqdom96: you can always map a subset of Nim to wasm, but you would surprised how much work that really is
10:16:29FromGitter<alehander92> @dom96 i'd really try to see nlvm and ask @arnetheduck
10:16:36AraqI'm not talking about the GC. it doesn't even support function pointers properly
10:16:37dom96would be nice if I could emit wasm in JS code like I can asm in C code
10:16:38FromGitter<alehander92> he works with wasm sometimes IIRC for his projects
10:16:59FromGitter<alehander92> and it wouldn't make sense to put so much work before actually seeing the alternative
10:17:00dom96I think I should talk to yglukhov, he probably knows how to get emscripten to work with Nim
10:17:22dom96I got it to almost work, but kept getting segfaults deep in GC code
10:17:32dadadaPMunch: putting conditions in () would get around it, too, but that's not good enough for my taste...
10:17:37FromGitter<alehander92> @dom96 probably its very easy to emit directly wasm even now
10:17:54PMunchdadada, hmm that is hard to get around..
10:18:00Araqit also doesn't offer an aliasable stack, so you get to emulate that too. and when you do, you need to ensure your emulation is like C++'s emulation or else you cannot call foreign code
10:18:29Araq"everything should be as simple as possible but not simpler", well wasm is the "simpler" design.
10:19:11FromGitter<alehander92> @dom96 something like https://developer.mozilla.org/en-US/docs/WebAssembly/Loading_and_running maybe where you just hardcode the bytes somehow
10:19:13dom96hah
10:20:29FromGitter<alehander92> @dom96 and you can also call staticExec in `{.wasm.}` if you have a way to compile a text representation of wasm
10:20:30dom96it sounds like a really fun project, but I sure have far too many projects already, I do need to try to get something that exists to work again
10:20:45FromGitter<alehander92> and then just put the bytes somehow in
10:21:09FromGitter<alehander92> (if you just want to emit text(?) wasm)
10:21:47Araqit's really not "fun" but ymmv.
10:22:03*lritter quit (Quit: Leaving)
10:22:20dom96the initial implementation will be fun, finding and fixing the hundreds of bugs to get the implementation to work 99% of the time will not be :)
10:22:34Araqpersonally I would target x86 16 bits and run the code inside DOS Box
10:22:42*neceve quit (Read error: Connection reset by peer)
10:22:46FromDiscord<clyybber> lol
10:23:13Araqbecause that stuff actually works.
10:23:22Yardanicohttps://copy.sh/v86/ :P
10:23:28Yardanicohas msdos
10:23:49dom96lol, does DOS Box for the browser exist? :P
10:24:11dadadaPMunch: if source code filters could be made to only replace actual code, and not characters inside string literals, and also understand some whitespace rules, they might be useful for this
10:24:19FromGitter<alehander92> they run linux in the browser man
10:24:22Yardanico@dom96 https://js-dos.com/
10:24:25FromGitter<alehander92> iirc
10:25:05Yardanico"Project uses dosbox as emulation layer for running dos programs."
10:26:22Yardanicoand yes they use emscripten
10:29:52PMunchdadada, didn't solve the () problem, but I added elif support: https://play.nim-lang.org/#ix=2igA
10:29:59PMunchYou can't combine it with else though
10:30:03PMunchOr have multiple elifs
10:30:06dadadaa full Linux instance running client-side in the browser would be cool, I'd run folding at home there
10:30:16Yardanicosee https://copy.sh/v86/
10:30:40PMunchHmm, I guess you could define `?` as a varargs[untyped] macro and just use lineinfo on the first one
10:30:44FromGitter<alehander92> PMunch why
10:31:11Yardanicodadada: folding@home needs proper GPU acceleration :P and CPU too
10:31:12FromGitter<alehander92> why
10:31:24Yardanico@alehander92 because dadada wants to :P
10:31:40FromGitter<alehander92> fun
10:32:16PMunchF04or06 t08he10 g12lo02ry04 o06f 08sa10ta12n!02 :04D
10:32:24Yardanicomy eyes
10:32:30dadadaalehander92: 1) people wouldn't need to install stuff, they could just load them into their browsers (i.e. folding at thome) 2) to control running programs would be as easy as opening/closing browser tabs, and it doesn't get easier than that
10:32:45Yardanicoplease no
10:32:45PMunchYardanico, you're welcome
10:32:50YardanicoI don't want to use my browser as an OS
10:33:15PMunchI made a script for it, so if I write /rainbow it will rainbowize my entire text :P
10:33:24Yardanicosadly only IRC people will see it :)
10:33:24PMunchS02oo04o 06fa08bo10ul12ou02s!
10:33:35YardanicoI mean on discord/gitter it's just plain text ;(
10:33:52PMunchLooks great in the logs as well: https://irclogs.nim-lang.org/16-04-2020.html#10:32:16
10:33:53PMunch:P
10:34:05Yardanicolol
10:34:09dadadaalehander92: I'm an experienced Linux user, I'm positive on systemd, and even I sometimes get annoyed with systemctl, just opening/closing tabs would be way more convenient 3) you could send people a link/URL and by simply opening it they could take part in something like folding at home, which would lower the bar for starting with something like that a lot, which can only be good
10:34:21Yardanicodadada: cryptominers already do this
10:34:23dadadaalehander92: and because I want to @Yardanico
10:34:24Yardanicoeven without asking users ;)
10:34:37AraqYardanico: the typ.n[1..N].sym.typ field should have the type too
10:34:40PMunchdom96, maybe the irclogs should use https://github.com/PMunch/ansitohtml ;)
10:34:49YardanicoAraq: oh thanks will try
10:35:02dadadaYardanico: I know, it'd be cool if this wasn't something exclusive to black hats
10:35:04dom96PMunch, PRs welcome ;)
10:35:15PMunchWhat repo is it in?
10:35:24dom96nimbot
10:36:47FromGitter<alehander92> PMunch Glory to God, man
10:36:51FromGitter<alehander92> dadada oh interesting
10:37:02PMunchalehander92, it's an old meme :P
10:37:03FromGitter<alehander92> sorry i was asking other stuff but this is very interesting
10:37:11FromGitter<alehander92> but i still feel its too heavy
10:37:48FromGitter<alehander92> PMunch doesnt matter
10:38:51dom96This reminds me of https://en.wikipedia.org/wiki/Hail_Satan%3F
10:38:54*josh joined #nim
10:38:55*josh is now known as Guest44398
10:39:00dom96It's a pretty good documentary
10:39:31*Guest44398 is now known as someunknownuser
10:39:43PMunchHuh, that looks good dom96
10:40:38*someunknownuser quit (Client Quit)
10:40:46*someunknownuser joined #nim
10:41:49*someunknownuser quit (Client Quit)
10:42:05*someunknownuser joined #nim
10:43:02*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
10:46:13*pbb quit (Ping timeout: 272 seconds)
10:47:23dom96PMunch, did you see Midsommar? I recently watched it on Prime and rather enjoyed it. As a Scandinavian, it might be right up your alley as well (note, it's a horror though)
10:47:43PMunchNope, haven't even heard of it
10:47:51PMunchNot a huge fan of horror though..
10:47:57*pbb joined #nim
10:48:36dom96ahh, then don't watch it. It's a horror's take on the midsummer celebrations
10:52:03PMunchFrom the trailer it didn't look that bad (although I did watch it without sound, because pulseaudio)
10:52:46dom96FWIW my SO doesn't like horrors either and she watched this one and seemed to enjoy it quite a bit. She also loves Scandinavian culture though so maybe that had a lot to do with it.
10:54:00*Ven`` joined #nim
10:54:48*narimiran quit (Ping timeout: 256 seconds)
11:00:06FromGitter<alehander92> dont put your trust in shock value docs
11:07:57*Vladar quit (Quit: Leaving)
11:10:06FromDiscord<Gary M> final: proc = proc() = return
11:10:22FromDiscord<Gary M> I have a parameter like that ^
11:10:35FromDiscord<Gary M> is there a better way of having an empty default proc?
11:11:06FromDiscord<Recruit_main707> what are you trying to do here?
11:11:43PMunchproc () = discard?
11:11:48FromDiscord<Gary M> It's a template I made to throw an exception, but if there is anything I want to do first, I'm passing a proc
11:12:04FromDiscord<Recruit_main707> parameter: proc()
11:12:21FromDiscord<Recruit_main707> but that wont work if you proc has a return type or parameters
11:12:31FromDiscord<Recruit_main707> iirc
11:12:33*someunknownuser quit (Quit: someunknownuser)
11:12:34PMunchIn a template it will I think
11:12:38FromDiscord<Gary M> it's currently working the way it is
11:12:40FromDiscord<Gary M> it's just ugly
11:13:21FromDiscord<Recruit_main707> may you show it in playground?
11:13:37FromDiscord<Gary M> sure one sec
11:14:09FromDiscord<Gary M> https://play.nim-lang.org/#ix=2igI
11:14:52FromDiscord<Recruit_main707> and the proc you are passing pls
11:15:30FromDiscord<Recruit_main707> PMunch: you sure about that?
11:15:39*Tyresc joined #nim
11:15:45PMunchNope, that's why I added "I think" :P
11:15:54FromDiscord<Recruit_main707> xD
11:16:35*fputs quit (Ping timeout: 260 seconds)
11:16:53FromDiscord<Gary M> https://play.nim-lang.org/#ix=2igK
11:17:05FromDiscord<Gary M> obviously you won't be able to run it in there heh
11:17:10FromGitter<alehander92> Araq talking about the vm
11:17:21FromGitter<alehander92> the debug vm flag seems good
11:17:26FromDiscord<Gary M> I'm interfacing with C a bunch 😄
11:17:29FromGitter<alehander92> thanks for it
11:17:33PMunchRecruit_main707, yeah it works: https://play.nim-lang.org/#ix=2igL
11:17:41PMunchSince the type is just `proc`
11:17:46PMunchWhich in a template matches any procedure
11:18:04FromDiscord<Recruit_main707> interesting
11:18:09FromDiscord<Gary M> cool, that'll make things easy
11:18:15*fputs joined #nim
11:18:37FromDiscord<Gary M> nim is pretty awesome
11:18:37PMunchThat `default(proc)` doesn't work though
11:18:55FromDiscord<Gary M> it's working for me, though
11:19:02FromDiscord<Gary M> well, hold on
11:19:05FromDiscord<Gary M> let me try something else
11:19:10PMunchUntil you don't pass anything
11:19:49FromDiscord<Recruit_main707> thats what i meant, yep, it doesnt work if you pass it arguments
11:20:27PMunchWell of course not, because you're not passing it anything in the template
11:20:50FromDiscord<Recruit_main707> i learned how to do it with a macro though
11:20:59FromDiscord<Gary M> https://i.imgur.com/AiRnKxv.png
11:21:07FromDiscord<Gary M> it's working without passing anything 😄
11:22:09FromDiscord<Gary M> https://i.imgur.com/3jNYZcK.png
11:22:17FromDiscord<Gary M> and then here when I pass in a proc without arguments
11:22:42FromDiscord<Gary M> so I'm guessing if I want arguments there's a problem?
11:24:05PMunchNot as pretty, but you can do this: https://play.nim-lang.org/#ix=2igO
11:25:04FromDiscord<Gary M> ah that looks alright let me try
11:25:50FromDiscord<Recruit_main707> can you run a function passed as a `typed` argument to a macro??
11:27:32FromDiscord<Recruit_main707> from withing the macro that is
11:29:45FromDiscord<Gary M> https://i.imgur.com/4RuPKww.png
11:29:50FromDiscord<Gary M> works 😄
11:29:53FromDiscord<Gary M> don't need macros
11:30:36FromDiscord<Gary M> Thanks PMunch
11:36:26FromDiscord<Recruit_main707> what should i do to check the return type of a proc inside my macro like here: https://play.nim-lang.org/#ix=2igS
11:37:46PMunchRecruit_main707: https://play.nim-lang.org/#ix=2igO
11:38:23FromDiscord<Recruit_main707> ?
11:38:40PMunchLook at the output
11:39:14FromDiscord<Recruit_main707> i dont get the point
11:39:19PMunchYou can see that the params node type is FormalParams
11:39:29PMunchAnd the 0th element is float, your return type
11:39:59FromDiscord<Recruit_main707> yep, but how do i check that in an if statement?
11:42:46*abm joined #nim
11:43:44FromGitter<alehander92> ok, so it seems calls
11:43:48FromGitter<alehander92> rewrite lineinfos
11:43:57FromGitter<alehander92> but i am not entirely sure if this is intended always
11:51:13FromDiscord<Recruit_main707> got it working
11:51:30FromDiscord<Recruit_main707> you have to check for its strVal
11:53:40*rockcavera joined #nim
11:54:23FromDiscord<Recruit_main707> next question about macros....
11:54:23FromDiscord<Recruit_main707> can they easily edit the function's body, but in the generated c/c++ code? probably by filling the function's body AST with emit pragmas?
11:54:32FromDiscord<Recruit_main707> "easily"
11:57:38*natrys joined #nim
12:03:20*chemist69 quit (Ping timeout: 246 seconds)
12:03:31dadadaPMunch: with 2 additional features for SCF it could be done 1) allow source code filters to use a macro for taking in the whole AST of a file (excluding the SCF and SCF-macro itself, of course) 2) make SCF a project wide feature so that nim knows to use specific SCF for all files in a project
12:03:43*chemist69 joined #nim
12:05:47*Vladar joined #nim
12:06:02*supakeen quit (Quit: WeeChat 1.9.1)
12:06:42*supakeen joined #nim
12:07:34*liblq-dev quit (Ping timeout: 256 seconds)
12:09:19*liblq-dev joined #nim
12:09:55*dadada quit (Ping timeout: 250 seconds)
12:11:49*dadada joined #nim
12:12:11*dadada is now known as Guest80034
12:12:19*narimiran joined #nim
12:12:26*Guest80034 is now known as dadada
12:12:50dadadathere were network issues, therefore I resend something, sorry, if it was already received
12:12:56dadadaPMunch: with 2 additional features for SCF it could be done 1) allow source code filters to use a macro for taking in the whole AST of a file (excluding the SCF and SCF-macro itself, of course) 2) make SCF a project wide feature so that nim knows to use specific SCF for all files in a project
12:13:06dadadaPMunch: pseudo code: https://play.nim-lang.org/#ix=2ih3 and then allow to put that SCF-macro into a project wide config file, that nim knows how to read
12:29:40liblq-devanybody ever tried to use cairo-trace with the cairo wrapper for Nim?
12:30:10liblq-devI'm trying to cairo-trace my program (`cairo-trace --no-file ./program arg1 arg2`), but I'm not getting anything printed in stdout
12:33:56FromGitter<alehander92> Araq we need
12:33:57FromGitter<alehander92> TSym info
12:33:58FromGitter<alehander92> right?
12:34:45dadadaliblq-dev: cairo wrapper? shouldn't cairo be usable with gobject introspection, you could simply load it with nim's support for gir (gobject introspection)
12:35:32liblq-devplease no, gintro is already bulky as it is. i don't want my program to compile 20 seconds.
12:41:00liblq-devwell anyways I solved my issue without cairo-trace
12:41:17liblq-devturns out I was clearing my surface with cairo_paint *right* after rendering it…
12:46:23*thomasross joined #nim
12:51:21*waleee-cl joined #nim
12:55:56*inv2004 joined #nim
12:57:06inv2004Hello, I have a question about c2nim, I have header with typdef struct s0{...}*S; which is ok for gcc, but c2nim print an error: token expected: ;
12:57:24inv2004If I do s0{...} S; - it works fine.
13:03:57*xcm is now known as Guest81365
13:03:57*Guest81365 quit (Killed (livingstone.freenode.net (Nickname regained by services)))
13:05:47*xcm joined #nim
13:09:38*Romanson joined #nim
13:11:12krux02inv2004, c2nim is a tool that doesn't work reliable.
13:11:50krux02that doesn't mean that it isn't useful.
13:12:11krux02I thinkou you can apply your change to the header, run c2nim and then fix the generated file.
13:12:18shashlickinv2004 - nimterop should be able to handle that case
13:13:05shashlicktypedef struct s0 { ... } S1, **S2, ***S3;
13:14:14shashlicklet's just say supporting 200 ways of writing the same thing is not fun
13:16:22inv2004looks like that I have to define {}S and do type SREF = ref S
13:22:12krux02a ref is not a pointer from C
13:22:16krux02a ptr is a pointer from C
13:23:28*zacharycarter joined #nim
13:24:30*ZoomZoomZoom joined #nim
13:27:46ZoomZoomZoomHi! 0day newbie here. Trying to compile a hello-world with nimx statically under Windows with mingw-w64 `nim c --threads:on -d:release --dynlibOverride:SDL2 --passL:-lSDL2 main.nim` but the executable still errs unable to find SDL2
13:28:19AraqZoomZoomZoom: that linking command seems Unix specific
13:28:26*hpyc9 joined #nim
13:28:30krux02ZoomZoomZoom, on windows you should put the sdl DLL in the same folder as the binary
13:29:04ZoomZoomZoomOf course, but can't it be statically linked?
13:29:18krux02I am also a bit puzzled, doesn't the SDL library try to link against SDL automatically?
13:29:44krux02ZoomZoomZoom, everybody asks this. But sdl is really designed to be a dynamic library.
13:31:04krux02it allows them to create more renderer backends and gampads to be supported just by updating the SDL dll
13:32:46ZoomZoomZoomI'm just exploring my options for writing what's supposed to end up as a plugin with GUI which should ideally be statically linked.
13:33:44krux02you want a plugin for what?
13:34:23krux02General advice, if you want to create a plugin for anything, you should use the plugin API
13:34:40zacharycarterwhat's the plugin API?
13:34:44*audiofile joined #nim
13:34:46ZoomZoomZoomThat's really not the point ATM
13:35:16zacharycarteroh SDL2 has a plugin API
13:35:23ZoomZoomZoomzacharycarter, Just the API which is provided by a software your plugin is written for.
13:36:01zacharycarteryeah - I thought someone had developed some library for Nim - I know shashlick has but it only works with bohem GC atm
13:36:20zacharycarterI'm using cr.h in my project to hot reload my game which I compile to a shared library
13:36:42zacharycarterthis only works with gc:arc/orc
13:36:56zacharycarterand I haven't done anything very complex yet on the plugin side of things
13:38:14zacharycarterbut anyway about your SDL2 problem - I don't think i've ever statically linked sdl2
13:38:37zacharycarternot even for emcsripten - but it should be fairly straightforward - use dynliboverride and then link the static lib
13:38:50zacharycarterneed to keep in mind linking order if you're on linux
13:38:59zacharycarterI need to run to the vet but I"ll be back later and can try to help more then
13:43:40*zacharycarter quit (Ping timeout: 256 seconds)
13:51:11FromGitter<alehander92> Araq should i expect tasyncawait_cyclebreaker.nim to fail?
13:51:46FromGitter<alehander92> i made some seemingly syntactic changes to make await template and now it seems to lead to ~150_000 allocations more
13:52:20*rockcavera quit (Remote host closed the connection)
13:52:24Araqwhat's 150_000 allocations among friends, it's fine
13:54:10FromGitter<alehander92> also how do you guys see errors i see a black page(loading?) for run ci error
13:54:12FromGitter<alehander92> https://dev.azure.com/nim-lang/Nim/_build/results?buildId=4330&view=logs&j=30931762-47c4-53b3-6a83-316eb5a6b9d7&t=b1c7d701-c448-5ecb-905d-689d8a5921e0
13:54:25Araqalehander92: the test is a bit fragile so see if it's green on your machine before your changes
13:54:34Araqand then ensure it stays green after your changes
13:58:15FromDiscord<Recruit_main707> why is this throwing an error? `newIdentNode("emit")'
13:59:17ZoomZoomZoomOk, for anyone looking for how to statically link SDL2 on Windows, look at your SDL2 sdl2-config.cmake, line 18. Pass all those arguments EXCEPT "-static-libgcc" PLUS "-static" to --passL: and it works.
14:00:34ZoomZoomZoom`--dynlibOverride:libSDL2 --passL:"-static -lmingw32 -lSDL2main -lSDL2 -mwindows -Wl,--no-undefined -Wl,--dynamicbase -Wl,--nxcompat -Wl,--high-entropy-va -lm -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lsetupapi -lversion -luuid"`
14:01:20FromDiscord<Varriount> That's quite a mouthful.
14:02:20dom96ZoomZoomZoom, you may want to add a new section into the Nim package's readme with this info :)
14:02:31ZoomZoomZoomYeah, and the resulting file is rather fat, but it worked.
14:03:15FromDiscord<Varriount> Well, that's often what happens with static linking. The only thing I can think of that would reduce the size is turning on link-time optimization.
14:04:02*Trustable joined #nim
14:04:10ZoomZoomZoomI'm rather wary of using my results because IDK What I'm Doing here basically :)
14:04:23ZoomZoomZoom... using for the readme
14:04:44FromDiscord<mratsim> @Araq would it be fine to add sanitizers template in Nim memory management so that ASAN in GCC and Clang can have a better idea of Nim custom memory management: see https://github.com/mratsim/weave/blob/master/weave/instrumentation/sanitizers.nim#L27-L37 for the templates usage, example: https://github.com/mratsim/weave/blob/master/weave/memory/memory_pools.nim#L174-L182, https://github.com/mratsim/weave/blob/master/weave/memory/memory_pool
14:05:00dom96ZoomZoomZoom, just preface it with the classic "I Dunno What I'm Doin'" dog gif :)
14:05:12FromDiscord<mratsim> This would help for our fuzzing efforts of Nimbus
14:05:15Araqmratsim: we have these annotations for ASAN already
14:05:36FromDiscord<mratsim> ah
14:05:40Araqproc markStackAndRegisters(gch: var GcHeap) {.noinline, cdecl,
14:05:40Araq codegenDecl: "CLANG_NO_SANITIZE_ADDRESS N_LIB_PRIVATE $# $#$#".}
14:06:06Araqbut probably more are required so that ASAN can understand our alloc/dealloc
14:06:31FromDiscord<mratsim> yes, for example detect out-of-bounds accesses on sequences
14:07:08FromDiscord<mratsim> well we do have indexerror
14:07:27FromDiscord<Varriount> mratsim: Out of bounds accesses on unchecked arrays?
14:09:48FromGitter<alehander92> sorry,
14:09:52ZoomZoomZoomI'm not familiar with cmake syntax, but since "sdl2-config.cmake" already has all the necessary switches, can't we leverage it with some option?
14:09:54FromGitter<alehander92> it does the ~same amount of allocs
14:10:00FromGitter<alehander92> but a bit less deallocs
14:12:33FromGitter<alehander92> in most cases it does 41, not 48 deallocs
14:13:12FromGitter<alehander92> ok, i'll wait to see if someone has a hint, i might look at it later
14:13:31*liblq-dev quit (Ping timeout: 265 seconds)
14:14:53FromGitter<alehander92> huh i didnt see the received messages Araq
14:14:54FromGitter<alehander92> sorry
14:15:00FromGitter<alehander92> i'll fix the test than
14:15:03FromGitter<alehander92> then*
14:15:10FromDiscord<Recruit_main707> why is this not working?? https://play.nim-lang.org/#ix=2ihA
14:15:24*liblq-dev joined #nim
14:16:54FromGitter<alehander92> but still i hope its not some kind of leak, as it does seem to deallocate less on each step
14:25:26FromDiscord<Rika> @Recruit_main707 if you dumptree the emit pragma you'll see the node you're missing
14:25:44FromDiscord<Rika> (ExprColonExpr)
14:26:38inv2004Another question: C-struct: struct {...}*S; Nim: S = ref INNER_C_STRUCT; INNER_C_STRUCT = object ...; and I have a c-function which is f(S* x, S y))
14:27:01FromDiscord<Recruit_main707> @Rika, i am grabbing it from https://nim-lang.org/docs/macros.html#callsslashexpressions-pragmas
14:27:02inv2004How can I define and pass the reference to the C function ?
14:32:16FromDiscord<mratsim> @Varriount that may be one thing
14:32:34FromDiscord<mratsim> but it's mostly because we've had some memory issues
14:38:16*endragor quit (Remote host closed the connection)
14:38:51*endragor joined #nim
14:42:35Araqinv2004: stop at 'ref INNER_C_STRUCT' already, it's a ptr, not a ref
14:42:51*liblq-dev quit (Ping timeout: 258 seconds)
14:43:39inv2004Ah, its without type of course
14:56:14FromDiscord<Rika> @Recruit_main707 and it clearly says `nnkPragma(nnkExprColonExpr(nnkIdent("emit"), nnkStrLit("#include <stdio.h>")))`
14:56:51FromDiscord<Recruit_main707> https://tenor.com/view/hmm-hmmm-hmmmm-thinking-gif-16016977
14:57:40FromDiscord<Rika> bruh
14:57:50FromDiscord<Recruit_main707> mega bruh
14:59:07*xcm quit (Remote host closed the connection)
15:00:53shashlickdoes anyone have OSX and proficient at debugging crashes
15:01:23*xcm joined #nim
15:01:53*icebattle joined #nim
15:01:55*Romanson quit ()
15:03:47FromDiscord<treeform> Nim can staticRead big files. But then the compile times get really slow. I wonder if a technique like this can be used https://flak.tedunangst.com/post/embedding-binary-objects-in-c ... Maybe it already does use it?
15:04:30FromDiscord<Rika> cant reach the site
15:07:45FromDiscord<Gary M> it looks like the Nim extension for Vscode doesn't syntax highlight variables properly
15:07:57*Romanson joined #nim
15:08:32*audiophile joined #nim
15:08:50*Romanson quit (Client Quit)
15:09:04FromDiscord<Gary M> https://i.imgur.com/oSsp9va.png
15:10:07FromDiscord<Rika> yes.
15:10:37FromDiscord<Rika>
15:10:37FromDiscord<Rika> https://cdn.discordapp.com/attachments/371759389889003532/700362517033123930/unknown.png
15:11:10*audiofile quit (Ping timeout: 256 seconds)
15:11:50FromDiscord<Gary M> it's getting the incorrect color applied
15:11:53FromDiscord<Gary M> https://i.imgur.com/r04n3h8.png
15:12:08FromDiscord<Rika> yes its pretty jank
15:12:10FromDiscord<Gary M> as though the variable is a procedure
15:12:23FromDiscord<Rika> im really wanting my semantic highlightinh
15:12:35FromDiscord<Rika> the regex is just super fucked i think
15:12:50FromDiscord<Gary M> I'll give them $5 to sort that shit out 😄
15:12:55FromDiscord<Recruit_main707> maybe they are your color themes
15:13:01FromDiscord<Rika> nope
15:13:03FromDiscord<Gary M> I made sure it wasn't
15:13:03FromDiscord<Rika> its not
15:13:19FromDiscord<Recruit_main707> my variables dont get highlighted as functions :p
15:13:24FromDiscord<Gary M> I'm manually applying the color red to all variables
15:13:25FromDiscord<Rika> update your extension
15:13:37FromDiscord<Rika> and try using augmented multiply assignment `*=`
15:13:51FromDiscord<Rika> you will get the wrong color for the variable
15:14:01FromDiscord<Gary M> absolutely nothing in any of my nim files is being colored like a variable
15:14:06FromDiscord<Rika> also happens with augmented add assignment but not division
15:14:18FromDiscord<Rika> your game and test is?
15:14:31FromDiscord<Gary M> the test was just to see the syntax highlight fuck up 😄
15:14:52FromDiscord<Gary M> the game is just initializing sdl2 and working through setting up vulkan
15:15:16*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:15:18FromDiscord<Rika> hm
15:15:18FromDiscord<Rika> https://cdn.discordapp.com/attachments/371759389889003532/700363696270082059/unknown.png
15:15:22FromDiscord<Rika> "Other"????
15:15:23FromDiscord<Recruit_main707> 0.6.6 is the latest and i still see dont see my variables as procs
15:15:52FromDiscord<Gary M> @Rika how did you get that prompt
15:15:54FromDiscord<Rika> its not even being recognized as a variable i dont think
15:16:07FromDiscord<Rika> @Gary M
15:16:07FromDiscord<Rika> https://cdn.discordapp.com/attachments/371759389889003532/700363897554599946/unknown.png
15:16:34*xcm quit (Ping timeout: 240 seconds)
15:16:43FromDiscord<Gary M> they're all Other for me
15:16:44inv2004INNER_C_STRUCT {.bycopy.} = ptr object ... ; is it equals to S in typedef MyStruct {...} *S ?
15:16:49FromDiscord<Rika> i see
15:16:56FromDiscord<Rika> look at textmate scopes
15:16:59FromDiscord<Rika> and foreground
15:17:14FromDiscord<Gary M> except comments
15:17:19FromDiscord<Gary M> comments are comments
15:17:22FromDiscord<Gary M> everything else is "other"
15:17:43FromDiscord<Rika> thats fuckin weird
15:17:49FromDiscord<Rika> man this extension is jank as hell
15:18:14FromDiscord<Gary M> there's no consistency with the textmate scope and foreground stuff either as far as I can tell
15:18:23FromDiscord<Gary M> at least there's mostly consistent coloring
15:18:26FromDiscord<Gary M> just not with variables
15:18:46*xcm joined #nim
15:18:52FromDiscord<Rika> > echo is a keyword
15:18:52FromDiscord<Rika> hmmmmmmmmmmm
15:19:18FromDiscord<Gary M> lol
15:19:22FromDiscord<Gary M> ok yeah it's jank
15:19:32FromDiscord<Recruit_main707> the only problem i know of is that when you overload a function or use * in its name, then try to make it public (with *), it will not highlight it, and when using an array combining strings and variables with emit, highlight breaks
15:19:37FromDiscord<Rika> am i really gonna move to vim just because of the jankiness of this nim plugin
15:19:38FromDiscord<Gary M> that should be entity.name.function.nim
15:20:00FromDiscord<Gary M> well the only problem you know clearly isn't all the problems we know
15:20:13FromDiscord<Recruit_main707> i cannot replicate yours
15:21:06FromDiscord<Gary M> https://i.imgur.com/0Ye8tqu.png
15:21:07FromDiscord<Gary M> do this
15:21:22FromDiscord<Gary M> ```nim
15:21:22FromDiscord<Gary M> var test = 1
15:21:22FromDiscord<Gary M> test += 1
15:21:22FromDiscord<Gary M> ```
15:21:26FromDiscord<Gary M> and screencap it please
15:21:39FromDiscord<Recruit_main707> now i see it :p
15:21:41FromDiscord<Gary M> variables shouldn't be getting recolored as procedures
15:21:48FromDiscord<Rika> haha
15:21:56FromDiscord<Rika> it really only does that for += and *=
15:21:59FromDiscord<Rika> not for /=
15:22:00FromDiscord<Gary M> they should be getting colored as *variables* to begin with
15:22:06FromDiscord<Rika> i dont know if -= is fucked either
15:22:14FromDiscord<Gary M> regardless of all this other weird behavior
15:22:25FromDiscord<Recruit_main707> > i dont know if -= is fucked either
15:22:25FromDiscord<Recruit_main707> nope
15:22:35FromDiscord<Gary M> https://i.imgur.com/lKpea6z.png
15:22:40FromDiscord<Rika> thats so odd
15:22:48FromDiscord<Rika> why is += and *= broken but not the others?
15:23:24FromDiscord<Recruit_main707> i still think its not so bad of an issue, (how do you display all that?)
15:23:25*icebattl1 joined #nim
15:23:32FromDiscord<Rika> also regex syntax highlighting is not something i would do
15:23:34FromDiscord<Rika> or like to fix
15:23:48FromDiscord<Rika> its pretty bad since its super noticeable
15:24:00FromDiscord<Gary M> ctrl+shift+p Inspect editor tokens
15:24:06FromDiscord<Rika> try multiplying 2 variables
15:24:11FromDiscord<Rika> you'll get the fucked colors too
15:25:13FromDiscord<Recruit_main707> the issue its with the * symbol specially? (also strings have token)
15:26:00FromDiscord<Gary M> I'm pretty sure it is a problem with the *
15:26:05FromDiscord<Gary M> and +
15:26:13*icebattle quit (Ping timeout: 250 seconds)
15:26:19*endragor quit (Remote host closed the connection)
15:26:41FromDiscord<Gary M> there's the coincidence of the opposites not being fucked, but there's no proof that it's directly related
15:26:59FromDiscord<Gary M> the + - * / operators are templates aren't they?
15:27:33FromDiscord<Gary M> I don't think it should be doing anything weird in the syntax highlighting though...
15:28:02FromDiscord<Rika> the highlighting doesnt know anything past the symbols
15:28:14FromDiscord<Rika> it only sees the file, not the compiler stuff
15:28:25FromDiscord<Gary M> maybe it's just the regex being fucked
15:28:45FromDiscord<Gary M> I mean variables at all just don't work
15:28:58FromDiscord<Gary M> and idk if it's even done with regex
15:29:03FromDiscord<Recruit_main707> but... if almost everything is other? how do they have different highlights?
15:29:04FromDiscord<Gary M> whatever it is, it's fucked
15:29:27FromDiscord<Gary M> well look at the other weird thing Recruit
15:29:38FromDiscord<Gary M> https://i.imgur.com/KHB0aPF.png
15:29:46FromDiscord<Gary M> the procedure echo get the highlighting of a keyword
15:30:14FromDiscord<Gary M> https://i.imgur.com/14gWl34.png
15:31:52FromDiscord<Recruit_main707> have you thought of openning an issue?
15:32:04FromDiscord<Recruit_main707> clearly all of this is not right
15:32:17FromDiscord<Rika> echo highlight as keyword kinda makes sense but i still think it shouldnt
15:32:24FromDiscord<Recruit_main707> ^
15:32:35FromDiscord<Gary M> actually might be using textmate rules idk
15:32:47FromDiscord<Gary M> https://code.visualstudio.com/api/language-extensions/syntax-highlight-guide
15:32:53FromDiscord<Gary M> it does mention textmate scopes
15:34:37Zevvpff, had to make a Nim comment in this silly HN thread about "Embedding Binary Objects in C"
15:35:00FromDiscord<Gary M> found it
15:35:03FromDiscord<Recruit_main707> wasnt that ZomZomZom? XD
15:35:17FromDiscord<Gary M> in the user path in .vscode, then in the nim extension folder
15:35:27FromDiscord<Gary M> syntaxes>nim.json
15:36:14FromDiscord<Gary M> ew there is regex
15:37:17FromDiscord<Recruit_main707> just in case someone fixes all of this, pls leave echo as it is (as an exception to the rule or something)
15:37:43FromDiscord<Gary M> reasoning?
15:37:53FromDiscord<Recruit_main707> it would be very ugly :p
15:38:01FromDiscord<Rika> @Gary M told ya it was regex
15:38:08FromDiscord<Gary M> well, it's a combination of regex
15:38:15FromDiscord<Gary M> you can look at the file yourself, too
15:38:20FromDiscord<Rika> i already did
15:38:27FromDiscord<Rika> before you raised the issue
15:39:57FromDiscord<Gary M> going to have to bust out the regex translator for this 😦
15:43:32*liblq-dev joined #nim
15:44:48krux02@alehander92: Can you please take a look at my issues about gara and the PR I made?
15:45:03krux0218 days ago
15:48:03*Prestige quit (Quit: Prestige)
15:48:20*Prestige joined #nim
15:49:15*Ven`` joined #nim
15:49:29FromDiscord<Gary M> found a minor issue in the operator regex @Rika
15:49:37FromDiscord<Rika> 👀 nice
15:49:40FromDiscord<Rika> hotfix where
15:50:03FromDiscord<Gary M> (=|\\+|-|\\*|`right here`/`this is not escaped`|<|>|@|\\$|~|&|%|!|\\?|\\^|\\.|:|\\\\)+
15:50:11FromDiscord<Gary M> dunno that it will do much 😄
15:50:13FromDiscord<Rika> nice
15:50:20FromDiscord<Gary M> but it should be escaped I think, anyways
15:50:34FromDiscord<Gary M> operator highlighting was working fine, anyways
15:50:46FromDiscord<Gary M> really need to fix that variable stuff
15:50:58FromDiscord<Gary M> at LEAST make them not color like functions
15:52:53*ITChap joined #nim
15:53:25FromGitter<zetashift> @Yardanico oooh nice, I've browsed through it, looking forward to seeing more
15:53:56FromGitter<zetashift> I'm also working on the book using Scala, but I'm trying to stick to some FP-isms but find it hard since the book uses mutability a lot
15:54:10FromDiscord<Recruit_main707> @Gary M does that fix something??
15:54:15FromDiscord<Gary M> not sure yet
15:54:23FromDiscord<Gary M> but I think I have something else to fix 😄
15:57:01*zacharycarter joined #nim
15:57:18FromDiscord<Gary M> I'm looking at some other things right now
15:57:19FromDiscord<Rika> @Gary M i cant find the issue that you pointed out
15:57:19FromDiscord<Rika> ??
15:57:19FromDiscord<Rika> https://cdn.discordapp.com/attachments/371759389889003532/700374011657584770/unknown.png
15:57:19FromDiscord<Rika> i dont see the issue]
15:57:19FromDiscord<Gary M> it's just an unescaped forward slash, but it might not make a difference
15:57:21FromDiscord<Rika> i dont think vscode cares about it
15:58:25FromDiscord<Gary M> https://i.imgur.com/tKh1PQq.png
15:58:31FromDiscord<Gary M> @Rika boy
15:58:35FromDiscord<Rika> ?
15:58:37FromDiscord<Gary M> or girl, dude, whatever
15:58:38FromDiscord<Gary M> look
15:58:47FromDiscord<Rika> ??? what am i supposed to see
15:58:53FromDiscord<Gary M> *look harder*
15:58:55FromDiscord<Rika> im kind of colorblind btw
15:58:59FromDiscord<Gary M> oh
15:59:07FromDiscord<Rika> legit ;;
15:59:08FromDiscord<Gary M> it's not coloring on that operator now
15:59:15FromDiscord<Gary M> on the plus
15:59:17FromDiscord<Rika> the test + 2
15:59:19FromDiscord<Gary M> yes
15:59:22FromDiscord<Rika> what regex did you fic
15:59:25FromDiscord<Rika> fix
15:59:52FromDiscord<Gary M> * is also fixed rn not sure why
16:00:16FromDiscord<Recruit_main707> if it works, leave it like that and ignore the logic :p
16:00:20*nsf quit (Quit: WeeChat 2.8)
16:00:26FromDiscord<Rika> WHAT REGEX DID YOU FIX
16:00:34FromDiscord<Recruit_main707> lel
16:00:57FromDiscord<Gary M> THE ONE THAT FIXES IT
16:01:05FromDiscord<Rika> WHICH ONE GOD DAMN IT
16:01:09FromDiscord<Gary M> lol
16:01:19FromDiscord<Gary M> ```json
16:01:20FromDiscord<Gary M> "comment": "Function call (no parenthesis).",
16:01:27FromDiscord<Gary M> "match": "(?!(openarray|varargs|void|range|array|seq|set|pointer|new|await|assert|echo|defined|declared|newException|countup|countdown|high|low|((uint|int)(8|16|32|64)?)|float(32|64)?|bool|string|auto|cstring|char|byte|tobject|typedesc|stmt|expr|any|untyped|typed|addr|as|asm|atomic|bind|cast|const|converter|concept|defer|discard|distinct|div|enum|export|from|import|include|let|mod|mixin|object|of|ptr|ref|shl|shr|static|type|using|var|t
16:01:27FromDiscord<Gary M> "name": "support.function.any-method.nim"
16:01:27FromDiscord<Gary M> ```
16:01:27FromDiscord<Gary M> that's one motherfuck of a regex
16:01:44FromDiscord<Gary M> at the very end it was doing (-+ a couple times
16:01:45FromDiscord<Rika> REST IN PEACE IRC PEOPLE
16:02:03FromGitter<zetashift> I've seen worse codeblocks pasted tbh
16:02:04FromDiscord<Recruit_main707> F
16:02:15FromDiscord<Gary M> which was matching characters from range ( to +
16:03:08FromDiscord<Gary M> kind of a weird thing
16:03:43FromDiscord<Rika> so just remove that and its done
16:03:57FromDiscord<Gary M> seems like it
16:04:00FromDiscord<Rika> also * is behind + so it makes sense that * is fixed now too
16:04:10FromDiscord<Gary M> I already did in that code block
16:04:59FromDiscord<Rika> bless your soul, i dont like looking at regex
16:05:09FromDiscord<Rika> though i am perfectly capable of doing this myself
16:05:14FromDiscord<Rika> i just do not want to
16:05:21FromDiscord<Gary M> well at least all of my variables are the same color for now 😄
16:06:13FromDiscord<Rika> yeah!
16:06:24FromDiscord<Rika> fuck
16:06:24FromDiscord<Rika> https://cdn.discordapp.com/attachments/371759389889003532/700376557382008862/unknown.png
16:06:32FromDiscord<Gary M> oh great.
16:06:35FromDiscord<Rika> HAHAHAHAHA
16:06:41Araqthat regex looks wrong on multiple levels
16:06:44FromDiscord<Rika> memed
16:07:22Araq1. mixes keywords with stuff that happens to be in system.nim
16:07:22FromDiscord<Gary M> it's the regex that's in the nim vscode extension 😄
16:07:28FromDiscord<arnetheduck> outputting `wasm` bytecode is easy - `nlvm` does that perfectly. a fibonacci example will fly faster than any javascript bird - emulating all of nim's std lib features is the hard part - you need a runtime corresponding to the `c` library - there's two options: emscriptem (easy) or wasi (hard) - also, you want to avoid a bunch of nim things or the experience will suck, in general: exceptions, gc.. GC works kind of if you manually collec
16:07:38FromDiscord<Rika> thats what i said for echo being a keyword!!!
16:07:50FromDiscord<Gary M> I don't know the spec OR regex nearly as well as you must, so we probably need some help cleaning this all up
16:07:56FromDiscord<Rika> its like saying print() is somehow a keyword in python
16:08:04FromDiscord<Rika> it USED to be one, it no longer is
16:08:11Araq2. "Function call without parenthesis" is like er, every Nim construct ever.
16:08:39FromDiscord<Rika> Araq: why do you think it has basically every nim construct ever in the list
16:08:39FromDiscord<Gary M> yeah that's a weird one
16:08:40FromDiscord<Rika> lmao
16:09:03FromDiscord<Gary M> so what should we do, start the regex from scratch? 🤣
16:09:16FromDiscord<Gary M> that doesn't sound fun
16:09:25FromDiscord<Rika> fix it up i guess
16:09:29FromDiscord<Rika> major rewrite
16:09:35FromDiscord<Rika> not from scratch though
16:09:42FromDiscord<Gary M> should div be a keyword or an operator?
16:10:19FromDiscord<Rika> lets wait for our lord and savior 😛
16:10:19FromDiscord<Recruit_main707> function?
16:10:24FromDiscord<Gary M> actually it's technically a proc
16:10:26FromDiscord<Rika> div is an operator function
16:10:31FromDiscord<Rika> since it's backticked
16:10:45FromDiscord<Gary M> ah ok
16:10:59FromDiscord<Gary M> https://i.imgur.com/17OG0IV.png
16:11:01FromDiscord<Recruit_main707> @Rika is that a rule or something?
16:11:02FromDiscord<Gary M> so this is fucked
16:11:29FromDiscord<Rika> @Recruit_main707 any proc name in backticks uses "operator" style usage
16:11:41FromDiscord<Recruit_main707> oh
16:11:48FromDiscord<Rika> so \`add` is used like 1 add 2, add is used like 1.add 2
16:12:01FromDiscord<Rika> symbols MUST be backticked
16:12:04FromDiscord<Gary M> would you say it should be colored the same as the + - * / operators
16:12:10FromDiscord<Rika> i would yes
16:12:17FromDiscord<Rika> not sure with ara q
16:12:37FromDiscord<Recruit_main707> what color though, mine are white XD
16:12:48FromDiscord<Rika> that's on the theme
16:12:55FromDiscord<Rika> not the highlighting
16:13:12FromDiscord<Gary M> https://i.imgur.com/cHctGR9.png closer to this
16:13:15FromDiscord<Recruit_main707> i know, i just dont remember seeing it highlighted
16:13:20FromDiscord<Gary M> although the variable is still fucked on that one
16:13:42FromDiscord<Rika> i really really do not want to deal with this 😛
16:14:18FromDiscord<Recruit_main707> open an issue and wait :smart:
16:14:41FromDiscord<Recruit_main707> open an issue and wait :p
16:15:06FromDiscord<Rika> or let the king gary m fix it
16:16:02FromDiscord<Recruit_main707> also, i got this to work, generated code is not as clean as i would have liked, but meh ¯\_(ツ)_/¯
16:16:07FromDiscord<Recruit_main707> https://play.nim-lang.org/#ix=2iim
16:16:44FromGitter<alehander92> krux02 sorry
16:16:54FromGitter<alehander92> i knew about it but i always delayed looking at it
16:16:55FromGitter<alehander92> merged
16:18:14FromDiscord<Rika> @Recruit_main707 you know you could have just used quote do https://play.nim-lang.org/#ix=2iiq
16:18:43FromDiscord<Recruit_main707> https://tenor.com/view/themoreyouknow-star-rainbowstreak-nbc-gif-4884642
16:19:05FromDiscord<Rika> F
16:19:14FromDiscord<Rika> should have told you earlier lmao
16:19:28FromDiscord<Recruit_main707> ill take it as learning experience xD
16:19:53FromDiscord<Rika> if its simple and valid nim syntax, try quote do
16:20:10FromDiscord<Rika> if it doesnt work, use manual ast creation
16:20:26FromDiscord<Recruit_main707> ill have it in mind
16:21:24FromGitter<alehander92> i think quote also need something like `{.lineInfo: node.}` similar to `{.inject.}`
16:25:39*disbot joined #nim
16:25:41*inv2004_ joined #nim
16:28:30FromDiscord<Gary M> I made negative progress!
16:28:32FromDiscord<Gary M> https://i.imgur.com/GWcod7R.png
16:28:42FromDiscord<Gary M> now all the variables are orange 😄
16:28:54*inv2004 quit (Ping timeout: 240 seconds)
16:29:13FromDiscord<Gary M> but only on the left side of an operation
16:29:27FromDiscord<Recruit_main707> bruh
16:29:42FromDiscord<Gary M> or even the right, it looks
16:29:56FromDiscord<Gary M> just, even less consistent than before, awesome
16:30:00FromDiscord<Gary M> regex is a *bitch*
16:30:13*disbot quit (Ping timeout: 264 seconds)
16:30:28FromDiscord<Rika> sigh
16:30:43FromDiscord<Rika> who thought syntax highlighting should be in regex
16:31:52FromDiscord<Gary M> sadists
16:33:47*inv2004__ joined #nim
16:37:00krux02Gary M: what are you working on?
16:38:01*inv2004_ quit (Ping timeout: 264 seconds)
16:39:01FromDiscord<Gary M> krux02: the syntax highlighting for the Nim extension in Vscode
16:39:05FromDiscord<Gary M> it's all sorts of messed up
16:39:28FromDiscord<Gary M> https://i.imgur.com/7AeidB3.png
16:39:33FromDiscord<Gary M> this image for example
16:39:42FromDiscord<Gary M> variables aren't at all colored as variables
16:39:57*disruptek joined #nim
16:40:01FromDiscord<Gary M> and then variables on the left of operations like + and * get colored like procs
16:40:19FromDiscord<Gary M> and some other fun things
16:40:24FromDiscord<Gary M> but that's the most annoying
16:40:57*disbot joined #nim
16:43:42*ITChap quit (Quit: ITChap)
16:44:06krux02yea I had similar experience with emacs syntax highlighting.
16:44:24krux02It was all messed up. But the worst part there was, it was messed up in performance.
16:44:52krux02Making editing of large files practically impossuble, unless you turn off syntax highlighting.
16:44:55*rockcavera joined #nim
16:45:26FromDiscord<Gary M> ouch
16:45:35FromDiscord<Gary M> one reason to just not use emacs?
16:45:50FromDiscord<Rika> not really idt
16:46:48krux02not really. It wasn't the fault of emacs the the guy implementing syntax highlighting didn't care about files larger than 10 lines of code.
16:46:56*disruptek quit (Ping timeout: 256 seconds)
16:47:24krux02It is now fast btw.
16:47:30*disbot quit (Ping timeout: 256 seconds)
16:47:42*icebattl1 quit (Ping timeout: 265 seconds)
16:47:55FromDiscord<Recruit_main707> (its totally off topic, but i dont know if the bridge is working so) does anyone know how to write spanish quotes in the keyboard?? (the ones that look like this: << >>)
16:48:13companion_cube«»
16:48:40*disbot joined #nim
16:49:11FromDiscord<Recruit_main707> ye, but how XD
16:49:12*disruptek joined #nim
16:49:49PMunchdadada, yeah I guess it would be doable with some modifications. The question is if we want to allow that kind of rewrite
16:50:12ZoomZoomZoomAlt+0171, Alt+0187
16:50:41FromDiscord<Recruit_main707> thx
16:50:55companion_cubeI use a compose key
16:51:11ZevvI just cut&paste from companion_cube
16:51:47companion_cubehttps://www.fileformat.info/info/unicode/char/search.htm?q=guillemet&preview=entity
16:52:18Zevvoh look gnu screen can do digraphs: « »
16:54:36*Vladar quit (Quit: Leaving)
16:54:40*liblq-dev quit (Quit: WeeChat 2.7.1)
16:59:10dadadaPMunch: after a quick survey of what SCF can do now, I think this feature needs to be rewritten/expanded anyway, there are many ways in which this can be useful, i.e. for templates, but it's much too restricted, for example why should all replace(..) be in one line? why can't you put them in multiple lines? why is regex not supported by default in replace and other SCF functions? then also the possibility on
16:59:15dadadacalling a macro on the whole code as I said. As for allowing it, if you don't all you're really doing is, to force userdevs to create their own external preprocessors (that of course will use Nim's own AST-parser/macros anyway) and thereby each such userdev will roll his/her own solution. That will create repeated work. Of course, such a need is not the norm, but it definitely comes up once in a while.
16:59:21FromDiscord<Rika> fuck, i should really read through the whole of docs
16:59:41FromDiscord<Rika> literally was thinking "hmm npeg would benefit from templates" and right in the docs there it is
17:00:21PMunchdadada, well SCF is seen as a bit of a "please don't use this unless you really need to" feature
17:01:05dadadaPMunch: officially macros are described in a similar manner in the docs (you should prefer everything else over macros) and yet it's one of Nim's main selling points :-)
17:01:10ZevvRika: always one step ahead!
17:01:26PMunchI think it's mostly made to allow using Nim as a templating language (like HTML templates) and possibly to silence the "why no tabs" crowd.
17:01:45PMunchAnd it's been considered for removal many times
17:02:03FromDiscord<Recruit_main707> what, macros?
17:02:07dadadait should be improved/built upon, not removed
17:02:20FromDiscord<Gary M> https://i.imgur.com/hPgnV3A.png
17:02:22PMunchRecruit_main707, haha no not macros
17:02:25FromDiscord<Gary M> yeah this regex is just butchered.
17:02:41PMunchdadada, well macros should be your last ditch effort for "normal" usage. But it's super helpful for writing ergonomic libraries and such
17:02:41FromDiscord<Rika> jesus what the fuck did you do
17:02:44FromDiscord<Gary M> absolute monstrosity
17:02:47dadadait's definitely not a feature that you should use all the time, but it's nice to have
17:02:52FromDiscord<Gary M> @Rika that's how it currently is 😦
17:02:53FromDiscord<Recruit_main707> yes, 4 spaces tabs wtf
17:03:10FromDiscord<Gary M> it's like, just not a good regex
17:03:30FromDiscord<Gary M> anyways it's 10am and I haven't slept. I should sleep 😄
17:03:33FromDiscord<Rika> jesus christ thats pretty bad
17:03:38FromDiscord<Rika> wait wait
17:03:40FromDiscord<Rika> btw
17:03:45PMunchRecruit_main707, everyone knows that 4 spaces for indentation but combine every 8th space with a tab
17:03:48FromDiscord<Gary M> I'll try to work on it when I've had some rest.
17:04:00FromDiscord<Rika> vscode uses `\\` instead of `\` for escaping @Gary M
17:04:08FromDiscord<Rika> just in case you didnt notice
17:04:10FromDiscord<Gary M> I know
17:04:15dadadaPMunch: I don't like the SCF in the current state much, however I see their potential, and then I like them a lot, so I vote against removal
17:04:33FromDiscord<Gary M> it's really that json uses that
17:04:38*owl_000 joined #nim
17:04:42krux02PMunch, I really wonder who came up with that idea
17:04:58FromDiscord<Gary M> you have to escape the escape, otherwise json tries to parse it before the regex does
17:05:13krux02dadada, what is SCF?
17:05:21dadadakrux02: source code filter
17:05:31krux02ah
17:05:37krux02yea, I vote to remove them
17:05:56krux02put them on an experimental feauture branch or somtehing
17:05:59dadadayou'd vote to remove varargs, too, and I love that feature
17:06:09PMunchkrux02, haha yeah I got some code formatted that way for an assignment in uni. Was so confused by it until I remembered hearing someone mentioning an old Emacs indentation scheme, and sure enough, that was it!
17:06:19owl_000in nim 1.2.0 what are those warnings? `/stdlib_io.nim.c: In function ‘raiseEIO__ZYk14k3sVNZUIjJjtqzFZQ’` `/stdlib_io.nim.c:627:1: warning: ‘noreturn’ function does return`
17:06:24krux02dadada, I don't want to remvoe varargs, I want to replace it with a varargs that works.
17:06:36krux02But that isn't possible without breaking varargs first.
17:06:53dadadakrux02: that's a thing I can get behind, it's just that for me in the few months of using Nim I had, varargs didn't fail me a single time (yet)
17:06:53PMunchowl_000, where do you see those?
17:06:57krux02dadada, maybe you will stop loving varargs if you try to fix its problems
17:07:03owl_000when i compile
17:07:08*xcm quit (Remote host closed the connection)
17:07:15krux02dadada, for me it did
17:07:19PMunchAnything? I've never seen that warning..
17:08:10FromDiscord<Rika> me neither
17:08:26FromDiscord<Rika> it looks like something went wrong with your nim compiler or something
17:08:28krux02btw I realized Nim has now 17000 commits
17:08:40FromDiscord<Rika> nice
17:08:41krux02precisely
17:08:46dadadacool
17:08:53krux02not sure if that measures anything
17:08:58FromDiscord<Rika> so who IS the author of the 17000th commit
17:09:00krux02probably effort
17:09:28krux02timotheecour it is
17:09:34krux02not that there is a price for it
17:09:56owl_000https://ibb.co/qr3hjK9 look at the screen shot
17:10:18dadadakrux02: if we knew how much work goes into an average commit in human hours, then we could approximate the number of work hours that have gone into creating Nim so far
17:11:22krux02dadada, that depends on the person creating the commit.
17:11:35FromDiscord<Gary M> @Rika ok one last fix before I log off
17:11:41FromDiscord<Gary M> go back to that same long ass regex
17:11:46krux02Some people work all day long for a commit, some people create a commit for just a few minutes of work
17:11:52FromDiscord<Gary M> right after "comment": "Function call (no parenthesis).",
17:12:13*xcm joined #nim
17:12:13FromDiscord<Gary M> change the start from (?! to (?=
17:13:18owl_000`let content = readFile("test.txt")` compiling it in linux shows those warning.
17:13:23FromDiscord<Gary M> https://i.imgur.com/6KVqv55.png
17:13:39FromDiscord<Gary M> seems to have unborked the variables better now.
17:13:56FromDiscord<Gary M> also I removed div from that one and put it in operators
17:13:59*liblq-dev joined #nim
17:14:06FromDiscord<Rika> nice
17:14:11FromDiscord<Gary M> generic operators for expressions
17:14:21FromDiscord<Gary M> just div| before the other things
17:14:28FromDiscord<Gary M> hope that helps 😄
17:15:05FromDiscord<Rika> does good, nice
17:15:05FromDiscord<Rika> thanks
17:15:29krux02div and or mod and all the other word operators?
17:16:02FromDiscord<Recruit_main707> that was hard to read lol
17:16:05zacharycarterZoomZoomZoom: you figure out your issue?
17:16:43*inv2004__ quit (Ping timeout: 250 seconds)
17:17:19ZoomZoomZoomzacharycarter, yep, moreover, I've made a PR for SDL2 library (#124) with an instruction
17:17:49FromDiscord<Recruit_main707> i should try to make sdl2 work again i guess
17:17:56ZoomZoomZoomzacharycarter, Thanks for getting back to me
17:18:30FromDiscord<Rika> @Gary M uh oh
17:18:30FromDiscord<Rika> https://cdn.discordapp.com/attachments/371759389889003532/700394700414124052/unknown.png
17:18:46FromDiscord<Rika> how the fuck does that happen lmaoooo
17:18:50FromDiscord<Gary M> LiVe WiTh It
17:18:57FromDiscord<Rika> haha go sleep
17:19:00FromDiscord<Rika> im just showing ya
17:19:12FromDiscord<Gary M> I'll work out the KINKS later ugh
17:21:11FromDiscord<Gary M> it's matching the alternate "of" and just moving on
17:23:15FromDiscord<Rika> go, before i report more bugs
17:24:51owl_000`echo "hello world"` nim 1.2.0 in linux 64 produces this warning too. https://ibb.co/vc7M4F1
17:25:23Prestigemy eyes
17:27:28disruptekholy shit.
17:27:58FromDiscord<Gary M> @Rika ok try this
17:27:59owl_000`--gc:refc` produces no warning though.
17:28:00FromDiscord<Gary M> lmao
17:28:08FromDiscord<Gary M> (?=(\b
17:28:21FromDiscord<Gary M> it's just adding \b right before the first thing
17:28:39FromDiscord<Rika> where should this go
17:28:42FromDiscord<Gary M> actually \\ for json
17:28:43FromDiscord<Rika> and you must sleep
17:28:46FromDiscord<Gary M> double \
17:28:53FromDiscord<Gary M> so \\\\b
17:29:00FromDiscord<Gary M> same place as last time
17:29:07FromDiscord<Gary M> function call no paren
17:30:16FromDiscord<Gary M> ah I also move of to the start...
17:30:28FromDiscord<Gary M> lemme just shoot you a message lol
17:30:33zacharycarterZoomZoomZoom: np! glad you got it figured out :)
17:31:14FromDiscord<Gary M> @Rika add me
17:31:30ZoomZoomZoomzacharycarter, "np!"="no problem"?
17:32:08ZoomZoomZoomP ≠ NP :D
17:38:00*NimBot joined #nim
17:38:54*inv2004__ joined #nim
17:42:28disruptekhearts and minds, people; hearts and minds!
17:43:41dadadadisruptek: glad to see you here again! we want streams
17:43:51dadadahope you've been well
17:44:07disruptekdude.
17:44:13disrupteki know you only tune in for the music.
17:44:25dadadaexactly! :D
17:44:45disrupteki'm fine but i've had a lot of hardware issues.
17:44:58disruptekwetware is tip-top, i'm happy to report.
17:45:11*Vladar joined #nim
17:45:27Zevv\o/
17:45:33disruptekawwww sup dawg
17:46:07Zevvso how the hell did you get through the days like that?!
17:46:15Zevvreading, like, books, or stuff like that?!
17:46:18FromGitter<zetashift> ewww
17:47:08disruptekwe don't read in 'murica
17:47:18FromGitter<zetashift> did you shoot some stuff
17:47:27disruptekactually, you have to read this writings.stephenwolfram.com article.
17:47:38disruptekit's got the gears turning.
17:47:41FromGitter<zetashift> the plottwist it is reading
17:48:04disrupteki'm desperate to learn what it says.
17:48:13disrupteki just look at the pictures.
17:48:24FromGitter<zetashift> Link to the article?
17:48:27FromGitter<zetashift> or is it the first one
17:48:42disruptekwhatever was posted on 4/14.
17:48:48disrupteki don't have a gui atm.
17:48:56FromGitter<zetashift> "Finally We May Have a Path to the Fundamental Theory of Physics… ⏎ and It’s Beautiful"
17:49:24FromGitter<zetashift> for the curious: https://writings.stephenwolfram.com/2020/04/finally-we-may-have-a-path-to-the-fundamental-theory-of-physics-and-its-beautiful/
17:51:17disruptekhonestly, it's about the most interesting thing i've read in years, and it meshes with a lot of my graph work.
17:54:23Zevvit's pretty pictures and all, true that
17:55:35disruptekwhat have the nimions been up to over the last week?
17:55:51Zevvno idea, I hardly come here these days
17:56:04leorizeyou're back disruptek \o/
17:56:19PrestigePMunch: I opened a quick PR for nimlsp to fix the issue we talked about yesterday
17:56:20narimirandisruptek: easter
17:56:37leorizeand disbot is back too, it's missed :p
17:57:47leorizenarimiran: can you add dochack to list of triggers for the docgen ci?
17:57:49disrupteki can wake up the bot once i get wayland running at >0.2fps.
17:58:05narimiranleorize: yeah, it might be a good idea
17:58:11leorizedisruptek: did you screw up your graphics driver?
17:58:19Zevvrunning on an e-ink display I bet
17:59:22disrupteki can't tell what's up. it's like, i have a 2020-01-03 bios and apparently the 5600 doesn't play nice with linux until a bios refresh, but it doesn't seem like a refresh is available for me and apparently my linux-firmware is up-to-date.
18:00:52disruptekthanks for the help on libimobiledevice. i gave up on it. it felt kludgy and i was seeing double-frees and stuff and i was like... fuck it.
18:01:07leorizelol
18:01:29leorizewhat brand of card is that? maybe I can find you a bios
18:01:37disruptekgigabyte
18:02:27leorizehttps://www.gigabyte.com/Graphics-Card/GV-R56XTGAMING-OC-6GD/support#support-dl-bios
18:02:39disruptekdon't waste your time, though; i will have to flash it in windows anyway, and i have network now, so it's no big deal.
18:02:58FromDiscord<Rika> i wish i had an e-ink monitor
18:02:59disruptekwhat's the latest date there? i have no browser.
18:03:18leorize2020-01-21
18:03:18disruptekiirc you can get e-ink panels pretty cheap.
18:03:25disruptekahh, i bet that's what i need.
18:04:01disruptekZevv: we shoulda made those nim-based corona badges.
18:04:12disruptekthere's still time if you are interested.
18:04:14*owl_000 quit (Quit: Leaving)
18:04:21FromDiscord<Rika> panels are cheap afaik, monitors arent
18:04:49FromDiscord<Rika> oh, panels ARENT cheap
18:04:51FromDiscord<Rika> lmao
18:07:00Zevvdisruptek: what would a "nim-based corona badge" do, exactly?
18:07:27Zevvflash "don't panic" in big friendly letters?
18:07:28disruptekyou wear it on a lanyard and it displays how much adjacency you've had with other spreaders.
18:07:52disruptekit's like those radiation badges.
18:08:09disruptekdidn't we talk about this a couple months ago?
18:09:08ZevvI recall you dropping the term "corona badge" once, but no background info
18:09:12ZevvI might have missed that
18:09:21disruptekgamification of the 14-day decay.
18:09:38Zevvprivacy! implications!
18:10:30disruptekyou prefer the google/apple solution?
18:10:54Zevvnope
18:11:31ZevvI do not believe in any technological means for this, I guess
18:13:20disruptekare walls technology?
18:13:38Zevvnarrow that down to anything that runs on batteries
18:14:00disruptekit's batteries you have a problem with.
18:14:28Zevvand 5G, right
18:16:37*audiophile quit (Quit: Going offline, see ya! (www.adiirc.com))
18:16:55*fputs quit (Quit: WeeChat 2.8)
18:16:55*audiophile joined #nim
18:23:04disruptekleorize: you wanna weigh in on this ryu thread?
18:23:24leorizewhat ryu thread?
18:23:26disruptek#7717
18:23:55disrupteki think your impl is the one we want, right?
18:24:53*inv2004__ quit (Quit: Leaving)
18:25:18leorizeno, I haven't even started on the impl :P
18:25:32leorizeclyybber impl is a 1:1 translation of the C one
18:25:43leorizemine can be used as a guide to navigate that mess :P
18:26:40disruptekbut, i don't think it makes sense to use the translation.
18:27:13disrupteki thought you were like 3/5ths done.
18:28:15leorizeI've only finished the reference impl, not ryu
18:28:23leorizeI haven't even started on ryu :P
18:32:31disruptekdisbot: can you work at 0.2fps?
18:32:32disbotyep. 😊
18:50:56leorize[m]disruptek: oh if you don't have windows you can actually flash from uefi if you're brave enough :P
18:51:26disrupteki'm brave, but i'm also not an idiot.
18:54:41FromDiscord<Varriount> Hey krux02. 😄
18:58:08audiophilecan someone explain how nim deals with the whole package management craze? it's a mess in python right now. Do we have virtualenv in nim?
19:00:08leorizeno
19:00:13audiophilek
19:00:25leorizeit's a mess in python because python separate packages by python version
19:00:29leorizewe don't do that here
19:00:40FromDiscord<Varriount> audiophile: You don't generally need something like virtualenv for a compiled language, because it doesn't require a runtime to be installed.
19:00:46leorizealso nimph is more reliable than nimble :P
19:00:51audiophilewhat if i want to use a library version x instead of latest y?
19:00:58audiophileoh first time hearing of nimph will check it out
19:01:04leorizenimble install lib@version
19:01:13leorize!repo nimph
19:01:16audiophileVarriount I iddn' understand that :(
19:01:24leorizedisbot is dead again :P
19:01:28audiophileleorize but where does it get installed?
19:01:34audiophiledoes it overwrite global installation
19:01:46FromDiscord<Varriount> leorize: I believe what's being asked is, "what do I do if I am working on 2 different projects, `foo` and `bar`, each of which require a different version of `baz`?"
19:01:47leorizeinstalled alongside the global one
19:02:06leorizethen each one will be compiled with the version they require
19:02:21FromDiscord<Varriount> How do you specify the version required?
19:02:24leorizekinda terrible imo, but it works because some people want it to
19:02:33leorize`requires` in .nimble
19:02:46leorizeyou can specify version constraints there
19:03:04audiophileoh that's kinda like a virtualenv I guess, except your different versions of `baz` also get installed globally?
19:03:39audiophile Varriount could you explain the 'because it doesn't require a runtime to be installed' part? do you mean after it's compiled into a binary?
19:03:50leorizeyea
19:04:02audiophileuh yeah to which question =)
19:04:07leorize[m]both
19:04:20audiophileah
19:04:25audiophilenice!
19:05:10disruptekyeah, lemme try flashing this thing. then the bot can return to service.
19:05:56audiophiledont flash
19:05:59audiophileit's illegal O_o
19:07:10audiophilePMunch hullo
19:07:51FromDiscord<Varriount> audiophile: Yes.
19:08:13audiophileuh im a bit confused
19:08:18audiophilewhat does that have to do with not needing virtualenv
19:08:35audiophileyou specify in the .nimble and just compile, that's all?
19:08:43audiophilespecify the package versions I mean
19:08:52Zevvwhat's "phi nodes"?
19:09:07FromDiscord<Varriount> audiophile: One of the problems I've faced is that virtualenv is required when you want to install multiple Python applications on a system, because the applications might have conflicting requirements.
19:09:15*aEverr quit (Read error: Connection reset by peer)
19:09:23audiophileohhh i see what you mean
19:09:31audiophileit all goes away with statically compiled bins right?
19:10:06FromDiscord<Varriount> Well, yes. You can still have problems with DLLs, but various operating systems have that mostly sorted out.
19:11:01FromDiscord<Varriount> Windows says "just bundle your required DLLs with your application", Linux says "version your DLLs by name"... I don't know exactly what OSX does, but it seems to work too.
19:11:17audiophileoh I see
19:11:26audiophilea lot of headache avoided nicely in nim
19:11:39audiophileis this messy situation common with interpreted langs?
19:12:17FromDiscord<Varriount> Javascript seems to have it sorted out, but then again, it essentially creates a virtual environment by default.
19:12:39supakeenJavascript package managers create an environment by default, Python is working on that bit as well.
19:12:58Zevvbut there's always the problem of package A depending on B and C, where B and C both depend on different versions of package D
19:14:08FromDiscord<Varriount> Zevv: Yeah, but that's hard to support unless you have some sort of object-oriented module system, where versions of the same module can coexist.
19:14:47FromDiscord<Varriount> I guess C/C++ technically allow that with DLLs? You tend to get odd behavior though.
19:14:50krux02Varriount: hey
19:14:58krux02@Varriount: just saw your message
19:15:00*natrys quit (Quit: natrys)
19:15:01krux02what's up?
19:15:22*someunknownuser joined #nim
19:15:35FromDiscord<Varriount> krux02: Nothing much, just interested to see what you're working on.
19:16:07krux02currently, I am trying to figure out a healthy way to continue Nim development.
19:17:33FromDiscord<Varriount> krux02: You can always fork the compiler. Or work on a library.
19:17:57krux02yes I can do that.
19:18:14FromDiscord<Varriount> For what it's worth, I agree with Araq on the `emit` stuff. And nothing says those functions can't be in a nimble package.
19:18:39krux02I don't really care too much about emit.
19:18:58krux02It should be improved, but it is not high on the list of priorities.
19:20:09companion_cubemaybe an alternative compiler would be a healthy way of continuing nim development?
19:22:08krux02maybe yes, an alternative Nim compiler would be good.
19:22:33krux02But I can't maintain a fork of Nim.
19:22:53krux02Not alone.
19:23:22FromDiscord<Recruit_main707> if someone does this, either a more pure nim to c transpiler or an actual nim -> exe compiler
19:23:41krux02I am thinking of a more pure Nim
19:23:47krux02no surprise features
19:23:48FromDiscord<Varriount> @Recruit_main707 See NLVM https://github.com/arnetheduck/nlvm
19:24:08FromDiscord<Recruit_main707> linux only to my known :(
19:24:21companion_cubea smaller nim means a smaller compiler, right? :)
19:24:27krux02I am on Linux as well, I don't even have windows.
19:24:39krux02a smaller Nim means less bugs.
19:24:51FromDiscord<Varriount> I have Windows... or will have, once my personal computer is fixed.
19:25:17krux02you want to help me build a fork of Nim?
19:26:04companion_cubeoh boy, wish I had the time
19:27:18Araqdo you want me to say anything?
19:27:28FromDiscord<Varriount> krux02: Well, what kind of help/support are you looking for?
19:29:38someunknownuserkrux02: What exactly do you mean by "no surprise features"?
19:29:41leorize[m]krux02: are you planning to create an another implementation of Nim?
19:30:32leorize[m]or are you gonna take the current compiler and trim it down?
19:32:24FromGitter<sheerluck> You know what is hard? To come up with a good name for a fork of Nim. Jennifer is a good name.
19:32:31Araqfwiw I can give you many guideliens for a trimmed down Nim...
19:32:36Araq*guidelines
19:34:27dadadafor what it's worth, I think there are still a lot of gaps in Nim functionality, so a smaller Nim is definitely not the direction that I'd be heading to, although the motivation that krux02 has, of producing something by higher quality by concentrating on the core of it, is awesome, I believe there's a much better path by growing Nim and its community, and therefore bringing new devs into the fold who can
19:34:33dadadamaintain different parts of it, increase the number of hands/eyes, and I don't think Nim should become like LUA, it's a multi-purpose programming-language, not something geared to a niche, and therefore it offering many tools for different kinds of programmers and tasks makes sense, of course not all of it has to reside inside Nim itself, I'm working on a kind of Nim extension package myself (in an early
19:34:39dadadastate, nothing that I want to show off at this time), and when I release this I'd of course welcome others to contribute, but it'd also be great for Nim to pick up more features, because in the end we have to compete with Java/Python-world, who are used to getting a lot of batteries included
19:35:03FromGitter<sheerluck> Brunhilda is a good name too.
19:35:24Araqbut I'm the scapegoat so I doubt you want my input, krux02
19:37:41Araqmy trimmed down version of Nim is called 'Nox', 'Nox' because it's what Araq works on at night. Nah, I'm kidding. I like the name though.
19:38:41companion_cubecould be called 'trim'
19:38:43krux02Varriount: If I actually do a Nim fork, there should be a homepage for it.
19:39:04krux02leorize[m], I am thinking of trimming down Nim.
19:39:26companion_cubemaybe with the same compiler and a -betterC flag!
19:39:29companion_cubeah wait, that's D.
19:39:48zacharycarterI don't really understand the motivation - aren't extra features hidden behind feature flags anyway?
19:39:55FromGitter<sheerluck> Why are you always tend to choose short names for programming languages? Ekaterina is a good name too by the way.
19:40:09krux02zacharycarter, nope
19:40:13leorize[m]I'd personally welcome an alternative implementation more
19:40:43zacharycarterI think Nim has grown larger and more complex because it's tackling larger and more complex problems
19:40:46krux02extra featuruse sprinkled around the codebase as gunk that nobody needs, but hinders bug fixes.
19:41:10zacharycarterwouldn't a simpler nim be a nim that's less usable in certain situations?
19:41:18krux02no
19:41:43krux02The feautures that I want to remove are probably feautures that you never even heared about.
19:41:55zacharycarterI guess so
19:42:03Araqwhich ones would that be?
19:42:06zacharycarterI'm definitely not very much into language design
19:42:06companion_cubekrux02: a list would be interesting
19:42:36krux02I don't have a list ready, but I will produce one.
19:42:44companion_cubethat'd be nice
19:43:24Araq.liftLocals
19:43:56krux02Things that I would adress that bothered me since the beginning is proper editor integration that works 100% reliable.
19:44:08krux02No more false error messages because a fil is included.
19:44:17FromDiscord<Varriount> fil?
19:44:23FromDiscord<Varriount> Oh, file
19:44:26krux02file yes
19:44:27krux02sorry
19:44:32dadadakrux02: to say that nobody needs them is hyperbole by definition, (if nobody needed them, the feature would not have been added), I used SCF today, they were also heavily used in Nim in Action (for templates), there are clearly some people that need features that you don't need, I've seen this kind of hyperbole from you a couple of times, and it neither helps your arguments (makes you look weaker in my view),
19:44:38dadadanor does it help you, when you railed against a certain person it looked like the same to me, and nevertheless I truly value your contributions in this channel and to Nim, because you're an awesome dev without a doubt!
19:44:58Prestigekrux02: what do you mean about the editor? I haven't run into that issue (yet?)
19:45:00krux02thanks
19:45:16Araqhe means that 'nim check' works as documented and that editors misuse it
19:45:19FromDiscord<Varriount> Prestige: You will if you've ever worked in a project that uses the `include` statement.
19:45:28Araqand it's of course Nim's fault. been there, discussed that.
19:46:12krux02Araq: yes, we discussed it. You are in denial that there is a problem. Therefore I could never fix it.
19:46:15AraqI don't mind changing 'nim check' though but the PR would likely contain random crap and it's my fault I won't merge it
19:46:40krux02no the problem is deeper.
19:46:43Araqah I'm in denial again.
19:47:06krux02yes.
19:47:23dadadacomedy and tragedy are very closely related!
19:47:38PrestigeHmm idk if I'll run into that issue since my editor just uses the lsp
19:47:44krux02I gave up on convincing you that there is a problem.
19:47:48FromDiscord<Recruit_main707> tragedy is comedy without the punchline
19:47:51krux02Can only be addressed in a fork.
19:48:33krux02I would also redo the command line interface.
19:49:07krux02``nim c`` what does c stand for? compile. Ok, then ``nim cpp`` what does cpp stand for?
19:49:27FromDiscord<Recruit_main707> c++?
19:49:37companion_cubecompile plus plus
19:49:37krux02yes
19:49:40FromDiscord<Recruit_main707> https://tenor.com/view/nickyoung-questionmarks-what-excuseme-huh-gif-4486363
19:49:46FromDiscord<Varriount> krux02: I could certainly help with that.
19:50:43PrestigeMaybe just update the help output but it seems fine
19:51:09AraqPrestige: his editor doesn't use the LSP though and it's Nim's fault once again.
19:51:13krux02I would change the command line interface to probably just `nim myfile.nim`
19:52:00PrestigeAraq: stop writing these bad editors /s
19:52:19FromDiscord<Varriount> krux02: How would the various commands (check, etc) be represented?
19:52:27dadadatalking about editors, has anyone here seen moe, which is a vim-like editor written in Nim? it looks like it's of to a good start?
19:52:30dadada!
19:52:53PrestigeLooks decent but I can't get away from vim
19:52:54FromDiscord<Recruit_main707> but its abandoned right?
19:52:59dadadasince it's written in Nim, you can assume that it's Nim support will be awesome
19:53:09dadadaRecruit_main707: no, very active on github
19:53:15krux02Varriount: not sure yet
19:53:22FromDiscord<Recruit_main707> oh really? does it work on windows?
19:53:28dadadaPrestige: it has vim keybindings, and plans to support mor vim features
19:53:33dadadamore
19:53:46krux02but this `c` mean `compile` but it kinda also means `C` as in the language, I really hate it.
19:54:05krux02same with `cstring`
19:54:06PrestigeI mean I have vim working with nim already
19:54:11krux02meaning string from C.
19:54:17dadadakrux02: I'd appreciate a git-style command based interface, they're relatively easy to intuit about
19:54:31krux02But then it is also in javascript, and it is also called `cstring`
19:54:39Prestigekrux02: I thought it was just the compile target, not actually meaning "compile"
19:54:59FromDiscord<Recruit_main707> krux02: would you prefer jsstring?
19:55:06krux02yes
19:55:33FromDiscord<Recruit_main707> lol, no, something else to worry about and not necesary imo
19:55:51leorizecstring is officially called "compatible string" lol
19:56:05PrestigeI suppose you could just submit a pr for the cli if you wanted? But it doesn't seem very necessary (even though the cli doesn't follow common argument conventions)
19:56:07FromDiscord<Recruit_main707> gotcha there
19:56:17krux02leorize, yes exactly
19:56:20leorizewhich makes zero sense tbf :p
19:56:38krux02but cint and clong is compatible int and compatible long?
19:56:51leorizePrestige: the way nim cli work is ingrained into the compiler itself
19:57:25Araqsure, "compatible with C" in this case, but *shrug*, this is not even nitpicking, it's trolling
19:57:29PrestigeInteresting. I think it's fine how it is
19:57:38FromGitter<sheerluck> while I was listening to your debate, it occurred to me for the first time how hard it is to create programming languages
19:57:47leorizeI'm not a huge fan of the nim cli either
19:58:04leorizebut I gotta create some good cli first before I can give ppl advise :p
19:58:42PrestigeCan just follow normal cli conventions, like -c, --compile would both be the same thing
19:58:47PrestigeBut it's like
19:58:48dadadaall I want is for disruptek to stream, so I can hear his music, pretend to listen to him, and then I'll be in the mood to do some programming
19:58:53PrestigeIt's working so who cares really
20:00:54shashlickkrux02: just so that i can understand, don't you think you are bundling your experience with the compiler codebase with the end user experience?
20:00:55PrestigeAraq: you have any thoughts on zig?
20:02:38leorize[m]Prestige: good cli go a long way. gcc thought so until clang forces them to up their game
20:02:49PrestigeFair enough
20:03:19AraqPrestige: no, I don't see the point. Just use Rust with unsafe blocks if you don't mind verbosity.
20:03:21dadadain the mood for promoting this: https://github.com/fox0430/moe there's this feature: Written in Nim ... I might join that project, too
20:04:12*naught-fowl joined #nim
20:04:25PMunchPrestige, sweet!
20:05:03PrestigeIt was only like 2 lines but I thought I'd save you the trouble
20:06:00Prestigedadada: looks interesting, if they add plugin support I'd actually check it out
20:06:51someunknownuserI also wrote my own editor in nim for editing nim code (See https://github.com/pseudo-random/editor).
20:07:46dadadaAraq: I see one point in Zig, and I think it's actually a really big one, there're tons of old yet still important projects written in pure C, and Zig is one of very few languages, that make it relatively easy to convert a C project to a somewhat more modern language, if there's ever somebody at the helm of the Linux kernel who wants can admit that Linux would never be written in C today, Zig would be one of
20:07:52dadadathe most realistic and least painful paths of transition.
20:08:22Araqmaybe. because Linus officially hates C++
20:08:44PrestigeNice someunknownuser :) you should add some gifts/screenshots imo, world be cool to see it in action
20:09:37PrestigeI heard a lot of people discussing rust for kernel development but it isn't quite there yet
20:09:38companion_cubeZIg goes a bit further than rust in its handling of allocators
20:09:44companion_cubeno global allocator is unusual
20:09:51someunknownuserPrestige: Thanks, I am planning on doing that at some point in the future.
20:10:21dadadaAraq: Linus did say that he thinks C++ is fine for creating desktop apps, I believe he even wrote his scoopadiver desktop app in C++. So hate is the wrong word, or he definitely wouldn't have done that. I think it'd be many times harder to convert a C project to a C++ one, than to a Zig project.
20:10:29*disruptek quit (Read error: Connection reset by peer)
20:11:04Araqand why do you think that? it makes no sense.
20:11:14*disbot quit (Ping timeout: 240 seconds)
20:11:22*disbot_ joined #nim
20:11:23Araqrename the .c file to .cpp and add some casts for the different void* handling.
20:12:02Araqit's harder when you used many C99 features but what's the point anyway, they think C99 is fine and are willing to stick with it until forever.
20:12:24*disruptek joined #nim
20:12:39Araqit's also not going anywhere, it's fine. I'll simply use RustOS when it's ready and won't look back ;-)
20:13:08companion_cubeyou mean https://www.redox-os.org/? :)
20:13:22Araqyeah
20:13:23PrestigeNimos when?
20:13:35FromDiscord<arnetheduck> @Araq help me with https://github.com/arnetheduck/nbindgen then 😉
20:13:41companion_cubethere's also serenityOS which is pretty cool
20:15:52dadadaAraq: I have converted C code to CPP code, and to convert it to idiomatic CPP is many times harder than you just described, there are subtle differences between C/C++ than can bite you (and I'm thankful that I didn't have to deal with that crap for a long time), Zig goes a long way to make sure such crap is avoided, of course you can compile a lot of C code in CPP, but that doesn't make it CPP code, when you
20:15:58dadadastart to incorporate CPP idioms it can get really hairy, and now think about a code base with millions of lines like the Linux kernel, C -> CPP can never happen there realistically now (while it might have been possible in the early 90s), but Zig makes a point of allowing for smooth transition from the beginning to the end, and that's why I think it could work, and it still would be a giant project
20:16:05dadadas/than can/that can
20:16:39Araqwhy does it have to be "idiomatic C++"?
20:17:19Araqyou can write the new code in more idiomatic C++, you don't have to convert the other trillion of lines
20:17:21PMunchPrestige, those are the hardest to do, because of the overhead
20:18:14dadadaAraq: have you looked at Linux kernel code? Just curious, don't want to troll you or anything?
20:18:14Araqbut ok, so go use Zig instead for that, I don't care. I personally think that not even C is good for kernel development when you restrict your stack size to 8KB
20:19:29dadadaAraq: I'm not going to use Zig for anything, I'm currently deep in the Nim trenches. relax!
20:19:40PMunchAnd Prestige, I think dom96 made a POC OS in Nim
20:19:47PMunchNot sure if it still compiles though
20:19:51AraqC makes stack allocation the easiest way to do allocations so you're fighting the language all the time and cannot use 3rd party code. In C++ you can use refcouting for the heap allocations
20:20:14PrestigeInteresting - I don't think I'll ever get into anything so deeply involved though
20:20:27tanehow do stack allocations make anyone fight the language?
20:22:09dadadaAraq: the Linux kernel guys have implemented their own in-kernel library for pretty much everything, I'm positive they have their own library for refcounting heap allocations, the Linux kernel code is its own world, they even use special GCC extensions that are made for specifically for the Linux kernel, which add features, so they're not even using pure C, they use C+FeaturesNeededForLinux
20:23:41dadadas/guys/guys and gals/
20:24:02*Trustable quit (Remote host closed the connection)
20:25:23companion_cubes/guys/y'all/
20:25:24Araqdadada: I know.
20:25:25companion_cubedon't thank me
20:25:48FromGitter<sheerluck> I thought in English the gals are included in the guys so you never have to s/guys/guys and gals/
20:25:50dadadacompanion_cube: I don't thank you!
20:26:37liblq-devhmm, I'm getting a segfault at popFrame() somewhere in the stacktrace system
20:26:39liblq-devno clue why
20:26:43leorize[m]depends on what english you're using I guess :P
20:26:47dadadasheerluck: yes, but I want to please the thought police
20:27:14leorize[m]liblq-dev: now that definitely doesn't sound good
20:27:14FromGitter<sheerluck> leorize dadada how about I fork English language?
20:27:30liblq-devleorize: it's probably something because I'm interfacing with C
20:27:38liblq-devworst thing is, it's not my library
20:27:47dadadasheerluck: there are already hundreds of forks of English
20:27:47liblq-devso I have to debug someone else's code.
20:27:56leorize[m]should affect too much, I think
20:28:02Prestigesheerluck: in the USA you can say "guys" to mean the immediate group of people you're talking about, which is genderless
20:28:04leorize[m]what are you using?
20:29:15companion_cubePrestige: y'all is just better 🤷
20:29:42PrestigeIf you're from Texas ;P
20:30:02companion_cubewell I lived in Texas, and it's clearly a good invention of theirs
20:30:16companion_cubeall y'all dunnow what y'all are missin
20:30:36disruptekin philly it's you's.
20:30:37dadadaPrestige: well, I had instances in my life where woman complained that I didn't address them, even though my intention was to address them, and I used a word much like guys to do it, which I thought to be applicable to all, but some people can make a point of being offended for no reason, so I play this game now of making a point of addressing the female gender, although I know precisely that all reasonable
20:30:43dadadapeople should feel included anyways and assume that I'm a well-meaning person
20:30:54*abm quit (Quit: Leaving)
20:30:56PMunchsheerluck, great idea, let's fork it clean up the cruft, add some nice features and call it English++
20:31:24Prestigedadada: I've been in that situation, I guess I just don't care enough to change my speech
20:31:37liblq-devhm, --gc:arc still segfaults but I get a way different result
20:31:57leorize[m]then maybe we need to see your code :p
20:32:01disruptekleorize: i had to actually abandon the radeon card. it turns out that there's no updated bios for the version i have. so i'm returning it for another.
20:32:21disruptek!repo nimph
20:32:22disbot_https://github.com/disruptek/nimph -- 9nimph: 11Nim package hierarchy manager from the future 🧚 15 59⭐ 4🍴 7& 1 more...
20:32:28*disruptek cheers.
20:32:35leorize[m]disruptek: that's sad then
20:33:01dadadaPrestige: I do it in a playful way, there's no significant change under the hood, for me all genders are the same, the only thing that matters is, do you write good code? :-)
20:33:01*narimiran quit (Ping timeout: 256 seconds)
20:33:11disrupteknope.
20:33:27dadadaPrestige: and it should be FOSS code
20:33:44FromGitter<sheerluck> In my fork of English I will 1) remove all articles A AN THE bc we russians don't remember them 2) add suffixes to nouns so you can tell male/female apart // like ship is female in english which is ridiculous
20:33:50Prestigelove me some foss
20:34:41PrestigeThe whole 'ship' being female thing is some weird sailor shit I think
20:35:14leorize[m]I definitely don't know enough english for this conversation
20:35:27dadadasheerluck: 2) is a big mistake, not having this is one of the best assets of the English language IMO
20:35:49dadadasheerluck: I'm not going that fork :D
20:36:06supakeenCan I submit a fork to this English PR to replace -ed with -t.
20:36:10PrestigeI wish we had a genderless shared version of he/she like we do in Farsi
20:36:26supakeenSo we can write walkt and burnt and learnt and talkt and it'll be consistent?
20:36:31PMunchsupakeen, poor people named Ted will now just be known as Tt
20:36:38supakeenHehe poor Ted.
20:36:39FromGitter<sheerluck> )))))
20:36:39Prestigelmao
20:36:40PMunchPrestige, they?
20:37:01PMunchsupakeen, oh yeah that'd be nice
20:37:04Prestigesounds weird to me, but what if you're telling a story with a male and female in the same sentence?
20:37:19PMunchWhat do you mean?
20:37:24Prestigemy brain keeps mixing up he and she when I say sentences like that
20:37:32supakeenThey is the common form used for ungendered stuff but it's not very common especially for non native speakers.
20:37:37Prestige"He told her that he did x and she said to him...."
20:37:42supakeenWhere it might map onto something that doesn't exist at all.
20:38:00PMunchPrestige, ah right
20:38:16dadadasupakeen: the endings usually sound more like ed than t, so I'd vote for the opposit, drop t, and take ed everytime, as that also looks nicer IMO
20:38:19PMunchThat sentence would just be massively confusing without the genders though
20:38:41PMunchXe told xe that xe did x and xe said to xe....
20:38:53PMunchThat's just completely unreadable :P
20:38:59supakeendadada: Fine, I'll fight you.
20:39:00supakeen;)
20:39:12PMunchTwo forks, the most stars wins!
20:39:22PMunchBut I'm off to bed now, ttyl
20:39:23*PMunch quit (Quit: leaving)
20:40:18Xehi
20:40:21Xeoh
20:40:39Prestigeo/
20:41:15*ryan_ quit (Ping timeout: 250 seconds)
20:43:12PrestigeIs nimph the common way to manage nim packages for repos? I need to figure out how deps are set up for builing packages
20:44:16disruptekit's the only sane way to handle arbitrary local/global dependency relationships, but it's not the common way.
20:44:26disruptekmost people use nimble alone.
20:44:45disruptekwe call those people, "throwbacks."
20:46:45*solitudesf is now known as throwback
20:46:54*disruptek snickers.
20:48:49*dadada mars
20:51:26supakeendid you know that what we call mars in eu is actually milky way in the usa and our milky way is called something something musketeers or something?
20:51:39supakeenanyways if you get a milky way in the us it's our mars
20:52:51*Ven`` quit (Quit: Textual IRC Client: www.textualapp.com)
20:53:13Prestigedadada: I lol'd
20:54:21FromGitter<sheerluck> supakeen speaking of musketeers -- did you know that Marsha was a name of some bitch that killed d'Artagnan in "Django Unchained (2012)"
20:55:18dadadaPrestige: wanted to see if somebody could go lower than me, apparently nobody can
20:55:27FromGitter<sheerluck> And I spent 2 hours wondering is that "Marsha" is close to russian name "Masha" or is it just coincidence
20:55:49supakeen@sheerluck: the dogs?
20:55:55FromGitter<sheerluck> yes
20:56:25dadadaenough with this silly chit chat, I've some hacking to do
20:56:47supakeen@sheerluck: I think Marsha was just a normal Egnlish name in the 50s or so when Marcy was popular as well
20:56:48*sagax quit (Remote host closed the connection)
20:57:04supakeenMasha in Russian is Maria in English isn't it?
20:57:12FromGitter<sheerluck> yes
20:57:25disruptekudev renaming eth ifaces according to hardware address is stupid.
20:57:44supakeen@sheerluck: Do you spell it wit that 'w' letter?
20:57:48supakeen(for sh)
20:58:00FromGitter<sheerluck> yes
20:58:01leorizeI find it kinda useful
20:58:13supakeenNice :)
20:58:38disruptekhuge pita when the hardware happens to change.
20:58:50disrupteki'm just renaming them manually now, eg. san0, wan1, etc.
20:58:55supakeenAnyways, if Masha = Maria, Marsha != Maria so I don't think the names are related!
20:59:38naught-fowlhowdy nimbos
21:02:21Araqnaught-fowl: is it you? fowl?
21:04:18disrupteknaught.
21:04:27disruptekAraq: whassup boss
21:04:54Araqdisruptek: waiting for your PR
21:05:27disrupteki know, i will work on it tonight. but, y'know, i think it's too much work to break out just the little refactor.
21:09:06Araqwell try it for one hour please
21:09:20Araqafter that, throw in the towel and tell me "dude, impossible!"
21:10:26disruptekthe whole file changed. i may as well just finish the refactor and push just that one file's changes.
21:11:18disruptekdon't worry; we're not going to lose this work product. it's on gh, fwiw.
21:11:37dadadainstalled moe with nimble install moe
21:11:42dadadaand get this: could not load: libncursesw.so
21:12:19dadadahmm, I thought that nimble takes care of such things... this is the first time something like that happened to me
21:12:34dadadawith nimble I mean, usually if you can nimble it, it'll work
21:12:36leorize[m]libncursesw.so is a system library
21:12:39disruptekyou sweet, summer child.
21:12:41Araqdisruptek: is it? which branch?
21:12:45leorize[m]nimble won't be able to deal with it :P
21:12:46disruptekic2
21:12:54leorize[m]what distro are you using?
21:12:56dadadaleorize[m]: yeah, I know that
21:13:06dadadaleorize[m]: fedora 31
21:13:16*xet7 joined #nim
21:13:16Araqgah this SSA stuff is so hard, maybe I should stream about it
21:13:23Araqforces me to focus when I stream...
21:13:23disruptekssa?
21:13:34Araq"static single assignment" form
21:14:12leorize[m]dadada: try installing ncurses-devel?
21:14:29dadadaleorize[m]: already installed
21:14:30leorize[m]I'm not sure what's the name for the development package there
21:14:57leorize[m]`/lib` and/or `/usr/lib` have no libncursesw.so?
21:16:01dadadaleorize[m]: they do, but there's a version number coming after .so, that's probably the issue here
21:16:25leorize[m]that means you haven't got the development package installed :P
21:17:04dadadaleorize[m]: I do have them installed, dnf install ncurses-devel
21:17:10dadadaPackage ncurses-devel-6.1-12.20190803.fc31.x86_64 is already installed.
21:17:36leorize[m]or fedora is weird
21:17:44dadada/lib/libncursesw.so.6 -> libncursesw.so.6.1
21:17:51dadadathere's no /lib/libncursesw.so
21:18:17leorize[m]usually development packages will have a `lib.so` (w/o version) for developers to link with `-llibname`
21:18:20disruptekjust make a link and move on with your life.
21:18:45FromGitter<sheerluck> dadada /usr/lib/libncursesw.so ?
21:18:54dadadaleorize[m]: I assume they want to make sure that no package compiled against an older ncurses can accidently use the newer library?!
21:19:36leorize[m]once linked the library will be referred to by its soname
21:19:43dadadalib is a symlink to /usr/lib in fedora, so there's no difference shee
21:19:45dadadasheerluck
21:19:47disrupteki'm sure that's it. those well-intentioned fedoralists.
21:19:57leorize[m]in your case `libncurses.so.6`, but linkers can only find `libncurses.so`
21:22:25dom96alehander92: reviewed your diff
21:24:13dadadaleorize[m]: created the link, moe still complains about the same thing.., hmm
21:24:24dadadacould not load: libncursesw.so
21:24:31leorize[m]where did you put the link? :p
21:24:38dadadamaybe there's simply another incompatibility
21:24:44dadadaleorize[m]: inside /usr/lib/
21:25:12leorize[m]have you verified that the link points to the right place?
21:25:34*lritter joined #nim
21:27:27*throwback quit (Ping timeout: 260 seconds)
21:28:35dadadaleorize[m]: here's what strace output looks like for moe https://pastebin.com/iUeg3xH7
21:28:48dadadaas you can see it tries to open the lib from different places
21:29:10dadadaI've verified that /lib64/libncursesw.so exist
21:29:12dadadaexists
21:32:46leorize[m]dadada: lol I see the problem now
21:32:57leorize[m]your `libncursesw.so` is a linker script :p
21:34:08dadadayeah, does look like it
21:34:13leorize[m]looks like you gotta build moe with some special flags
21:35:42leorize[m]`nimble build --dynlibOverride:ncurses --passL:-lncursesw` <- that's how it should be built for you
21:36:01leorize[m]alternatively fix this so that it uses a search regex :P https://github.com/walkre-niboshi/nim-ncurses/blob/master/ncurses.nim#L7
21:39:20dadadaleorize[m]: I wonder why the thing looks in lib64, but not lib
21:39:45leorize[m]because that's what fedora configured it's glibc to do
21:40:46dadadaI'll see what #fedora has to say
21:41:29leorize[m]they will tell you that you gotta link it instead of `dlopen` like so :P
21:42:42*Vladar quit (Quit: Leaving)
21:44:14dadadacan someone verify that nimble install moe works in other distributions?
21:44:50leorize[m]definitely not mine
21:44:52*dadada sneeky way of promoting moe
21:44:54leorize[m]got a linker script too
21:45:03dadadawhich distro?
21:45:09leorize[m]gentoo
21:46:58leorize[m]actually, maybe it could work
21:46:58leorize[m]wait
21:47:04dadadahttps://github.com/fox0430/moe/issues/508
21:47:05disbot_Unable to locate installed libncursesw.so
21:48:12leorize[m]lol the linked PR remains unmerged to this day
21:48:23leorize[m]yep moe doesn't work here
21:48:48dadadadon't like that he closed the issue becaue a symbol link worked, there must be a better solution than to require your users to find a closed issue and then create symbolic link
21:49:01dadadas/he/he or she
21:49:25*inv2004 joined #nim
21:50:29dadadaI think moe shouldn't even be based on ncurses, we need a pure Nim library for such stuff, if I'm not mistaken clybber was working on something like that
21:50:56inv2004Hello, another hour - another question: I have c-func: S myF(S) {S->arr} , but in C code I use myF(S)[10] , how can I do the same within nim with array within my C-structure ?
21:53:22Araqarray[10, S]
21:55:19*sagax joined #nim
21:55:52inv2004thx
22:02:37dadadathis is related https://github.com/nim-lang/Nim/issues/987
22:02:57dadadaand this also https://github.com/rnowley/nim-ncurses/issues/15
22:02:58disbot_Problem with using 'libncursesw.so' (Linux)
22:03:22dadadaseems like Linux users are getting a worse experience than Windows/Mac users in this case
22:04:07*dadada wonders if Nim/Nimble works in wine
22:06:29*endragor joined #nim
22:07:20dadadathis leads me to asking, what do we do about wrappers that aren't well maintained, but a lot of projects rely on, there's a pull request for the ncurses wrapper that probably fixes this, but the maintainer apparently has no time for it, yet ncurses is still a popular API for the CLI
22:10:44FromGitter<alehander92> @dom96 thank you
22:10:52FromGitter<alehander92> i'll look at this after a few days, sorry guys
22:10:55FromGitter<alehander92> Easter vacation
22:10:57FromGitter<alehander92> for us here
22:11:51dadadaI'd rather trust a well done tool like nimterop to provide wrappers on the fly than a random guy to maintain a wrapper by hand and to care about his users years down the line
22:15:11ZoomZoomZoomI'm reading the --gc:arc announcement thread and I wanted to say that I'm pleasantly impressed with Araq's handling of questions. Short but exhaustive and to the point!
22:15:17ZoomZoomZoomGreat work
22:15:32Araqthanks
22:15:44Araqdevelopment is on-going
22:15:47dadadaZoomZoomZoom: where?
22:15:56ZoomZoomZoomhttps://forum.nim-lang.org/t/5734
22:17:08Araqthis is outdated btw
22:17:16Araqsink inference is in 1.2
22:17:28Araqas is the new exception handling implementation
22:17:33ZoomZoomZoomI'm at the stage of emerging into the ecosystem
22:17:57ZoomZoomZoomSo trying to suck in the info with some historical perspective :)
22:18:56ZoomZoomZoomWhere to read next?
22:19:18AraqZoomZoomZoom: watched my video about it?
22:19:25ZoomZoomZoomNot yet, will do
22:19:26*tane quit (Quit: Leaving)
22:19:37Araqit's outdated too but was done later :P
22:20:01Araqdadada: I like hand written wrappers but regardless, I think the solution is to fork the package
22:20:11Araqhappens all the time
22:20:13*nande joined #nim
22:20:20ZoomZoomZoomOk. I'm pondering over using nim for audio, so arc is what came up first.
22:21:35*inv2004 quit (Quit: Leaving)
22:24:26*arecaceae quit (Remote host closed the connection)
22:24:50*arecaceae joined #nim
22:25:48AraqZoomZoomZoom: IMHO all new development should use --gc:arc
22:27:24ZoomZoomZoomSure looks like it, but what do I know
22:28:50dadadaZoomZoomZoom: we have a commonality
22:31:44*inv2004 joined #nim
22:32:05dadadaZoomZoomZoom: 3x da 3x Zoom
22:32:33ZoomZoomZoomnice catch
22:33:02*someunknownuser quit (Quit: someunknownuser)
22:33:32liblq-devis it possible to specify a git repository URL in nimble requires()?
22:33:37ZoomZoomZoomAlthough, I'm mostly go by ZoomZoomZoom/3
22:34:14Araqliblq-dev: yeah, iirc you simply write down the URL
22:36:54shashlickhere's a nimterop curses wrapper if anyone needs it - http://ix.io/2ila/nim
22:37:03*nande quit (Remote host closed the connection)
22:38:19shashlickhttp://ix.io/2ilb/nim is the output on Linux
22:38:31ZoomZoomZoomWait, I've seen the video from FOSDEM already. Oh, boy...
22:39:54zacharycarterI want to emit `__attribute__((used, section("__DATA,__state")))` in my C code before a function definition - is this possible?
22:40:59zacharycarterI was thinking of trying to use a template as a pragma to do this - but I'm not sure how to make it prefix the function definition
22:41:31zacharycarterah nevermind I Found examples of this
22:43:33leorize[m]I'm not a fan of `codegenDecl`, but it works for this kind of things
22:43:49zacharycarteryeah - that's what the example I found was using
22:47:19dadadashashlick: thanks, is there a central place for all nimterop wrapper generator files? would be useful to stop people from reinventing the wheel
22:48:19ZoomZoomZoomBTW, is "Nim in Action" a recommended read, or considered outdated?
22:49:29dadadaZoomZoomZoom: still good, go read it, I recommend this blog post to new Nim people https://totallywearingpants.com/posts/nim-language-highlights/
22:50:06ZoomZoomZoomThx
22:52:20leorize[m]dadada: https://github.com/nimterop/nimterop/wiki/Wrappers
22:53:21FromDiscord<KingDarBoja> Hi 😄
22:54:55shashlickThere is a wrappers repo but I haven't had time to get it up and running
22:55:10shashlickRight now I maintain them in individual repos
22:55:19shashlickNimarchive and nimgit2
22:55:55FromDiscord<Recruit_main707> Has someone tried using c2nim/nimterop to wrap a Python.h?
22:56:31dadadashashlick: putting all in one repo would have the advantage that no individual wrapper would have to rely on the original maintainer of that wrapper, the wrapper repo could have multiple maintainers, and someone should always be around to accept pull requests
22:56:55leorizeAraq: is there a proper way for --gc:arc and cycles to live together?
22:57:17leorizeor is --gc:arc capable of warning me about potential cycles?
22:58:32AraqRecruit_main707: there is a python.nim somewhere
22:58:55shashlickhttps://github.com/nimterop/wrappers
22:59:04Araqleorize: it can warn but it's not reliable. I'm not sure the problem has a solution beyond what 'owned' did
22:59:23FromDiscord<Recruit_main707> Araq: It didn’t work so well when I tried it
22:59:27*endragor quit (Remote host closed the connection)
23:00:19Araqwell you can either write a bug report or re-wrap it :-)
23:01:33FromDiscord<Recruit_main707> I think I actually have one...
23:01:37FromGitter<sealmove> Guys I did it :) You can already use Kaitai with Nim https://ci.kaitai.io/
23:01:45FromDiscord<Recruit_main707> Well, a github issue
23:05:47FromDiscord<KingDarBoja> What is kaitai? Sorry for my ignorance 😄
23:06:14FromDiscord<Recruit_main707> Similar to flatbuffers I think
23:06:16liblq-devI made a program for animating things https://github.com/liquid600pgm/pan
23:06:40liblq-devstill a WIP, there are a few things I'll need to sort out before I can call it done
23:06:49leorize[m]kaitai is a binary parser language
23:06:50liblq-deveg. a timeline, importing audio files
23:07:06leorize[m]it lets you parse any binary data, given the schema
23:07:28dadadawhen will arc be the default GC?
23:07:43leorize[m]once Araq solved cycles
23:07:43FromDiscord<Recruit_main707> libq-dev how about you add support for Nim?
23:07:50leorize[m]:P
23:09:04zacharycarteraren't cycles solved with --gc:orc?
23:09:36leorize[m]--gc:orc kinda ruins everything --gc:arc stands for
23:10:04zacharycarterDoes it? Couldn't --gc:orc still be used in soft realtime apps? Like games?
23:10:31zacharycarterit still gets one past the lack of a shared heap
23:10:39leorize[m]determinism is the main feature of --gc:arc
23:10:42inv2004Sorry for so simple question: cast[S](t.un.g.addr) <- it is return my S struct, but how can I extract 2nd element? .g.adde is start of the C-array of S
23:10:52leorize[m]zacharycarter: orc breaks this
23:11:13leorize[m]inv2004: `cast[ptr UncheckedArray[S]]`
23:11:42zacharycarterI get it - but I think it still allows me to make progress haha
23:11:43FromDiscord<KingDarBoja> I feel like dumb after seeing all those nim projects 😄
23:11:57FromDiscord<KingDarBoja> Pretty awesome the Lua-Nim program
23:11:59*dwdv quit (Ping timeout: 260 seconds)
23:12:07leorizeyou'll get used to it soon
23:13:08FromGitter<sealmove> what Lua-Nim program?
23:13:18leorize[m]!repo pan
23:13:19disbot_https://github.com/liquid600pgm/pan -- 9pan: 11puny animator – create motion graphics using Lua 15 0⭐ 0🍴 7& 1 more...
23:14:28FromGitter<sealmove> hmm
23:16:58inv2004@leorize[m], type mismatch: got <ptr UncheckedArray[S]> but expected 'S = ptr S:ObjectType'
23:17:20leorize[m]what are you trying to do?
23:18:16inv2004I have addr of beginning of c-array of S-struct. I want extract N-th struct from the c-array
23:18:39inv2004... of S-structs.
23:18:41liblq-dev@Recruit_main707 how about no? the Nim VM is slow and hard to work with
23:19:03liblq-devall that passing PNodes around and what not
23:19:05leorize[m]liblq-dev: or you can make it a library :P
23:19:19liblq-devI could, but then I'm losing out on fast hot code reloading.
23:19:25liblq-devdon't think I didn't consider that :P
23:19:34leorize[m]inv2004: then `ptr UncheckedArray` is what you want
23:19:55leorize[m]but I can't tell you why it's erroring out without seeing the code
23:20:18leorize[m]liblq-dev: or you could have make it do both :p
23:21:03liblq-devmaintaining two different APIs is hard. I want to have one unified API and reference.
23:21:08*vegai quit (Ping timeout: 258 seconds)
23:21:51inv2004leorize[m], my nim's type S = ptr object ... .
23:22:21inv2004because C:typedef struct s0{...} *S
23:22:32liblq-devdo you guys really hate lua so much? :P
23:22:38liblq-devit's not a bad language for fast prototyping.
23:22:43leorize[m]you're in `#nim`
23:22:52leorize[m]in `#nim`, nim is the best
23:22:52liblq-devbut pan is written in nim!
23:22:59FromDiscord<KingDarBoja> You gained a follower liblq-dev
23:23:27FromDiscord<KingDarBoja> I used LUA with Love2D cuz it was the language being used at the CS50 Videogame design course
23:23:30leorize[m]not enough, you still used the inferior lua
23:23:32FromDiscord<KingDarBoja> it is*
23:23:33FromDiscord<Recruit_main707> > in `#nim`, (and everywhere else) nim is the best
23:23:58liblq-devleorize: dude, I know. it's just that I needed something fast and didn't want to mess with long compile times
23:24:16leorize[m]i know, i was just joking around lol
23:24:19*FromDiscord <KingDarBoja> Insert chad meme here
23:24:50liblq-devikr
23:25:44liblq-devthough I would've used Nim if it compiled as fast as a lightweight VM language
23:26:43FromDiscord<Recruit_main707> compiled VM?
23:27:12FromDiscord<Recruit_main707> Either one or the other :p
23:28:21liblq-devthis is partially why I'm developing my own scripting language. to be able to enjoy an experience similar to programming in Nim while having the benefits of a VM
23:28:41liblq-devwell anyways, I'm out for now. goodnight.
23:28:43*liblq-dev quit (Quit: WeeChat 2.7.1)
23:28:49leorize[m]you could have developed an alternative Nim VM :p
23:28:53FromDiscord<KingDarBoja> https://www.slant.co/versus/395/1418/~nim_vs_lua
23:28:54leorize[m]'night
23:29:29FromDiscord<Recruit_main707> As an expython programmer, I will say vm advantages are not as much as compiled ones.
23:29:29FromDiscord<Recruit_main707> Good night
23:30:10*krux02_ joined #nim
23:30:50FromDiscord<Recruit_main707> Surely you can rerun it fast and all that, but performance men...
23:34:12*krux02 quit (Ping timeout: 256 seconds)
23:37:13lqdev[m]@Recruit_main707 negligible when you're sending expensive commands to the GPU.
23:37:20audiophilewaht is dsl/domain specific lang and why should I care? just curious
23:37:27audiophileis it dll stuff?
23:37:35lqdev[m]as long as it runs fast enough to play at 60fps, I'm happy.
23:38:13*endragor joined #nim
23:41:33FromDiscord<KingDarBoja> Didn't you went to bed?
23:41:43audiophilehello king
23:41:57FromDiscord<KingDarBoja> ❤️
23:42:06FromDiscord<KingDarBoja> Sup mate
23:42:24audiophile:D not much here working on building some C source code wbu
23:43:10FromDiscord<KingDarBoja> Nice, I am right now updating my local repo of TS-website to keep translating sections of the site
23:43:18FromDiscord<KingDarBoja> To spanish lang
23:43:21audiophileTS?
23:43:36audiophileteamspeak??
23:43:42*endragor quit (Remote host closed the connection)
23:43:54leorize[m]lqdev[m]: oh do you finally get the lqdev name?
23:44:12leorize[m]they should've done the old nick purge on the 11th
23:46:16FromGitter<sealmove> audiophile: TypeScript
23:48:24*endragor joined #nim
23:56:32FromDiscord<KingDarBoja> TypeScript
23:58:08audiophileah
23:58:19audiophilestatically typed js?
23:58:49FromDiscord<KingDarBoja> Yeap
23:59:49krux02_audiophile, it really feel like a C# ish javascript.
23:59:57FromDiscord<KingDarBoja> That's true too