Comments by "p11" (@porky1118) on "ThePrimeTime"
channel.
-
122
-
33
-
29
-
25
-
20
-
16
-
15
-
12
-
9
-
8
-
16:40 Rust is also pretty authoritarian. You /could/ use a fork of Serde, but then YOUR serde types are not compatible with the serde types of the other library.
You really have to decide. Do you want your own system, or do you want to use the system everyone else uses.
You could also fork every lib you use and make them use your serde fork.
It's mostly because of the orphan rules. I love them, but sometimes I hate them.
I guess, that's the main reason why people coordinate to use the same crates.
In most languages you would just implement serde for all the types you import, if they don't already implement them.
In Rust, it's pretty annoying, so you'd rather demand everyone to use the serialization library you use for your crate.
That forces everyone to use the same library. If you don't use it, you are excluded by parts of the ecosystem. And I consider that some kind of authoritarianism.
It might be effective to coordinate on some specific systems, but it takes away some of your freedom.
You either have to obey, or you have to do your own thing almost completely.
You can't just implement your serde fork for each type form other libraries.
You /could/ do it if you derive every library you use inside your serde fork itself, but that's far from scalable. You're never done.
8
-
7
-
6
-
6
-
5
-
5
-
5
-
5
-
5
-
4
-
4
-
4
-
4
-
4
-
3
-
3
-
3
-
3
-
3
-
3
-
3
-
3
-
3
-
3
-
3
-
3
-
3:00 I think, the best argument for command line is , that you can just copy-paste commands instead of clicking through GUis.
Especially if you don't know, what you are doing, you can just google the command, or a coworker can send you the command, and then you paste it and it probably does, what you want.
Maybe you have to insert the correct filenames or something.
Or especially when using AI, you can just ask the AI "how to resize all your images in one folder and subfolders to a maximum of 1920×1080 without changing the aspect ratio in the fish shell", and it probably gives you a command, which just works.
3
-
3
-
3
-
3
-
2
-
8:15 Yup, that's how things should be done. Always be more restrictive by default, and in order to allow more, you have to add more code.
That has been my philosophy since I'm using Rust. Or when I think about it, even before I started using Rust.
I defned some language for stories, where you can define something like this:
a -> b | c -> d
Which means "Scene a first, then either scene b or c, then scene d"
And if you defined "a -> b & c -> d", it means the same, but "both, scene b AND c"
But when you define both of these at once, always the less restrictive variant is used, which means, after a comes b AND c, but d only needs b OR c to be finished.
Not exactly the same, but probably similar.
2
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
2
-
1
-
2:45 Lisp was my first real programming language. I learned most of programming using Game Maker with its own programming language GML. And also RenPy. Around the same time, I was learning Java at school, but it was very basic. I also tried to program games using Java, but didn't get very far.
After school I tried C++ with old OpenGL, but I didn't even know of the stl or libs in general yet.
I was looking into a bunch of languges, and then got stuck with go for a little. I liked it very much at first, but the lack of generics quickly made me lose interest.
And then I stumbled upon Common Lisp. It seemed so minimalistic, and I liked that. (I liked to think about minimalistic langugaes anyway, both programming and spoken languages)
At first I didn't think, it was possible to prograam using this.
I couldn't see if something was a function or a definition or whatever.
So I bought a book, the Land of Lisp. It took me a while to get into it, but soon I thought, I'd never want to use a different language.
I was using it almost exclusively for at least three years, except in university. Whenever I saw shortcomings, I thought they could be fixed using macros or something.
I played around with a few other languages, often lisp inspired. What annoyed me most was that Lisp was so high level, and I couldn't trust the compiler to optimize stuff for me. I just want my stuff efficient by default.
Nowadays I'm mostly using Rust, but there is a Language, which has the real Lisp experience how I would have liked it before. Scopes.
It's basically Lisp, but with more powerful macros to make it more like C++ in some ways (for generic types).
It has a Rust inspired borrow checker.
The low level stuff is lower level than C (there's a distinction between local variables and values).
Syntax is indentation based like python.
And the general feel is a little like Lua (multiple value semantics).
1
-
1
-
1
-
10:00 You COULD write your code in some way that it's easy to change, which would be hard otherwise.
For example if you wrote a game, where some subsystem are 3D (Rendering) and some are 2D (physics, UI), and then you decide to change the dimension of one subsystem (physics), it might be very easy or very difficult, depending on how you wrote it.
In the simplest case you would have to change a 2 to a 3 at one place.
But in the worst case, you have to change ONLY the types, which are related to physics into their 3D equivalents.
In 2D you just used a float to represent rotation, while in 3D it would have to be a quaternion.
You have to rewrite most of the algorithms, since you didn't use algorithms based on dimension generic operations (like the dot product), but instead you used dimension specific operations (like accessing x and y of the vector).
Or if you convert from 3D to 2D, you would probably have used Vectors for rotation speed, which would be scalars in 2D. So you don't immediately know which vectors have to be changed into floats and which would be 2D vectors insdead.
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
15:40 Maybe I'm programming for 5 hours and don't get anything done. And then I get an idea and am 10 hours productive and don't even want to eat. And then I want to sleep, but I just want to finish it, I'm almost done anyway. If I tried to sleep now, I couldn't anyway and would just watch stupid stuff, and still be tired the next day.
And the next day, all my motivation would be gone. Now I have the whole day to finish it, and it's almost finished anyway. I'll first have a long breakfast, then I watch a few episodes of my current anime, then I slowly look into my project and realize I have no idea where to start, so I eat lunch and then go outside. And at 9 in the evening I think, I should just finish it, but since it's not finished yet at midnight and I have work tomorrow, I go to bed and haven't finished it yet. If I just finished it yesterday, it would have taken another 5 hours, but at least it would have been finished.
Something like this isn't considered in this algorithm, right?
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
I work at a small company, around 5 paid workers and around 5 interns most of the time.
Since 2020 we work remote most of the time.
And since then, half of the interns we get don't even live close.
We have a group calls running all the time.
Even if we go to office once in a while (around once per week currently, only the boss, me and one other paid worker), we can't turn off the call, since not everybody can just come to office.
And coming to office makes communication with people even more difficult, since only one person per room can join the call, else we get echo effects.
And with the continuously running group call it's almost as if we were in office.
If you need something, just ask somebody directly. No need to wait for meetings or write a mail or something.
If I want to tallk to a single person, I can just enter another call with just this person.
This also makes work with interns pretty comfortable. They can just ask if they have a problem, and they can share screen.
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
@voskresenie- I don't remember most of this conversation.
When you include zero in your natural numebers, which often makes sense, 0 is the first number.
Starting to count from 0 doesn't really make sense.
If you count, it's like jumping over the elements.
You start at zero, but you don't say it.
I would only make ordinal numbers start from zero, not cardinal, just like it already is in most programming languages.
So I start at 0, this is my "first" (0st) element.
Then I move to place one, there still is an element, so it's element 1. Then I go to place two, and if there still is something, it's 2. And I repeat this until there is no element anymore. The resulting number is the count.
The first index with doesn't have an element.
That's one way to view it.
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
3:50 Yeah, if you have to use unwrap, you probably did something wrong.
In most cases, you can get the values using if-let.
If you expect something to fail, avoid using unwrap, but either forward the error to the next function or generate some error message for the user, if possible one which doesn't kill the program.
If you know, it won't fail, then unwrap is acceptable, but I'd still use except, just to be sure, or use unwrap_unsafe, if you're really sure.
1
-
1
-
1
-
1
-
1
-
1
-
1
-
7:50 What I hate most about inheritance is being able to override things multiple times.
Something should either be abstract or maybe virtual with a default implementation, and you only override it once.
Else something like this could happen.
There's a class A. Class B inherits class A, since it's basically the same, but almost everything is slightly different.
Class C inherits from class B, since it's basically the same, but almost everything is slightly different.
Why not just let class C already inherit from class A and duplicate the one method from class B, which is still the same?
Or even better, turn this method into a function.
Maybe just create an abstract super class for A, B and C, all three of them, and only make the parts, which are not exactly the same abstract methods?
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1:35 Yay, Lisp!
I think he has a point there.
Lisp was my first programming language, I really got into.
It seemed so weird at first. Everything just looked the same, no matter if it was a function call, a macro call, control flow, type definitions or function definitions.
But the different syntax is just an abstraction for humans. It's not necessary.
Before I only used Java in school.
And I did a bunch of programming in GML (Game Maker) to create many unfinished games.
Then I started to get into C++ for Graphics Programming (with old OpenGL), and also tried a few others, one of them being Go.
But I never really used a standard library.
But when I got into Lisp, I really learned all of the language features, including the more obscure non-standardized ones like the CLOS MOP, and I also used a package manager for the first time (quicklisp).
I used Common Lisp for around 3 years almost exclusively. Whenever I didn't like something about the language I thought, I could simply fix it by using macros, preventing me from really getting into other languages, especially if they weren't S-Expression based.
Aferwards I had another phase, where I tried a bunch of PLs, most of them being inspired by Lisp, like Stanza, Dale, Scopes, and also started to get into Rust.
I still think Scopes has potential to be the best programming language. It's basically Lisp, but using an indentattion based syntax, being more low level than C, having a borrow checker, havnig three kinds of macros, useful multiple value return semantics like Lua. Basically Common Lisp, but everything is better.
I think, the best programming language is basically Rust, but with S-Expression based intermediate format.
I think, the programming language should not be monolithic, but be devided into two layers: The semantic layer and the syntax layer.
The semantic layer defines the core features, and it's defined in S-Expressions. It only is about thinks like if it's statically or dynamically typed (by default), if it's garbage collected, does it have classes, interfaces, etc, a borrow checker, etc.
The syntax layer is just a syntax, which could work for different languages. It is just a different format for S-Expressions.
So a C-like syntax, a python-like syntax, a node based visual language, a voice based programming language, etc. all map some format to the same S-Expression format.
I hope, this will happen to Rust one day, too.
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
Part of why I don't like vim is becasue it uses specific keys to represent specific meta keys, which aren't even ordered in a useful way.
Besides that, I already have most of my meta keys on a different layer of my standard keyboard position, like arrow keys, numpad, enter, backspace, etc. (I use neo layout).
And when using a non querty or similar keyboard layout, keybindings don't make sense anymore anyway.
Programs should be keyboard layout independant, if the positioning of the keys is more important than the symbol they represent in the current layout.
And it's not that difficult. Just use the scancode, which your windowing library hopefully provide (winit does).
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
When I was a bit over 20 I had used Java, GML, Python, C++, Go, Common Lisp, Scala, C, Julia, Dale, Scopes
1