<< 28-08-2021 >>

00:11:16FromDiscord<fae> What’s the difference between `1.0f` and `1.0'f` ? It seems the latter is mentioned in the reference as type suffixes, but no mention of the first syntax even though it seems valid?
00:12:07FromDiscord<Elegantbeef> `'` 😛
00:12:41FromDiscord<fae> Also it seems strange that by default `float` is 64 bit but `1.0f` is 32 bit
00:12:42FromDiscord<Elegantbeef> They're identical you can do `10u8` or `10'u8` though with the new(devel new) user defined literals you need to do `'yourLit`
00:12:43FromDiscord<konsumlamm> the first is legal as well, but the secpnd is recommended, because you can define custom literal suffixes with the `'` syntax
00:13:06FromDiscord<Elegantbeef> well fae do `1.0` and then you'll really be confused 😉
00:13:21FromDiscord<konsumlamm> `1.0f` being a float32 probably comes from that being the behaviour in C etc
00:13:31FromDiscord<fae> It’s by default `float` which is 64 bit no?
00:13:37FromDiscord<Elegantbeef> yes
00:13:52FromDiscord<fae> Yea this threw me off for like 20 min trying to render a triangle lol
00:13:54FromDiscord<konsumlamm> in Nim, `float` is 64 bit, but in C it's 32 bit
00:13:56FromDiscord<fae> My stride was wrong
00:14:30FromDiscord<Elegantbeef> `sizeof(var)` goes brrr
00:14:40FromDiscord<fae> So anyway, to answer my original question, using the type suffix syntax is more idiomatic
00:15:59FromDiscord<konsumlamm> they're both "type suffix syntax", but only the version with `'` can be user-defined
00:16:20FromDiscord<fae> Okay, thank you
00:17:10FromDiscord<konsumlamm> possibly `1.0f` will be deprecated in the future, in favor of `1.0'f` (or `1.0'f32` or something)
00:17:28FromDiscord<Elegantbeef> I dont see why it would
00:18:37FromDiscord<fae> It feels weird to have two syntax to do the exact same thing
00:18:47FromDiscord<Elegantbeef> Welcome to Nim fae
00:19:03FromDiscord<Elegantbeef> Nim tons of flexibility in how you do stuff
00:20:25FromDiscord<fae> Yea but usually multiple syntaxes will at least offer some type of ergonomic benefit. I don’t see it here, except the `'` being more noisy
00:20:47FromDiscord<fae> Like snake case or camel case calling is a feature. This just seems weird
00:21:20FromDiscord<fae> But I’m new so I’m sure I have plenty to learn about the benefits
00:21:35FromDiscord<Elegantbeef> Well there arent any benefits it's just if you prefer `'` or not 😀
00:21:44FromDiscord<Elegantbeef> Atleast when talking about built ins
00:22:20FromDiscord<Elegantbeef> And now that i'm thinking about it the `1.0f` could be removed in favour of a non compiler supported variant, which could be a benefit
00:22:33FromDiscord<konsumlamm> and if you prefer consistency or having to type one chsracter less
00:22:57FromDiscord<konsumlamm> and that's also part of the reason, it could be defined in the stdlib
00:22:59FromDiscord<fae> i think i prefer consistency, making builtins more consistent with user defined makes more sense to me 🤷‍♂️
00:26:04FromDiscord<fae> Another question... is there some magic that automatically applies the type of the first element in an array/seq to the rest of the elements?
00:26:38FromDiscord<konsumlamm> yes, that magic is called type inference
00:28:12FromDiscord<fae> sent a code paste, see https://play.nim-lang.org/#ix=3xaN
00:28:31FromDiscord<fae> you would think i wouldnt need to annotate the first element since ive already defined it as float32
00:29:01FromDiscord<konsumlamm> indeed
00:29:03FromDiscord<Elegantbeef> Nim lacks good left to right hand type inference, which can cause hidden errors
00:29:13FromDiscord<fae> ahh
00:29:21FromDiscord<konsumlamm> ye, it's annoying sometimes
00:29:41FromDiscord<fae> I will look out for that, ty
00:32:06FromDiscord<Elegantbeef> The most annoying point is with expressions since you know the type should be X but the compiler is complaining the second value doesnt match
00:34:01FromDiscord<Elegantbeef> It's pretty common with procedures that are supposed to be converted to a specific type
01:04:16FromDiscord<cabboose> https://play.nim-lang.org/#ix=3xaU
01:04:34FromDiscord<cabboose> So I'm trying to understand how the `[]` func for hashsets work
01:04:48FromDiscord<cabboose> I'm passing it the same hash
01:04:55FromDiscord<cabboose> and I've provided a custom `==` function
01:05:11FromDiscord<cabboose> but still attempting to get the element with the same hash provides a key error
01:05:44FromDiscord<cabboose> is there some underlying issue? is it to do with using inheritable objects?
01:07:46FromDiscord<gogolxdong (liuxiaodong)> Anyone saw error like this `/home/lingx/.nimble/pkgs/websock-0.1.0/websock/extensions/compression/deflate.nim(384, 8) Error: cannot bind another '=destroy' to: DeflateExt:ObjectType; previous declaration was constructed here implicitly: /home/lingx/.nimble/pkgs/chronos-3.0.6/chronos/asyncmacro2.nim(321, 33)`
01:11:29FromDiscord<cabboose> Yeah status modules aren't usually orc/arc compatible afaik atm
01:12:01*neurocyte0 joined #nim
01:12:01*neurocyte0 quit (Changing host)
01:12:01*neurocyte0 joined #nim
01:13:37FromDiscord<cabboose> the compiler automatically constructs `=destroy` funcs if one isn't provided before the use of the type, trying to pass another one to it will cause that error
01:14:25*neurocyte quit (Ping timeout: 250 seconds)
01:14:25*neurocyte0 is now known as neurocyte
01:14:29FromDiscord<cabboose> `var ext: DeflateExt; ext.new(destroyExt)` thats the code being raised by the compiler
01:19:32arkanoidwhat does it mean "Error: unhandled exception: over- or underflow [OverflowDefect]" ?
01:20:43arkanoidI get it when I add this piece of code generated by c2nim https://termbin.com/44s1
01:21:25FromDiscord<cabboose> what are you trying to do with c2nim and soap
01:21:54FromDiscord<cabboose> are you trying to make a soap client?
01:21:57arkanoidyes
01:22:21FromDiscord<cabboose> is it for a specific API or you want a general one
01:22:43FromDiscord<cabboose> because I have made specific API soap clients I can share the code for
01:23:05arkanoidoh, the error was generated by too many whitespaces after each string
01:24:14arkanoidcabboose. I've created a poc of a specific soap client too, lot's of xml stuff (deeply nested schemes here). Now I'm trying to wrap gSOAP
01:24:31arkanoidproblem is that API I'm dealing with ha hundreds of functions
01:24:36arkanoidand complex types
01:25:11arkanoidI've been trying to metaprogramming all that, but it's very difficult and requires some parsing knowledge that I lack
01:26:14FromDiscord<cabboose> hahaha yeah I see what you mean; luckily the schemas I was accessing weren't too over developed
01:26:15arkanoidcabboose, but if you like to share, I'd be happy to read it
01:27:11arkanoidcabboose, I've a total of 42 xml files, the maximum import/include level is 7
01:27:58arkanoidI just gave up after seeing complexType into complexType and so on for 6 times
01:28:14arkanoidso now I'm trying the wrapping path
01:29:36FromDiscord<cabboose> Soap do be like that 😦
01:30:01arkanoidI got rid of the previous error, but now nim compiler complains about nil in my UncheckedArray https://termbin.com/44s1
01:30:11arkanoidError: type mismatch: got <typeof(nil)> but expected 'string'
01:31:15arkanoidcabbose I've already have a macro that given a Soap action and a wsdl file creates a proc for that to send request and receive response. Problem is data binding
01:31:47arkanoidI need to create objects for all functions input and output, it would take ages without some automation
01:33:01FromDiscord<cabboose> I haven't though about it too far but wouldn't tuples work?
01:34:16FromDiscord<cabboose> but then they'd probably be ridiculously nested considering what you're saying about the objects
01:35:19arkanoidcabboose, I'd be happy with tuples too
01:35:27arkanoidproblem is data binding
01:36:12arkanoidI mean, writing a program that maps xml schema hierarchy to nim data types and back is hard
01:36:33arkanoidmicrosoft has it for c#, apache foundation has it for java
01:37:18FromDiscord<cabboose> I was happy with an agnostic response format so converted the soap response into json and then pass that to treeforms jsony to make my types
01:37:22arkanoidhow can I tell that a [nil,nil,nil,nil] is of type array[0..3, string] when --nilseqs:on ?
01:37:40FromDiscord<cabboose> I don’t have any solution for input though
01:38:23arkanoidcabboose, yeah I also have that sort of automatic binding for all proc with no input args and just output
01:39:03arkanoidbut I have to deal with input too. I have helper template for that that gives me easy way to map input, problem is still the amount of it
01:39:16FromDiscord<cabboose> Then you are alone friend; but I would be happy to help
01:40:43FromDiscord<gogolxdong (liuxiaodong)> @\_discord\_364103562243866624\:t2bot.io how to fix this error
01:41:47arkanoidcabboose, well if you know how to build a parser, I'm probably not too far away to achieve at least the xml to nim types part
01:42:16arkanoidthen we would need the types to xml part, and that would also be part of a good parser
01:42:32arkanoidthat's why I stopped, I need to study first
01:43:22*auxym_ quit (Ping timeout: 252 seconds)
01:43:38FromDiscord<cabboose> See my issue was I don’t know enough about wsdl
01:43:51FromDiscord<cabboose> I think the parser is not that bad
01:43:52FromDiscord<cabboose> hahahaha
01:44:50arkanoidwsdl is not difficult, it's just overly verbose
01:44:56arkanoidproblem is xml schema
01:45:01FromDiscord<cabboose> You can’t fix the error unless you fork websock and maybe even chronos to make them gc arc/orc compatible
01:45:57FromDiscord<cabboose> chronos to a certain extent afaik is, but some of their client/server funcs aren’t
01:46:26FromDiscord<cabboose> it’s not a priority for them atm (stability and completion of what they’re making atm is) so if you can do that then you’d be swimmin
01:47:21FromDiscord<cabboose> arkanoid I can work with the lower end of xmlparse; you know wsdl and I don’t
01:47:25FromDiscord<cabboose> maybe we can make a brain baby
01:47:29FromDiscord<cabboose> hahahahaha
01:49:57arkanoidhahaha
01:50:12arkanoidbut I quite don't get what you find difficult of wsdl
01:50:40FromDiscord<cabboose> I have 0 knowledge of it and i really didn't need to know it
01:50:41arkanoidyou just need a couple of functions to reach al the leafs of a directory of xml, starting from a wsdl
01:51:43arkanoidwsdl contains function signatures, and with them the input and output types. Stating from there you seek all the xsd and all the types and build the hierarchy via a parser
01:51:51FromDiscord<cabboose> I have a pharmacy application in development that accesses a dispensary API that uses soap; the data is pretty easy to get at and I didn't want to 'waste' time on wsdl
01:51:56arkanoidwsdl is really the asy part
01:52:52arkanoidyou've already done the hard part. Wsdl is just a normal wsdl schema plus a list of function names
01:53:02FromDiscord<cabboose> Yeah I get the basics of it, the verbosity made it look like vomit to me and I have the issue of being a dopamine deprived zoomer that needed results quickly
01:54:47FromDiscord<cabboose> Can you make a repo I can work on with you?
01:54:52FromDiscord<cabboose> maybe I can give it another crack
01:55:17FromDiscord<cabboose> I am overly adverse to having to learn how the scheme of wsdl works, xml is fair enough but wsdl just looked like vomit
01:55:40arkanoidcabbose, here you can find some wsdl reading, and just a quick try to fetch all the required items for each function https://play.nim-lang.org/#ix=3xaZ
01:56:22arkanoidcabboose, I am really conviced that you're overstimating wsdl a lot
01:57:27arkanoidcode in incomplete,was just a quick try to fetch the required elements over multiple schemas given a wsdl
01:58:05FromDiscord<cabboose> Maybe; I only touched it because of the software I'm working with using it for their API but it's all inhouse and they provided me the wsdl files and yada yada yada I lost interest in it
02:01:04arkanoidif you managed to build valid soap messages with namespace and types stuff in place you've already grokked what's needed. wsdl just contains the action name
02:02:09arkanoidit's 99.9% understanding how schema works and build/parse valid xml from it, the rest (wsdl/soap messages) is just a verbose way to put that xml into another xml envelope
02:04:34FromDiscord<cabboose> I do understand how to build the soap messages but getting that information from the wsdl was my vomit that's all i can say
02:04:37FromDiscord<cabboose> hahahaha
02:05:49FromDiscord<cabboose> let me have a look at the wsdl I have and see if I can understand now
02:05:52FromDiscord<cabboose> but I doubt it
02:06:43FromDiscord<cabboose> Ok it actually makes a bit more sense now that you've explained it
02:07:00FromDiscord<cabboose> its still annoying to look at
02:09:05FromDiscord<cabboose> https://play.nim-lang.org/#ix=3xb5 would this be considered a simple wsdl?
02:10:28*LyndsySimon quit (Ping timeout: 256 seconds)
02:12:51*LyndsySimon joined #nim
02:26:04arkanoidcabbose, the complexity is not the wsdl, it's the type hierachy it uses
02:26:46FromDiscord<cabboose> Here's what I think, you give me a wsdl or something and tell me "parse this into this" and I can do it
02:27:46FromDiscord<cabboose> tell me to parse a wsdl and I have no idea what I'm trying to do with it; I just can't wrap my head around the absurdity of how it's formatted and what it's supposed to represent
02:27:46arkanoidthis is what I'm working on: https://www.onvif.org/profiles/specifications/
02:28:13arkanoidyou can start from device.wsdl, that one drags in quite all the types
02:29:09FromDiscord<cabboose> ok and then how would you want it to work; would you want it to generate a soap envelope if you give it a function name and a tuple of params? would that work?
02:29:28arkanoidnow sure how you can say that wsdl is complicated when at the same time you say that you've walked over xml schema specification that an order of magnitude more complicated
02:30:30FromDiscord<cabboose> I don't think I've walked over xml schema specification 😢
02:30:39FromDiscord<cabboose> I am mentally deficient give me a break
02:30:52arkanoidif you manage to generate a wrapper that exposes all the wsdl procedures with input arguments (and maybe just generic json output) would be good
02:31:35arkanoidI've already done it by hand for the ones that I needed the most
02:31:49arkanoid(you can see that there are many wsdl on that website)
02:34:30arkanoidby xml schema specification, I mean this hell of a thing https://www.w3.org/TR/xmlschema11-1/
02:35:14arkanoidthat's basically what makes devs NOPE when someone proposes xml
02:35:59arkanoidexcept for microsoft people, they have wsdl.exe that comes with visual studio that given a wsdl creates C# class files and vice-versa
02:36:14arkanoidand that's also how most of the wsdl are created
02:36:37FromDiscord<cabboose> yeah no I didn't know about this; but I like this document, it so clearly outlines how it works
02:36:43FromDiscord<cabboose> this is easier to read than the wsdl file
02:36:43FromDiscord<cabboose> lol
02:37:06*arkurious quit (Quit: Leaving)
02:38:11FromDiscord<cabboose> ok I can do this probably, but I do have an assignment to work on for monday with my field of study being completely unrelated to this (medicine); but I will try to have something working by wed
02:38:43FromDiscord<cabboose> you keep doing your wrap of gSOAP but I don't see the issue with making a parser
02:41:29arkanoidare you on linux/windows/other?
02:44:47FromDiscord<cabboose> windows
02:45:39FromDiscord<cabboose> pharmacies in australia will forever be on windows and I will forever have to develop on windows lol
02:50:45arkanoidso you have access to wsdl.exe
02:51:09arkanoidhttps://docs.microsoft.com/en-us/sql/reporting-services/report-server-web-service/net-framework/creating-the-web-service-proxy?view=sql-server-ver15
02:51:19arkanoidnot sure if something more recent is in use today
02:51:49arkanoidbut you can have a look on how that tool generates classes to find out if your typing is going into a walkable path
02:52:19arkanoidit is also available in the mono framework on linux, but I think it is somehow less capable
02:57:22*flynn quit (Read error: Connection reset by peer)
02:58:29*flynn joined #nim
02:59:47arkanoidI'm dealing with a dynlib that fails with error "/usr/lib/x86_64-linux-gnu/libgsoap.so: undefined symbol: namespaces". That symbol is contained in a .h file that I'm importing with {.emit: """#include "../ffi/DeviceBinding.nsmap"""".}, but I keep getting that error
03:14:20arkanoidhow is that nim complains about "undefined symbol: namespaces" even before that the includes in the emit section are processed?
03:14:46arkanoidI can put jibberish text into those .h and the result is the same undefined symbol
03:26:48FromDiscord<demotomohiro> Are you sure the error comes from nim, not from backend c compiler?
03:28:35FromDiscord<demotomohiro> Maybe you are compiling with `nim c foo.nim` command while the header file you are trying to include is C++ file?
03:29:45FromDiscord<demotomohiro> If you are using c++ library, you have to build like `nim cpp foo.nim`.
03:33:27FromDiscord<retkid> is sending packets from local servers done all in ram?
03:34:21FromDiscord<ajusa> Given a type, is it possible for me to get comment as a string next to the type field definition? I believe Nim docs do this so I think it should be possible.
03:35:15FromDiscord<Elegantbeef> doc comments are stored in the typedefinition s oyes with a macro
03:36:26FromDiscord<ajusa> sent a code paste, see https://paste.rs/eYN
03:38:12FromDiscord<Elegantbeef> Ah turns out nope comments are not accessible from the typed AST
03:38:54FromDiscord<ajusa> Got any smart alternatives for what I'm going for here 😄
03:38:58FromDiscord<ajusa> (edit) "😄" => "😄?"
03:40:13FromDiscord<cabboose> macroooooo
03:42:35FromDiscord<cabboose> maybe a custom type defining macro would be possible?
03:46:01FromDiscord<cabboose> https://github.com/filcuc/nimqml/blob/master/src/nimqml/private/nimqmlmacros.nim deals with type definitions inside a macro
03:46:16FromDiscord<demotomohiro> Maybe use double hash comment and get it as nnkCommentStmt↵https://nim-lang.org/docs/macros.html#callsslashexpressions-documentation-comments
03:46:50FromDiscord<cabboose> just need to pick out the comments as demotomohiro mentions
03:47:28FromDiscord<cabboose> which is what ElegantBeef said originally which is what he meant by doc comments
03:47:42FromDiscord<cabboose> doc comments have two hashes unlike your example
03:48:30FromDiscord<ajusa> Got it, I'll check those out. Thanks!
04:06:01*supakeen quit (Quit: WeeChat 3.2)
04:06:30*supakeen joined #nim
04:09:13FromDiscord<cabboose> anyone know where nim rawGet is defined?
04:10:56FromDiscord<cabboose> nvrm got it
04:12:29FromDiscord<linux user> nim is on tiobe list
04:12:31FromDiscord<linux user> !!!!!
04:14:51FromDiscord<hamidb80> hey
04:15:06FromDiscord<hamidb80> how can i escape `{}` in strformat ?
04:15:21FromDiscord<hamidb80> `fmt"\{}" ` doesn't work
04:15:57FromDiscord<hamidb80> ah i think it's a string literal
04:16:00FromDiscord<cabboose> yep
04:16:11FromDiscord<Varriount> Just ran into the VM loop limit. Turns out compiling an NPeg grammar translated from PostgreSQL's Yacc grammar causes the compiler to run more than 10000000 loops
04:16:15FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/881029386642542652/unknown.png
04:16:16FromDiscord<retkid> WOO
04:16:16FromDiscord<cabboose> fmt syntax uses a generalised raw string literal
04:16:19FromDiscord<retkid> WE BEAT TYPESCRIPT
04:16:31FromDiscord<retkid> and bash... somehow?
04:16:33FromDiscord<retkid> wat
04:16:42FromDiscord<Varriount> URL pls
04:16:53FromDiscord<hamidb80> In reply to @retkid "": what's that?
04:17:03FromDiscord<retkid> https://www.tiobe.com/tiobe-index/
04:17:45FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/881029763706286110/unknown.png
04:17:48FromDiscord<retkid> so i guess fortran is cool again
04:17:53FromDiscord<retkid> assembly is booming for some reason\
04:18:01FromDiscord<retkid> php is still being used why
04:18:14FromDiscord<Varriount> Well, the fact that Nim is only one hundreth of a percent less than D is nice.
04:18:15FromDiscord<retkid> Visual Basic is now a language?
04:18:28FromDiscord<cabboose> In reply to @hamidb80 "how can i escape": Use `&` operator instead?
04:18:28FromDiscord<retkid> SQL doesn't count
04:18:44FromDiscord<retkid> i don't like this top 15
04:19:07FromDiscord<Varriount> _throws the shuriken stars of PL/SQL at @retkid_
04:19:27FromDiscord<retkid> yea SQL sucks
04:19:40FromDiscord<Varriount> Eh, it's good for what it does.
04:19:42FromDiscord<retkid> they are just that, stars you have to dodge
04:20:20FromDiscord<retkid> ok my question is, how the fuck is bash #50
04:20:36FromDiscord<cabboose> how does it determine ranking
04:20:38FromDiscord<Varriount> Perhaps it's a ranking of change.
04:20:55FromDiscord<Varriount> I don't mind SQL, but I feel like the language is a tad fossilized. It could use with a re-think
04:20:59FromDiscord<cabboose> if it determines it by language use on github or something that would make sense wouldnt it?
04:21:16FromDiscord<retkid> sent a long message, see http://ix.io/3xbp
04:21:33FromDiscord<retkid> i suppose its because bash isn't a language you choodse
04:21:35FromDiscord<retkid> (edit) "choodse" => "choose"
04:21:41FromDiscord<retkid> its a language you've been born with
04:21:55FromDiscord<retkid> you don't wake up and go "imma program in bash
04:22:01FromDiscord<cabboose> gross
04:22:07FromDiscord<retkid> you go "I need to make a compile script, i gotta use bash"
04:22:29FromDiscord<retkid> so bash should realistically be in the top 30
04:22:37FromDiscord<retkid> (edit) "30" => "30, but isn't due to sampeling bias"
04:22:40FromDiscord<retkid> (edit) "sampeling" => "sampling"
04:22:46FromDiscord<cabboose> courses... we definitely lose
04:24:59FromDiscord<retkid> yea nim isn't really a lang to learn by someone new to programming
04:25:06FromDiscord<cabboose> why not
04:25:17FromDiscord<retkid> small lang, not many tutorials
04:25:19FromDiscord<retkid> (edit) "tutorials" => "tutorials, etc"
04:25:22FromDiscord<cabboose> Oh yeah
04:25:27FromDiscord<retkid> little jimmy 13 year old shouldn't learn nim
04:25:29FromDiscord<cabboose> but theres no reason why it cant be
04:25:36FromDiscord<cabboose> f jimmy
04:25:53FromDiscord<retkid> Jimmy's fine, hes just gonna learn either java or python
04:25:54FromDiscord<retkid> lol
04:25:59FromDiscord<cabboose> vomit
04:26:22FromDiscord<retkid> or Lua, like me
04:26:26FromDiscord<cabboose> i think i've forgotten everything about python
04:26:42FromDiscord<cabboose> i started with python; got very far, and then forgot it the second I found nim
04:27:04FromDiscord<retkid> I learned Lua when i was like 12 playing minecraft
04:27:15FromDiscord<retkid> got angry because i guess i didn't understand functions or something weird
04:27:19FromDiscord<retkid> stopped
04:27:28FromDiscord<retkid> learned bash when i was 15
04:27:33FromDiscord<retkid> (edit) "15" => "15, rest was history"
04:27:38FromDiscord<cabboose> was minecraft and lua related somehow
04:27:41FromDiscord<retkid> yes
04:27:45FromDiscord<cabboose> i thought minecraft was java
04:27:58FromDiscord<retkid> it is, but computer craft as a java implementat ion of lua-jit\
04:28:02FromDiscord<retkid> (edit) "implementat" => "implementation"
04:28:08FromDiscord<retkid> (edit) "as" => "was"
04:28:10FromDiscord<retkid> (edit) "lua-jit\" => "lua-jit"
04:28:18FromDiscord<retkid> so you did lua inside java
04:28:23FromDiscord<cabboose> erk
04:28:33FromDiscord<retkid> smells like a memory hole, right
04:28:55FromDiscord<cabboose> i was going to say depression hole
04:29:10FromDiscord<retkid> it was... ok
04:29:21FromDiscord<retkid> people programmed like, game of life and shit
04:29:23FromDiscord<retkid> and guis
04:29:47FromDiscord<cabboose> … w… why
04:30:04FromDiscord<retkid> well, the reason is
04:30:09FromDiscord<retkid> factorio didn't exist yet
04:30:10FromDiscord<retkid> lol
04:30:33FromDiscord<cabboose> and now satisfactory
04:31:07FromDiscord<retkid> little me, liked making factories and things
04:31:23FromDiscord<retkid> liked seeings numbers go up and efficiency
04:31:34FromDiscord<retkid> controlling stuff with lua is really useful in this case
04:31:39FromDiscord<cabboose> What about study; do you hate study
04:32:33FromDiscord<retkid> study?
04:32:40FromDiscord<cabboose> in general
04:32:49FromDiscord<cabboose> outside of something stimulating like programming
04:32:58FromDiscord<cabboose> can you read a book without getting bored
04:33:09FromDiscord<retkid> I can listen to a book
04:33:14FromDiscord<cabboose> lol
04:33:16FromDiscord<retkid> i cannot read a book because visual problems
04:33:21FromDiscord<cabboose> ah
04:33:25FromDiscord<retkid> very difficult for me to retain information tha way
04:33:27FromDiscord<retkid> (edit) "tha" => "that"
04:33:40FromDiscord<cabboose> You smell like ADD
04:33:49FromDiscord<cabboose> i love that brain type
04:33:57FromDiscord<retkid> nah
04:34:00FromDiscord<retkid> thats just Aspergers
04:34:07FromDiscord<retkid> a tad of add but not enough to get diagnosed
04:34:15FromDiscord<retkid> (edit) "add" => "adhd"
04:34:16FromDiscord<cabboose> aspergers is similar
04:34:33FromDiscord<cabboose> most get diagnosed or treated with ADD meds too
04:34:46FromDiscord<retkid> I guarantee you 35% of people here at least have ASD as well
04:34:47FromDiscord<retkid> at least
04:35:03FromDiscord<cabboose> i wouldnt go that far; id go as far as ADD
04:35:20FromDiscord<cabboose> Well I guess its an abstract definition
04:35:23FromDiscord<cabboose> even in Psychiatry
04:35:48FromDiscord<cabboose> You have social deficits? ok aspergers; no? mehbeh add
04:36:05FromDiscord<cabboose> infact if it wasnt for the stigmatisation of ASD probably yes
04:36:14FromDiscord<retkid> not anymore
04:36:21FromDiscord<retkid> i've gotten over almost all of my social flaws
04:36:58FromDiscord<cabboose> So you dont have diagnosable ASD anymore 🙂
04:37:16FromDiscord<retkid> well, its a perverse psychological disorder
04:37:26FromDiscord<cabboose> well yeah; that and its diagnosed on childhood function
04:37:32FromDiscord<retkid> so you never loose it truely, your brain is just different
04:37:43FromDiscord<retkid> but, i did get tested for disability for ASD
04:37:50FromDiscord<retkid> and they said i no longer qualify
04:38:35FromDiscord<cabboose> I would just be interested to know whether the brain chemistry of ADD and ASD are all that different once the social centres have been compensated
04:38:56FromDiscord<cabboose> because dopamine deficiency is a common denominator there
04:39:37FromDiscord<retkid> a child behavioral psychologist told me that because i had poor vision growing up, i didn't learn facial features and cant identify faces as well
04:39:43FromDiscord<retkid> part of autism
04:39:48FromDiscord<retkid> so, food for thought
04:42:28FromDiscord<cabboose> Interesting; they’re such heterogenous disorders with wildly different connotations
04:42:40FromDiscord<cabboose> I don’t like that
04:43:57NimEventerNew thread by Exelotl: Goodboy Galaxy - Kickstarter and demo now live!, see https://forum.nim-lang.org/t/8375
05:06:17FromDiscord<cabboose> Okay I'm having an issue with hashsets, I've defined my own `==` func but its not using it?!
05:07:26FromDiscord<cabboose> ok i figured it out
05:07:34FromDiscord<Elegantbeef> did you define as a hash procedure?
05:07:49FromDiscord<cabboose> yeah; the issue was order of importation
05:08:07FromDiscord<cabboose> or having the function defined before importing sets or hashes
05:08:31FromDiscord<cabboose> something along those lines, I've got it working by changing my import and proc definition order
05:09:00FromDiscord<cabboose> I guess I have to have the `==` defined before I import sets?
05:09:34FromDiscord<cabboose> I guess it makes sense in hindsight -.-
05:10:00FromDiscord<cabboose> https://tenor.com/view/patrickpain-patricksomuchpain-patrickfleas-spongebobpain-spongebobsomuchpain-gif-18151897
05:10:42FromDiscord<cabboose> no I'm wrong
05:11:08FromDiscord<cabboose> it's because I have to have it defined before I create my type that is derived from HashSet
05:11:36FromDiscord<cabboose> WRONG AGAIN.
05:11:45FromDiscord<cabboose> Ok final time; it's because I have to have it defined before the hash
05:11:54FromDiscord<cabboose> yep
05:12:00FromDiscord<cabboose> that was why
05:12:50FromDiscord<cabboose> `func hash(); func ==()` would fail but `func ==(); func hash()` works as intended
05:12:53FromDiscord<cabboose> god damnit
05:13:00FromDiscord<cabboose> so much time wasted
05:14:11FromDiscord<gogolxdong (liuxiaodong)> @\_discord\_364103562243866624\:t2bot.io but it compiles on windows while errors on linux.
05:17:07FromDiscord<cabboose> yeah it's failing again
05:17:13FromDiscord<cabboose> what the gypsy magic is going on
05:17:42FromDiscord<Elegantbeef> What's the code
05:19:09FromDiscord<cabboose> let me see if I can replicate it in one file rather than in my use case and ill upload on playground
05:26:53FromDiscord<cabboose> https://play.nim-lang.org/#ix=3xbD is an example of code that should work but isnt (afaik by my understanding)
05:27:37FromDiscord<cabboose> now I'm going to try figure out how I made it work in my use case; that only works with a very specific organisation structure
05:27:43FromDiscord<Elegantbeef> Why would this work you dont hash your ComplexObject
05:28:17FromDiscord<cabboose> because they inherit no?
05:28:48FromDiscord<cabboose> wait if they're methods it works
05:29:20FromDiscord<cabboose> wait i'm so lost
05:29:30FromDiscord<Elegantbeef> Procedures do not autoconvert for inherited types
05:29:50FromDiscord<Elegantbeef> Atleast afaik
05:29:55FromDiscord<cabboose> ok; would defining the `==` operator as a base method not be acceptable?
05:30:21FromDiscord<cabboose> like i would have expected this to work https://play.nim-lang.org/#ix=3xbE
05:31:13FromDiscord<Elegantbeef> Ok actually it does call the procedure
05:31:55FromDiscord<Elegantbeef> I think this is an issue i've seen before with hashsets + ref types
05:34:09FromDiscord<cabboose> sent a long message, see https://paste.rs/Dus
05:34:14FromDiscord<cabboose> sent a long message, see http://ix.io/3xbI
05:34:27FromDiscord<cabboose> (edit) "http://ix.io/3xbI" => "http://ix.io/3xbJ"
05:34:58FromDiscord<Varriount> @exelotl Congrats on the game!
05:35:20FromDiscord<hamidb80> that was hard
05:35:25FromDiscord<hamidb80> i lost in the map
05:35:27FromDiscord<hamidb80> 😄
05:37:07FromDiscord<hamidb80> (edit) "i lost in the map ... " added "😄"
05:43:20FromDiscord<cabboose> In reply to @Elegantbeef "I think this is": ok so I have narrowed it down to the fact that the rawGet hashset implementation will use the inherited hash proc but it doesn't use the inherited cmp proc
05:44:54FromDiscord<cabboose> but it still doesn't really explain to me why my use case code errors/doesn't error with weird changes in organisation
05:46:49FromDiscord<gogolxdong (liuxiaodong)> How to set value for Option field?
05:50:03FromDiscord<retkid> almost done with my generator kotlin interface generator
05:57:24FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/881054841915465758/unknown.png
05:57:49FromDiscord<retkid> the only limitation is i need to update it with java equivalents for return types
05:58:37FromDiscord<retkid> i dont think i can import a nim table to a java hashmpa
05:58:39FromDiscord<retkid> (edit) "hashmpa" => "hashmap"
05:58:53FromDiscord<retkid> even if they represent the same thing
06:02:27FromDiscord<Paulo> https://play.nim-lang.org/#ix=3xbN↵↵can someone help me with that? I'm trying to pass a Socket as parameter to a function in another thread, but i get a `SIGSEGV: Illegal storage access. (Attempt to read from nil?)` error. I read the manual about threads I think i understand why that happen, i just have no idea how to properly do something like that
06:04:16FromDiscord<retkid> ?
06:04:19FromDiscord<retkid> sent a code paste, see https://play.nim-lang.org/#ix=3xbS
06:04:50FromDiscord<Paulo> sent a code paste, see https://paste.rs/Fxk
06:04:53FromDiscord<retkid> is that the line the error comes from?
06:04:54FromDiscord<Paulo> (edit) "https://play.nim-lang.org/#ix=3xbU" => "https://play.nim-lang.org/#ix=3xbT"
06:05:08FromDiscord<Paulo> its a runtime error, no lines informed
06:05:14FromDiscord<Paulo> the code compiles just fine
06:05:36FromDiscord<retkid> run a loop that echos out the socket and see what happens
06:06:33FromDiscord<retkid> if its always null then you're either defining it wrong or not suppose to pass it to functions
06:06:39FromDiscord<retkid> if its sometimes null then something weird is happening
06:07:56FromDiscord<Paulo> sent a code paste, see https://paste.rs/kQ9
06:08:10FromDiscord<Paulo> sent a code paste, see https://play.nim-lang.org/#ix=3xbW
06:15:02FromDiscord<retkid> you aren't passing any vars to handleConnection?
06:16:44FromDiscord<Rika> its right there
06:16:45FromDiscord<Rika> client
06:17:29FromDiscord<Rika> i dont recall if sockets are safe to pass to another thread though... but it might be so
06:18:25FromDiscord<Paulo> In reply to @Rika "client": yeas
06:18:26FromDiscord<Paulo> (edit) "yeas" => "yes"
06:18:59FromDiscord<Paulo> In reply to @Rika "i dont recall if": i think they are not, at least not in the way in doing it lol
06:19:41FromDiscord<Paulo> but i have no idea how the "right way to it" is
06:22:07FromDiscord<Rika> what i would do is to have threads only work on data, and only one thread handles connections
06:22:22FromDiscord<Rika> dispatch the data to the other threads via channels
06:28:28FromDiscord<Paulo> In reply to @Rika "dispatch the data to": thank you
07:08:37FromDiscord<retkid> ok guys
07:08:38FromDiscord<retkid> pick one
07:09:08FromDiscord<retkid> i make a thread which launches a nim server, and ffi inter ops via socks
07:09:13FromDiscord<retkid> (edit) "inter ops" => "interops"
07:09:36FromDiscord<retkid> (edit) "socks" => "socks, and pingpong that way"
07:09:54FromDiscord<retkid> or i pingpong using functions and return codes
07:10:02FromDiscord<retkid> (edit) "functions and return codes" => "functions, calling them"
07:10:20FromDiscord<retkid> or i do a combination of both, have a separate thread where nim functions are called
07:10:54FromDiscord<retkid> im leaning to the socks but i feel like that creates needless overhead
07:11:01FromDiscord<retkid> (edit) "im leaning to the socks but i feel like that creates needless overhead ... " added "and faliure poiints"
07:11:51*jjido joined #nim
07:27:14*max22- joined #nim
07:36:18madpropshow can I make this (the if else) more visually pleasing? https://play.nim-lang.org/#ix=d/ni
07:38:46FromDiscord<impbox [ftsf]> broken link
07:38:49madpropsi mean this https://dpaste.org/Wn82
07:39:45FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3xcb
07:39:57FromDiscord<impbox [ftsf]> you could also use a case instead probably
07:40:20madpropscan't singleline everytime though
07:40:42madpropsit was a generic example
07:40:54FromDiscord<Rika> is that not visually pleasing to you? what do you think is visually pleasing
07:41:06madpropsif and elif and else on the same margin
07:41:11FromDiscord<impbox [ftsf]> visually pleasing is subjective and context specific
07:41:41FromDiscord<Rika> after the `=` make a block
07:41:48FromDiscord<Rika> then put the if on the next line
07:41:55FromDiscord<Rika> then indent as expectetd
07:41:59madpropsah that might work
07:46:24FromDiscord<Rika> not might, im sure it will
07:46:31FromDiscord<Rika> unless you dont like the look
07:47:55madpropsi like it
07:48:02madpropsim now wondering about this https://dpaste.org/FFFr
07:48:08madpropsthat inside an elif
07:48:20madpropsthat's my way of dealing with multiple ifs
07:48:25madpropsto return something in all cases
07:49:17FromDiscord<Rika> if you think its better you can have a mutable var
07:49:26FromDiscord<Rika> just return the contents of such at the end
07:49:38madpropsthat's what i had
07:49:55madpropsoh you mean inside the elif
07:49:59FromDiscord<Rika> whichever you like more
07:50:51madpropshttps://dpaste.org/8coa
07:50:55madpropsso something like that
07:51:14madpropsyeah i think makes more sense
07:52:04FromDiscord<gogolxdong (liuxiaodong)> Anyone knows `{"code":-32602,"message":"invalid argument 0: json: cannot unmarshal non-string into Go struct field SendTxArgs.gasPrice of type hexutil.Big"}`
07:52:19FromDiscord<gogolxdong (liuxiaodong)> with nim-web3
07:55:54FromDiscord<Yardanico> @madprops about the if - you can just do this - https://play.nim-lang.org/#ix=3xcd
07:56:12madpropsweird I did try that Yardanico
07:56:21madpropsbut i think i had an empty line in between
07:56:41madpropsohh
07:56:43madpropsi didn't indent it
07:57:25madpropsso it's almost the same as using block
07:57:28madpropsexcept it's not a block
07:58:32FromDiscord<Yardanico> It's just an if expression :)
08:18:35*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
08:20:53NimEventerNew thread by Rforcen: Disk based btree, see https://forum.nim-lang.org/t/8376
08:39:39*neurocyte quit (Quit: The Lounge - https://thelounge.chat)
08:43:27*Vladar joined #nim
08:44:28*neurocyte joined #nim
08:44:28*neurocyte quit (Changing host)
08:44:28*neurocyte joined #nim
08:56:12FromDiscord<cabboose> I forgot about this gem from June blog post
08:56:41FromDiscord<cabboose> https://media.discordapp.net/attachments/371759389889003532/881099959552868402/image0.png
08:59:34FromDiscord<Recruit_main707> lol
09:14:26FromDiscord<Rika> I don’t think it was intentional
09:16:04FromDiscord<cabboose> I mean if it wasn’t that’s hilarious
09:16:11FromDiscord<cabboose> If it was it’s legendary and hilarious
09:31:49FromDiscord<Saurav Niroula> is there else statement in for loop as python
09:32:32FromDiscord<Saurav Niroula> i am a begineer and i am learning from youtube python videos to calculate nth prime number
09:32:59FromDiscord<Saurav Niroula> i am not knowing how to do it 😔
09:35:06madprops"Dik is a Dict." oh
09:37:13FromDiscord<j-james> Are there any downsides to declaring a large amount of types within the same type block?
09:45:06FromDiscord<j-james> Performance or otherwise
09:48:00*emery quit (Ping timeout: 272 seconds)
09:50:36FromDiscord<Rika> In reply to @Saurav Niroula "is there else statement": No
09:51:05NimEventerNew thread by Kalbhairab: Code competition., see https://forum.nim-lang.org/t/8377
09:51:15FromDiscord<Rika> In reply to @j-james "Are there any downsides": I do not think there is a naked-eye observable difference in performance
09:51:48FromDiscord<haxscramper> > ↵> Nim should organize code competition as other programming languages do.↵>↵(<@709044657232936960_=4eim=45venter=5b=49=52=43=5d>)
09:51:51FromDiscord<haxscramper> Just what is the point
09:55:08FromDiscord<haxscramper> In reply to @arkanoid "<@608382355454951435>, I'm trying to": This part of code is old, and `wrapWithConfig` is no longer used. For latest wrapper generator script, you can see https://github.com/haxscramper/cxxstd/blob/master/src/cxxstd/make_wrap.nim
09:56:19FromDiscord<haxscramper> In reply to @arkanoid "<@608382355454951435>, I've read what": > says to be even more compliant than Intel compiler proprocessor↵Honestly this seems like PR bs for the most part, since C++ preprocessor standard is defined using very ambiguous language, this has been pointed out multiple times in different tests I've read
09:56:22FromDiscord<Rika> In reply to @haxscramper "Just what is the": Fun?
09:56:24FromDiscord<Rika> Why not
09:56:31arkanoidThanks!
09:56:53*emery joined #nim
10:03:02FromDiscord<haxscramper> I should probably write architecture.md for it
10:08:53arkanoidI have C function that initializes a large struct in the heap and returns its pointer, I've already wrapped that and it works. Now I need to edit just 2 cstring attributes of this struct, but I'm lazy and I don't want to define the whole type of for that. One option would be to emit a C function that does the job and wrap it, is there a better solution?
10:13:07FromDiscord<haxscramper> you can only wrap two attributes
10:13:16FromDiscord<haxscramper> you don't have to wrap all fields
10:15:50arkanoidReally? Do you have an example? How does this work?
10:19:26FromDiscord<haxscramper> What kind of example do you need? Just don't wrap all fields, that's all
10:22:25arkanoidWell this is surprising. Thanks
10:23:00arkanoidI've another unrelated question. What is the "header" pragma do?
10:24:03FromDiscord<haxscramper> It specifies header file to be included when proc or type is used
10:24:26FromDiscord<haxscramper> So if nim generates C code and uses your proc, which has `header: <string>`, it will add `#include <string>` to the generated header
10:24:29FromDiscord<haxscramper> generated C file\
10:24:40FromDiscord<haxscramper> `header:` can be any text
10:25:02FromDiscord<haxscramper> If it is `<header>` or `"header"` it will be wrapped as `#include <XXX>`, anything else will be pased verbatim
10:25:19FromDiscord<haxscramper> So you can do `header: "#include <header1>\n#include <header2>` if you need
10:26:04arkanoidOk! So it may be seen as a convenient way to avoid emit on top of nim file?
10:26:36FromDiscord<haxscramper> Yes, it is actually a recommended way of wrapping things
10:26:57FromDiscord<haxscramper> `{.emit:` will not work if you declare a proc and then use it in different module for example
10:28:36arkanoidThanks!
10:41:35*auxym_ joined #nim
10:47:31*jjido joined #nim
11:00:41arkanoidhow to wrap this C function type? "int(*)(struct soap *, struct soap_plugin *, void *)"
11:01:19arkanoidI've already wrapped the "struct soap *" and "struct soap_plugin *" types, but I don't know how to put all together into a function type
11:02:57*auxym_ quit (Ping timeout: 248 seconds)
11:04:48arkanoidwhat about " SoapPluginCreate {.header: soapH, importc: "int(*)(struct soap *, struct soap_plugin *, void *)".} = proc(soap: Soap, plugin: SoapPlugin, args: ptr object): int"
11:05:43FromDiscord<haxscramper> `int()(struct soap , struct soap_plugin , void )` is a `proc(sa: ptr soap, a2: ptr soap_plugin, a3: pointer) {.cdecl.}`
11:06:29FromDiscord<haxscramper> matrix edits are not propagaged to IRC? Anyway, I forgot to add `: cint` return type
11:06:44arkanoidthanks
11:06:51FromDiscord<haxscramper> `void` is a `pointer`, while `ptr object` is a nim generic
11:07:03FromDiscord<haxscramper> And you don't `importc` typedefs
11:07:27arkanoid?
11:07:35FromDiscord<haxscramper> And don't `header` them as well, since they don't really exist in the C code as well, they are just like shortcuts for type
11:07:54FromDiscord<haxscramper> You have `typedef int()(struct soap , struct soap_plugin , void ) SoapPluginCreate `?
11:08:30arkanoidno, I have to wrap this function: https://www.genivia.com/doc/guide/html/group__group__plugin.html#gad645e5a58ed442fe4753dcc2338c8bdb
11:09:07arkanoidwhere the first argument is the ptr object I've been asking you before about reading single attribute, and it is working
11:09:35arkanoidthe second argument is a proc declared in a .h file
11:09:39FromDiscord<exelotl> In reply to @Varriount "<@!90614688374624256> Congrats on the": Thank you! ^^
11:10:41FromDiscord<haxscramper> `void soap_register_plugin(soap: ptr soap, fcreate: proc(sa: ptr soap, a2: ptr soap_plugin, a3: pointer): cint {.cdecl.})`
11:12:23arkanoidhaxscramper, thanks. Do you think it is better to declare types as object and declare arguments as "ptr thatobject" or is better to just declare the type "ptr object"
11:12:48arkanoidI see you went the first path in your example
11:17:09FromDiscord<haxscramper> I prefer to defined simple `object` type and if it is often used as `ptr T` I just declare `type PT = ptr T`
11:17:35FromDiscord<haxscramper> `type WaveToken {.apiPtr.} = object` and `type PWaveToken = ptr WaveToken`
11:19:15arkanoidthanks!
11:25:53*auxym_ joined #nim
11:32:43*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
11:33:07*max22- quit (Ping timeout: 240 seconds)
11:38:44FromDiscord<dom96> In reply to @haxscramper "> > Nim": https://forum.nim-lang.org/t/8377#53999↵↵Sorry, couldn't help myself
11:41:00arkanoidnot sure if I should add cdecl to all C wrapped function or not. It doesn't change anything if I put it or not
11:41:07arkanoidI mean, it compiles correctly
11:42:45FromDiscord<haxscramper> No, C procedures must be wrapped using `{.cdecl.}`
11:42:59FromDiscord<haxscramper> It might compile and maybe even run correctly
11:43:28FromDiscord<haxscramper> But regular nim `proc()` is implemented as closure with `struct { void impl; void env; };` roughly speaking
11:43:51FromDiscord<haxscramper> While `{.cdecl.}` proc is a pointer to proc, no additional data
11:52:54arkanoidok, but what if I'm calling a C macro, do I need it?
11:53:09FromDiscord<whisperdev> What kind of error is this 😐 asyncdocker.nim(261, 23) Error: cannot open file: asynchttpclient
11:53:32arkanoidI'm doing "proc newSoap(): PSoap {.header: soapH, importc: "soap_new".}" but soap_new is a macro that calls a macro that calls a macro and so on
11:53:39arkanoidthe real function name is weird
11:54:03arkanoidit is working now, without cdecl
11:55:03FromDiscord<Rika> In reply to @whisperdev "What kind of error": Async versions are already in the httpclient module
11:55:21*jjido joined #nim
11:56:42FromDiscord<whisperdev> crap...
12:00:14FromDiscord<haxscramper> arkanoid\: I was talking about callbacks etc.
12:06:02*supakeen quit (Quit: WeeChat 3.2)
12:06:32*supakeen joined #nim
12:06:51arkanoidhaxscramper, so cdecl is only required when C code needs to call nim proc, and not the other way around?
12:08:01FromDiscord<whisperdev> Can this easily be fixed? I dont really understand the expected type
12:08:03FromDiscord<whisperdev> Error: type mismatch: got <proc (chunk: string): Future[system.bool]{.closure, locks: <unknown>.}> but expected 'Callback = proc (fd: AsyncFD): bool{.closure, gcsafe.}'
12:08:10arkanoidsorry for the noob questions, but I'm not an experienced C programmer and I'm still learning the underlying basics
12:09:05*auxym_ quit (Ping timeout: 248 seconds)
12:09:41FromDiscord<haxscramper> `int()(...)` etc.
12:09:59FromDiscord<Rika> In reply to @whisperdev "Error: type mismatch: got": the callback you're registering has the wrong parameter and return types
12:23:54*max22- joined #nim
12:30:17arkanoidI need an hand to understand why I'm getting gibberish out of "soap->authrealm" while trying to reproduce this simple example in nim: https://www.genivia.com/doc/guide/html/index.html#httpdaplugin
12:34:41arkanoidthis is the current nim code: https://play.nim-lang.org/#ix=3xdf
12:44:11*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
12:47:37*arkurious joined #nim
13:02:56FromDiscord<haxscramper> sent a long message, see https://paste.rs/X6A
13:14:46arkanoidthis is great news! congrats!
13:15:08arkanoidI'm just puzzled why a combination of different parsers is required
13:15:18arkanoidaren't them overlapping?
13:15:40FromDiscord<haxscramper> I'm writing an updated readme, but
13:15:46FromDiscord<haxscramper> sent a long message, see http://ix.io/3xdp
13:15:53FromDiscord<haxscramper> Basically I'm doing two things
13:15:59FromDiscord<haxscramper> So I need two parsers
13:16:42FromDiscord<haxscramper> Or you mean why wave and tree-sitter?
13:17:11arkanoidyeah, why two
13:17:28arkanoidI mean, isn't wave building an AST of the C/C++ code too?
13:17:42arkanoidjust curious, consider an ELI5 answer
13:19:33*jjido joined #nim
13:21:00FromDiscord<haxscramper> No, wave does not build AST of the C++ code, instead it provides an iterator over preprocessed tokens
13:21:33arkanoidquick question. I'm wrapping a C struct that has attributes that begins with capital letter. How can I wrap it to make nep1 happy?
13:21:42FromDiscord<haxscramper> C parsing also consists of two parts - preprocessing and actual parsing, so to get the best result without relying on libclang I need to match these two as close as possible
13:22:14FromDiscord<haxscramper> `> wrapping a C struct that has attributes that begins with capital letter` you can use `fieldName: {.importc: "ActualFieldName".}`
13:22:39arkanoidhaxscramper, got it. So boost wave is like a preprocessor and you feed the result into tree-sitter
13:22:47FromDiscord<haxscramper> correct
13:23:10FromDiscord<haxscramper> Other alternative is to use libtooling's preprocessor callbacls, but this would require interfacing with C++ library
13:23:16arkanoidand libclang would do that all by itself but it's overlycomplicated
13:23:45FromDiscord<haxscramper> Yes, for average use case it requires too complicated setup
13:25:10arkanoidhooray! got my little wrapping experiment work!
13:25:45arkanoidso I got that adding header and importc pragmas on types is required to access their attributes
13:26:59arkanoidthere are still thing not quite clear to me: when to use .pure., when to use .cdecl., what is .link., when .header. is really necessary
13:28:08arkanoidbut it works! If you have any good hint on this wrapping code, I'd be happy to learn and improve https://play.nim-lang.org/#ix=3xdu
13:36:08FromDiscord<haxscramper> sent a long message, see http://ix.io/3xdw
13:38:03FromDiscord<haxscramper> I just put header all over the place, but arnetheduck for example says that in status they tend to avoid it, because you can just write a proc signature that matches base one, and it will be enoughg
13:38:58FromDiscord<haxscramper> But really there is almost always an exception to the rules like this, because well C
13:39:05FromDiscord<haxscramper> And so on
13:39:45FromDiscord<haxscramper> For example you didn't as about `bycopy`, and IIRC it is almost required for interop, otherwise nim's smart argument passing might get in the way
13:47:17arkanoidthanks! As you can see from my nim code I'm using .passL. to statically link everything. It works, but if understood what you are saying it would be more convenient to add it as a link pragma to everything
13:47:20arkanoidam I wrong?
13:50:49FromDiscord<haxscramper> yes, `.link.` is preferred to `.passl.`
13:51:00FromDiscord<haxscramper> Both work for linking, but `.link.` is specifically designed for that task
14:04:05*byanka__ joined #nim
14:07:22*byanka_ quit (Ping timeout: 250 seconds)
14:08:19arkanoidso, a "good" binding consists of pragmas: header, importc, link/dynlib. For types (if needed) pure, bycopy. For proc (if needed) cdecl. Avoiding PassL and emit is a good thing
14:08:35arkanoidI'm just trying to understand the general pattern
14:15:13*Guest24 joined #nim
14:19:31*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
14:26:52FromDiscord<haxscramper> Yes, that basically main pattern
14:27:28FromDiscord<haxscramper> nim-lang org on GitHub has some wrappers, you can look I to them as well, just to get an idea of what is being used
14:30:57arkanoiddo you mean the source code of the website?
14:32:10*Guest24 quit (Quit: Client closed)
14:35:14*stkrdknmibalz quit (Quit: WeeChat 3.0.1)
14:36:18*krux02 joined #nim
14:38:21FromDiscord<haxscramper> I mean GitHub organization
14:39:09FromDiscord<haxscramper> https://github.com/nim-lang/opengl https://github.com/nim-lang/x11 etc
14:39:49FromDiscord<Saurav Niroula> i found isPrime function and i am able to calculate prime number below certain number. But i cant figure out how to calculate nth prime number. I am new to programming and bit confused. i found python style code but it doesnt work for nim. can any one provide suggestion plz.😊
14:40:00FromDiscord<haxscramper> tlc wrapper, lua wrapper
14:46:36*jjido joined #nim
14:57:23*auxym_ joined #nim
15:00:44arkanoidk!
15:37:13*flynn quit (Read error: Connection reset by peer)
15:37:51*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
15:38:25*flynn joined #nim
15:45:41FromDiscord<ericdp> In reply to @Saurav Niroula "i found isPrime function": have you figured out how the example code works ? If so, what is it doing you can't translate to nim ?
16:01:40*auxym_ quit (Ping timeout: 240 seconds)
16:22:21*jjido joined #nim
16:23:47*flynn quit (Read error: Connection reset by peer)
16:24:55*flynn joined #nim
16:39:51NimEventerNew post on r/nim by thelolrus: [Livestream] Coding a template language in Nim | Jambone episode 3, see https://reddit.com/r/nim/comments/pdd50a/livestream_coding_a_template_language_in_nim/
16:52:56*auxym_ joined #nim
17:18:33FromDiscord<reilly> Would it be a bad idea to make something both multithreaded and asynchronous at the same time?
17:25:02FromDiscord<fae> Like with everything, depends on what you’re trying to do lol. If you’re doing heavy IO you probably want async. If you are also doing heavy computations that can be run in another thread and the complexity of doing so actually gets you performance benefits, then sure why not.
17:29:53*beshr joined #nim
18:19:53*andinus quit (Remote host closed the connection)
18:20:33*andinus joined #nim
18:21:25*auxym_ quit (Ping timeout: 250 seconds)
18:25:17FromDiscord<treeform> In reply to @reilly "Would it be a": Sound like double the pain for a little gain...
18:25:39FromDiscord<Yardanico> xd
18:27:19*lain quit (Quit: kthxbai)
18:28:03*lain joined #nim
18:44:32FromDiscord<Yardanico> https://twitter.com/reduzio/status/1431257697622573056
19:13:42*Vladar quit (Quit: Leaving)
19:33:01FromDiscord<5271> sent a code paste, see https://play.nim-lang.org/#ix=3xfm
19:33:19*stkrdknmibalz joined #nim
19:37:21FromDiscord<trenta3> sent a code paste, see https://play.nim-lang.org/#ix=3xfo
19:39:26FromDiscord<Yardanico> In reply to @5271 "how do i format": check out the strformat module
19:40:36FromDiscord<5271> okay
19:44:31NimEventerNew thread by Niminem: Advice for handling circular dependencies (functions), see https://forum.nim-lang.org/t/8378
19:49:57*beshr quit (Remote host closed the connection)
19:53:01FromDiscord<Yardanico> Does anyone know if there are any string command parsers? Something like cligen but just for strings. just want to make a telegram bot and don't want to do it myself if someone has something that's already available :)
19:53:25FromDiscord<Yardanico> or maybe I can do that with cligen itself?
20:01:08*perro quit (Remote host closed the connection)
20:03:13FromDiscord<Ruggila> You can parse strings with npeg, for example. I'm just not sure what you really want, and so I don't know what I should suggest...
20:03:35FromDiscord<Ruggila> https://github.com/zevv/npeg
20:03:37nrds<R2D299> itHub: 7"PEGs for Nim, another take"
20:07:15FromDiscord<Yardanico> well, I know npeg and used it quite a lot in some other projects, but it'll still be pretty similar to doing all the parsing myself
20:07:24FromDiscord<Yardanico> I found something similar to what I need - https://github.com/iffy/nim-argparse
20:07:25nrds<R2D299> itHub: 7"Argument parsing for Nim"
20:07:26FromDiscord<Yardanico> gonna try it now
20:14:47FromDiscord<Yardanico> yeah, seems like it's exactly what I need
20:14:56FromDiscord<Yardanico> I just want CLI-like commands for my Telegram bot and argparse fits exactly
20:26:53FromDiscord<Ayy Lmao> Are asserts mainly meant for unit tests or are they meant to be used in normal code as well?
20:35:28FromDiscord<konsumlamm> they're also meant to be used in normal code
20:35:56FromDiscord<konsumlamm> for checking if invariants you have really hold etc.
20:36:30FromDiscord<Yardanico> just don't forget that `assert` is disabled with release/danger
20:36:39FromDiscord<Yardanico> there's doAssert that's always enabled though
20:37:32FromDiscord<Ayy Lmao> Sweet, thanks for the info!
20:41:41*supakeen quit (Remote host closed the connection)
20:42:05*supakeen joined #nim
20:45:46FromDiscord<timotheecour> > just don't forget that assert is disabled with release/danger↵not true, only danger
20:50:44arkanoidin c2nim, #mangle are applied before or after --nep1 ?
21:06:01arkanoidI need to solve this problem via c2nim (or other solution if you know one): I have C structs with names like https://play.nim-lang.org/#ix=3xfS, if I run c2nim with --nep2 both types are converted to same string
21:06:17arkanoids/--nep2/--nep1/
21:26:56arkanoidit would be really useful if mangle op in c2num could uppercase letter
22:02:55FromDiscord<dan> In reply to @haxscramper "Yes, that basically main": would you happen to know why the header needs to be added with the "header" keyword? i have done it without and my code correctly produces the function definition which should also link fine
22:06:10*max22- quit (Quit: Leaving)
22:06:20arkanoidis it possible to have a function with same name of struct type in C?! Mangle madness
22:25:28FromDiscord<treeform> In reply to @dan "would you happen to": you only need to import the header once, some one else might import it for you
22:25:53FromDiscord<dan> but why do i need to import it? 🤔
22:26:23FromDiscord<dan> im wrapping all of the stuff by hand anyways and it outputs the correct definitions
22:26:58FromDiscord<dan> what is this feature actually intended for?
22:28:56FromDiscord<dan> maybe for header only libraries?
23:00:54FromDiscord<treeform> you right you might not need the header at all
23:03:16arkanoidwhy does c2nim writes importc pragmas wrong? It writes {.importc: "_c_type_foo".} but I have to manually correct to {.importc: "struct _c_type_foo".} to make it work. Why?
23:17:28arkanoidit's a regression bug https://github.com/nim-lang/c2nim/issues/131
23:19:18arkanoidthis issue should be reopened
23:35:23*flynn quit (Remote host closed the connection)
23:36:29*flynn joined #nim