00:00:23 | * | Tyresc quit (Quit: WeeChat 2.7-dev) |
00:01:04 | * | ftsf joined #nim |
00:20:10 | * | endragor joined #nim |
00:36:00 | FromDiscord | <Skaruts> doesn't nim support this: `echo "$1" % [10]` |
00:36:27 | FromGitter | <zetashift> I have no idea what that is |
00:36:28 | FromDiscord | <Skaruts> I'm getting `undeclared identifier: '%'` |
00:36:33 | Yardanico | import strutils |
00:36:39 | Yardanico | and 10 needs to be a string so use $10 |
00:36:41 | Yardanico | or just use strformat :) |
00:36:58 | Yardanico | !eval import strutils; echo "$1" % [$10] |
00:37:01 | NimBot | 10 |
00:37:13 | FromDiscord | <Skaruts> oh thanks |
00:37:26 | FromGitter | <zetashift> huh I've always used strformat's fmt and & |
00:37:29 | Yardanico | lol |
00:37:39 | Yardanico | I remember the old times when we didn't have strformat :P |
00:37:55 | Yardanico | there was strfmt but I didn't really use it, I only remember that nimbench depends on it |
00:37:57 | FromGitter | <zetashift> you're at the stage you can have nim nostalgia huh |
00:38:32 | Yardanico | well even though I don't do nim stuff that often, I've been around for like 3 years :D |
00:40:21 | FromDiscord | <Skaruts> what does !eval do? |
00:40:35 | Yardanico | executes nim code via nim playground and shows output |
00:41:07 | Yardanico | https://github.com/nim-lang/nimbot/blob/master/src/nimbot.nim#L98 |
00:41:10 | Yardanico | !lag |
00:41:10 | NimBot | 88ms between me and the server. |
00:41:12 | Yardanico | !ping |
00:41:12 | NimBot | pong |
00:41:23 | FromDiscord | <Skaruts> 🙂 |
00:41:44 | FromDiscord | <Skaruts> !eval import strutils; echo "$1" % [$10] |
00:41:46 | NimBot | 10 |
00:41:53 | FromDiscord | <Skaruts> oh I see |
00:41:56 | FromDiscord | <Skaruts> lol |
00:42:20 | Yardanico | !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:21 | NimBot | <no output> |
00:42:56 | Yardanico | from https://forum.nim-lang.org/t/5858 if someone's wondering |
00:43:40 | FromDiscord | <Skaruts> !eval echo "I'm a nice bot!" |
00:43:42 | NimBot | I'm a nice bot! |
00:43:56 | Yardanico | It's literally same as on https://play.nim-lang.org/ :) |
00:45:21 | Prestige | I'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:06 | Yardanico | you can't get a value from an iterator like that |
00:46:09 | Yardanico | you need to use a for loop |
00:46:19 | Yardanico | like "for event in eventpoller.nextXEvent(display): stuff" |
00:47:08 | Yardanico | also "continue" on line 11 is unneccesary since you don't have any other code in a while loop anyway |
00:47:33 | Prestige | Thanks! |
00:48:10 | Prestige | was a little confused looking at the bottom of https://nim-by-example.github.io/for_iterators/ |
00:48:34 | Yardanico | the bottom example is a proc returning an iterator |
00:48:45 | * | hoffentl1chja joined #nim |
00:48:52 | Yardanico | so "let next = countTo20()" doesn't get a value from an iterator, it gets an iterator itself |
00:49:01 | Prestige | ah |
00:50:04 | Yardanico | sadly 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:38 | Prestige | Hopefully I can learn this language well enough to start contributing soon |
00:56:27 | Yardanico | well you can always start with simpler stuff like finding typos or contributing more docs :) |
00:57:09 | Prestige | I'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:06 | Yardanico | I'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:17 | Yardanico | (I'm doing it in Nim though, I don't want to touch java xD) |
01:32:27 | Yardanico | and I don't think I'll need this "metaprogramming" hack either |
01:35:53 | Yardanico | i'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:35 | Yardanico | I just checked and Nim AST uses object variants too of course |
01:36:47 | Yardanico | https://github.com/nim-lang/Nim/blob/devel/compiler/ast.nim very interesting to look at of course |
01:44:43 | shashlick | I 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:39 | Yardanico | wait I can do nested object variants? amazing |
02:14:25 | Prestige | I 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:40 | Yardanico | you mean a hash table? |
02:14:42 | Prestige | Couldn't you just invoke saveDouble(a) without calling map? |
02:14:44 | Prestige | Yeah |
02:14:46 | Yardanico | https://nim-lang.org/docs/tables.html |
02:14:48 | leorize | tables |
02:15:15 | Prestige | Thanks - my question about map is unrelated though (I realized it was a different thing) |
02:16:46 | Prestige | Don't understand what its use case would be |
02:17:05 | Yardanico | "Applies a callback function to the value of the Option, if it has one." |
02:17:20 | Yardanico | basically "do something on an Option object if it has a value" |
02:17:21 | * | ryan__ joined #nim |
02:17:42 | Yardanico | it's literally 2 lines of code, just to make your life simpler and code shorter :) |
02:17:52 | Yardanico | https://github.com/nim-lang/Nim/blob/version-1-2/lib/pure/options.nim#L239 |
02:18:08 | Yardanico | don't fear the stdlib, most of the code in stdlib is really nice and understandable |
02:18:09 | Prestige | ah 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:44 | Prestige | Would there by any performance differences/advantages to passing a pointer rather than its dereferenced value? |
02:22:15 | Yardanico | well it depends on the size of objects you operate on I guess |
02:22:20 | * | muffindrake quit (Ping timeout: 246 seconds) |
02:22:22 | Yardanico | and also if you need to modify them |
02:22:34 | leorize | it doesn't depend on the size fwiw |
02:22:47 | leorize | nim do pass by reference if obj > 3x float size |
02:22:49 | Yardanico | oh |
02:23:19 | Prestige | They're just xevents so they should just be read |
02:24:47 | * | muffindrake joined #nim |
02:32:52 | FromDiscord | <KingDarBoja> Woah, just finished reading the whole stack of messages |
02:33:00 | FromDiscord | <KingDarBoja> Too sad to know the vscode nim plugin is doomed :c |
02:33:06 | Yardanico | wdyn? |
02:33:08 | Yardanico | *wdym? |
02:33:52 | Yardanico | I mentioned that vscode nim plugin is the most "complete" one == the best |
02:34:04 | Yardanico | althoug 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:38 | FromDiscord | <KingDarBoja> I didn't saw your comment D: |
02:35:53 | Yardanico | what did you mean then? |
02:37:41 | FromDiscord | <KingDarBoja> Oh I got it wrong |
02:37:45 | FromDiscord | <KingDarBoja> It says: "VSCode's syntax highlighting is just broken in all sort of ways" |
02:37:57 | Yardanico | well it's not perfect but it works fine |
02:38:10 | Yardanico | oh I see where that was |
02:38:54 | * | hoffentlichja joined #nim |
02:39:30 | FromDiscord | <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:47 | Yardanico | well how would you want it to work instead? :P |
02:39:56 | Yardanico | use autosave maybe |
02:40:53 | FromDiscord | <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:57 | FromDiscord | <KingDarBoja> I didn't know it was the supposed behaviour 😆 |
02:41:24 | Yardanico | well vscode nim plugin doesn't "rely on another different file save" itself |
02:41:27 | Yardanico | it uses nim check for checking files |
02:41:28 | * | hoffentl1chja quit (Ping timeout: 256 seconds) |
02:41:42 | Yardanico | and "nim check" needs, well, to read the file from the disk in order to check it for errors :) |
02:42:28 | Yardanico | vscode 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:18 | FromDiscord | <KingDarBoja> So it only find errors after checking the whole file by using another file in my case? |
02:44:37 | Yardanico | well, "nim check" is just nim compiler but without the actual "compile to binary" step |
02:44:39 | FromDiscord | <KingDarBoja> Arrrgh sorry if it sounds weird, it is better if I provide some recording |
02:44:45 | Yardanico | it imports modules as the nim compiler does |
02:45:09 | Yardanico | so 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:28 | FromDiscord | <KingDarBoja> I always save the file first |
02:45:38 | FromDiscord | <KingDarBoja> The errors usually comes while writing the test file and saving it |
02:45:40 | * | bunbunbunbunny joined #nim |
02:45:52 | FromDiscord | <KingDarBoja> Like, some proc I wrote seems okay, I hit save and no errors |
02:46:38 | FromDiscord | <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:46 | FromDiscord | <KingDarBoja> Something like that is what it happens to me |
02:46:46 | Yardanico | because nim has dead code elimination :) |
02:46:51 | Yardanico | and it's always enabled |
02:47:08 | Yardanico | but it will show errors for stuff like proc anyways |
02:47:13 | Yardanico | but not for templates or macros for example |
02:47:29 | Yardanico | if 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:33 | Yardanico | that's how the language works :P |
02:48:12 | FromDiscord | <KingDarBoja> I see, well I am using proc everywhere so... |
02:48:29 | FromDiscord | <KingDarBoja> Didn't know it was the "cause" |
02:48:54 | FromDiscord | <KingDarBoja> Maybe because the languages I have use aren't statically typed and all that stuff (Python I am looking at you) |
02:49:55 | FromDiscord | <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:07 | Yardanico | oh yeah that's very old |
02:50:17 | Yardanico | vscode nim plugin doesn't properly parse .cfg and .nims files |
02:50:51 | FromDiscord | <KingDarBoja> https://github.com/pragmagic/vscode-nim/issues/107 |
02:50:55 | FromDiscord | <KingDarBoja> Yeah, closing mine right now |
02:52:57 | * | bunbunbunbunny quit (Quit: leaving) |
02:53:17 | FromDiscord | <KingDarBoja> Dang, I have lost my desire to keep coding these days due to my job lol |
02:54:23 | Yardanico | what's your job? coding? :P |
02:55:49 | FromDiscord | <KingDarBoja> Yes |
02:55:55 | FromDiscord | <KingDarBoja> "FullStack Dev" lol |
02:55:57 | Yardanico | well yeah that's understandable |
02:56:12 | FromDiscord | <KingDarBoja> But even thought one of my projects is awesome |
02:56:32 | FromDiscord | <KingDarBoja> The new one is pretty much like styling components using CSS (Tailwind) |
02:56:45 | FromDiscord | <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:05 | Yardanico | btw, 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:57 | Yardanico | i just hope we get ability to use fields of same name in object variants (if they hold the same type at least) |
03:08:03 | Yardanico | AFAIK there's a PR for that |
03:09:13 | FromDiscord | <KingDarBoja> I wished for that too |
03:10:05 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
03:11:02 | FromDiscord | <KingDarBoja> So I could get rid of this |
03:11:17 | Yardanico | dont do big pastes |
03:11:40 | FromDiscord | <KingDarBoja> https://github.com/KingDarBoja/Phosphate/blob/master/src/language/ast.nim#L194 |
03:11:51 | FromDiscord | <KingDarBoja> I know bro, calm down 😄 |
03:11:58 | Yardanico | well |
03:12:04 | Yardanico | you can do your code with object variants |
03:12:12 | Yardanico | you'll just do stuff like "boolVal: bool" |
03:12:15 | Yardanico | "floatVal: float" |
03:12:20 | Yardanico | so fields are of different names |
03:12:34 | Yardanico | also btw you can have multiple types in one "type" block, you don't need it for each type separately |
03:13:07 | Yardanico | like https://play.nim-lang.org/#ix=2ieO |
03:13:08 | FromDiscord | <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:28 | FromDiscord | <KingDarBoja> Oh, yeah, I have that on my TODO list |
03:13:48 | Yardanico | well with object variants you do a big "case" statement in your type declaration |
03:14:05 | Yardanico | and then in code which handles different token types you do stuff like "case tok.kind of Literal: do stuff with literal" etc |
03:14:15 | Yardanico | you can put that into separate procs too of course |
03:15:01 | FromDiscord | <KingDarBoja> Yeah, it was the earliest KingDarBoja when asking for that and I went into full mode inheritance 😆 |
03:15:26 | FromDiscord | <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:43 | Yardanico | you can always live without it, it just depends on how much code you'll need to change |
03:15:47 | FromDiscord | <KingDarBoja> like "value: float" for one type and ""value: int" for another |
03:16:11 | FromDiscord | <KingDarBoja> Let me check... IntValueNode |
03:16:47 | Yardanico | so you'll have a single "Node" type with a kind field (of ASTKind) |
03:17:26 | Yardanico | Just fyi - nim standard style guide prefers to write abbreviations like Www or Http for easier typing and stuff :) |
03:17:42 | Yardanico | but it's styling and nim doesn't enforce you for a single style, so you can write like you want |
03:17:51 | Yardanico | here https://nim-lang.org/docs/nep1.html |
03:17:58 | Prestige | Can someone tell me what's wrong with this? https://play.nim-lang.org/#ix=2ieQ |
03:18:10 | Prestige | Getting a type mismatch on the last line |
03:18:49 | FromDiscord | <KingDarBoja> That tip was because? |
03:18:55 | FromDiscord | <KingDarBoja> The Node names? |
03:18:57 | Yardanico | Prestige: "const" -> "var |
03:19:04 | Yardanico | "const" is compile-time only |
03:19:09 | Prestige | ah thanks |
03:19:15 | Yardanico | "let" is runtime immutable, "var" is runtime mutable |
03:19:39 | Prestige | so is there no way to declare it as let? I thought that would be okay |
03:19:42 | Yardanico | no |
03:19:55 | Yardanico | well you actually can if you use "newTable", but there's no reason to really |
03:19:59 | Yardanico | "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:23 | FromDiscord | <KingDarBoja> https://github.com/search?q=org%3Agraphql-python+parse_int&type=Code Yardanico |
03:20:27 | Prestige | ty ty |
03:20:32 | Yardanico | @KingDarBoja so? |
03:20:39 | Yardanico | I mean if it's a 1:1 port it's ok |
03:20:39 | FromDiscord | <KingDarBoja> I find the lack of code uses disturbing |
03:20:42 | FromDiscord | <KingDarBoja> LOL |
03:21:03 | FromDiscord | <KingDarBoja> Now I need to check the source of the source, the JavaScript Implementation |
03:21:12 | * | FromDiscord <KingDarBoja> I need answers |
03:21:47 | Yardanico | i'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:55 | Yardanico | https://play.nim-lang.org/#ix=2ieT |
03:22:10 | Yardanico | it would actually be less lines than Java code anyway |
03:22:22 | FromDiscord | <KingDarBoja> Seems clever |
03:22:29 | FromDiscord | <KingDarBoja> By the way Yardanicco-sensei |
03:22:40 | Yardanico | wat |
03:23:01 | FromDiscord | <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:04 | FromDiscord | <KingDarBoja> Nothing else it seems |
03:23:45 | Yardanico | well I'm just saying that in case of AST trees it's always possible to replace inheritance with object variants :) |
03:23:58 | Yardanico | nim compiler itself uses object variants for AST so ... |
03:24:02 | FromDiscord | <KingDarBoja> Nvm, I found a possible need of value name |
03:24:07 | FromDiscord | <KingDarBoja> Yeah, I know what you mean |
03:24:11 | Yardanico | I didn't say you can't keep value name |
03:24:16 | Yardanico | you can keep it |
03:25:09 | FromDiscord | <KingDarBoja> I know, but would be awesome If I could use object variants AND same property names across several kinds |
03:25:12 | FromDiscord | <KingDarBoja> Like the PR |
03:25:36 | FromDiscord | <KingDarBoja> If that get's merge, I would rewrite it for sure 😄 |
03:25:58 | FromDiscord | <KingDarBoja> But I would like to have some good example between each approach advantage and cons |
03:26:03 | FromDiscord | <KingDarBoja> pros and cons* |
03:26:32 | Yardanico | @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:06 | FromDiscord | <KingDarBoja> WAT |
03:27:09 | Yardanico | ? |
03:27:11 | FromDiscord | <KingDarBoja> https://github.com/nim-lang/RFCs/issues/19 |
03:27:18 | Yardanico | yes |
03:27:32 | Yardanico | "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:34 | FromDiscord | <KingDarBoja> Ohhhh right, they can't use different type |
03:27:37 | FromDiscord | <KingDarBoja> 🤦 |
03:28:00 | Yardanico | there's my own comment in that issue too btw |
03:28:37 | FromDiscord | <KingDarBoja> "Allowing to do this would allow much nicer type definition and usage for types (in some cases)" |
03:28:38 | FromDiscord | <KingDarBoja> Oh yes |
03:30:31 | FromDiscord | <KingDarBoja> `I mean if it's a 1:1 port it's ok` ❤️ Quote of the day |
03:43:37 | FromDiscord | <Rika> Hi |
03:43:43 | FromDiscord | <KingDarBoja> ❤️ hi |
03:44:40 | FromDiscord | <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:36 | Yardanico | use npeg |
03:48:12 | Yardanico | also i created a git repo to follow my progress for some reason https://github.com/Yardanico/nim-lox |
03:48:13 | FromDiscord | <KingDarBoja> So weird, I thought I had a note explaining the diff between object variant and type inheritance |
03:48:36 | Yardanico | @KingDarBoja object variants are just mapped to C's union types :P |
03:48:51 | Yardanico | for JS backend it's different though |
03:49:18 | FromDiscord | <Rika> yardanico i am already |
03:49:58 | FromDiscord | <KingDarBoja> So pros and cons between each approach? Just to copy into my notes? 🙈 |
03:50:11 | FromDiscord | <KingDarBoja> I have zero knowledge of C 😄 |
03:50:25 | FromDiscord | <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:49 | Yardanico | well 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:26 | Yardanico | maybe object variants are a bit faster at runtime, I'm not really sure |
03:54:26 | FromDiscord | <Rika> you cant use object variants if 2 kinds share only certain fields |
03:54:30 | FromDiscord | <KingDarBoja> Makes sense to me |
03:54:40 | Yardanico | @Rika you can, just name these fields differently |
03:54:54 | FromDiscord | <KingDarBoja> The idiomatic reasoning I mean |
03:54:56 | FromDiscord | <KingDarBoja> 😋 |
03:55:07 | FromDiscord | <Rika> defeats the purpose imo |
03:55:59 | FromDiscord | <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:20 | FromDiscord | <KingDarBoja> And use the case stmt to specify certain fields? |
03:57:07 | Prestige | Yardanico: does this look correct? Was having trouble getting it to compile (it's compiling now) https://play.nim-lang.org/#ix=2ieZ |
03:57:48 | FromDiscord | <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:49 | Prestige | Also 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:02 | Yardanico | well, 1) nim seqs nowadays are initialized by default, 2) you don't need to explicitly use "system.add" |
03:58:03 | Yardanico | hmm |
03:58:32 | Yardanico | it works for me just fine though |
03:58:38 | Prestige | well add(...) works but listenerMap[theType].add(listener) wasn't |
03:58:44 | Yardanico | it works for me too :P |
03:58:47 | Yardanico | also in nim you don't have to specify "void" return type |
03:58:50 | FromDiscord | <Rika> also `if not listenerMap.hasKey(theType):` can be `if theType notin listenerMap:` no? |
03:58:50 | Prestige | hm |
03:58:52 | Prestige | oh neat |
03:58:57 | Yardanico | https://play.nim-lang.org/#ix=2if0 |
03:59:05 | Yardanico | ah sorry you were checking for the key |
03:59:12 | Yardanico | ah actually no |
03:59:17 | Yardanico | you can remove it, yes |
03:59:37 | FromDiscord | <Rika> no i dont think you can |
03:59:56 | Yardanico | @Rika the original code was checking if a key already exists |
03:59:57 | FromDiscord | <Rika> you're adding to a key that isnt created |
04:00:01 | Yardanico | ah yeah |
04:00:06 | Yardanico | so keep it :P |
04:00:12 | FromDiscord | <Rika> lol |
04:00:42 | Yardanico | Prestige: https://play.nim-lang.org/#ix=2if2 |
04:00:43 | Prestige | ah Yardanico I was having the issue when declaring - let listeners = listenerm |
04:00:59 | Prestige | 1 sec |
04:01:11 | Yardanico | "a notin b " is just sugar over "not (a in b)" |
04:01:25 | Yardanico | and tables have "contains" proc defined so "notin" and "in" just work for them (TM) |
04:01:56 | Prestige | https://play.nim-lang.org/#ix=2if3 <- was having issues with this particular setup actually |
04:02:06 | Prestige | if I declare listeners then try listeners.add(listener) |
04:02:14 | Yardanico | yes |
04:02:23 | Yardanico | because "let" is for immutable stuff |
04:02:32 | Yardanico | and you are trying to modify an immutable variable :P |
04:02:40 | Prestige | ah I thought that was just for assignment, mb |
04:04:12 | FromDiscord | <KingDarBoja> Rika: I don't see any other use case for objects variants |
04:04:13 | Yardanico | https://narimiran.github.io/nim-basics/#_immutable_assignment |
04:04:20 | Yardanico | Prestige: ^ |
04:04:30 | Prestige | Thanks :) |
04:04:32 | Yardanico | that book generally covers most of Nim |
04:04:50 | Yardanico | well, the simpler stuff |
04:05:21 | FromDiscord | <Rika> i think object variants work best if you can make them work |
04:05:23 | Yardanico | it 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:30 | FromDiscord | <KingDarBoja> Or maybe I got your example wrong |
04:05:35 | FromDiscord | <Rika> otherwise youre stuck with inheritance i assume |
04:06:02 | * | supakeen quit (Quit: WeeChat 1.9.1) |
04:06:03 | FromDiscord | <KingDarBoja> Yeah, inheritance is way more familiar for newcomers that are used to it. |
04:06:22 | Yardanico | I wasn't really used to inheritance when I (re)discovered Nim in 2017 :P |
04:06:25 | Yardanico | I was using Python at the time |
04:06:43 | Yardanico | also I mean (re)discovering because I vaguely remember visiting (then) Nimrod's website in 2014 |
04:06:45 | FromDiscord | <KingDarBoja> Python inheritance is kinda weak |
04:06:46 | * | supakeen joined #nim |
04:06:59 | Yardanico | with old design |
04:07:00 | Yardanico | oh yesss |
04:07:02 | Yardanico | the old crown |
04:07:55 | FromDiscord | <KingDarBoja> As everything in Python is an object, You couldn't trust at all with inheriting from a base type |
04:08:23 | FromDiscord | <KingDarBoja> But object protoyping in Javascript is way weird IMO |
04:08:32 | FromDiscord | <Rika> i want more ways to identify whether some type adheres to container mechanics, i guess i just want better concepts no? |
04:08:43 | Yardanico | concepts are for compile-time only |
04:08:44 | FromDiscord | <KingDarBoja> So better look at Java for these examples hahahs |
04:08:49 | Yardanico | like you can't store "concepts" in a sequence |
04:08:56 | Yardanico | concepts are not interfaces |
04:09:00 | FromDiscord | <Rika> i never needed to |
04:09:10 | Yardanico | otherwise concepts can be quite cool |
04:09:11 | FromDiscord | <Rika> i dont think ive needed it for runtime |
04:09:26 | Yardanico | I'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:28 | FromDiscord | <KingDarBoja> Don't tell me concepts is another Num stuff |
04:09:50 | Yardanico | it is |
04:09:58 | Yardanico | it's an "experimental" feature since some version though |
04:10:03 | Yardanico | one of the simplest examples is https://github.com/Yardanico/nimpylib/blob/master/src/pylib.nim#L10 |
04:10:05 | FromDiscord | <KingDarBoja> Nim* |
04:10:14 | Yardanico | You "describe" what a type should have |
04:10:25 | Yardanico | and then you can make proc which accept any object which matches with a concept |
04:10:44 | Yardanico | https://nim-lang.org/docs/manual_experimental.html#concepts |
04:11:02 | Yardanico | also there are term-rewriting macros in Nim too :P |
04:11:25 | FromDiscord | <KingDarBoja> I got tempted to use that but preferred to do it on my own |
04:12:13 | Yardanico | https://nim-lang.github.io/Nim/manual_experimental.html#term-rewriting-macros |
04:12:21 | Yardanico | really neat stuff |
04:12:36 | Yardanico | arraymancer actually uses them to apply some optimizations |
04:12:47 | Yardanico | https://github.com/mratsim/Arraymancer/blob/532f45a6/src/tensor/optim_ops_fusion.nim#L53-L74 |
04:13:14 | Yardanico | ah yeah I remember a very funny example |
04:13:25 | FromDiscord | <KingDarBoja> By looking at that iterable |
04:13:58 | FromDiscord | <KingDarBoja> Does that means I can pass a tuple or sequence as those are the "same" type |
04:14:10 | FromDiscord | <KingDarBoja> By same I mean, iterables |
04:14:13 | FromDiscord | <Rika> oh yeah i remember someone writing a string obfuscator with them term rewriting macros |
04:14:28 | Yardanico | it wasn't with term rewriting macros was it though? if you mean xor it's just macros |
04:14:30 | Yardanico | not term rewriting macros |
04:14:45 | Yardanico | https://forum.nim-lang.org/t/1305 |
04:14:56 | Yardanico | ah nvm found https://forum.nim-lang.org/t/338 |
04:15:03 | FromDiscord | <Rika> yup |
04:15:05 | Yardanico | https://forum.nim-lang.org/t/338#1767 idk if that works rn though |
04:15:10 | FromDiscord | <Rika> the one where you dont need to invoke the macro on the string |
04:16:35 | Yardanico | @KingDarBoja it won't work for tuples because they don't have an "items" iterator |
04:17:29 | FromDiscord | <KingDarBoja> Gotcha |
04:18:20 | FromDiscord | <KingDarBoja> Still I do better feel using pure Nim code to get away of Python lazyness |
04:18:24 | FromDiscord | <KingDarBoja> From* |
04:18:33 | Yardanico | well this is nim code |
04:23:37 | FromDiscord | <Yardanico> @KingDarBoja @Rika term-rewriting templates/macros are very "fun" https://play.nim-lang.org/#ix=2if5 😄 |
04:23:47 | FromDiscord | <Yardanico> run it |
04:24:36 | Yardanico | well, the compiler shows hints when a term-rewriting pattern was applied |
04:25:17 | Prestige | Hm this is weird, is HashSet not in hashes? |
04:25:28 | Yardanico | https://nim-lang.org/docs/sets.html |
04:25:47 | Yardanico | "hashes" is for, well, hashes themselves |
04:25:56 | Yardanico | like get a unique hash of a string or of a number |
04:32:33 | FromDiscord | <KingDarBoja> Loool |
04:32:41 | FromDiscord | <Rika> ? lol? |
04:32:53 | FromDiscord | <KingDarBoja> Brainf"ck with that rewrite |
04:32:57 | Yardanico | power of nim :PP |
04:33:14 | FromDiscord | <Rika> imagine how many people you can fuck over with term rewriting macros... |
04:33:21 | FromDiscord | <Yardanico> @Rika compiler shows hints tho 😦 |
04:33:23 | FromDiscord | <Yardanico> ah wait actually |
04:33:24 | FromDiscord | <Yardanico> HAHHAHA |
04:33:31 | FromDiscord | <KingDarBoja> Imagine someone putting that on someone code 😋 |
04:33:58 | FromDiscord | <KingDarBoja> That's a new level of trolling hahshsh |
04:34:04 | FromDiscord | <Rika> who the fuck reads hints 😛 |
04:34:26 | FromDiscord | <KingDarBoja> X2 |
04:34:56 | FromDiscord | <KingDarBoja> I am on bed right now listening some OSTs |
04:35:09 | Yardanico | @Rika, that term rewriting macro for encrypting string actually worked btw |
04:35:14 | Yardanico | works* |
04:35:32 | Yardanico | i'm adapting it to the encryption used in https://forum.nim-lang.org/t/1305 |
04:36:22 | FromDiscord | <Rika> nice, id like to see the code once youre done 😄 |
04:38:56 | shashlick | yay for varargs support |
04:39:16 | Yardanico | shashlick: really? you actually did it? :D |
04:40:03 | shashlick | yep - i can push a branch, want to test? |
04:40:06 | Yardanico | yeah |
04:40:29 | FromDiscord | <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:53 | FromDiscord | <Yardanico> and the binary will contain "\xB2\xBE\xA8\xA9\xA9" bytes for "hello" |
04:41:19 | FromDiscord | <Yardanico> actually on each recompile the values will change because the key uses compilation time and date |
04:41:57 | FromDiscord | <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:36 | shashlick | Yardanico: pushed a varargs branch for nimterop |
04:42:49 | FromDiscord | <Rika> something that would save from amateur reverse engineers would be a per string key |
04:42:58 | FromDiscord | <Yardanico> ehm |
04:43:02 | FromDiscord | <Yardanico> this code has a different key for each string |
04:43:28 | FromDiscord | <Rika> ah its a counter |
04:43:30 | FromDiscord | <Rika> not a key |
04:43:31 | FromDiscord | <Rika> 👀 |
04:43:45 | FromDiscord | <Yardanico> it's a compile-time counter yeah, the resulting binary will only contain generated keys |
04:43:46 | FromDiscord | <Rika> so string order influences bytes too |
04:44:09 | * | nsf joined #nim |
04:44:22 | Yardanico | shashlick: testing now |
04:46:12 | FromDiscord | <Rika> is +% and *% saturated arithmetic? |
04:46:12 | Yardanico | how do I enable debug mode for this build? |
04:46:31 | Yardanico | I got "/home/dian/.nim/lib/core/macros.nim(1827, 31) Error: undeclared identifier: 'vlc_object_t'" |
04:46:51 | Yardanico | @Rika https://nim-lang.org/docs/system.html#%2B%25%2Cint%2Cint |
04:47:03 | FromDiscord | <Rika> yardanico: i read that |
04:47:13 | FromDiscord | <Rika> in one ear, out the other |
04:48:19 | FromDiscord | <Rika> `The result is truncated to fit into the result` this fooled me |
04:54:39 | shashlick | Use -d for flags |
04:54:46 | shashlick | If you need it of course |
04:54:47 | Yardanico | it's already there |
04:54:58 | Yardanico | I just get "/home/dian/.nim/lib/core/macros.nim(1827, 31) Error: undeclared identifier: 'vlc_object_t'" |
04:55:08 | shashlick | Ok, where is vlc_object_t defined |
04:55:17 | shashlick | In the headers |
04:56:06 | * | narimiran joined #nim |
04:56:10 | Yardanico | ah it was my fault |
04:56:18 | Yardanico | seems like the old nimterop backend just ignored that type (?) |
04:56:28 | Yardanico | it's in "vlc_common.h" which I did not import before |
04:56:43 | Yardanico | now 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:19 | Yardanico | fixed that by adding another "elif" to onSymbol |
04:58:05 | Yardanico | now I get a different assertion error, will get the output |
04:58:19 | * | thomasross quit (Ping timeout: 250 seconds) |
04:59:26 | Yardanico | shashlick: it's quite long https://gist.github.com/Yardanico/313b472a16fdf39b4b4603dae12845c8 |
04:59:43 | Yardanico | seems to fail on vlc_callback_t |
05:00:03 | Yardanico | https://git.videolan.org/?p=vlc.git;a=blob;f=include/vlc_common.h;h=222ce81bc40185031f69c2d8985c7decbc7c31bb;hb=HEAD#l490 |
05:01:33 | shashlick | Ya added nested struct support yesterday |
05:02:46 | shashlick | Must be comments throwing it off |
05:03:12 | Yardanico | how can I modify a header and say to nimterop to not re-fetch? |
05:03:50 | shashlick | It won't refresh unless you -f |
05:03:57 | shashlick | Refetch |
05:04:26 | Yardanico | well it seems to revert old file state, I have "-f:ast2 -d" flags |
05:06:17 | shashlick | Well it does git reset at the beginning |
05:06:27 | shashlick | It could be the void * |
05:06:35 | Yardanico | yeah I thought that too |
05:06:42 | Yardanico | that's just "pointer" in Nim right? |
05:07:30 | shashlick | Most likely the char const * |
05:07:48 | shashlick | Ugh, the gift that keeps giving |
05:07:54 | Yardanico | yeah it's pretty complex |
05:08:04 | Yardanico | I would've only used the "libvlc" headers but they refer to VLC headers :/ |
05:08:08 | shashlick | Try skipping that proc for now, I'll fix it |
05:08:15 | shashlick | What else breaks |
05:10:39 | * | rockcavera quit (Remote host closed the connection) |
05:11:01 | Yardanico | wait I think I can just ignore these headers if I skip vlc_log_t |
05:11:14 | Yardanico | so I can only use libvlc headers |
05:12:24 | Yardanico | ah no I can't :/ |
05:12:46 | Yardanico | can I just get a few functions from the header? |
05:13:03 | Yardanico | libvlc seems to need "vlc_log_t" from vlc_messages.h and nothing more |
05:13:50 | shashlick | Nope it just pulls everything unless skipped |
05:13:57 | FromDiscord | <Varriount> Hm, I tried using term-rewriting macros to automatically rewrite type declarations, but it didn't work (unfortunately). |
05:15:59 | shashlick | I might have a simple fix, let me see |
05:17:55 | Prestige | Random question, why do sets use incl and excl instead of add/remove? |
05:18:15 | Yardanico | for what? |
05:18:32 | * | Jjp137 quit (Read error: Connection reset by peer) |
05:18:40 | Prestige | adding and removing elements |
05:18:43 | * | Jjp137 joined #nim |
05:19:01 | Yardanico | in where? :P |
05:19:09 | narimiran | `add` in strings, seqs, etc. adds *to the end*, which is not the case for sets |
05:19:12 | Prestige | in sets, like a HashSet |
05:19:23 | Yardanico | they don't have "add" anyway |
05:19:26 | shashlick | Yardanico: will check back in the morning, quite late now, thanks for testing again |
05:19:32 | Yardanico | it's more of a mathematical notation I guess |
05:19:35 | Yardanico | "include in the set" |
05:19:45 | Prestige | ah |
05:19:54 | Prestige | just used to other languages I suppose haha |
05:20:07 | FromDiscord | <Varriount> shashlick: https://play.nim-lang.org/#ix=2ifm |
05:20:21 | Yardanico | maybe you wanted to reply to me instead? :P |
05:22:35 | FromDiscord | <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:25 | Yardanico | yeah I'm trying, although I'm not really experienced with term rewriting macros :P |
05:26:05 | FromDiscord | <Yardanico> @Varriount with this it calls the macro "macro foo{a}(a: typed{nkTypeDef}): NimNode =" |
05:26:16 | FromDiscord | <Yardanico> but there's an error for some reason "Error: invalid expression: Foo = int" |
05:26:29 | FromDiscord | <Varriount> "this"? |
05:26:40 | FromDiscord | <Yardanico> I mean change macro definition to this |
05:26:47 | FromDiscord | <Yardanico> the code in quotes I sent 😛 |
05:28:12 | FromDiscord | <Yardanico> ah you need nnkTypeSection maybe? |
05:28:33 | FromDiscord | <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:21 | FromDiscord | <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:11 | FromDiscord | <Varriount> @Yardanico I also don't know if term-rewriting macros affect code generated by regular macros. |
05:32:35 | FromDiscord | <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:02 | Yardanico | what's the best way to copy a ref object instance? |
06:17:07 | Yardanico | so it'll work with --gc:arc and whatnot |
06:17:51 | * | solitudesf joined #nim |
06:21:33 | FromGitter | <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:08 | leorize | Yardanico: obj[] = another[] |
06:27:13 | Yardanico | thanks :) |
06:27:23 | Yardanico | @sheerluck yay! |
06:27:35 | Yardanico | 16999 though XD |
06:27:43 | Yardanico | who will make the 17000th commit |
06:28:30 | FromDiscord | <Rika> ara q ofc |
06:28:38 | FromDiscord | <Rika> i kid |
06:30:09 | * | PMunch joined #nim |
06:38:11 | leorize | forum is down for me |
06:38:13 | leorize | 504 :( |
06:42:17 | narimiran | same here |
06:42:20 | narimiran | dom96: ^ |
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:06 | narimiran | leorize: now seems to be ok for me.... |
07:12:34 | PMunch | Might've just been something on CloudFlares side (I think that's still used) |
07:15:51 | leorize[m] | the systemd service probably auto restarted :p |
07:17:23 | PMunch | Or that, of course .P |
07:17:48 | PMunch | Hmm, this is a bit worrying: https://forum.nim-lang.org/t/4932. So Nim will always occupy it's peak memory usage.. |
07:18:06 | leorize[m] | nim does release memory |
07:18:24 | PMunch | Well, 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:40 | leorize[m] | the reuse pool is around 8MiB |
07:19:15 | PMunch | Why does treeform have issues with it using 15Gb then? |
07:19:28 | leorize[m] | logical leak |
07:20:26 | PMunch | Meaning? |
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:49 | FromDiscord | <Varriount> Yardanico: I feel like term-rewriting macros could be used for more things, they just aren't well known. |
07:30:56 | Yardanico | yeah, that's true |
07:31:01 | Yardanico | and they have a lot of bugs probably too :P |
07:32:16 | * | mwbrown joined #nim |
07:32:21 | Zevv | PMunch: returning memory is hard because of fragmentation |
07:32:49 | Zevv | You 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:31 | Zevv | it'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:56 | livcd | "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:12 | Zevv | well, 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:48 | PMunch | Well you could have a pager in the Nim GC |
07:54:10 | PMunch | So 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:42 | Zevv | sure, that's basically how it works. But the problem is that a chunk needs to be 100% unused |
08:05:56 | Zevv | so imagine you slurp 15Gb of json and keep 1% of the nodes referenced |
08:06:00 | Zevv | these are spread all over the heap |
08:06:12 | Zevv | so now all these chunks have 1% of them used and the rest unused |
08:06:15 | Zevv | still you can not return |
08:06:18 | Zevv | we do not have a moving GC |
08:06:23 | * | ftsf quit (Ping timeout: 250 seconds) |
08:07:09 | Araq | livcd, Zevv with -d:useMalloc is outside of our domain though |
08:07:20 | Araq | and once again we should focus on ARC, IMO |
08:09:19 | Yardanico | I forgot, "use" got removed from Nim? |
08:09:30 | Yardanico | ah, seems so |
08:24:26 | Araq | what's "use"? |
08:34:35 | Yardanico | Araq: ah, sorry, I meant "using" |
08:34:54 | Yardanico | oh wait it's still there |
08:34:54 | Yardanico | XDD |
08:38:20 | Yardanico | oh yess amazing I love it |
08:38:33 | Yardanico | when you have 15+ procs which take the same first type "using" is good |
08:46:47 | Araq | Yardanico, please fix the docgen so that it understands 'using' ;-) |
08:47:17 | Yardanico | to expand types from "using"? |
08:47:18 | Yardanico | I'll try |
08:48:36 | * | dwdv joined #nim |
08:49:21 | dadada | ? 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:23 | PMunch | That's unfortunately not possible |
08:54:28 | * | liblq-dev joined #nim |
08:55:14 | PMunch | Huh in the manual under lexical analysis -> other tokens it mentions [: being a token (but not :]). What is this used for? |
08:56:10 | Yardanico | PMunch: [: is for specifying generic instatiations with UFCS |
08:56:19 | Yardanico | like if you have proc test[T](a: Interpreter, b: T) |
08:56:39 | * | Vladar quit (Quit: Leaving) |
08:58:06 | Yardanico | you can call it as myinterp.test[:int](5) |
08:58:26 | PMunch | Aaah, that's how you do that! |
08:58:31 | Yardanico | it's in https://nim-lang.org/docs/manual.html#procedures-method-call-syntax |
08:58:37 | Yardanico | in the end of that section |
09:02:18 | Yardanico | @zetashift did some stuff today https://github.com/Yardanico/nim-lox |
09:02:26 | PMunch | Is this a new thing? |
09:02:57 | FromDiscord | <Recruit_main707> it would be so cool writing a python interpreter in nim |
09:03:24 | Yardanico | it's not hard to write a *minimal* one with a subset of Python |
09:03:26 | Yardanico | like RPython |
09:03:39 | Yardanico | but if you will implement all features it'd be harder :P |
09:04:04 | Araq | IMHO it's easier than you think to simply copy compiler/vmdef|vm|vmgen.nim and mutate it heavily |
09:04:13 | Yardanico | well yeah that too |
09:04:22 | * | dddddd joined #nim |
09:04:45 | Araq | to give you a VM for Python |
09:04:48 | PMunch | Haha, that would be a fun project indeed. Not sure why you'd want that for anything though :P |
09:05:14 | Araq | I cringe every time I see people write new stack based VMs in Nim |
09:05:27 | * | narimiran quit (Ping timeout: 260 seconds) |
09:05:37 | FromDiscord | <Recruit_main707> lmao |
09:06:10 | PMunch | Well, I guess as a way to embed PythonScript® in a Nim project |
09:08:24 | FromDiscord | <Recruit_main707> i dont get the point of embeding python in nim |
09:08:29 | * | Ven`` joined #nim |
09:08:35 | Yardanico | yeah lua is better for an embedded language |
09:08:38 | Yardanico | or NimScript even better :P |
09:08:43 | FromDiscord | <Recruit_main707> id like to do it the other way around |
09:09:14 | FromDiscord | <Recruit_main707> basically being able to use autoswig with nim or something |
09:14:30 | FromDiscord | <Recruit_main707> has someone tried running some of this tools with nim's generated c/c++ code?? |
09:14:35 | Yardanico | ? |
09:14:49 | FromDiscord | <Recruit_main707> pybind11, autoswig... |
09:14:59 | FromDiscord | <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:24 | PMunch | Hmm, 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:26 | FromDiscord | <Recruit_main707> --header? |
09:20:40 | FromDiscord | <Recruit_main707> i think thats exactly what you want |
09:21:00 | Araq | --header is not supported |
09:21:11 | PMunch | Yeah it's not in the manual, or in --fullhelp.. |
09:21:24 | Araq | the code generator simply wasn't designed for this and Nim is not a transpiler ;-) |
09:21:34 | dadada | so 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:39 | FromDiscord | <Recruit_main707> wdym? ive used it |
09:22:11 | Yardanico | dadada: there's that thing... |
09:22:13 | Araq | dadada, why is it so important though? instead of ? x you can use 'q x' |
09:23:53 | FromDiscord | <Recruit_main707> i dont understand why do you say --header is not supported |
09:23:54 | dadada | Araq: technically yes, want to use ? because it's much easier to grasp what the code is intended to do |
09:24:07 | Yardanico | you can do it with https://nim-lang.org/docs/filters.html |
09:24:12 | Yardanico | but please don't |
09:25:47 | Araq | dadada, what is it intended to do? |
09:27:03 | * | neceve joined #nim |
09:28:31 | dadada | Araq: 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:43 | Yardanico | what's wrong with if: a else: b |
09:28:55 | Yardanico | a little more characters but much more consistent |
09:29:37 | Araq | dadada, it's fine and I'm sorry that this channel can be unwelcoming |
09:29:40 | dadada | Yardanico: 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:50 | PMunch | dadada, when did people hate on stuff like that? As long as it's for fun it's cool :P |
09:29:50 | Yardanico | I don't criticize you |
09:29:54 | Yardanico | I just don't understand why |
09:30:11 | PMunch | For fun! |
09:30:27 | dadada | PMunch: exactly, a couple of times, and I've only been here for a few months |
09:30:38 | Araq | x ? y ! z # like so? |
09:30:44 | PMunch | I'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:47 | FromDiscord | <Recruit_main707> look at me! i am supporting nim for a framework, and no one else is gonna even use it! |
09:31:34 | PMunch | dadada, 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:42 | dadada | Yardanico: 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:47 | PMunch | Recruit_main707, what framework? |
09:31:56 | FromDiscord | <Recruit_main707> rlbot |
09:32:26 | PMunch | Cool! |
09:32:46 | PMunch | dadada, do you have a syntax sample of what you want? |
09:32:51 | PMunch | I might have an idea |
09:33:43 | FromDiscord | <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:37 | dadada | Araq: 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:43 | dadada | (while traditionally if-else have different lengths, so it's not possible), saves some column space too |
09:39:45 | PMunch | So do you have a syntax sample? |
09:40:49 | dadada | PMunch: took some random Nim code from github (MIT), and applied it there: https://play.nim-lang.org/#ix=2ign |
09:41:42 | Yardanico | why not just use "F: " for "if" part then? :P |
09:41:43 | dadada | of course you'd also be able to do var foo = ? someTest: "hello" L: "bye" |
09:41:59 | Yardanico | oh you want without the : hmm |
09:42:08 | dadada | Yardanico: because I don't think it'd be half as intuitive |
09:42:21 | Yardanico | I wouldn't exactly call "?" intuitive but ok :P |
09:43:07 | dadada | Yardanico: if you can't admit that an if statement resembles a question (is this true?), then you're not honest |
09:43:46 | Yardanico | it's not "is this true?", it's "if this is true, do:" |
09:44:02 | Yardanico | at least for me |
09:45:45 | PMunch | A source code filter works, but it replaces all occurrences of ?: https://play.nim-lang.org/#ix=2igp |
09:47:06 | dadada | PMunch: already have a solution for the L part. |
09:47:11 | PMunch | Part of your problem is that if/else is one block |
09:47:14 | PMunch | Wait, how? |
09:47:22 | dadada | PMunch: and a solution for the ? part, but it only work when it's written with `?` |
09:47:28 | Yardanico | PMunch: template? |
09:47:48 | PMunch | I mean this works: https://play.nim-lang.org/#ix=2igr |
09:47:52 | PMunch | For ? |
09:50:01 | dadada | PMunch: 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:06 | dadada | the whole thing to a regular if-elif-else |
09:50:34 | dadada | so the `?` macro reads the L blocks directly from the source |
09:50:37 | PMunch | Ooooh |
09:50:42 | PMunch | That's hacky :P I love it! |
09:50:54 | PMunch | How do you determine if it is after? |
09:51:14 | PMunch | With lineinfo you only get a line number, do you go by indentation from there? |
09:51:50 | dadada | again 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:11 | dadada | basically you look for the next line where the L starts in the same column as the ? did |
09:52:20 | dadada | s/line/lines |
09:54:07 | dadada | lineinfo gives you not only the line number, but also the filename of the source, so you can directly read the source files |
09:54:20 | PMunch | Yeah I know |
09:56:00 | * | krux02 joined #nim |
09:56:19 | dadada | the source filters are too aggressive |
09:56:29 | FromGitter | <alehander92> Yardanico |
09:56:37 | FromGitter | <alehander92> yeah writing a python vm might be cool |
09:56:43 | FromGitter | <alehander92> you can even directly load the bytecode there |
09:56:48 | FromGitter | <alehander92> without going through parsing etc |
09:56:51 | dom96 | ooh, this is cool https://github.com/wltsmrz/nimler |
09:56:52 | dadada | it'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:55 | FromGitter | <alehander92> this way you can support much more of python |
09:57:07 | FromGitter | <alehander92> as the bytecode isn't complicated i'd say |
09:57:16 | FromGitter | <alehander92> but what would you do about c extensions is another question |
09:57:28 | FromGitter | <alehander92> Araq i dont agree with that, people need to write their own code to learn |
09:57:53 | FromGitter | <alehander92> reading the compiler/vm source is of course very useful to learn as well |
09:57:55 | supakeen | You 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:36 | FromGitter | <alehander92> thank you, but how easy would it be to simulate that in a custom vm is what i dont know |
09:58:59 | FromGitter | <alehander92> as i am not sure how does cpython encode the "ffi" invocations |
09:59:02 | Araq | alehander92: writing a stack based VM isn't "learning", it's repeating well documented mistakes :P |
09:59:12 | FromGitter | <alehander92> ahhh so its about stack vs register |
09:59:36 | FromGitter | <alehander92> well the cpython vm opcodes are stack-based already .. |
09:59:54 | FromGitter | <alehander92> of course here one can just parse python to his own custom register-based bytecode |
10:01:22 | Araq | but 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:44 | dom96 | cool, looks like I fixed openssl problems in Nimble with my patch https://github.com/nim-lang/nimble/issues/792#issuecomment-614516847 |
10:02:32 | FromGitter | <alehander92> @dom96 cool ! |
10:03:33 | FromGitter | <alehander92> Araq i feel you are ironic, but why is it bad to have types in the IR |
10:03:51 | Araq | nothing, it's great. .NET has it and wasm doesn't. |
10:04:22 | Yardanico | @dom96 I feel I should retry my attempt at cross-compiling a nim binary with statically linked libressl to arm |
10:04:30 | Yardanico | it was crashing with SIGILL too 🤔 |
10:04:43 | FromGitter | <alehander92> Araq so what about https://webassembly.github.io/spec/core/syntax/types.html |
10:04:59 | FromGitter | <alehander92> (i dont really know honestly , just searching for docs) |
10:05:02 | dom96 | Yardanico, go for it, but note that my patch fixed dynamic linking specifically |
10:05:20 | dom96 | alehander92: what are you suggesting? |
10:06:30 | Araq | alehander92: well yeah, it has this poor excuse of a type system |
10:06:41 | FromGitter | <alehander92> @dom96 i am not suggesting anything , sorry, just discussing vm-s |
10:07:25 | dom96 | Ahh. |
10:07:38 | FromGitter | <alehander92> Araq but isn't having a too specific type system in IR making it harder to target from 20 languages |
10:08:04 | FromGitter | <alehander92> @dom96 i am going to push fixes to my async PR |
10:08:21 | dom96 | I'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:36 | Araq | well 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:48 | Yardanico | @dom96 nlvm has wasm support via LLVM already btw :P |
10:08:50 | Araq | wasm is about the latter. |
10:09:06 | dadada | dom96: why isn't Nim -> C -> WASM sufficient? |
10:09:14 | dom96 | Yardanico, is it mature enough for production? |
10:09:23 | FromGitter | <alehander92> @dom96 interesting, but how much is the overhead for wasm<=>javascript |
10:09:33 | Yardanico | well a new backend wouldn't be so mature for production either |
10:09:34 | dom96 | dadada, I tried it but couldn't figure out how to fix the segfaults |
10:09:59 | Araq | dom96: it runs 95% of our test cases iirc, so I suppose it works good enough. never used it though. |
10:10:05 | dom96 | alehander92: 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:12 | dadada | alehnader92: 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:22 | dadada | there's |
10:10:36 | PMunch | dadada, something like this? https://play.nim-lang.org/#ix=2igy |
10:10:39 | FromGitter | <alehander92> dadada yeah but there was some problems with e.g. writing wasm to call javascript to access the dom etc |
10:10:47 | FromGitter | <alehander92> but they might have changed that |
10:10:54 | FromGitter | <alehander92> i might be wrong |
10:11:13 | FromGitter | <alehander92> dom96 yeah we've also thought about that for our electron app IIRC? |
10:11:17 | dom96 | Araq, how hard would it be to get {.wasm.} started for simple procs? |
10:11:25 | dom96 | Have you got any experience with wasm? |
10:11:36 | FromGitter | <alehander92> but it's probably easier to that in nlvm in this case |
10:11:46 | FromGitter | <alehander92> as it already should have both wasm and javascript support |
10:11:50 | Araq | dom96: my knowledge is outdated, now it has "Table Types" |
10:12:00 | Araq | (a step in the right direction) |
10:12:21 | PMunch | dom96, what's the benefit of nimler over just importing C functions? |
10:12:25 | dom96 | Araq, I bet I could follow the same approach I took with my asm adventures (way way back) |
10:12:35 | Araq | but when I looked at it, it was bad all around |
10:12:38 | dadada | PMunch: 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:45 | dom96 | PMunch, no idea, I just saw Erlang and NIm and love that people are making such packages |
10:13:16 | FromGitter | <alehander92> dom96 can you build your game with nlvm? |
10:13:42 | Araq | dom96: it's very hard because wasm is a moving target and you have to emulate so many features on top of it |
10:13:44 | dom96 | alehander92: I might give it a try tonight. But I'm doubtful it'll work. |
10:13:55 | FromGitter | <alehander92> but the problem is |
10:14:08 | FromGitter | <alehander92> how would you do it in the compiler to use two backends for two functions |
10:14:26 | Yardanico | Araq: do parameters created with "using" have an actual type somewhere in PNode fields? so far I couldn't find it |
10:14:27 | dom96 | dunno, I'm sure there is a way :P |
10:14:30 | FromGitter | <alehander92> maybe it should be easy |
10:14:46 | dom96 | Araq, yeah, guess it would be a lot to bootstrap everything, in particular the GC. |
10:14:47 | FromGitter | <alehander92> just somehow detecting it in the last stage and redirecting to TargetGenPass |
10:15:12 | Araq | alehander92: 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:15 | dadada | PMunch: but apart from that, really nice implementation! |
10:15:58 | Araq | dom96: you can always map a subset of Nim to wasm, but you would surprised how much work that really is |
10:16:29 | FromGitter | <alehander92> @dom96 i'd really try to see nlvm and ask @arnetheduck |
10:16:36 | Araq | I'm not talking about the GC. it doesn't even support function pointers properly |
10:16:37 | dom96 | would be nice if I could emit wasm in JS code like I can asm in C code |
10:16:38 | FromGitter | <alehander92> he works with wasm sometimes IIRC for his projects |
10:16:59 | FromGitter | <alehander92> and it wouldn't make sense to put so much work before actually seeing the alternative |
10:17:00 | dom96 | I think I should talk to yglukhov, he probably knows how to get emscripten to work with Nim |
10:17:22 | dom96 | I got it to almost work, but kept getting segfaults deep in GC code |
10:17:32 | dadada | PMunch: putting conditions in () would get around it, too, but that's not good enough for my taste... |
10:17:37 | FromGitter | <alehander92> @dom96 probably its very easy to emit directly wasm even now |
10:17:54 | PMunch | dadada, hmm that is hard to get around.. |
10:18:00 | Araq | it 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:29 | Araq | "everything should be as simple as possible but not simpler", well wasm is the "simpler" design. |
10:19:11 | FromGitter | <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:13 | dom96 | hah |
10:20:29 | FromGitter | <alehander92> @dom96 and you can also call staticExec in `{.wasm.}` if you have a way to compile a text representation of wasm |
10:20:30 | dom96 | it 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:45 | FromGitter | <alehander92> and then just put the bytes somehow in |
10:21:09 | FromGitter | <alehander92> (if you just want to emit text(?) wasm) |
10:21:47 | Araq | it's really not "fun" but ymmv. |
10:22:03 | * | lritter quit (Quit: Leaving) |
10:22:20 | dom96 | the 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:34 | Araq | personally 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:46 | FromDiscord | <clyybber> lol |
10:23:13 | Araq | because that stuff actually works. |
10:23:22 | Yardanico | https://copy.sh/v86/ :P |
10:23:28 | Yardanico | has msdos |
10:23:49 | dom96 | lol, does DOS Box for the browser exist? :P |
10:24:11 | dadada | PMunch: 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:19 | FromGitter | <alehander92> they run linux in the browser man |
10:24:22 | Yardanico | @dom96 https://js-dos.com/ |
10:24:25 | FromGitter | <alehander92> iirc |
10:25:05 | Yardanico | "Project uses dosbox as emulation layer for running dos programs." |
10:26:22 | Yardanico | and yes they use emscripten |
10:29:52 | PMunch | dadada, didn't solve the () problem, but I added elif support: https://play.nim-lang.org/#ix=2igA |
10:29:59 | PMunch | You can't combine it with else though |
10:30:03 | PMunch | Or have multiple elifs |
10:30:06 | dadada | a full Linux instance running client-side in the browser would be cool, I'd run folding at home there |
10:30:16 | Yardanico | see https://copy.sh/v86/ |
10:30:40 | PMunch | Hmm, I guess you could define `?` as a varargs[untyped] macro and just use lineinfo on the first one |
10:30:44 | FromGitter | <alehander92> PMunch why |
10:31:11 | Yardanico | dadada: folding@home needs proper GPU acceleration :P and CPU too |
10:31:12 | FromGitter | <alehander92> why |
10:31:24 | Yardanico | @alehander92 because dadada wants to :P |
10:31:40 | FromGitter | <alehander92> fun |
10:32:16 | PMunch | F04or06 t08he10 g12lo02ry04 o06f 08sa10ta12n!02 :04D |
10:32:24 | Yardanico | my eyes |
10:32:30 | dadada | alehander92: 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:45 | Yardanico | please no |
10:32:45 | PMunch | Yardanico, you're welcome |
10:32:50 | Yardanico | I don't want to use my browser as an OS |
10:33:15 | PMunch | I made a script for it, so if I write /rainbow it will rainbowize my entire text :P |
10:33:24 | Yardanico | sadly only IRC people will see it :) |
10:33:24 | PMunch | S02oo04o 06fa08bo10ul12ou02s! |
10:33:35 | Yardanico | I mean on discord/gitter it's just plain text ;( |
10:33:52 | PMunch | Looks great in the logs as well: https://irclogs.nim-lang.org/16-04-2020.html#10:32:16 |
10:33:53 | PMunch | :P |
10:34:05 | Yardanico | lol |
10:34:09 | dadada | alehander92: 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:21 | Yardanico | dadada: cryptominers already do this |
10:34:23 | dadada | alehander92: and because I want to @Yardanico |
10:34:24 | Yardanico | even without asking users ;) |
10:34:37 | Araq | Yardanico: the typ.n[1..N].sym.typ field should have the type too |
10:34:40 | PMunch | dom96, maybe the irclogs should use https://github.com/PMunch/ansitohtml ;) |
10:34:49 | Yardanico | Araq: oh thanks will try |
10:35:02 | dadada | Yardanico: I know, it'd be cool if this wasn't something exclusive to black hats |
10:35:04 | dom96 | PMunch, PRs welcome ;) |
10:35:15 | PMunch | What repo is it in? |
10:35:24 | dom96 | nimbot |
10:36:47 | FromGitter | <alehander92> PMunch Glory to God, man |
10:36:51 | FromGitter | <alehander92> dadada oh interesting |
10:37:02 | PMunch | alehander92, it's an old meme :P |
10:37:03 | FromGitter | <alehander92> sorry i was asking other stuff but this is very interesting |
10:37:11 | FromGitter | <alehander92> but i still feel its too heavy |
10:37:48 | FromGitter | <alehander92> PMunch doesnt matter |
10:38:51 | dom96 | This 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:00 | dom96 | It's a pretty good documentary |
10:39:31 | * | Guest44398 is now known as someunknownuser |
10:39:43 | PMunch | Huh, 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:23 | dom96 | PMunch, 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:43 | PMunch | Nope, haven't even heard of it |
10:47:51 | PMunch | Not a huge fan of horror though.. |
10:47:57 | * | pbb joined #nim |
10:48:36 | dom96 | ahh, then don't watch it. It's a horror's take on the midsummer celebrations |
10:52:03 | PMunch | From the trailer it didn't look that bad (although I did watch it without sound, because pulseaudio) |
10:52:46 | dom96 | FWIW 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:06 | FromGitter | <alehander92> dont put your trust in shock value docs |
11:07:57 | * | Vladar quit (Quit: Leaving) |
11:10:06 | FromDiscord | <Gary M> final: proc = proc() = return |
11:10:22 | FromDiscord | <Gary M> I have a parameter like that ^ |
11:10:35 | FromDiscord | <Gary M> is there a better way of having an empty default proc? |
11:11:06 | FromDiscord | <Recruit_main707> what are you trying to do here? |
11:11:43 | PMunch | proc () = discard? |
11:11:48 | FromDiscord | <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:04 | FromDiscord | <Recruit_main707> parameter: proc() |
11:12:21 | FromDiscord | <Recruit_main707> but that wont work if you proc has a return type or parameters |
11:12:31 | FromDiscord | <Recruit_main707> iirc |
11:12:33 | * | someunknownuser quit (Quit: someunknownuser) |
11:12:34 | PMunch | In a template it will I think |
11:12:38 | FromDiscord | <Gary M> it's currently working the way it is |
11:12:40 | FromDiscord | <Gary M> it's just ugly |
11:13:21 | FromDiscord | <Recruit_main707> may you show it in playground? |
11:13:37 | FromDiscord | <Gary M> sure one sec |
11:14:09 | FromDiscord | <Gary M> https://play.nim-lang.org/#ix=2igI |
11:14:52 | FromDiscord | <Recruit_main707> and the proc you are passing pls |
11:15:30 | FromDiscord | <Recruit_main707> PMunch: you sure about that? |
11:15:39 | * | Tyresc joined #nim |
11:15:45 | PMunch | Nope, that's why I added "I think" :P |
11:15:54 | FromDiscord | <Recruit_main707> xD |
11:16:35 | * | fputs quit (Ping timeout: 260 seconds) |
11:16:53 | FromDiscord | <Gary M> https://play.nim-lang.org/#ix=2igK |
11:17:05 | FromDiscord | <Gary M> obviously you won't be able to run it in there heh |
11:17:10 | FromGitter | <alehander92> Araq talking about the vm |
11:17:21 | FromGitter | <alehander92> the debug vm flag seems good |
11:17:26 | FromDiscord | <Gary M> I'm interfacing with C a bunch 😄 |
11:17:29 | FromGitter | <alehander92> thanks for it |
11:17:33 | PMunch | Recruit_main707, yeah it works: https://play.nim-lang.org/#ix=2igL |
11:17:41 | PMunch | Since the type is just `proc` |
11:17:46 | PMunch | Which in a template matches any procedure |
11:18:04 | FromDiscord | <Recruit_main707> interesting |
11:18:09 | FromDiscord | <Gary M> cool, that'll make things easy |
11:18:15 | * | fputs joined #nim |
11:18:37 | FromDiscord | <Gary M> nim is pretty awesome |
11:18:37 | PMunch | That `default(proc)` doesn't work though |
11:18:55 | FromDiscord | <Gary M> it's working for me, though |
11:19:02 | FromDiscord | <Gary M> well, hold on |
11:19:05 | FromDiscord | <Gary M> let me try something else |
11:19:10 | PMunch | Until you don't pass anything |
11:19:49 | FromDiscord | <Recruit_main707> thats what i meant, yep, it doesnt work if you pass it arguments |
11:20:27 | PMunch | Well of course not, because you're not passing it anything in the template |
11:20:50 | FromDiscord | <Recruit_main707> i learned how to do it with a macro though |
11:20:59 | FromDiscord | <Gary M> https://i.imgur.com/AiRnKxv.png |
11:21:07 | FromDiscord | <Gary M> it's working without passing anything 😄 |
11:22:09 | FromDiscord | <Gary M> https://i.imgur.com/3jNYZcK.png |
11:22:17 | FromDiscord | <Gary M> and then here when I pass in a proc without arguments |
11:22:42 | FromDiscord | <Gary M> so I'm guessing if I want arguments there's a problem? |
11:24:05 | PMunch | Not as pretty, but you can do this: https://play.nim-lang.org/#ix=2igO |
11:25:04 | FromDiscord | <Gary M> ah that looks alright let me try |
11:25:50 | FromDiscord | <Recruit_main707> can you run a function passed as a `typed` argument to a macro?? |
11:27:32 | FromDiscord | <Recruit_main707> from withing the macro that is |
11:29:45 | FromDiscord | <Gary M> https://i.imgur.com/4RuPKww.png |
11:29:50 | FromDiscord | <Gary M> works 😄 |
11:29:53 | FromDiscord | <Gary M> don't need macros |
11:30:36 | FromDiscord | <Gary M> Thanks PMunch |
11:36:26 | FromDiscord | <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:46 | PMunch | Recruit_main707: https://play.nim-lang.org/#ix=2igO |
11:38:23 | FromDiscord | <Recruit_main707> ? |
11:38:40 | PMunch | Look at the output |
11:39:14 | FromDiscord | <Recruit_main707> i dont get the point |
11:39:19 | PMunch | You can see that the params node type is FormalParams |
11:39:29 | PMunch | And the 0th element is float, your return type |
11:39:59 | FromDiscord | <Recruit_main707> yep, but how do i check that in an if statement? |
11:42:46 | * | abm joined #nim |
11:43:44 | FromGitter | <alehander92> ok, so it seems calls |
11:43:48 | FromGitter | <alehander92> rewrite lineinfos |
11:43:57 | FromGitter | <alehander92> but i am not entirely sure if this is intended always |
11:51:13 | FromDiscord | <Recruit_main707> got it working |
11:51:30 | FromDiscord | <Recruit_main707> you have to check for its strVal |
11:53:40 | * | rockcavera joined #nim |
11:54:23 | FromDiscord | <Recruit_main707> next question about macros.... |
11:54:23 | FromDiscord | <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:32 | FromDiscord | <Recruit_main707> "easily" |
11:57:38 | * | natrys joined #nim |
12:03:20 | * | chemist69 quit (Ping timeout: 246 seconds) |
12:03:31 | dadada | PMunch: 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:50 | dadada | there were network issues, therefore I resend something, sorry, if it was already received |
12:12:56 | dadada | PMunch: 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:06 | dadada | PMunch: 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:40 | liblq-dev | anybody ever tried to use cairo-trace with the cairo wrapper for Nim? |
12:30:10 | liblq-dev | I'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:56 | FromGitter | <alehander92> Araq we need |
12:33:57 | FromGitter | <alehander92> TSym info |
12:33:58 | FromGitter | <alehander92> right? |
12:34:45 | dadada | liblq-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:32 | liblq-dev | please no, gintro is already bulky as it is. i don't want my program to compile 20 seconds. |
12:41:00 | liblq-dev | well anyways I solved my issue without cairo-trace |
12:41:17 | liblq-dev | turns 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:06 | inv2004 | Hello, 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:24 | inv2004 | If 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:12 | krux02 | inv2004, c2nim is a tool that doesn't work reliable. |
13:11:50 | krux02 | that doesn't mean that it isn't useful. |
13:12:11 | krux02 | I thinkou you can apply your change to the header, run c2nim and then fix the generated file. |
13:12:18 | shashlick | inv2004 - nimterop should be able to handle that case |
13:13:05 | shashlick | typedef struct s0 { ... } S1, **S2, ***S3; |
13:14:14 | shashlick | let's just say supporting 200 ways of writing the same thing is not fun |
13:16:22 | inv2004 | looks like that I have to define {}S and do type SREF = ref S |
13:22:12 | krux02 | a ref is not a pointer from C |
13:22:16 | krux02 | a ptr is a pointer from C |
13:23:28 | * | zacharycarter joined #nim |
13:24:30 | * | ZoomZoomZoom joined #nim |
13:27:46 | ZoomZoomZoom | Hi! 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:19 | Araq | ZoomZoomZoom: that linking command seems Unix specific |
13:28:26 | * | hpyc9 joined #nim |
13:28:30 | krux02 | ZoomZoomZoom, on windows you should put the sdl DLL in the same folder as the binary |
13:29:04 | ZoomZoomZoom | Of course, but can't it be statically linked? |
13:29:18 | krux02 | I am also a bit puzzled, doesn't the SDL library try to link against SDL automatically? |
13:29:44 | krux02 | ZoomZoomZoom, everybody asks this. But sdl is really designed to be a dynamic library. |
13:31:04 | krux02 | it allows them to create more renderer backends and gampads to be supported just by updating the SDL dll |
13:32:46 | ZoomZoomZoom | I'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:44 | krux02 | you want a plugin for what? |
13:34:23 | krux02 | General advice, if you want to create a plugin for anything, you should use the plugin API |
13:34:40 | zacharycarter | what's the plugin API? |
13:34:44 | * | audiofile joined #nim |
13:34:46 | ZoomZoomZoom | That's really not the point ATM |
13:35:16 | zacharycarter | oh SDL2 has a plugin API |
13:35:23 | ZoomZoomZoom | zacharycarter, Just the API which is provided by a software your plugin is written for. |
13:36:01 | zacharycarter | yeah - I thought someone had developed some library for Nim - I know shashlick has but it only works with bohem GC atm |
13:36:20 | zacharycarter | I'm using cr.h in my project to hot reload my game which I compile to a shared library |
13:36:42 | zacharycarter | this only works with gc:arc/orc |
13:36:56 | zacharycarter | and I haven't done anything very complex yet on the plugin side of things |
13:38:14 | zacharycarter | but anyway about your SDL2 problem - I don't think i've ever statically linked sdl2 |
13:38:37 | zacharycarter | not even for emcsripten - but it should be fairly straightforward - use dynliboverride and then link the static lib |
13:38:50 | zacharycarter | need to keep in mind linking order if you're on linux |
13:38:59 | zacharycarter | I 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:11 | FromGitter | <alehander92> Araq should i expect tasyncawait_cyclebreaker.nim to fail? |
13:51:46 | FromGitter | <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:24 | Araq | what's 150_000 allocations among friends, it's fine |
13:54:10 | FromGitter | <alehander92> also how do you guys see errors i see a black page(loading?) for run ci error |
13:54:12 | FromGitter | <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:25 | Araq | alehander92: the test is a bit fragile so see if it's green on your machine before your changes |
13:54:34 | Araq | and then ensure it stays green after your changes |
13:58:15 | FromDiscord | <Recruit_main707> why is this throwing an error? `newIdentNode("emit")' |
13:59:17 | ZoomZoomZoom | Ok, 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:34 | ZoomZoomZoom | `--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:20 | FromDiscord | <Varriount> That's quite a mouthful. |
14:02:20 | dom96 | ZoomZoomZoom, you may want to add a new section into the Nim package's readme with this info :) |
14:02:31 | ZoomZoomZoom | Yeah, and the resulting file is rather fat, but it worked. |
14:03:15 | FromDiscord | <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:10 | ZoomZoomZoom | I'm rather wary of using my results because IDK What I'm Doing here basically :) |
14:04:23 | ZoomZoomZoom | ... using for the readme |
14:04:44 | FromDiscord | <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:00 | dom96 | ZoomZoomZoom, just preface it with the classic "I Dunno What I'm Doin'" dog gif :) |
14:05:12 | FromDiscord | <mratsim> This would help for our fuzzing efforts of Nimbus |
14:05:15 | Araq | mratsim: we have these annotations for ASAN already |
14:05:36 | FromDiscord | <mratsim> ah |
14:05:40 | Araq | proc markStackAndRegisters(gch: var GcHeap) {.noinline, cdecl, |
14:05:40 | Araq | codegenDecl: "CLANG_NO_SANITIZE_ADDRESS N_LIB_PRIVATE $# $#$#".} |
14:06:06 | Araq | but probably more are required so that ASAN can understand our alloc/dealloc |
14:06:31 | FromDiscord | <mratsim> yes, for example detect out-of-bounds accesses on sequences |
14:07:08 | FromDiscord | <mratsim> well we do have indexerror |
14:07:27 | FromDiscord | <Varriount> mratsim: Out of bounds accesses on unchecked arrays? |
14:09:48 | FromGitter | <alehander92> sorry, |
14:09:52 | ZoomZoomZoom | I'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:54 | FromGitter | <alehander92> it does the ~same amount of allocs |
14:10:00 | FromGitter | <alehander92> but a bit less deallocs |
14:12:33 | FromGitter | <alehander92> in most cases it does 41, not 48 deallocs |
14:13:12 | FromGitter | <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:53 | FromGitter | <alehander92> huh i didnt see the received messages Araq |
14:14:54 | FromGitter | <alehander92> sorry |
14:15:00 | FromGitter | <alehander92> i'll fix the test than |
14:15:03 | FromGitter | <alehander92> then* |
14:15:10 | FromDiscord | <Recruit_main707> why is this not working?? https://play.nim-lang.org/#ix=2ihA |
14:15:24 | * | liblq-dev joined #nim |
14:16:54 | FromGitter | <alehander92> but still i hope its not some kind of leak, as it does seem to deallocate less on each step |
14:25:26 | FromDiscord | <Rika> @Recruit_main707 if you dumptree the emit pragma you'll see the node you're missing |
14:25:44 | FromDiscord | <Rika> (ExprColonExpr) |
14:26:38 | inv2004 | Another 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:01 | FromDiscord | <Recruit_main707> @Rika, i am grabbing it from https://nim-lang.org/docs/macros.html#callsslashexpressions-pragmas |
14:27:02 | inv2004 | How can I define and pass the reference to the C function ? |
14:32:16 | FromDiscord | <mratsim> @Varriount that may be one thing |
14:32:34 | FromDiscord | <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:35 | Araq | inv2004: 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:39 | inv2004 | Ah, its without type of course |
14:56:14 | FromDiscord | <Rika> @Recruit_main707 and it clearly says `nnkPragma(nnkExprColonExpr(nnkIdent("emit"), nnkStrLit("#include <stdio.h>")))` |
14:56:51 | FromDiscord | <Recruit_main707> https://tenor.com/view/hmm-hmmm-hmmmm-thinking-gif-16016977 |
14:57:40 | FromDiscord | <Rika> bruh |
14:57:50 | FromDiscord | <Recruit_main707> mega bruh |
14:59:07 | * | xcm quit (Remote host closed the connection) |
15:00:53 | shashlick | does 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:47 | FromDiscord | <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:30 | FromDiscord | <Rika> cant reach the site |
15:07:45 | FromDiscord | <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:04 | FromDiscord | <Gary M> https://i.imgur.com/oSsp9va.png |
15:10:07 | FromDiscord | <Rika> yes. |
15:10:37 | FromDiscord | <Rika> |
15:10:37 | FromDiscord | <Rika> https://cdn.discordapp.com/attachments/371759389889003532/700362517033123930/unknown.png |
15:11:10 | * | audiofile quit (Ping timeout: 256 seconds) |
15:11:50 | FromDiscord | <Gary M> it's getting the incorrect color applied |
15:11:53 | FromDiscord | <Gary M> https://i.imgur.com/r04n3h8.png |
15:12:08 | FromDiscord | <Rika> yes its pretty jank |
15:12:10 | FromDiscord | <Gary M> as though the variable is a procedure |
15:12:23 | FromDiscord | <Rika> im really wanting my semantic highlightinh |
15:12:35 | FromDiscord | <Rika> the regex is just super fucked i think |
15:12:50 | FromDiscord | <Gary M> I'll give them $5 to sort that shit out 😄 |
15:12:55 | FromDiscord | <Recruit_main707> maybe they are your color themes |
15:13:01 | FromDiscord | <Rika> nope |
15:13:03 | FromDiscord | <Gary M> I made sure it wasn't |
15:13:03 | FromDiscord | <Rika> its not |
15:13:19 | FromDiscord | <Recruit_main707> my variables dont get highlighted as functions :p |
15:13:24 | FromDiscord | <Gary M> I'm manually applying the color red to all variables |
15:13:25 | FromDiscord | <Rika> update your extension |
15:13:37 | FromDiscord | <Rika> and try using augmented multiply assignment `*=` |
15:13:51 | FromDiscord | <Rika> you will get the wrong color for the variable |
15:14:01 | FromDiscord | <Gary M> absolutely nothing in any of my nim files is being colored like a variable |
15:14:06 | FromDiscord | <Rika> also happens with augmented add assignment but not division |
15:14:18 | FromDiscord | <Rika> your game and test is? |
15:14:31 | FromDiscord | <Gary M> the test was just to see the syntax highlight fuck up 😄 |
15:14:52 | FromDiscord | <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:18 | FromDiscord | <Rika> hm |
15:15:18 | FromDiscord | <Rika> https://cdn.discordapp.com/attachments/371759389889003532/700363696270082059/unknown.png |
15:15:22 | FromDiscord | <Rika> "Other"???? |
15:15:23 | FromDiscord | <Recruit_main707> 0.6.6 is the latest and i still see dont see my variables as procs |
15:15:52 | FromDiscord | <Gary M> @Rika how did you get that prompt |
15:15:54 | FromDiscord | <Rika> its not even being recognized as a variable i dont think |
15:16:07 | FromDiscord | <Rika> @Gary M |
15:16:07 | FromDiscord | <Rika> https://cdn.discordapp.com/attachments/371759389889003532/700363897554599946/unknown.png |
15:16:34 | * | xcm quit (Ping timeout: 240 seconds) |
15:16:43 | FromDiscord | <Gary M> they're all Other for me |
15:16:44 | inv2004 | INNER_C_STRUCT {.bycopy.} = ptr object ... ; is it equals to S in typedef MyStruct {...} *S ? |
15:16:49 | FromDiscord | <Rika> i see |
15:16:56 | FromDiscord | <Rika> look at textmate scopes |
15:16:59 | FromDiscord | <Rika> and foreground |
15:17:14 | FromDiscord | <Gary M> except comments |
15:17:19 | FromDiscord | <Gary M> comments are comments |
15:17:22 | FromDiscord | <Gary M> everything else is "other" |
15:17:43 | FromDiscord | <Rika> thats fuckin weird |
15:17:49 | FromDiscord | <Rika> man this extension is jank as hell |
15:18:14 | FromDiscord | <Gary M> there's no consistency with the textmate scope and foreground stuff either as far as I can tell |
15:18:23 | FromDiscord | <Gary M> at least there's mostly consistent coloring |
15:18:26 | FromDiscord | <Gary M> just not with variables |
15:18:46 | * | xcm joined #nim |
15:18:52 | FromDiscord | <Rika> > echo is a keyword |
15:18:52 | FromDiscord | <Rika> hmmmmmmmmmmm |
15:19:18 | FromDiscord | <Gary M> lol |
15:19:22 | FromDiscord | <Gary M> ok yeah it's jank |
15:19:32 | FromDiscord | <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:37 | FromDiscord | <Rika> am i really gonna move to vim just because of the jankiness of this nim plugin |
15:19:38 | FromDiscord | <Gary M> that should be entity.name.function.nim |
15:20:00 | FromDiscord | <Gary M> well the only problem you know clearly isn't all the problems we know |
15:20:13 | FromDiscord | <Recruit_main707> i cannot replicate yours |
15:21:06 | FromDiscord | <Gary M> https://i.imgur.com/0Ye8tqu.png |
15:21:07 | FromDiscord | <Gary M> do this |
15:21:22 | FromDiscord | <Gary M> ```nim |
15:21:22 | FromDiscord | <Gary M> var test = 1 |
15:21:22 | FromDiscord | <Gary M> test += 1 |
15:21:22 | FromDiscord | <Gary M> ``` |
15:21:26 | FromDiscord | <Gary M> and screencap it please |
15:21:39 | FromDiscord | <Recruit_main707> now i see it :p |
15:21:41 | FromDiscord | <Gary M> variables shouldn't be getting recolored as procedures |
15:21:48 | FromDiscord | <Rika> haha |
15:21:56 | FromDiscord | <Rika> it really only does that for += and *= |
15:21:59 | FromDiscord | <Rika> not for /= |
15:22:00 | FromDiscord | <Gary M> they should be getting colored as *variables* to begin with |
15:22:06 | FromDiscord | <Rika> i dont know if -= is fucked either |
15:22:14 | FromDiscord | <Gary M> regardless of all this other weird behavior |
15:22:25 | FromDiscord | <Recruit_main707> > i dont know if -= is fucked either |
15:22:25 | FromDiscord | <Recruit_main707> nope |
15:22:35 | FromDiscord | <Gary M> https://i.imgur.com/lKpea6z.png |
15:22:40 | FromDiscord | <Rika> thats so odd |
15:22:48 | FromDiscord | <Rika> why is += and *= broken but not the others? |
15:23:24 | FromDiscord | <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:32 | FromDiscord | <Rika> also regex syntax highlighting is not something i would do |
15:23:34 | FromDiscord | <Rika> or like to fix |
15:23:48 | FromDiscord | <Rika> its pretty bad since its super noticeable |
15:24:00 | FromDiscord | <Gary M> ctrl+shift+p Inspect editor tokens |
15:24:06 | FromDiscord | <Rika> try multiplying 2 variables |
15:24:11 | FromDiscord | <Rika> you'll get the fucked colors too |
15:25:13 | FromDiscord | <Recruit_main707> the issue its with the * symbol specially? (also strings have token) |
15:26:00 | FromDiscord | <Gary M> I'm pretty sure it is a problem with the * |
15:26:05 | FromDiscord | <Gary M> and + |
15:26:13 | * | icebattle quit (Ping timeout: 250 seconds) |
15:26:19 | * | endragor quit (Remote host closed the connection) |
15:26:41 | FromDiscord | <Gary M> there's the coincidence of the opposites not being fucked, but there's no proof that it's directly related |
15:26:59 | FromDiscord | <Gary M> the + - * / operators are templates aren't they? |
15:27:33 | FromDiscord | <Gary M> I don't think it should be doing anything weird in the syntax highlighting though... |
15:28:02 | FromDiscord | <Rika> the highlighting doesnt know anything past the symbols |
15:28:14 | FromDiscord | <Rika> it only sees the file, not the compiler stuff |
15:28:25 | FromDiscord | <Gary M> maybe it's just the regex being fucked |
15:28:45 | FromDiscord | <Gary M> I mean variables at all just don't work |
15:28:58 | FromDiscord | <Gary M> and idk if it's even done with regex |
15:29:03 | FromDiscord | <Recruit_main707> but... if almost everything is other? how do they have different highlights? |
15:29:04 | FromDiscord | <Gary M> whatever it is, it's fucked |
15:29:27 | FromDiscord | <Gary M> well look at the other weird thing Recruit |
15:29:38 | FromDiscord | <Gary M> https://i.imgur.com/KHB0aPF.png |
15:29:46 | FromDiscord | <Gary M> the procedure echo get the highlighting of a keyword |
15:30:14 | FromDiscord | <Gary M> https://i.imgur.com/14gWl34.png |
15:31:52 | FromDiscord | <Recruit_main707> have you thought of openning an issue? |
15:32:04 | FromDiscord | <Recruit_main707> clearly all of this is not right |
15:32:17 | FromDiscord | <Rika> echo highlight as keyword kinda makes sense but i still think it shouldnt |
15:32:24 | FromDiscord | <Recruit_main707> ^ |
15:32:35 | FromDiscord | <Gary M> actually might be using textmate rules idk |
15:32:47 | FromDiscord | <Gary M> https://code.visualstudio.com/api/language-extensions/syntax-highlight-guide |
15:32:53 | FromDiscord | <Gary M> it does mention textmate scopes |
15:34:37 | Zevv | pff, had to make a Nim comment in this silly HN thread about "Embedding Binary Objects in C" |
15:35:00 | FromDiscord | <Gary M> found it |
15:35:03 | FromDiscord | <Recruit_main707> wasnt that ZomZomZom? XD |
15:35:17 | FromDiscord | <Gary M> in the user path in .vscode, then in the nim extension folder |
15:35:27 | FromDiscord | <Gary M> syntaxes>nim.json |
15:36:14 | FromDiscord | <Gary M> ew there is regex |
15:37:17 | FromDiscord | <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:43 | FromDiscord | <Gary M> reasoning? |
15:37:53 | FromDiscord | <Recruit_main707> it would be very ugly :p |
15:38:01 | FromDiscord | <Rika> @Gary M told ya it was regex |
15:38:08 | FromDiscord | <Gary M> well, it's a combination of regex |
15:38:15 | FromDiscord | <Gary M> you can look at the file yourself, too |
15:38:20 | FromDiscord | <Rika> i already did |
15:38:27 | FromDiscord | <Rika> before you raised the issue |
15:39:57 | FromDiscord | <Gary M> going to have to bust out the regex translator for this 😦 |
15:43:32 | * | liblq-dev joined #nim |
15:44:48 | krux02 | @alehander92: Can you please take a look at my issues about gara and the PR I made? |
15:45:03 | krux02 | 18 days ago |
15:48:03 | * | Prestige quit (Quit: Prestige) |
15:48:20 | * | Prestige joined #nim |
15:49:15 | * | Ven`` joined #nim |
15:49:29 | FromDiscord | <Gary M> found a minor issue in the operator regex @Rika |
15:49:37 | FromDiscord | <Rika> 👀 nice |
15:49:40 | FromDiscord | <Rika> hotfix where |
15:50:03 | FromDiscord | <Gary M> (=|\\+|-|\\*|`right here`/`this is not escaped`|<|>|@|\\$|~|&|%|!|\\?|\\^|\\.|:|\\\\)+ |
15:50:11 | FromDiscord | <Gary M> dunno that it will do much 😄 |
15:50:13 | FromDiscord | <Rika> nice |
15:50:20 | FromDiscord | <Gary M> but it should be escaped I think, anyways |
15:50:34 | FromDiscord | <Gary M> operator highlighting was working fine, anyways |
15:50:46 | FromDiscord | <Gary M> really need to fix that variable stuff |
15:50:58 | FromDiscord | <Gary M> at LEAST make them not color like functions |
15:52:53 | * | ITChap joined #nim |
15:53:25 | FromGitter | <zetashift> @Yardanico oooh nice, I've browsed through it, looking forward to seeing more |
15:53:56 | FromGitter | <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:10 | FromDiscord | <Recruit_main707> @Gary M does that fix something?? |
15:54:15 | FromDiscord | <Gary M> not sure yet |
15:54:23 | FromDiscord | <Gary M> but I think I have something else to fix 😄 |
15:57:01 | * | zacharycarter joined #nim |
15:57:18 | FromDiscord | <Gary M> I'm looking at some other things right now |
15:57:19 | FromDiscord | <Rika> @Gary M i cant find the issue that you pointed out |
15:57:19 | FromDiscord | <Rika> ?? |
15:57:19 | FromDiscord | <Rika> https://cdn.discordapp.com/attachments/371759389889003532/700374011657584770/unknown.png |
15:57:19 | FromDiscord | <Rika> i dont see the issue] |
15:57:19 | FromDiscord | <Gary M> it's just an unescaped forward slash, but it might not make a difference |
15:57:21 | FromDiscord | <Rika> i dont think vscode cares about it |
15:58:25 | FromDiscord | <Gary M> https://i.imgur.com/tKh1PQq.png |
15:58:31 | FromDiscord | <Gary M> @Rika boy |
15:58:35 | FromDiscord | <Rika> ? |
15:58:37 | FromDiscord | <Gary M> or girl, dude, whatever |
15:58:38 | FromDiscord | <Gary M> look |
15:58:47 | FromDiscord | <Rika> ??? what am i supposed to see |
15:58:53 | FromDiscord | <Gary M> *look harder* |
15:58:55 | FromDiscord | <Rika> im kind of colorblind btw |
15:58:59 | FromDiscord | <Gary M> oh |
15:59:07 | FromDiscord | <Rika> legit ;; |
15:59:08 | FromDiscord | <Gary M> it's not coloring on that operator now |
15:59:15 | FromDiscord | <Gary M> on the plus |
15:59:17 | FromDiscord | <Rika> the test + 2 |
15:59:19 | FromDiscord | <Gary M> yes |
15:59:22 | FromDiscord | <Rika> what regex did you fic |
15:59:25 | FromDiscord | <Rika> fix |
15:59:52 | FromDiscord | <Gary M> * is also fixed rn not sure why |
16:00:16 | FromDiscord | <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:26 | FromDiscord | <Rika> WHAT REGEX DID YOU FIX |
16:00:34 | FromDiscord | <Recruit_main707> lel |
16:00:57 | FromDiscord | <Gary M> THE ONE THAT FIXES IT |
16:01:05 | FromDiscord | <Rika> WHICH ONE GOD DAMN IT |
16:01:09 | FromDiscord | <Gary M> lol |
16:01:19 | FromDiscord | <Gary M> ```json |
16:01:20 | FromDiscord | <Gary M> "comment": "Function call (no parenthesis).", |
16:01:27 | FromDiscord | <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:27 | FromDiscord | <Gary M> "name": "support.function.any-method.nim" |
16:01:27 | FromDiscord | <Gary M> ``` |
16:01:27 | FromDiscord | <Gary M> that's one motherfuck of a regex |
16:01:44 | FromDiscord | <Gary M> at the very end it was doing (-+ a couple times |
16:01:45 | FromDiscord | <Rika> REST IN PEACE IRC PEOPLE |
16:02:03 | FromGitter | <zetashift> I've seen worse codeblocks pasted tbh |
16:02:04 | FromDiscord | <Recruit_main707> F |
16:02:15 | FromDiscord | <Gary M> which was matching characters from range ( to + |
16:03:08 | FromDiscord | <Gary M> kind of a weird thing |
16:03:43 | FromDiscord | <Rika> so just remove that and its done |
16:03:57 | FromDiscord | <Gary M> seems like it |
16:04:00 | FromDiscord | <Rika> also * is behind + so it makes sense that * is fixed now too |
16:04:10 | FromDiscord | <Gary M> I already did in that code block |
16:04:59 | FromDiscord | <Rika> bless your soul, i dont like looking at regex |
16:05:09 | FromDiscord | <Rika> though i am perfectly capable of doing this myself |
16:05:14 | FromDiscord | <Rika> i just do not want to |
16:05:21 | FromDiscord | <Gary M> well at least all of my variables are the same color for now 😄 |
16:06:13 | FromDiscord | <Rika> yeah! |
16:06:24 | FromDiscord | <Rika> fuck |
16:06:24 | FromDiscord | <Rika> https://cdn.discordapp.com/attachments/371759389889003532/700376557382008862/unknown.png |
16:06:32 | FromDiscord | <Gary M> oh great. |
16:06:35 | FromDiscord | <Rika> HAHAHAHAHA |
16:06:41 | Araq | that regex looks wrong on multiple levels |
16:06:44 | FromDiscord | <Rika> memed |
16:07:22 | Araq | 1. mixes keywords with stuff that happens to be in system.nim |
16:07:22 | FromDiscord | <Gary M> it's the regex that's in the nim vscode extension 😄 |
16:07:28 | FromDiscord | <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:38 | FromDiscord | <Rika> thats what i said for echo being a keyword!!! |
16:07:50 | FromDiscord | <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:56 | FromDiscord | <Rika> its like saying print() is somehow a keyword in python |
16:08:04 | FromDiscord | <Rika> it USED to be one, it no longer is |
16:08:11 | Araq | 2. "Function call without parenthesis" is like er, every Nim construct ever. |
16:08:39 | FromDiscord | <Rika> Araq: why do you think it has basically every nim construct ever in the list |
16:08:39 | FromDiscord | <Gary M> yeah that's a weird one |
16:08:40 | FromDiscord | <Rika> lmao |
16:09:03 | FromDiscord | <Gary M> so what should we do, start the regex from scratch? 🤣 |
16:09:16 | FromDiscord | <Gary M> that doesn't sound fun |
16:09:25 | FromDiscord | <Rika> fix it up i guess |
16:09:29 | FromDiscord | <Rika> major rewrite |
16:09:35 | FromDiscord | <Rika> not from scratch though |
16:09:42 | FromDiscord | <Gary M> should div be a keyword or an operator? |
16:10:19 | FromDiscord | <Rika> lets wait for our lord and savior 😛 |
16:10:19 | FromDiscord | <Recruit_main707> function? |
16:10:24 | FromDiscord | <Gary M> actually it's technically a proc |
16:10:26 | FromDiscord | <Rika> div is an operator function |
16:10:31 | FromDiscord | <Rika> since it's backticked |
16:10:45 | FromDiscord | <Gary M> ah ok |
16:10:59 | FromDiscord | <Gary M> https://i.imgur.com/17OG0IV.png |
16:11:01 | FromDiscord | <Recruit_main707> @Rika is that a rule or something? |
16:11:02 | FromDiscord | <Gary M> so this is fucked |
16:11:29 | FromDiscord | <Rika> @Recruit_main707 any proc name in backticks uses "operator" style usage |
16:11:41 | FromDiscord | <Recruit_main707> oh |
16:11:48 | FromDiscord | <Rika> so \`add` is used like 1 add 2, add is used like 1.add 2 |
16:12:01 | FromDiscord | <Rika> symbols MUST be backticked |
16:12:04 | FromDiscord | <Gary M> would you say it should be colored the same as the + - * / operators |
16:12:10 | FromDiscord | <Rika> i would yes |
16:12:17 | FromDiscord | <Rika> not sure with ara q |
16:12:37 | FromDiscord | <Recruit_main707> what color though, mine are white XD |
16:12:48 | FromDiscord | <Rika> that's on the theme |
16:12:55 | FromDiscord | <Rika> not the highlighting |
16:13:12 | FromDiscord | <Gary M> https://i.imgur.com/cHctGR9.png closer to this |
16:13:15 | FromDiscord | <Recruit_main707> i know, i just dont remember seeing it highlighted |
16:13:20 | FromDiscord | <Gary M> although the variable is still fucked on that one |
16:13:42 | FromDiscord | <Rika> i really really do not want to deal with this 😛 |
16:14:18 | FromDiscord | <Recruit_main707> open an issue and wait :smart: |
16:14:41 | FromDiscord | <Recruit_main707> open an issue and wait :p |
16:15:06 | FromDiscord | <Rika> or let the king gary m fix it |
16:16:02 | FromDiscord | <Recruit_main707> also, i got this to work, generated code is not as clean as i would have liked, but meh ¯\_(ツ)_/¯ |
16:16:07 | FromDiscord | <Recruit_main707> https://play.nim-lang.org/#ix=2iim |
16:16:44 | FromGitter | <alehander92> krux02 sorry |
16:16:54 | FromGitter | <alehander92> i knew about it but i always delayed looking at it |
16:16:55 | FromGitter | <alehander92> merged |
16:18:14 | FromDiscord | <Rika> @Recruit_main707 you know you could have just used quote do https://play.nim-lang.org/#ix=2iiq |
16:18:43 | FromDiscord | <Recruit_main707> https://tenor.com/view/themoreyouknow-star-rainbowstreak-nbc-gif-4884642 |
16:19:05 | FromDiscord | <Rika> F |
16:19:14 | FromDiscord | <Rika> should have told you earlier lmao |
16:19:28 | FromDiscord | <Recruit_main707> ill take it as learning experience xD |
16:19:53 | FromDiscord | <Rika> if its simple and valid nim syntax, try quote do |
16:20:10 | FromDiscord | <Rika> if it doesnt work, use manual ast creation |
16:20:26 | FromDiscord | <Recruit_main707> ill have it in mind |
16:21:24 | FromGitter | <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:30 | FromDiscord | <Gary M> I made negative progress! |
16:28:32 | FromDiscord | <Gary M> https://i.imgur.com/GWcod7R.png |
16:28:42 | FromDiscord | <Gary M> now all the variables are orange 😄 |
16:28:54 | * | inv2004 quit (Ping timeout: 240 seconds) |
16:29:13 | FromDiscord | <Gary M> but only on the left side of an operation |
16:29:27 | FromDiscord | <Recruit_main707> bruh |
16:29:42 | FromDiscord | <Gary M> or even the right, it looks |
16:29:56 | FromDiscord | <Gary M> just, even less consistent than before, awesome |
16:30:00 | FromDiscord | <Gary M> regex is a *bitch* |
16:30:13 | * | disbot quit (Ping timeout: 264 seconds) |
16:30:28 | FromDiscord | <Rika> sigh |
16:30:43 | FromDiscord | <Rika> who thought syntax highlighting should be in regex |
16:31:52 | FromDiscord | <Gary M> sadists |
16:33:47 | * | inv2004__ joined #nim |
16:37:00 | krux02 | Gary M: what are you working on? |
16:38:01 | * | inv2004_ quit (Ping timeout: 264 seconds) |
16:39:01 | FromDiscord | <Gary M> krux02: the syntax highlighting for the Nim extension in Vscode |
16:39:05 | FromDiscord | <Gary M> it's all sorts of messed up |
16:39:28 | FromDiscord | <Gary M> https://i.imgur.com/7AeidB3.png |
16:39:33 | FromDiscord | <Gary M> this image for example |
16:39:42 | FromDiscord | <Gary M> variables aren't at all colored as variables |
16:39:57 | * | disruptek joined #nim |
16:40:01 | FromDiscord | <Gary M> and then variables on the left of operations like + and * get colored like procs |
16:40:19 | FromDiscord | <Gary M> and some other fun things |
16:40:24 | FromDiscord | <Gary M> but that's the most annoying |
16:40:57 | * | disbot joined #nim |
16:43:42 | * | ITChap quit (Quit: ITChap) |
16:44:06 | krux02 | yea I had similar experience with emacs syntax highlighting. |
16:44:24 | krux02 | It was all messed up. But the worst part there was, it was messed up in performance. |
16:44:52 | krux02 | Making editing of large files practically impossuble, unless you turn off syntax highlighting. |
16:44:55 | * | rockcavera joined #nim |
16:45:26 | FromDiscord | <Gary M> ouch |
16:45:35 | FromDiscord | <Gary M> one reason to just not use emacs? |
16:45:50 | FromDiscord | <Rika> not really idt |
16:46:48 | krux02 | not 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:24 | krux02 | It is now fast btw. |
16:47:30 | * | disbot quit (Ping timeout: 256 seconds) |
16:47:42 | * | icebattl1 quit (Ping timeout: 265 seconds) |
16:47:55 | FromDiscord | <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:13 | companion_cube | «» |
16:48:40 | * | disbot joined #nim |
16:49:11 | FromDiscord | <Recruit_main707> ye, but how XD |
16:49:12 | * | disruptek joined #nim |
16:49:49 | PMunch | dadada, yeah I guess it would be doable with some modifications. The question is if we want to allow that kind of rewrite |
16:50:12 | ZoomZoomZoom | Alt+0171, Alt+0187 |
16:50:41 | FromDiscord | <Recruit_main707> thx |
16:50:55 | companion_cube | I use a compose key |
16:51:11 | Zevv | I just cut&paste from companion_cube |
16:51:47 | companion_cube | https://www.fileformat.info/info/unicode/char/search.htm?q=guillemet&preview=entity |
16:52:18 | Zevv | oh 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:10 | dadada | PMunch: 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:15 | dadada | calling 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:21 | FromDiscord | <Rika> fuck, i should really read through the whole of docs |
16:59:41 | FromDiscord | <Rika> literally was thinking "hmm npeg would benefit from templates" and right in the docs there it is |
17:00:21 | PMunch | dadada, well SCF is seen as a bit of a "please don't use this unless you really need to" feature |
17:01:05 | dadada | PMunch: 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:10 | Zevv | Rika: always one step ahead! |
17:01:26 | PMunch | I 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:45 | PMunch | And it's been considered for removal many times |
17:02:03 | FromDiscord | <Recruit_main707> what, macros? |
17:02:07 | dadada | it should be improved/built upon, not removed |
17:02:20 | FromDiscord | <Gary M> https://i.imgur.com/hPgnV3A.png |
17:02:22 | PMunch | Recruit_main707, haha no not macros |
17:02:25 | FromDiscord | <Gary M> yeah this regex is just butchered. |
17:02:41 | PMunch | dadada, well macros should be your last ditch effort for "normal" usage. But it's super helpful for writing ergonomic libraries and such |
17:02:41 | FromDiscord | <Rika> jesus what the fuck did you do |
17:02:44 | FromDiscord | <Gary M> absolute monstrosity |
17:02:47 | dadada | it's definitely not a feature that you should use all the time, but it's nice to have |
17:02:52 | FromDiscord | <Gary M> @Rika that's how it currently is 😦 |
17:02:53 | FromDiscord | <Recruit_main707> yes, 4 spaces tabs wtf |
17:03:10 | FromDiscord | <Gary M> it's like, just not a good regex |
17:03:30 | FromDiscord | <Gary M> anyways it's 10am and I haven't slept. I should sleep 😄 |
17:03:33 | FromDiscord | <Rika> jesus christ thats pretty bad |
17:03:38 | FromDiscord | <Rika> wait wait |
17:03:40 | FromDiscord | <Rika> btw |
17:03:45 | PMunch | Recruit_main707, everyone knows that 4 spaces for indentation but combine every 8th space with a tab |
17:03:48 | FromDiscord | <Gary M> I'll try to work on it when I've had some rest. |
17:04:00 | FromDiscord | <Rika> vscode uses `\\` instead of `\` for escaping @Gary M |
17:04:08 | FromDiscord | <Rika> just in case you didnt notice |
17:04:10 | FromDiscord | <Gary M> I know |
17:04:15 | dadada | PMunch: 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:33 | FromDiscord | <Gary M> it's really that json uses that |
17:04:38 | * | owl_000 joined #nim |
17:04:42 | krux02 | PMunch, I really wonder who came up with that idea |
17:04:58 | FromDiscord | <Gary M> you have to escape the escape, otherwise json tries to parse it before the regex does |
17:05:13 | krux02 | dadada, what is SCF? |
17:05:21 | dadada | krux02: source code filter |
17:05:31 | krux02 | ah |
17:05:37 | krux02 | yea, I vote to remove them |
17:05:56 | krux02 | put them on an experimental feauture branch or somtehing |
17:05:59 | dadada | you'd vote to remove varargs, too, and I love that feature |
17:06:09 | PMunch | krux02, 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:19 | owl_000 | in 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:24 | krux02 | dadada, I don't want to remvoe varargs, I want to replace it with a varargs that works. |
17:06:36 | krux02 | But that isn't possible without breaking varargs first. |
17:06:53 | dadada | krux02: 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:53 | PMunch | owl_000, where do you see those? |
17:06:57 | krux02 | dadada, maybe you will stop loving varargs if you try to fix its problems |
17:07:03 | owl_000 | when i compile |
17:07:08 | * | xcm quit (Remote host closed the connection) |
17:07:15 | krux02 | dadada, for me it did |
17:07:19 | PMunch | Anything? I've never seen that warning.. |
17:08:10 | FromDiscord | <Rika> me neither |
17:08:26 | FromDiscord | <Rika> it looks like something went wrong with your nim compiler or something |
17:08:28 | krux02 | btw I realized Nim has now 17000 commits |
17:08:40 | FromDiscord | <Rika> nice |
17:08:41 | krux02 | precisely |
17:08:46 | dadada | cool |
17:08:53 | krux02 | not sure if that measures anything |
17:08:58 | FromDiscord | <Rika> so who IS the author of the 17000th commit |
17:09:00 | krux02 | probably effort |
17:09:28 | krux02 | timotheecour it is |
17:09:34 | krux02 | not that there is a price for it |
17:09:56 | owl_000 | https://ibb.co/qr3hjK9 look at the screen shot |
17:10:18 | dadada | krux02: 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:22 | krux02 | dadada, that depends on the person creating the commit. |
17:11:35 | FromDiscord | <Gary M> @Rika ok one last fix before I log off |
17:11:41 | FromDiscord | <Gary M> go back to that same long ass regex |
17:11:46 | krux02 | Some people work all day long for a commit, some people create a commit for just a few minutes of work |
17:11:52 | FromDiscord | <Gary M> right after "comment": "Function call (no parenthesis).", |
17:12:13 | * | xcm joined #nim |
17:12:13 | FromDiscord | <Gary M> change the start from (?! to (?= |
17:13:18 | owl_000 | `let content = readFile("test.txt")` compiling it in linux shows those warning. |
17:13:23 | FromDiscord | <Gary M> https://i.imgur.com/6KVqv55.png |
17:13:39 | FromDiscord | <Gary M> seems to have unborked the variables better now. |
17:13:56 | FromDiscord | <Gary M> also I removed div from that one and put it in operators |
17:13:59 | * | liblq-dev joined #nim |
17:14:06 | FromDiscord | <Rika> nice |
17:14:11 | FromDiscord | <Gary M> generic operators for expressions |
17:14:21 | FromDiscord | <Gary M> just div| before the other things |
17:14:28 | FromDiscord | <Gary M> hope that helps 😄 |
17:15:05 | FromDiscord | <Rika> does good, nice |
17:15:05 | FromDiscord | <Rika> thanks |
17:15:29 | krux02 | div and or mod and all the other word operators? |
17:16:02 | FromDiscord | <Recruit_main707> that was hard to read lol |
17:16:05 | zacharycarter | ZoomZoomZoom: you figure out your issue? |
17:16:43 | * | inv2004__ quit (Ping timeout: 250 seconds) |
17:17:19 | ZoomZoomZoom | zacharycarter, yep, moreover, I've made a PR for SDL2 library (#124) with an instruction |
17:17:49 | FromDiscord | <Recruit_main707> i should try to make sdl2 work again i guess |
17:17:56 | ZoomZoomZoom | zacharycarter, Thanks for getting back to me |
17:18:30 | FromDiscord | <Rika> @Gary M uh oh |
17:18:30 | FromDiscord | <Rika> https://cdn.discordapp.com/attachments/371759389889003532/700394700414124052/unknown.png |
17:18:46 | FromDiscord | <Rika> how the fuck does that happen lmaoooo |
17:18:50 | FromDiscord | <Gary M> LiVe WiTh It |
17:18:57 | FromDiscord | <Rika> haha go sleep |
17:19:00 | FromDiscord | <Rika> im just showing ya |
17:19:12 | FromDiscord | <Gary M> I'll work out the KINKS later ugh |
17:21:11 | FromDiscord | <Gary M> it's matching the alternate "of" and just moving on |
17:23:15 | FromDiscord | <Rika> go, before i report more bugs |
17:24:51 | owl_000 | `echo "hello world"` nim 1.2.0 in linux 64 produces this warning too. https://ibb.co/vc7M4F1 |
17:25:23 | Prestige | my eyes |
17:27:28 | disruptek | holy shit. |
17:27:58 | FromDiscord | <Gary M> @Rika ok try this |
17:27:59 | owl_000 | `--gc:refc` produces no warning though. |
17:28:00 | FromDiscord | <Gary M> lmao |
17:28:08 | FromDiscord | <Gary M> (?=(\b |
17:28:21 | FromDiscord | <Gary M> it's just adding \b right before the first thing |
17:28:39 | FromDiscord | <Rika> where should this go |
17:28:42 | FromDiscord | <Gary M> actually \\ for json |
17:28:43 | FromDiscord | <Rika> and you must sleep |
17:28:46 | FromDiscord | <Gary M> double \ |
17:28:53 | FromDiscord | <Gary M> so \\\\b |
17:29:00 | FromDiscord | <Gary M> same place as last time |
17:29:07 | FromDiscord | <Gary M> function call no paren |
17:30:16 | FromDiscord | <Gary M> ah I also move of to the start... |
17:30:28 | FromDiscord | <Gary M> lemme just shoot you a message lol |
17:30:33 | zacharycarter | ZoomZoomZoom: np! glad you got it figured out :) |
17:31:14 | FromDiscord | <Gary M> @Rika add me |
17:31:30 | ZoomZoomZoom | zacharycarter, "np!"="no problem"? |
17:32:08 | ZoomZoomZoom | P ≠ NP :D |
17:38:00 | * | NimBot joined #nim |
17:38:54 | * | inv2004__ joined #nim |
17:42:28 | disruptek | hearts and minds, people; hearts and minds! |
17:43:41 | dadada | disruptek: glad to see you here again! we want streams |
17:43:51 | dadada | hope you've been well |
17:44:07 | disruptek | dude. |
17:44:13 | disruptek | i know you only tune in for the music. |
17:44:25 | dadada | exactly! :D |
17:44:45 | disruptek | i'm fine but i've had a lot of hardware issues. |
17:44:58 | disruptek | wetware is tip-top, i'm happy to report. |
17:45:11 | * | Vladar joined #nim |
17:45:27 | Zevv | \o/ |
17:45:33 | disruptek | awwww sup dawg |
17:46:07 | Zevv | so how the hell did you get through the days like that?! |
17:46:15 | Zevv | reading, like, books, or stuff like that?! |
17:46:18 | FromGitter | <zetashift> ewww |
17:47:08 | disruptek | we don't read in 'murica |
17:47:18 | FromGitter | <zetashift> did you shoot some stuff |
17:47:27 | disruptek | actually, you have to read this writings.stephenwolfram.com article. |
17:47:38 | disruptek | it's got the gears turning. |
17:47:41 | FromGitter | <zetashift> the plottwist it is reading |
17:48:04 | disruptek | i'm desperate to learn what it says. |
17:48:13 | disruptek | i just look at the pictures. |
17:48:24 | FromGitter | <zetashift> Link to the article? |
17:48:27 | FromGitter | <zetashift> or is it the first one |
17:48:42 | disruptek | whatever was posted on 4/14. |
17:48:48 | disruptek | i don't have a gui atm. |
17:48:56 | FromGitter | <zetashift> "Finally We May Have a Path to the Fundamental Theory of Physics… ⏎ and It’s Beautiful" |
17:49:24 | FromGitter | <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:17 | disruptek | honestly, it's about the most interesting thing i've read in years, and it meshes with a lot of my graph work. |
17:54:23 | Zevv | it's pretty pictures and all, true that |
17:55:35 | disruptek | what have the nimions been up to over the last week? |
17:55:51 | Zevv | no idea, I hardly come here these days |
17:56:04 | leorize | you're back disruptek \o/ |
17:56:19 | Prestige | PMunch: I opened a quick PR for nimlsp to fix the issue we talked about yesterday |
17:56:20 | narimiran | disruptek: easter |
17:56:37 | leorize | and disbot is back too, it's missed :p |
17:57:47 | leorize | narimiran: can you add dochack to list of triggers for the docgen ci? |
17:57:49 | disruptek | i can wake up the bot once i get wayland running at >0.2fps. |
17:58:05 | narimiran | leorize: yeah, it might be a good idea |
17:58:11 | leorize | disruptek: did you screw up your graphics driver? |
17:58:19 | Zevv | running on an e-ink display I bet |
17:59:22 | disruptek | i 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:52 | disruptek | thanks 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:07 | leorize | lol |
18:01:29 | leorize | what brand of card is that? maybe I can find you a bios |
18:01:37 | disruptek | gigabyte |
18:02:27 | leorize | https://www.gigabyte.com/Graphics-Card/GV-R56XTGAMING-OC-6GD/support#support-dl-bios |
18:02:39 | disruptek | don'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:58 | FromDiscord | <Rika> i wish i had an e-ink monitor |
18:02:59 | disruptek | what's the latest date there? i have no browser. |
18:03:18 | leorize | 2020-01-21 |
18:03:18 | disruptek | iirc you can get e-ink panels pretty cheap. |
18:03:25 | disruptek | ahh, i bet that's what i need. |
18:04:01 | disruptek | Zevv: we shoulda made those nim-based corona badges. |
18:04:12 | disruptek | there's still time if you are interested. |
18:04:14 | * | owl_000 quit (Quit: Leaving) |
18:04:21 | FromDiscord | <Rika> panels are cheap afaik, monitors arent |
18:04:49 | FromDiscord | <Rika> oh, panels ARENT cheap |
18:04:51 | FromDiscord | <Rika> lmao |
18:07:00 | Zevv | disruptek: what would a "nim-based corona badge" do, exactly? |
18:07:27 | Zevv | flash "don't panic" in big friendly letters? |
18:07:28 | disruptek | you wear it on a lanyard and it displays how much adjacency you've had with other spreaders. |
18:07:52 | disruptek | it's like those radiation badges. |
18:08:09 | disruptek | didn't we talk about this a couple months ago? |
18:09:08 | Zevv | I recall you dropping the term "corona badge" once, but no background info |
18:09:12 | Zevv | I might have missed that |
18:09:21 | disruptek | gamification of the 14-day decay. |
18:09:38 | Zevv | privacy! implications! |
18:10:30 | disruptek | you prefer the google/apple solution? |
18:10:54 | Zevv | nope |
18:11:31 | Zevv | I do not believe in any technological means for this, I guess |
18:13:20 | disruptek | are walls technology? |
18:13:38 | Zevv | narrow that down to anything that runs on batteries |
18:14:00 | disruptek | it's batteries you have a problem with. |
18:14:28 | Zevv | and 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:04 | disruptek | leorize: you wanna weigh in on this ryu thread? |
18:23:24 | leorize | what ryu thread? |
18:23:26 | disruptek | #7717 |
18:23:55 | disruptek | i think your impl is the one we want, right? |
18:24:53 | * | inv2004__ quit (Quit: Leaving) |
18:25:18 | leorize | no, I haven't even started on the impl :P |
18:25:32 | leorize | clyybber impl is a 1:1 translation of the C one |
18:25:43 | leorize | mine can be used as a guide to navigate that mess :P |
18:26:40 | disruptek | but, i don't think it makes sense to use the translation. |
18:27:13 | disruptek | i thought you were like 3/5ths done. |
18:28:15 | leorize | I've only finished the reference impl, not ryu |
18:28:23 | leorize | I haven't even started on ryu :P |
18:32:31 | disruptek | disbot: can you work at 0.2fps? |
18:32:32 | disbot | yep. 😊 |
18:50:56 | leorize[m] | disruptek: oh if you don't have windows you can actually flash from uefi if you're brave enough :P |
18:51:26 | disruptek | i'm brave, but i'm also not an idiot. |
18:54:41 | FromDiscord | <Varriount> Hey krux02. 😄 |
18:58:08 | audiophile | can 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:08 | leorize | no |
19:00:13 | audiophile | k |
19:00:25 | leorize | it's a mess in python because python separate packages by python version |
19:00:29 | leorize | we don't do that here |
19:00:40 | FromDiscord | <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:46 | leorize | also nimph is more reliable than nimble :P |
19:00:51 | audiophile | what if i want to use a library version x instead of latest y? |
19:00:58 | audiophile | oh first time hearing of nimph will check it out |
19:01:04 | leorize | nimble install lib@version |
19:01:13 | leorize | !repo nimph |
19:01:16 | audiophile | Varriount I iddn' understand that :( |
19:01:24 | leorize | disbot is dead again :P |
19:01:28 | audiophile | leorize but where does it get installed? |
19:01:34 | audiophile | does it overwrite global installation |
19:01:46 | FromDiscord | <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:47 | leorize | installed alongside the global one |
19:02:06 | leorize | then each one will be compiled with the version they require |
19:02:21 | FromDiscord | <Varriount> How do you specify the version required? |
19:02:24 | leorize | kinda terrible imo, but it works because some people want it to |
19:02:33 | leorize | `requires` in .nimble |
19:02:46 | leorize | you can specify version constraints there |
19:03:04 | audiophile | oh that's kinda like a virtualenv I guess, except your different versions of `baz` also get installed globally? |
19:03:39 | audiophile | 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:50 | leorize | yea |
19:04:02 | audiophile | uh yeah to which question =) |
19:04:07 | leorize[m] | both |
19:04:20 | audiophile | ah |
19:04:25 | audiophile | nice! |
19:05:10 | disruptek | yeah, lemme try flashing this thing. then the bot can return to service. |
19:05:56 | audiophile | dont flash |
19:05:59 | audiophile | it's illegal O_o |
19:07:10 | audiophile | PMunch hullo |
19:07:51 | FromDiscord | <Varriount> audiophile: Yes. |
19:08:13 | audiophile | uh im a bit confused |
19:08:18 | audiophile | what does that have to do with not needing virtualenv |
19:08:35 | audiophile | you specify in the .nimble and just compile, that's all? |
19:08:43 | audiophile | specify the package versions I mean |
19:08:52 | Zevv | what's "phi nodes"? |
19:09:07 | FromDiscord | <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:23 | audiophile | ohhh i see what you mean |
19:09:31 | audiophile | it all goes away with statically compiled bins right? |
19:10:06 | FromDiscord | <Varriount> Well, yes. You can still have problems with DLLs, but various operating systems have that mostly sorted out. |
19:11:01 | FromDiscord | <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:17 | audiophile | oh I see |
19:11:26 | audiophile | a lot of headache avoided nicely in nim |
19:11:39 | audiophile | is this messy situation common with interpreted langs? |
19:12:17 | FromDiscord | <Varriount> Javascript seems to have it sorted out, but then again, it essentially creates a virtual environment by default. |
19:12:39 | supakeen | Javascript package managers create an environment by default, Python is working on that bit as well. |
19:12:58 | Zevv | but 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:08 | FromDiscord | <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:47 | FromDiscord | <Varriount> I guess C/C++ technically allow that with DLLs? You tend to get odd behavior though. |
19:14:50 | krux02 | Varriount: hey |
19:14:58 | krux02 | @Varriount: just saw your message |
19:15:00 | * | natrys quit (Quit: natrys) |
19:15:01 | krux02 | what's up? |
19:15:22 | * | someunknownuser joined #nim |
19:15:35 | FromDiscord | <Varriount> krux02: Nothing much, just interested to see what you're working on. |
19:16:07 | krux02 | currently, I am trying to figure out a healthy way to continue Nim development. |
19:17:33 | FromDiscord | <Varriount> krux02: You can always fork the compiler. Or work on a library. |
19:17:57 | krux02 | yes I can do that. |
19:18:14 | FromDiscord | <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:39 | krux02 | I don't really care too much about emit. |
19:18:58 | krux02 | It should be improved, but it is not high on the list of priorities. |
19:20:09 | companion_cube | maybe an alternative compiler would be a healthy way of continuing nim development? |
19:22:08 | krux02 | maybe yes, an alternative Nim compiler would be good. |
19:22:33 | krux02 | But I can't maintain a fork of Nim. |
19:22:53 | krux02 | Not alone. |
19:23:22 | FromDiscord | <Recruit_main707> if someone does this, either a more pure nim to c transpiler or an actual nim -> exe compiler |
19:23:41 | krux02 | I am thinking of a more pure Nim |
19:23:47 | krux02 | no surprise features |
19:23:48 | FromDiscord | <Varriount> @Recruit_main707 See NLVM https://github.com/arnetheduck/nlvm |
19:24:08 | FromDiscord | <Recruit_main707> linux only to my known :( |
19:24:21 | companion_cube | a smaller nim means a smaller compiler, right? :) |
19:24:27 | krux02 | I am on Linux as well, I don't even have windows. |
19:24:39 | krux02 | a smaller Nim means less bugs. |
19:24:51 | FromDiscord | <Varriount> I have Windows... or will have, once my personal computer is fixed. |
19:25:17 | krux02 | you want to help me build a fork of Nim? |
19:26:04 | companion_cube | oh boy, wish I had the time |
19:27:18 | Araq | do you want me to say anything? |
19:27:28 | FromDiscord | <Varriount> krux02: Well, what kind of help/support are you looking for? |
19:29:38 | someunknownuser | krux02: What exactly do you mean by "no surprise features"? |
19:29:41 | leorize[m] | krux02: are you planning to create an another implementation of Nim? |
19:30:32 | leorize[m] | or are you gonna take the current compiler and trim it down? |
19:32:24 | FromGitter | <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:31 | Araq | fwiw I can give you many guideliens for a trimmed down Nim... |
19:32:36 | Araq | *guidelines |
19:34:27 | dadada | for 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:33 | dadada | maintain 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:39 | dadada | state, 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:03 | FromGitter | <sheerluck> Brunhilda is a good name too. |
19:35:24 | Araq | but I'm the scapegoat so I doubt you want my input, krux02 |
19:37:41 | Araq | my 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:41 | companion_cube | could be called 'trim' |
19:38:43 | krux02 | Varriount: If I actually do a Nim fork, there should be a homepage for it. |
19:39:04 | krux02 | leorize[m], I am thinking of trimming down Nim. |
19:39:26 | companion_cube | maybe with the same compiler and a -betterC flag! |
19:39:29 | companion_cube | ah wait, that's D. |
19:39:48 | zacharycarter | I don't really understand the motivation - aren't extra features hidden behind feature flags anyway? |
19:39:55 | FromGitter | <sheerluck> Why are you always tend to choose short names for programming languages? Ekaterina is a good name too by the way. |
19:40:09 | krux02 | zacharycarter, nope |
19:40:13 | leorize[m] | I'd personally welcome an alternative implementation more |
19:40:43 | zacharycarter | I think Nim has grown larger and more complex because it's tackling larger and more complex problems |
19:40:46 | krux02 | extra featuruse sprinkled around the codebase as gunk that nobody needs, but hinders bug fixes. |
19:41:10 | zacharycarter | wouldn't a simpler nim be a nim that's less usable in certain situations? |
19:41:18 | krux02 | no |
19:41:43 | krux02 | The feautures that I want to remove are probably feautures that you never even heared about. |
19:41:55 | zacharycarter | I guess so |
19:42:03 | Araq | which ones would that be? |
19:42:06 | zacharycarter | I'm definitely not very much into language design |
19:42:06 | companion_cube | krux02: a list would be interesting |
19:42:36 | krux02 | I don't have a list ready, but I will produce one. |
19:42:44 | companion_cube | that'd be nice |
19:43:24 | Araq | .liftLocals |
19:43:56 | krux02 | Things that I would adress that bothered me since the beginning is proper editor integration that works 100% reliable. |
19:44:08 | krux02 | No more false error messages because a fil is included. |
19:44:17 | FromDiscord | <Varriount> fil? |
19:44:23 | FromDiscord | <Varriount> Oh, file |
19:44:26 | krux02 | file yes |
19:44:27 | krux02 | sorry |
19:44:32 | dadada | krux02: 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:38 | dadada | nor 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:58 | Prestige | krux02: what do you mean about the editor? I haven't run into that issue (yet?) |
19:45:00 | krux02 | thanks |
19:45:16 | Araq | he means that 'nim check' works as documented and that editors misuse it |
19:45:19 | FromDiscord | <Varriount> Prestige: You will if you've ever worked in a project that uses the `include` statement. |
19:45:28 | Araq | and it's of course Nim's fault. been there, discussed that. |
19:46:12 | krux02 | Araq: yes, we discussed it. You are in denial that there is a problem. Therefore I could never fix it. |
19:46:15 | Araq | I 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:40 | krux02 | no the problem is deeper. |
19:46:43 | Araq | ah I'm in denial again. |
19:47:06 | krux02 | yes. |
19:47:23 | dadada | comedy and tragedy are very closely related! |
19:47:38 | Prestige | Hmm idk if I'll run into that issue since my editor just uses the lsp |
19:47:44 | krux02 | I gave up on convincing you that there is a problem. |
19:47:48 | FromDiscord | <Recruit_main707> tragedy is comedy without the punchline |
19:47:51 | krux02 | Can only be addressed in a fork. |
19:48:33 | krux02 | I would also redo the command line interface. |
19:49:07 | krux02 | ``nim c`` what does c stand for? compile. Ok, then ``nim cpp`` what does cpp stand for? |
19:49:27 | FromDiscord | <Recruit_main707> c++? |
19:49:37 | companion_cube | compile plus plus |
19:49:37 | krux02 | yes |
19:49:40 | FromDiscord | <Recruit_main707> https://tenor.com/view/nickyoung-questionmarks-what-excuseme-huh-gif-4486363 |
19:49:46 | FromDiscord | <Varriount> krux02: I could certainly help with that. |
19:50:43 | Prestige | Maybe just update the help output but it seems fine |
19:51:09 | Araq | Prestige: his editor doesn't use the LSP though and it's Nim's fault once again. |
19:51:13 | krux02 | I would change the command line interface to probably just `nim myfile.nim` |
19:52:00 | Prestige | Araq: stop writing these bad editors /s |
19:52:19 | FromDiscord | <Varriount> krux02: How would the various commands (check, etc) be represented? |
19:52:27 | dadada | talking 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:30 | dadada | ! |
19:52:53 | Prestige | Looks decent but I can't get away from vim |
19:52:54 | FromDiscord | <Recruit_main707> but its abandoned right? |
19:52:59 | dadada | since it's written in Nim, you can assume that it's Nim support will be awesome |
19:53:09 | dadada | Recruit_main707: no, very active on github |
19:53:15 | krux02 | Varriount: not sure yet |
19:53:22 | FromDiscord | <Recruit_main707> oh really? does it work on windows? |
19:53:28 | dadada | Prestige: it has vim keybindings, and plans to support mor vim features |
19:53:33 | dadada | more |
19:53:46 | krux02 | but this `c` mean `compile` but it kinda also means `C` as in the language, I really hate it. |
19:54:05 | krux02 | same with `cstring` |
19:54:06 | Prestige | I mean I have vim working with nim already |
19:54:11 | krux02 | meaning string from C. |
19:54:17 | dadada | krux02: I'd appreciate a git-style command based interface, they're relatively easy to intuit about |
19:54:31 | krux02 | But then it is also in javascript, and it is also called `cstring` |
19:54:39 | Prestige | krux02: I thought it was just the compile target, not actually meaning "compile" |
19:54:59 | FromDiscord | <Recruit_main707> krux02: would you prefer jsstring? |
19:55:06 | krux02 | yes |
19:55:33 | FromDiscord | <Recruit_main707> lol, no, something else to worry about and not necesary imo |
19:55:51 | leorize | cstring is officially called "compatible string" lol |
19:56:05 | Prestige | I 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:07 | FromDiscord | <Recruit_main707> gotcha there |
19:56:17 | krux02 | leorize, yes exactly |
19:56:20 | leorize | which makes zero sense tbf :p |
19:56:38 | krux02 | but cint and clong is compatible int and compatible long? |
19:56:51 | leorize | Prestige: the way nim cli work is ingrained into the compiler itself |
19:57:25 | Araq | sure, "compatible with C" in this case, but *shrug*, this is not even nitpicking, it's trolling |
19:57:29 | Prestige | Interesting. I think it's fine how it is |
19:57:38 | FromGitter | <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:47 | leorize | I'm not a huge fan of the nim cli either |
19:58:04 | leorize | but I gotta create some good cli first before I can give ppl advise :p |
19:58:42 | Prestige | Can just follow normal cli conventions, like -c, --compile would both be the same thing |
19:58:47 | Prestige | But it's like |
19:58:48 | dadada | all 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:53 | Prestige | It's working so who cares really |
20:00:54 | shashlick | krux02: 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:55 | Prestige | Araq: you have any thoughts on zig? |
20:02:38 | leorize[m] | Prestige: good cli go a long way. gcc thought so until clang forces them to up their game |
20:02:49 | Prestige | Fair enough |
20:03:19 | Araq | Prestige: no, I don't see the point. Just use Rust with unsafe blocks if you don't mind verbosity. |
20:03:21 | dadada | in 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:25 | PMunch | Prestige, sweet! |
20:05:03 | Prestige | It was only like 2 lines but I thought I'd save you the trouble |
20:06:00 | Prestige | dadada: looks interesting, if they add plugin support I'd actually check it out |
20:06:51 | someunknownuser | I also wrote my own editor in nim for editing nim code (See https://github.com/pseudo-random/editor). |
20:07:46 | dadada | Araq: 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:52 | dadada | the most realistic and least painful paths of transition. |
20:08:22 | Araq | maybe. because Linus officially hates C++ |
20:08:44 | Prestige | Nice someunknownuser :) you should add some gifts/screenshots imo, world be cool to see it in action |
20:09:37 | Prestige | I heard a lot of people discussing rust for kernel development but it isn't quite there yet |
20:09:38 | companion_cube | ZIg goes a bit further than rust in its handling of allocators |
20:09:44 | companion_cube | no global allocator is unusual |
20:09:51 | someunknownuser | Prestige: Thanks, I am planning on doing that at some point in the future. |
20:10:21 | dadada | Araq: 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:04 | Araq | and 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:23 | Araq | rename the .c file to .cpp and add some casts for the different void* handling. |
20:12:02 | Araq | it'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:39 | Araq | it's also not going anywhere, it's fine. I'll simply use RustOS when it's ready and won't look back ;-) |
20:13:08 | companion_cube | you mean https://www.redox-os.org/? :) |
20:13:22 | Araq | yeah |
20:13:23 | Prestige | Nimos when? |
20:13:35 | FromDiscord | <arnetheduck> @Araq help me with https://github.com/arnetheduck/nbindgen then 😉 |
20:13:41 | companion_cube | there's also serenityOS which is pretty cool |
20:15:52 | dadada | Araq: 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:58 | dadada | start 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:05 | dadada | s/than can/that can |
20:16:39 | Araq | why does it have to be "idiomatic C++"? |
20:17:19 | Araq | you can write the new code in more idiomatic C++, you don't have to convert the other trillion of lines |
20:17:21 | PMunch | Prestige, those are the hardest to do, because of the overhead |
20:18:14 | dadada | Araq: have you looked at Linux kernel code? Just curious, don't want to troll you or anything? |
20:18:14 | Araq | but 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:29 | dadada | Araq: I'm not going to use Zig for anything, I'm currently deep in the Nim trenches. relax! |
20:19:40 | PMunch | And Prestige, I think dom96 made a POC OS in Nim |
20:19:47 | PMunch | Not sure if it still compiles though |
20:19:51 | Araq | C 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:14 | Prestige | Interesting - I don't think I'll ever get into anything so deeply involved though |
20:20:27 | tane | how do stack allocations make anyone fight the language? |
20:22:09 | dadada | Araq: 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:41 | dadada | s/guys/guys and gals/ |
20:24:02 | * | Trustable quit (Remote host closed the connection) |
20:25:23 | companion_cube | s/guys/y'all/ |
20:25:24 | Araq | dadada: I know. |
20:25:25 | companion_cube | don't thank me |
20:25:48 | FromGitter | <sheerluck> I thought in English the gals are included in the guys so you never have to s/guys/guys and gals/ |
20:25:50 | dadada | companion_cube: I don't thank you! |
20:26:37 | liblq-dev | hmm, I'm getting a segfault at popFrame() somewhere in the stacktrace system |
20:26:39 | liblq-dev | no clue why |
20:26:43 | leorize[m] | depends on what english you're using I guess :P |
20:26:47 | dadada | sheerluck: yes, but I want to please the thought police |
20:27:14 | leorize[m] | liblq-dev: now that definitely doesn't sound good |
20:27:14 | FromGitter | <sheerluck> leorize dadada how about I fork English language? |
20:27:30 | liblq-dev | leorize: it's probably something because I'm interfacing with C |
20:27:38 | liblq-dev | worst thing is, it's not my library |
20:27:47 | dadada | sheerluck: there are already hundreds of forks of English |
20:27:47 | liblq-dev | so I have to debug someone else's code. |
20:27:56 | leorize[m] | should affect too much, I think |
20:28:02 | Prestige | sheerluck: in the USA you can say "guys" to mean the immediate group of people you're talking about, which is genderless |
20:28:04 | leorize[m] | what are you using? |
20:29:15 | companion_cube | Prestige: y'all is just better 🤷 |
20:29:42 | Prestige | If you're from Texas ;P |
20:30:02 | companion_cube | well I lived in Texas, and it's clearly a good invention of theirs |
20:30:16 | companion_cube | all y'all dunnow what y'all are missin |
20:30:36 | disruptek | in philly it's you's. |
20:30:37 | dadada | Prestige: 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:43 | dadada | people should feel included anyways and assume that I'm a well-meaning person |
20:30:54 | * | abm quit (Quit: Leaving) |
20:30:56 | PMunch | sheerluck, great idea, let's fork it clean up the cruft, add some nice features and call it English++ |
20:31:24 | Prestige | dadada: I've been in that situation, I guess I just don't care enough to change my speech |
20:31:37 | liblq-dev | hm, --gc:arc still segfaults but I get a way different result |
20:31:57 | leorize[m] | then maybe we need to see your code :p |
20:32:01 | disruptek | leorize: 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:21 | disruptek | !repo nimph |
20:32:22 | disbot_ | 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:35 | leorize[m] | disruptek: that's sad then |
20:33:01 | dadada | Prestige: 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:11 | disruptek | nope. |
20:33:27 | dadada | Prestige: and it should be FOSS code |
20:33:44 | FromGitter | <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:50 | Prestige | love me some foss |
20:34:41 | Prestige | The whole 'ship' being female thing is some weird sailor shit I think |
20:35:14 | leorize[m] | I definitely don't know enough english for this conversation |
20:35:27 | dadada | sheerluck: 2) is a big mistake, not having this is one of the best assets of the English language IMO |
20:35:49 | dadada | sheerluck: I'm not going that fork :D |
20:36:06 | supakeen | Can I submit a fork to this English PR to replace -ed with -t. |
20:36:10 | Prestige | I wish we had a genderless shared version of he/she like we do in Farsi |
20:36:26 | supakeen | So we can write walkt and burnt and learnt and talkt and it'll be consistent? |
20:36:31 | PMunch | supakeen, poor people named Ted will now just be known as Tt |
20:36:38 | supakeen | Hehe poor Ted. |
20:36:39 | FromGitter | <sheerluck> ))))) |
20:36:39 | Prestige | lmao |
20:36:40 | PMunch | Prestige, they? |
20:37:01 | PMunch | supakeen, oh yeah that'd be nice |
20:37:04 | Prestige | sounds weird to me, but what if you're telling a story with a male and female in the same sentence? |
20:37:19 | PMunch | What do you mean? |
20:37:24 | Prestige | my brain keeps mixing up he and she when I say sentences like that |
20:37:32 | supakeen | They is the common form used for ungendered stuff but it's not very common especially for non native speakers. |
20:37:37 | Prestige | "He told her that he did x and she said to him...." |
20:37:42 | supakeen | Where it might map onto something that doesn't exist at all. |
20:38:00 | PMunch | Prestige, ah right |
20:38:16 | dadada | supakeen: 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:19 | PMunch | That sentence would just be massively confusing without the genders though |
20:38:41 | PMunch | Xe told xe that xe did x and xe said to xe.... |
20:38:53 | PMunch | That's just completely unreadable :P |
20:38:59 | supakeen | dadada: Fine, I'll fight you. |
20:39:00 | supakeen | ;) |
20:39:12 | PMunch | Two forks, the most stars wins! |
20:39:22 | PMunch | But I'm off to bed now, ttyl |
20:39:23 | * | PMunch quit (Quit: leaving) |
20:40:18 | Xe | hi |
20:40:21 | Xe | oh |
20:40:39 | Prestige | o/ |
20:41:15 | * | ryan_ quit (Ping timeout: 250 seconds) |
20:43:12 | Prestige | Is 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:16 | disruptek | it's the only sane way to handle arbitrary local/global dependency relationships, but it's not the common way. |
20:44:26 | disruptek | most people use nimble alone. |
20:44:45 | disruptek | we 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:26 | supakeen | did 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:39 | supakeen | anyways 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:13 | Prestige | dadada: I lol'd |
20:54:21 | FromGitter | <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:18 | dadada | Prestige: wanted to see if somebody could go lower than me, apparently nobody can |
20:55:27 | FromGitter | <sheerluck> And I spent 2 hours wondering is that "Marsha" is close to russian name "Masha" or is it just coincidence |
20:55:49 | supakeen | @sheerluck: the dogs? |
20:55:55 | FromGitter | <sheerluck> yes |
20:56:25 | dadada | enough with this silly chit chat, I've some hacking to do |
20:56:47 | supakeen | @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:04 | supakeen | Masha in Russian is Maria in English isn't it? |
20:57:12 | FromGitter | <sheerluck> yes |
20:57:25 | disruptek | udev renaming eth ifaces according to hardware address is stupid. |
20:57:44 | supakeen | @sheerluck: Do you spell it wit that 'w' letter? |
20:57:48 | supakeen | (for sh) |
20:58:00 | FromGitter | <sheerluck> yes |
20:58:01 | leorize | I find it kinda useful |
20:58:13 | supakeen | Nice :) |
20:58:38 | disruptek | huge pita when the hardware happens to change. |
20:58:50 | disruptek | i'm just renaming them manually now, eg. san0, wan1, etc. |
20:58:55 | supakeen | Anyways, if Masha = Maria, Marsha != Maria so I don't think the names are related! |
20:59:38 | naught-fowl | howdy nimbos |
21:02:21 | Araq | naught-fowl: is it you? fowl? |
21:04:18 | disruptek | naught. |
21:04:27 | disruptek | Araq: whassup boss |
21:04:54 | Araq | disruptek: waiting for your PR |
21:05:27 | disruptek | i 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:06 | Araq | well try it for one hour please |
21:09:20 | Araq | after that, throw in the towel and tell me "dude, impossible!" |
21:10:26 | disruptek | the whole file changed. i may as well just finish the refactor and push just that one file's changes. |
21:11:18 | disruptek | don't worry; we're not going to lose this work product. it's on gh, fwiw. |
21:11:37 | dadada | installed moe with nimble install moe |
21:11:42 | dadada | and get this: could not load: libncursesw.so |
21:12:19 | dadada | hmm, I thought that nimble takes care of such things... this is the first time something like that happened to me |
21:12:34 | dadada | with nimble I mean, usually if you can nimble it, it'll work |
21:12:36 | leorize[m] | libncursesw.so is a system library |
21:12:39 | disruptek | you sweet, summer child. |
21:12:41 | Araq | disruptek: is it? which branch? |
21:12:45 | leorize[m] | nimble won't be able to deal with it :P |
21:12:46 | disruptek | ic2 |
21:12:54 | leorize[m] | what distro are you using? |
21:12:56 | dadada | leorize[m]: yeah, I know that |
21:13:06 | dadada | leorize[m]: fedora 31 |
21:13:16 | * | xet7 joined #nim |
21:13:16 | Araq | gah this SSA stuff is so hard, maybe I should stream about it |
21:13:23 | Araq | forces me to focus when I stream... |
21:13:23 | disruptek | ssa? |
21:13:34 | Araq | "static single assignment" form |
21:14:12 | leorize[m] | dadada: try installing ncurses-devel? |
21:14:29 | dadada | leorize[m]: already installed |
21:14:30 | leorize[m] | I'm not sure what's the name for the development package there |
21:14:57 | leorize[m] | `/lib` and/or `/usr/lib` have no libncursesw.so? |
21:16:01 | dadada | leorize[m]: they do, but there's a version number coming after .so, that's probably the issue here |
21:16:25 | leorize[m] | that means you haven't got the development package installed :P |
21:17:04 | dadada | leorize[m]: I do have them installed, dnf install ncurses-devel |
21:17:10 | dadada | Package ncurses-devel-6.1-12.20190803.fc31.x86_64 is already installed. |
21:17:36 | leorize[m] | or fedora is weird |
21:17:44 | dadada | /lib/libncursesw.so.6 -> libncursesw.so.6.1 |
21:17:51 | dadada | there's no /lib/libncursesw.so |
21:18:17 | leorize[m] | usually development packages will have a `lib.so` (w/o version) for developers to link with `-llibname` |
21:18:20 | disruptek | just make a link and move on with your life. |
21:18:45 | FromGitter | <sheerluck> dadada /usr/lib/libncursesw.so ? |
21:18:54 | dadada | leorize[m]: I assume they want to make sure that no package compiled against an older ncurses can accidently use the newer library?! |
21:19:36 | leorize[m] | once linked the library will be referred to by its soname |
21:19:43 | dadada | lib is a symlink to /usr/lib in fedora, so there's no difference shee |
21:19:45 | dadada | sheerluck |
21:19:47 | disruptek | i'm sure that's it. those well-intentioned fedoralists. |
21:19:57 | leorize[m] | in your case `libncurses.so.6`, but linkers can only find `libncurses.so` |
21:22:25 | dom96 | alehander92: reviewed your diff |
21:24:13 | dadada | leorize[m]: created the link, moe still complains about the same thing.., hmm |
21:24:24 | dadada | could not load: libncursesw.so |
21:24:31 | leorize[m] | where did you put the link? :p |
21:24:38 | dadada | maybe there's simply another incompatibility |
21:24:44 | dadada | leorize[m]: inside /usr/lib/ |
21:25:12 | leorize[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:35 | dadada | leorize[m]: here's what strace output looks like for moe https://pastebin.com/iUeg3xH7 |
21:28:48 | dadada | as you can see it tries to open the lib from different places |
21:29:10 | dadada | I've verified that /lib64/libncursesw.so exist |
21:29:12 | dadada | exists |
21:32:46 | leorize[m] | dadada: lol I see the problem now |
21:32:57 | leorize[m] | your `libncursesw.so` is a linker script :p |
21:34:08 | dadada | yeah, does look like it |
21:34:13 | leorize[m] | looks like you gotta build moe with some special flags |
21:35:42 | leorize[m] | `nimble build --dynlibOverride:ncurses --passL:-lncursesw` <- that's how it should be built for you |
21:36:01 | leorize[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:20 | dadada | leorize[m]: I wonder why the thing looks in lib64, but not lib |
21:39:45 | leorize[m] | because that's what fedora configured it's glibc to do |
21:40:46 | dadada | I'll see what #fedora has to say |
21:41:29 | leorize[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:14 | dadada | can someone verify that nimble install moe works in other distributions? |
21:44:50 | leorize[m] | definitely not mine |
21:44:52 | * | dadada sneeky way of promoting moe |
21:44:54 | leorize[m] | got a linker script too |
21:45:03 | dadada | which distro? |
21:45:09 | leorize[m] | gentoo |
21:46:58 | leorize[m] | actually, maybe it could work |
21:46:58 | leorize[m] | wait |
21:47:04 | dadada | https://github.com/fox0430/moe/issues/508 |
21:47:05 | disbot_ | ➥ Unable to locate installed libncursesw.so |
21:48:12 | leorize[m] | lol the linked PR remains unmerged to this day |
21:48:23 | leorize[m] | yep moe doesn't work here |
21:48:48 | dadada | don'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:01 | dadada | s/he/he or she |
21:49:25 | * | inv2004 joined #nim |
21:50:29 | dadada | I 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:56 | inv2004 | Hello, 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:22 | Araq | array[10, S] |
21:55:19 | * | sagax joined #nim |
21:55:52 | inv2004 | thx |
22:02:37 | dadada | this is related https://github.com/nim-lang/Nim/issues/987 |
22:02:57 | dadada | and this also https://github.com/rnowley/nim-ncurses/issues/15 |
22:02:58 | disbot_ | ➥ Problem with using 'libncursesw.so' (Linux) |
22:03:22 | dadada | seems 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:20 | dadada | this 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:44 | FromGitter | <alehander92> @dom96 thank you |
22:10:52 | FromGitter | <alehander92> i'll look at this after a few days, sorry guys |
22:10:55 | FromGitter | <alehander92> Easter vacation |
22:10:57 | FromGitter | <alehander92> for us here |
22:11:51 | dadada | I'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:11 | ZoomZoomZoom | I'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:17 | ZoomZoomZoom | Great work |
22:15:32 | Araq | thanks |
22:15:44 | Araq | development is on-going |
22:15:47 | dadada | ZoomZoomZoom: where? |
22:15:56 | ZoomZoomZoom | https://forum.nim-lang.org/t/5734 |
22:17:08 | Araq | this is outdated btw |
22:17:16 | Araq | sink inference is in 1.2 |
22:17:28 | Araq | as is the new exception handling implementation |
22:17:33 | ZoomZoomZoom | I'm at the stage of emerging into the ecosystem |
22:17:57 | ZoomZoomZoom | So trying to suck in the info with some historical perspective :) |
22:18:56 | ZoomZoomZoom | Where to read next? |
22:19:18 | Araq | ZoomZoomZoom: watched my video about it? |
22:19:25 | ZoomZoomZoom | Not yet, will do |
22:19:26 | * | tane quit (Quit: Leaving) |
22:19:37 | Araq | it's outdated too but was done later :P |
22:20:01 | Araq | dadada: I like hand written wrappers but regardless, I think the solution is to fork the package |
22:20:11 | Araq | happens all the time |
22:20:13 | * | nande joined #nim |
22:20:20 | ZoomZoomZoom | Ok. 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:48 | Araq | ZoomZoomZoom: IMHO all new development should use --gc:arc |
22:27:24 | ZoomZoomZoom | Sure looks like it, but what do I know |
22:28:50 | dadada | ZoomZoomZoom: we have a commonality |
22:31:44 | * | inv2004 joined #nim |
22:32:05 | dadada | ZoomZoomZoom: 3x da 3x Zoom |
22:32:33 | ZoomZoomZoom | nice catch |
22:33:02 | * | someunknownuser quit (Quit: someunknownuser) |
22:33:32 | liblq-dev | is it possible to specify a git repository URL in nimble requires()? |
22:33:37 | ZoomZoomZoom | Although, I'm mostly go by ZoomZoomZoom/3 |
22:34:14 | Araq | liblq-dev: yeah, iirc you simply write down the URL |
22:36:54 | shashlick | here'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:19 | shashlick | http://ix.io/2ilb/nim is the output on Linux |
22:38:31 | ZoomZoomZoom | Wait, I've seen the video from FOSDEM already. Oh, boy... |
22:39:54 | zacharycarter | I want to emit `__attribute__((used, section("__DATA,__state")))` in my C code before a function definition - is this possible? |
22:40:59 | zacharycarter | I 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:31 | zacharycarter | ah nevermind I Found examples of this |
22:43:33 | leorize[m] | I'm not a fan of `codegenDecl`, but it works for this kind of things |
22:43:49 | zacharycarter | yeah - that's what the example I found was using |
22:47:19 | dadada | shashlick: thanks, is there a central place for all nimterop wrapper generator files? would be useful to stop people from reinventing the wheel |
22:48:19 | ZoomZoomZoom | BTW, is "Nim in Action" a recommended read, or considered outdated? |
22:49:29 | dadada | ZoomZoomZoom: still good, go read it, I recommend this blog post to new Nim people https://totallywearingpants.com/posts/nim-language-highlights/ |
22:50:06 | ZoomZoomZoom | Thx |
22:52:20 | leorize[m] | dadada: https://github.com/nimterop/nimterop/wiki/Wrappers |
22:53:21 | FromDiscord | <KingDarBoja> Hi 😄 |
22:54:55 | shashlick | There is a wrappers repo but I haven't had time to get it up and running |
22:55:10 | shashlick | Right now I maintain them in individual repos |
22:55:19 | shashlick | Nimarchive and nimgit2 |
22:55:55 | FromDiscord | <Recruit_main707> Has someone tried using c2nim/nimterop to wrap a Python.h? |
22:56:31 | dadada | shashlick: 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:55 | leorize | Araq: is there a proper way for --gc:arc and cycles to live together? |
22:57:17 | leorize | or is --gc:arc capable of warning me about potential cycles? |
22:58:32 | Araq | Recruit_main707: there is a python.nim somewhere |
22:58:55 | shashlick | https://github.com/nimterop/wrappers |
22:59:04 | Araq | leorize: it can warn but it's not reliable. I'm not sure the problem has a solution beyond what 'owned' did |
22:59:23 | FromDiscord | <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:19 | Araq | well you can either write a bug report or re-wrap it :-) |
23:01:33 | FromDiscord | <Recruit_main707> I think I actually have one... |
23:01:37 | FromGitter | <sealmove> Guys I did it :) You can already use Kaitai with Nim https://ci.kaitai.io/ |
23:01:45 | FromDiscord | <Recruit_main707> Well, a github issue |
23:05:47 | FromDiscord | <KingDarBoja> What is kaitai? Sorry for my ignorance 😄 |
23:06:14 | FromDiscord | <Recruit_main707> Similar to flatbuffers I think |
23:06:16 | liblq-dev | I made a program for animating things https://github.com/liquid600pgm/pan |
23:06:40 | liblq-dev | still a WIP, there are a few things I'll need to sort out before I can call it done |
23:06:49 | leorize[m] | kaitai is a binary parser language |
23:06:50 | liblq-dev | eg. a timeline, importing audio files |
23:07:06 | leorize[m] | it lets you parse any binary data, given the schema |
23:07:28 | dadada | when will arc be the default GC? |
23:07:43 | leorize[m] | once Araq solved cycles |
23:07:43 | FromDiscord | <Recruit_main707> libq-dev how about you add support for Nim? |
23:07:50 | leorize[m] | :P |
23:09:04 | zacharycarter | aren't cycles solved with --gc:orc? |
23:09:36 | leorize[m] | --gc:orc kinda ruins everything --gc:arc stands for |
23:10:04 | zacharycarter | Does it? Couldn't --gc:orc still be used in soft realtime apps? Like games? |
23:10:31 | zacharycarter | it still gets one past the lack of a shared heap |
23:10:39 | leorize[m] | determinism is the main feature of --gc:arc |
23:10:42 | inv2004 | Sorry 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:52 | leorize[m] | zacharycarter: orc breaks this |
23:11:13 | leorize[m] | inv2004: `cast[ptr UncheckedArray[S]]` |
23:11:42 | zacharycarter | I get it - but I think it still allows me to make progress haha |
23:11:43 | FromDiscord | <KingDarBoja> I feel like dumb after seeing all those nim projects 😄 |
23:11:57 | FromDiscord | <KingDarBoja> Pretty awesome the Lua-Nim program |
23:11:59 | * | dwdv quit (Ping timeout: 260 seconds) |
23:12:07 | leorize | you'll get used to it soon |
23:13:08 | FromGitter | <sealmove> what Lua-Nim program? |
23:13:18 | leorize[m] | !repo pan |
23:13:19 | disbot_ | https://github.com/liquid600pgm/pan -- 9pan: 11puny animator – create motion graphics using Lua 15 0⭐ 0🍴 7& 1 more... |
23:14:28 | FromGitter | <sealmove> hmm |
23:16:58 | inv2004 | @leorize[m], type mismatch: got <ptr UncheckedArray[S]> but expected 'S = ptr S:ObjectType' |
23:17:20 | leorize[m] | what are you trying to do? |
23:18:16 | inv2004 | I have addr of beginning of c-array of S-struct. I want extract N-th struct from the c-array |
23:18:39 | inv2004 | ... of S-structs. |
23:18:41 | liblq-dev | @Recruit_main707 how about no? the Nim VM is slow and hard to work with |
23:19:03 | liblq-dev | all that passing PNodes around and what not |
23:19:05 | leorize[m] | liblq-dev: or you can make it a library :P |
23:19:19 | liblq-dev | I could, but then I'm losing out on fast hot code reloading. |
23:19:25 | liblq-dev | don't think I didn't consider that :P |
23:19:34 | leorize[m] | inv2004: then `ptr UncheckedArray` is what you want |
23:19:55 | leorize[m] | but I can't tell you why it's erroring out without seeing the code |
23:20:18 | leorize[m] | liblq-dev: or you could have make it do both :p |
23:21:03 | liblq-dev | maintaining 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:51 | inv2004 | leorize[m], my nim's type S = ptr object ... . |
23:22:21 | inv2004 | because C:typedef struct s0{...} *S |
23:22:32 | liblq-dev | do you guys really hate lua so much? :P |
23:22:38 | liblq-dev | it's not a bad language for fast prototyping. |
23:22:43 | leorize[m] | you're in `#nim` |
23:22:52 | leorize[m] | in `#nim`, nim is the best |
23:22:52 | liblq-dev | but pan is written in nim! |
23:22:59 | FromDiscord | <KingDarBoja> You gained a follower liblq-dev |
23:23:27 | FromDiscord | <KingDarBoja> I used LUA with Love2D cuz it was the language being used at the CS50 Videogame design course |
23:23:30 | leorize[m] | not enough, you still used the inferior lua |
23:23:32 | FromDiscord | <KingDarBoja> it is* |
23:23:33 | FromDiscord | <Recruit_main707> > in `#nim`, (and everywhere else) nim is the best |
23:23:58 | liblq-dev | leorize: dude, I know. it's just that I needed something fast and didn't want to mess with long compile times |
23:24:16 | leorize[m] | i know, i was just joking around lol |
23:24:19 | * | FromDiscord <KingDarBoja> Insert chad meme here |
23:24:50 | liblq-dev | ikr |
23:25:44 | liblq-dev | though I would've used Nim if it compiled as fast as a lightweight VM language |
23:26:43 | FromDiscord | <Recruit_main707> compiled VM? |
23:27:12 | FromDiscord | <Recruit_main707> Either one or the other :p |
23:28:21 | liblq-dev | this 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:41 | liblq-dev | well anyways, I'm out for now. goodnight. |
23:28:43 | * | liblq-dev quit (Quit: WeeChat 2.7.1) |
23:28:49 | leorize[m] | you could have developed an alternative Nim VM :p |
23:28:53 | FromDiscord | <KingDarBoja> https://www.slant.co/versus/395/1418/~nim_vs_lua |
23:28:54 | leorize[m] | 'night |
23:29:29 | FromDiscord | <Recruit_main707> As an expython programmer, I will say vm advantages are not as much as compiled ones. |
23:29:29 | FromDiscord | <Recruit_main707> Good night |
23:30:10 | * | krux02_ joined #nim |
23:30:50 | FromDiscord | <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:13 | lqdev[m] | @Recruit_main707 negligible when you're sending expensive commands to the GPU. |
23:37:20 | audiophile | waht is dsl/domain specific lang and why should I care? just curious |
23:37:27 | audiophile | is it dll stuff? |
23:37:35 | lqdev[m] | as long as it runs fast enough to play at 60fps, I'm happy. |
23:38:13 | * | endragor joined #nim |
23:41:33 | FromDiscord | <KingDarBoja> Didn't you went to bed? |
23:41:43 | audiophile | hello king |
23:41:57 | FromDiscord | <KingDarBoja> ❤️ |
23:42:06 | FromDiscord | <KingDarBoja> Sup mate |
23:42:24 | audiophile | :D not much here working on building some C source code wbu |
23:43:10 | FromDiscord | <KingDarBoja> Nice, I am right now updating my local repo of TS-website to keep translating sections of the site |
23:43:18 | FromDiscord | <KingDarBoja> To spanish lang |
23:43:21 | audiophile | TS? |
23:43:36 | audiophile | teamspeak?? |
23:43:42 | * | endragor quit (Remote host closed the connection) |
23:43:54 | leorize[m] | lqdev[m]: oh do you finally get the lqdev name? |
23:44:12 | leorize[m] | they should've done the old nick purge on the 11th |
23:46:16 | FromGitter | <sealmove> audiophile: TypeScript |
23:48:24 | * | endragor joined #nim |
23:56:32 | FromDiscord | <KingDarBoja> TypeScript |
23:58:08 | audiophile | ah |
23:58:19 | audiophile | statically typed js? |
23:58:49 | FromDiscord | <KingDarBoja> Yeap |
23:59:49 | krux02_ | audiophile, it really feel like a C# ish javascript. |
23:59:57 | FromDiscord | <KingDarBoja> That's true too |