« first day (2372 days earlier)      last day (1099 days later) » 

1:08 AM
I'm using rusqlite and getting this error InvalidColumnType and it makes me confused because the type is Integer and the target is String. Wouldn't Rust be able to convert an Integer to a String?
 
... I think I am about to do something that's either elegant or utter crap and I really can't decide on which. I can catch the exception and convert manually based on the error itself InvalidColumnType(0, "id", Integer).
 
Im too newbie to help sorry
my opinion is not even worth 1 penny :<
 
2:00 AM
@AntoninGAVREL Are you acquainted with try catch blocks, in any language?
 
2:14 AM
yes I am
what are your 3 variables ? its more easy to understand with function definition
(prototype)
 
@AntoninGAVREL Cool. So I think the question can be explained as "on a scale of 1 to 10, how much do you like seeing code that uses try catch to control the flow of execution?"
 
InvalidColumnType(error_code, ?, type).
I don't really like try catch actually
I use fuckit in python :D
I make sure all errors are handle with if else
I still add try catch for critical segments where anything can happen
like http requests
made my life with the selenium scrapper easier
(sometimes the field you are looking for does not exist, you want to keep scrapping)
The Python Error Steamroller
FuckIt.py uses state-of-the-art technology to make sure your Python code runs whether it has any right to or not. Some code has an error? Fuck it.
 
this is like, the exact antithesis of Rust ;-)
 
I know right :D
this is just for my scrapper, dont worry
and I check what I scrap before sending to the db
if selenium does not find the class or id on the page it throws an exception, which is kind of annoying
for Rust I use the match result for error handling
its perfect for that
its a bit sad you cant cancel a close vote
on stackoverflow
I requested a close for duplicate and then realized the question was slightly different
 
it happens to everyone, don't sweat it.
 
2:26 AM
yes but its an easy feature to implement
 
oh sure, the feature is not an actual programming challenge to implement.
 
its like you judge a criminal with the jury, as long as all the jury is not decided you should be able to swing your vote
 
but the ripples on the review system would require some serious consideration to even grasp. (I think)
 
2:44 AM
interesting related topic: users.rust-lang.org/t/…
(for match)
 
 
5 hours later…
7:18 AM
Morning!
 
 
3 hours later…
9:55 AM
Hi, does anyone happen to know some way by which we can add a proc-macro to every function in the crate?
I suppose if there is some way of getting the AST like structure of the entire crate's code, that could be done.
 
 
1 hour later…
10:59 AM
I don't think it's possible
maybe with #![my_proc_macro]
 
 
2 hours later…
12:50 PM
@Mihir Why do you need this?
 
why not ?
I can imagine think like want to trace every function in your crate
 
I never said it was irrational
Just curious why they need it
 
1:11 PM
An sxd question! Raise the @Shep signal!
 
@Stargateur Yes for that only. For debugging purposes, I wanted have some boilerplate code on every function.
 
1:29 PM
So after having used an Err() to manage the flow of execution for the second time, I wonder if Rust is not, in a way, encouraging the use of the error types as flow control helpers. Of the different solutions I was seeing, it's been a few times that the simplest and less expensive solution (expensive in terms of difficulty to reason about and implement) has been to use the "try catch" as flow control.
An tbh, while I think I've generally think that such was Not The Way™, I can't help but try to look at it fairly, and it appear like an actually suitable solution, that is not the worse out there.
So, it feels like in a way, Rust's type system as well as the obligation to manage results kindly pushes me in the direction of acting on the Error types.
 
There's a person which tries absurd optimizations that the optimizer would do itself if they worked...
0
Q: Optional trait's method: call empty method or skip it at all?

DenisKolodinIf I have an optional method that has to be called many many times what is better if I want to skip it: have an empty body and call it or check the bool/Option before calling it? The following benchmark make no sense. It gave zeroes. #![feature(test)] extern crate test; trait OptTrait: 'static ...

@FélixGagnon-Grenier I fail to understand your point here. But maybe it's clearer for others ?
 
@DenysSéguret hmm, I'll try to rephrase; It feels to me that by design, Rust is more tolerant (and possibly appreciative) of the various try-catch shenanigans that are sometimes frowned upon by users of other languages I've worked with.
12 hours ago, by Félix Gagnon-Grenier
... I think I am about to do something that's either elegant or utter crap and I really can't decide on which. I can catch the exception and convert manually based on the error itself InvalidColumnType(0, "id", Integer).
after this^
I was faced with either refactor in somewhat complex ways in order to have the code account for very many possibilities of the rusqlite fields, or use the information given to me by the error to change the integer into the string I wanted manually
And after doing it, I realized I didn't really feel dirty, as if while possibly unotrthodox, this was not actually a major smell
 
Are you talking about a real error, or one that could just theoretically happen in impossible cases ?
 
There are several extant RFCs that point toward possible future broader applications of ?
 
I mean, do you really have a SQL error due to a wrong column past the initial test ?
 
1:38 PM
@DenysSéguret a real error. I was transforming all fields in a sqlite db into strings, and I believe that there was no helper for the library to convert automatically an integer to String
the integer to string failed conversion would block the rest, but accounting for the Integer type in the match Err arm was rather efficient
... got to run I'll be back later!
 
@FélixGagnon-Grenier I observe that in some "other languages" exceptions are thrown and caught by a separate mechanism than regular value return, so using them for non-exceptional control flow may incur a large performance cost
And exceptions have varying degrees of checkedness depending on the language (and the exception), which is another possible source of bugs
Results are just data, so they don't really have either of those problems
(I also note that some languages, such as Python, have absolutely no reservations about using exceptions for control flow)
 
2:17 PM
witch is better, api rest, /account or /accounts I can't decide
 
I prefer singular for the actual path components but plural for sql tables (I think)
 
It's been debated since the beginning of REST. You'll find arguments in both directions
Personally I use the plural form in my API
 
@trentcl huh, thanks, I had not considered the implementation differences between these
 
2:22 PM
(never used this site. I wanted to check whether the debate was closed and fell on this page)
 
... well it seems I haven't actually designed an API in a long time because the arguments I read there for plural resonate way more
 
@FélixGagnon-Grenier I did the exact opposite xd
I like the plurial form but sometime... /smss it doesn't work
 
hahaha you baguette whisperer
 
@Stargateur /texts #britishism
 
@PeterVaro I rename to phones...
 
2:29 PM
@Stargateur You don't have to, just search for and select English (British) in the settings :P
 
such subtle humor humour
 
@FélixGagnon-Grenier You meant the other way around, didn't you? ;)
 
really debated which one was about to be crossed, I think I chose poorly
lol, ninja'd
right, after many tries, this joke is ready for human eyes ;)
 
@Stargateur Personally it depends how the endpoint would be used. Say it can take a query string which acts as a filter and so it will return multiple entities, in this case, plural. Say the URL path continues and it takes an ID as the next fragment, in that case I would use plural, because you select one specific thing from multiple stuff, as you would write x = xs[id]. However if the entity doesn't exist and you're about to create one then it is singular.
 
Can you elaborate on the last sentence? I think I don't really get it.
(also, shoot, we are now monday and it means I need to program actual money-creating stuff in php rather than hack at rust)
(don't let the folks over at r11 know ^)
 
2:35 PM
@FélixGagnon-Grenier Think of a PUT request: you don't have an ID or anything to filter by, and you only wish to create a single entity and the details may or may not be provided in the request body. In that case, it would be singular.
(If you could create multiple entities in one request, it would be plural of course.)
 
ah right, I think I start to grasp it. PUT /user vs GET /users vs POST /users or even PATCH /users/123
 
Very likely that's how I would do it. (Depends on how each of these endpoints should behave.)
When I'm thinking about these names, I'm always thinking about "function names"
If you function is supposed to return a single entity or should create a single one, then it is singular, if not, then plural
(Naturally, naming things is the hardest problem in computer science, so thinking about endpoint names in a similar fashion as one would with function names won't help much now, will it?)
 
2:58 PM
@PeterVaro yeah I think of that.. like POST /account but that create a route just for that
@PeterVaro yeah exactly...
 
3:24 PM
@PeterVaro now I'm reminded of … "HATEOAS".
 
@Jason ..why?
 
I wondered how they came up with. It's not the most beautiful acronym to me.
I think these might be called backronyms, right?
 
Not really. Backronym is when you have an acronym first and you add a meaning to it later. Say you pick a word JASON and you say it is an acronym for July August September October November, albeit it is only your name but now you made it into an acronym ;)
 
Haha, yes. It reads as somewhat of a failed backronym to me. I tend to see "HATE .. OAS".
Regarding the months, that is quite funny.
Whenever I mentioned that to people, they wouldn't believe it at first. I could see them doing "July = J, August = A, …" in their heads until they'd form my name and then they'd be surprised.
Related to APIs and Rust! Has anyone used github.com/graphql-rust/juniper yet and if so, how did you like it? I was thinking about playing around with it and Actix this weekend.
 
3:48 PM
@Jason I have!
it seems to be quite nice in the webview context
I like graphql generally so I am somewhat partial, but I find it was at least as easy to set the graph endpoint in Rust as it was in javascript or php, or possibly easier.
 
Oh, sweet.
Is the repository public?
 
not yet ;) I'm thinking on pushing another commit to the app-skeleton, if you're interested I can try to do it in the next days instead of 6-8 weeks :)
 
That would be great, I'm curious, but don't feel rushed!
 
collaborating with someone I met on the internet by sharing code that makes me passionate while being on a topic that seems to interest them is the best thing that's happen to me in the last three months, no worries about me feeling rushed :P
(please no commentary on what that means for my life ;)
 
4:03 PM
@FélixGagnon-Grenier It just looks awesome, no worry
 
<3 :-)
 
4:31 PM
@Jason just blew my mind, no love for December?
 
Regarding stackoverflow.com/questions/67062157/…, is there a definition of "end of life" in rust ? Are old editions maintained ?
 
they have a guarantee to be maintained for a certain amount of years Denis, I read it somewhere
so yes they do
 
This looks like a valid question
 
the answer, you have to browse comments
 
Speaking of guarantee, I'm not sure this qualifies as an answer
 
4:36 PM
yes
thats why I just comment
could not find a clear answer
^^
 
 
1 hour later…
5:44 PM
thx scaleway
 
which computer do you use to develop
I am thinking of getting a Mac because its the only way to compile Rust code for both ios and android
for Flutter
@Stargateur you are talking about the company that had its datacenter burned to the ground?
 
archlinux
 
@Stargateur btw
 
@AntoninGAVREL no, you confuse with ovh
 
oh right
 
5:48 PM
I'm using Arch as well @AntoninGAVREL.
 
@Jason btw
 
have always been using ubuntu
what is so special about arch
is it just UI?
 
ubuntu is shit, archlinux is glorious
 
To my surprise, there was no UI when I installed it.
 
there is no default ui on arch xd
you just have pacman
and a documentation
 
5:50 PM
Haha, yeah @Stargateur, I thought I broke my machine at first.
The documentation is excellent in my opinion.
 
I would have given a try if I was not coerced by Apple to buy their product
 
you know you can compile android on linux ? xd
and apple is evil
 
^
you mean I couldn't compile android on windows?
 
android yes but not xcode
Im developing Flutter apps
Im talking about the ios part
 
5:54 PM
The M1 looks great, but if I recall correctly the Macbook Air can't connect to two monitors?
 
@Stargateur I will look into it
 
@AntoninGAVREL The only legal way. If that's not your concern you could do it in a VM or on a Hackintosh.
 
6:13 PM
yes I was looking into that lol ;)
thinking of buying a new linux desktop with archlinux and a hackintosh VM
but problem is that GPU are sold out
I dont know what to do about that
its really crazy this situation
 
... yeah the gpu shortage is real?
I see a lot of memes but I haven't looked for one in a few years
 
its surreal
I just want a nvidia gpu, have been using their products since a while and always great value
but at current prices it does not make any sense
a gpu with advised retail price of $400 is sold by scalpers at $900 (if you are lucky)
instead of hackingtosh
 
@AntoninGAVREL I haven't heard about this one, but it looks pretty great, especially:
> Does it violate Apple's EULA?
No! We only directly use those parts of Darwin that are released as fully free software.
OTOH Wine is pretty much crap when it comes to the majority of the applications.
So I'm not 100% sure, how well Darling will behave. But most certainly it's worth a try.
 
Im not sure
testing right now, will report ;)
Im installing but it needs 4gb of space (woof!!!)
so it takes a bit of time
The main reason I started Rust, despite being a beautiful language, was the ability to be used as a backend for flutter, so I need to find a solution to make it works, and if possible without throwing my money at Apple
I agree that Apple has become really evil in the past decade
I think without the Asian market they would not be doing so well, in Asia people want Apple product to show their status
 
6:29 PM
They have always been. Yet, if you wish to make money on their platform, why don't you play by their rules?
 
In France rich people use crappy cars to not attract the IFRS (fisc) and jealousy from neighbors and friends ^^
I play by their rules, I will give 30% of my profit made from the ios app
its not enough @PeterVaro ?
I think thats all abuse of dominant position
also
 
I didn't say it is not.
Anyway, in case Darling won't work for you (or other similar EULA-compliant solutions) running macOS on a non-Apple hardware means you're not playing by their rules.
 
like linux do not coerce you to have a linux software to build Android app, you can build from windows or mac
@PeterVaro I know that
just like when I speed on the highway I know it is bad :p
verrrrry bad
I will auto whip myself to redeem for my sins
be assured of that ;)
I also repeat "I am a bad citizen" 3 times each time I download a copyrighted movie through torrent
 
6:52 PM
12% darling/src/external/objc4/runtime/NSObject.mm:2000:2: error: prefix attribute must be followed by an interface or protocol
 
7:08 PM
how comes they sell this desktop for $900 ? bestbuy.com/site/… it doesnt even have a decent graphic card
regarding darling it takes forever to build, only at 24%, even had to edit the code to make it work
 
7:28 PM
"Another way to speed up the build is to run make with multiple jobs. For this, run make -j8 instead, where 8 is a number of current jobs to run of your choosing. In general, avoid running more jobs than twice the amount CPU cores of your machine." I should have used this from the start
 
 
1 hour later…
8:31 PM
1h later, 95%: darling/src/external/security/SecurityTool/macOS/keychain_export.m:563:15: error: ARC forbids Objective-C objects in struct
not sure if its normal to have to fix myself so many compilation errors
 
@AntoninGAVREL 6 month I try to buy a gpu...
 
8:53 PM
Big money programming
> Total reclaimed space: 21.27GB
 
@EnnMichael Cargo clean? Docker images? node_modules?
 
@Jason Docker a.k.a my favorite tool
A year from now we're going to be MILLIONAIRES if we keep doing big money programming on the blockchain
With docker and electron and AVIF
 
9:17 PM
@EnnMichael you might as well develop a mining algo
@Stargateur 4 months on my side
 
my old gpu die last summer... I'm lucky I have a good portable pc with my work xd
 
9:34 PM
I am a cockroach
You can't get rid of me
I'm a rat
I thrive
 
9:56 PM
you are strange
 

« first day (2372 days earlier)      last day (1099 days later) »