New Math Language in Rust (Noq Ep.01)

  Рет қаралды 49,770

Tsoding Daily

Tsoding Daily

2 жыл бұрын

References:
- Coq: coq.inria.fr/
- Derivative: en.wikipedia.org/wiki/Derivative
- Noq: github.com/tsoding/Noq

Пікірлер: 116
@stinkytoby
@stinkytoby 2 жыл бұрын
Finally, I can witness Tsoding's not coq
@whannabi
@whannabi 2 жыл бұрын
I'm glad there's a negation before coq
@cobbcoding
@cobbcoding 6 ай бұрын
@@whannabi wouldn't want positive coq's around here
@mrorigo
@mrorigo 2 жыл бұрын
Made my day. Impressive to say Coq so many times and not get banned from YT :P
@naturallyinterested7569
@naturallyinterested7569 2 жыл бұрын
If you're interested in this (graph transformations and equivalence), you should definitely check out egg (E-Graphs Good) and E(quivalence)-Graphs in general (if you haven't already)! (It's written in Rust, so bear caution! ;) Gist: The basic idea is that you have your Abstract Syntax-DAG that contains your expression and you apply rules and what you get is your transformed expression *while keeping* the _original_ one in the *same* data structure, so that subsequent applications still have that information. So by applying all your rules again and again you eventually reach a state where potentially none match anymore (called saturation) and you have ALL POSSIBLE derivations, from which you can select your desired one.
@vasiliigulevich9202
@vasiliigulevich9202 2 жыл бұрын
Bug: Some bindings are left populated even if match fails. Bindings should only be filled if all arguments of a functor are matching, but are populated for each argument, even if later arguments do not match.
@janAkaliKilo
@janAkaliKilo 2 жыл бұрын
Всё правильно - не кок, а повар плавсостава. Спасибо за просвещение, Тсодинг Ежедневник.
@user-ev5xt1ij8v
@user-ev5xt1ij8v Жыл бұрын
Наконец-то нашёл русскоговорящего на этом канале
@MrHatoi
@MrHatoi 2 жыл бұрын
1:02:30 One thing you can do to make the &str -> String conversion clearer is using `to_owned` instead of `to_string`; it does the exact same thing but it's clearer what the actual purpose of the method call is: to convert from a borrowed slice of another string to an independent "owned" string. The fact that `to_string` does the same thing is kind of just a coincidence, since it's just a trait method for any type that can be converted to a string.
@naturallyinterested7569
@naturallyinterested7569 2 жыл бұрын
Also definitely check out the logos crate, which is an uncomplicated lexer state-machine generator that provides you with a *really fast* (subset of) regex and token macros ontop of your Lexeme enum, so that you don't have to re-implement lexing all-the-time and can focus on parsing (we use it in out university's compilers class as a rust alternative to (f)lex). It can be a bit rough around the edges (no lookahead or non-greedy matching, and the documentation isn't the best) but provides easy workarounds for the nitty-gritty and should be completely sufficient for your use-case. (I am not affiliated)
@fybits
@fybits 2 жыл бұрын
No Porth? ⠀⣞⢽⢪⢣⢣⢣⢫⡺⡵⣝⡮⣗⢷⢽⢽⢽⣮⡷⡽⣜⣜⢮⢺⣜⢷⢽⢝⡽⣝ ⠸⡸⠜⠕⠕⠁⢁⢇⢏⢽⢺⣪⡳⡝⣎⣏⢯⢞⡿⣟⣷⣳⢯⡷⣽⢽⢯⣳⣫⠇ ⠀⠀⢀⢀⢄⢬⢪⡪⡎⣆⡈⠚⠜⠕⠇⠗⠝⢕⢯⢫⣞⣯⣿⣻⡽⣏⢗⣗⠏⠀ ⠀⠪⡪⡪⣪⢪⢺⢸⢢⢓⢆⢤⢀⠀⠀⠀⠀⠈⢊⢞⡾⣿⡯⣏⢮⠷⠁⠀⠀ ⠀⠀⠀⠈⠊⠆⡃⠕⢕⢇⢇⢇⢇⢇⢏⢎⢎⢆⢄⠀⢑⣽⣿⢝⠲⠉⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⡿⠂⠠⠀⡇⢇⠕⢈⣀⠀⠁⠡⠣⡣⡫⣂⣿⠯⢪⠰⠂⠀⠀⠀⠀ ⠀⠀⠀⠀⡦⡙⡂⢀⢤⢣⠣⡈⣾⡃⠠⠄⠀⡄⢱⣌⣶⢏⢊⠂⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⢝⡲⣜⡮⡏⢎⢌⢂⠙⠢⠐⢀⢘⢵⣽⣿⡿⠁⠁⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠨⣺⡺⡕⡕⡱⡑⡆⡕⡅⡕⡜⡼⢽⡻⠏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⣼⣳⣫⣾⣵⣗⡵⡱⡡⢣⢑⢕⢜⢕⡝⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⣴⣿⣾⣿⣿⣿⡿⡽⡑⢌⠪⡢⡣⣣⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⡟⡾⣿⢿⢿⢵⣽⣾⣼⣘⢸⢸⣞⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠁⠇⠡⠩⡫⢿⣝⡻⡮⣒⢽⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
@fybits
@fybits 2 жыл бұрын
But coq sounds kinda funny ngl
@anon_y_mousse
@anon_y_mousse 2 жыл бұрын
Neat, where did you copy that from?
@fabiodan30
@fabiodan30 2 жыл бұрын
As someone who loves working with ASTs, it's great to know that that your viewers are interested in the topic! I loved the part where you implemented pattern matching, I had no idea how one would do that.
@didyoustealmyfood8729
@didyoustealmyfood8729 7 ай бұрын
Why do you love working with abstract syntax trees. That like a representation thing. Surely not a statement a dev would say
@ErikOrjehag
@ErikOrjehag 2 жыл бұрын
I really missed your content. You are my favorite KZfaqr atm. I hope that Putin will end his stupid war asap...
@astroid-ws4py
@astroid-ws4py 2 жыл бұрын
Putin is putting an end to the Nαzis in Ukraine, Do not get why you are so mad.
@lolcat69
@lolcat69 Жыл бұрын
He hasn't ended it yet :(
@dixztube
@dixztube 11 күн бұрын
I agree but the us keeps provoking him and architecting schemes with our insane intel agencies and nato. But ya I hope all these horrible wars end. These governments are all so horrible. Russia and the us. Ukraine seems pretty awful too
@hikingpete
@hikingpete 2 жыл бұрын
The functionality of this language is very reminiscent of the Wolfram language (Mathematica). It's described as 'term rewriting' or something like that. Thanks for sharing.
@Bobbias
@Bobbias 2 жыл бұрын
This is really neat. I've always wanted a system where I could input a math expression and "explore" the possible ways to manipulate it. Although in my case the idea is that the program would be able to visually show you different ways to manipulate the expression based off of all the various algebraic manipulations without needing them to be manually supplied the way your system works.
@sebastiangudino9377
@sebastiangudino9377 2 жыл бұрын
Isn't that what Wolfram alpha does?
@j-wenning
@j-wenning 2 жыл бұрын
At 53:30, regarding capturing values, you can do so with a "move closure", as it's referred to within the Rust book.
@remrevo3944
@remrevo3944 2 жыл бұрын
Closures in rust can generally capture their environment. Only if you need something by value (e.g. as an owned value) you need a move closure.
@ratherbyexploring4898
@ratherbyexploring4898 2 жыл бұрын
We need a nice long rust-roast video. And what you think is better.
@thepaulcraft957
@thepaulcraft957 2 жыл бұрын
You r living in russia and u r putting a donation link for victims of war in ur description? i think this is a pretty brave act
@thepaulcraft957
@thepaulcraft957 2 жыл бұрын
@Mariano Bustos 😂😂💪💪
@AnarchySane
@AnarchySane 6 ай бұрын
@@MarionLord FSB love big balls of steel, because steel ones conduct electricity well.😂
@AnarchySane
@AnarchySane 6 ай бұрын
А я то думаю почему у него такой приятный и понятный акцент. ❤
@markblacket8900
@markblacket8900 2 жыл бұрын
this video is a gold mine for someone who would want to make a "tsoding out of context" vid
@ot44eto
@ot44eto Жыл бұрын
Damn, your topics are an incredibly interesting man. Cheers!
@peyop917
@peyop917 2 жыл бұрын
Thank you for all this excellent content
@programming3218
@programming3218 2 жыл бұрын
I love your coq replacement, thinking about replacing mine too
@batlin
@batlin 2 жыл бұрын
Great to have Tsoding back on YT!
@louis1001
@louis1001 Жыл бұрын
Nice. I was working on something similar in swift. With an enum ast and SwiftUI rendering. I'm trying to practice calculus while creating the transformation
@TheRedbeardster
@TheRedbeardster 2 жыл бұрын
Very nice! What do you think of Isabelle/HOL?
@Mozartenhimer
@Mozartenhimer 2 жыл бұрын
Yay another vod!
@drdca8263
@drdca8263 2 жыл бұрын
I’ve considered doing something a little similar, except instead of having like, a general purpose AST, it just has tensor products and compositions? So, in the idea I’m imagining, each thing could optionally have a domain and codomain, which would also be things, and for a given pair of things (maybe requiring that the two things have the same “level”?) there would be the ordered pair (/ tensor product) of those two things (and if those two things had a domain and codomain, the product would also have a domain and codomain, and its domain and codomain would be the products of the domains and codomains respectively of the two things it is a product of) and if the codomain of one thing is the domain of another thing, they can be composed, Except, I think probably people have already made the thing im thinking of? Or at least something similar. But I don’t understand how to use their tool. It is apparently supposed to model infinity categories? So I guess I was thinking of maybe making a broken but easier for me to understand version of what they did.
@Lightofmask
@Lightofmask 2 жыл бұрын
I've been giving the idea quite a lot of thought as well since I learned about Lean prover last year.. I'd like to set up a discord to talk about it for an opensource project with a Unity front-end (very game-y to make people see and instantiate mathematical objects), but I haven't really done the housekeeping for my digital identity yet. plz dm me if you'd like an invite
@drdca8263
@drdca8263 2 жыл бұрын
@@Lightofmask that sounds interesting. How do I send a DM on KZfaq? Or do you mean send you a DM on discord? If so, what handle?
@ecosta
@ecosta 2 жыл бұрын
Publishing amazing content. Then making a bunch of jokes about bad documentation == "job security". I was already a big fan. Now, reappearing from ashes and making jokes about hiding from KGB (I hope both are not literal), with a link to donations to the victims of war - and all of that without making any money for himself. That's true altruism, people.
@sebastiangudino9377
@sebastiangudino9377 2 жыл бұрын
I would have NEVER expected somebody who primarily programs in C and in Haskell to dislike Rust. The closest thing to a low level Declarative language, so yeah, pretty much a middle ground between those two
@john.dough.
@john.dough. 2 жыл бұрын
yeah honestly, coming from a similar background, I've had nothing but love for Rust
@csbnikhil
@csbnikhil 2 жыл бұрын
Also I didn't understand why the community was said to be annoying. I've only had positive experiences with the community and it's generally a really nice one.
@sebastiangudino9377
@sebastiangudino9377 2 жыл бұрын
@@csbnikhil I agree, although there is a vocal minority of people that go: "Bro why u using JS bro, use rust, is faster. Bro whats c? That a dead language, use rust instead, same performance but good haha lol" that could be percieved as anoying
@AlFredo-sx2yy
@AlFredo-sx2yy Жыл бұрын
i come from C and C++ for years and i've always hated Rust tbh ... I simply dont like it, and im constantly looking for reasons to like it, but the community just repeats the same stuff i already know... convince me i should use Rust, convince me its any good.
@sebastiangudino9377
@sebastiangudino9377 Жыл бұрын
@@AlFredo-sx2yy I mean, I don't have to convince you, you can just not like it and that's fine. But I don't understand why tho. You could just wrap everything in unsafe. Treat "borrowing" as C++ references (So really just pointers) and code in a very similar manner as you do in C. Handling data as structs and all. So I don't see why you would hate it. And the you can slowly start to integrate rusts benefits into your code and see how the clean things up without having to forget everything you know from C/C++
@Lightofmask
@Lightofmask 2 жыл бұрын
what about Lean to exploit their Tactics to create structures of proof templates ?
@qaqkirby9781
@qaqkirby9781 7 ай бұрын
i leaned most from tscoding's strearm that i learned in university in 5 years.
@stepan_chous
@stepan_chous 2 жыл бұрын
Спасибо за видео, очень вдохновил, когда прога заработала, получил удовольствие, будто сам написал. Сейчас как раз это изучаем на дискретной математике, если не секрет, что заканчивал?
@tianned
@tianned 2 ай бұрын
Что то связанное с металлургией если мне не изменяет память
@Eugensson
@Eugensson 2 ай бұрын
You should try a calculator with CAS support (Computer Algebra System). Smth like HP Prime. Not much bureaucracy there over derivative simplifications.
@DeviRuto
@DeviRuto 2 жыл бұрын
What font are you using? It looks so good
@DeviRuto
@DeviRuto 2 жыл бұрын
(it's Iosevka, turns out)
@redpepper74
@redpepper74 Жыл бұрын
18:14 holy jeez i thought you were gonna use js
@gertrudessampaio8689
@gertrudessampaio8689 Ай бұрын
You are a fucking genius, i want give money for this amazing
@andreyvlasov9927
@andreyvlasov9927 2 жыл бұрын
Doesn't Prolog do this exact thing?
@richardsh8770
@richardsh8770 Жыл бұрын
Hi. Really enjoying your channel for years. Can I support you from Russia somehow? Boosty maybe?
@jursamaj
@jursamaj 2 жыл бұрын
Regarding subscription: eventually, after the war is over and sanctions lifted, the money will get where it's meant to go. Otherwise, Twitch would be committing massive fraud by accepting the subscriptions.
@RemcoJvGrevenbroek
@RemcoJvGrevenbroek Жыл бұрын
not sure if you aware of this but i not get notifitcations of your videos anymore , I am in europe- the netherlands
@HowDoYouUseSpaceBar
@HowDoYouUseSpaceBar 6 ай бұрын
51:10 never do "use some_module::SomeLongEnumName::*" as this can cause a bunch of issues down the line when you remove a variant, try "use some_module::SomeLongEnumName as SomeEnum" instead 👍
@DJohn001
@DJohn001 2 жыл бұрын
Why does it make you sad if someone uses emacs because of you. Looking how fast it works voor you it looks very nice. I wish I could use the keyboard as good and fast as you. That's harder in other IDE's than emacs I guess. Or do you have another opinion/idea?
@sebastiangudino9377
@sebastiangudino9377 2 жыл бұрын
Honestly with Vim and even VSCode you can code just as fast as him. It's not really about the IDE. Is about CHOOSING an IDE and taking the time to master it. You can be super humanly fast in whatever editor you prefer. The important thing is to decide to master your keybindings and knowing how to navigate other than just moving the arrow keys. Being able to find at a glance the least amount of keystrokes to get from point a to point b is the real key to success
@JoeShmowYo
@JoeShmowYo 2 жыл бұрын
YEP Coq
@simoads8483
@simoads8483 2 жыл бұрын
Nice T-shirt.
@poo81
@poo81 2 жыл бұрын
Nice
@astroid-ws4py
@astroid-ws4py 2 жыл бұрын
OCaml might be better instead of Rust, Coq is built with it.
@masterj556
@masterj556 2 жыл бұрын
Hello hello ❤❤❤
@MariaRamirez-nz8ms
@MariaRamirez-nz8ms 2 жыл бұрын
A new tsoding video. Made my day today. First viewer too.
@_inetuser
@_inetuser Жыл бұрын
5:53 bruv
@cedricvillani8502
@cedricvillani8502 2 жыл бұрын
😂 ya when CS students get board, they create functions and amusing mathworks projects.
@damjanbabic6768
@damjanbabic6768 7 ай бұрын
Ofc you don't need money cuz the system you're making can automate and standardise the concept of a "process". This is the shit
@Ryan-xq3kl
@Ryan-xq3kl 2 жыл бұрын
i clicked because i am a rust shill
@Idle826
@Idle826 2 жыл бұрын
hehe... coq
@frankiee1550
@frankiee1550 2 жыл бұрын
How's going in Russia?
@s_van_riy4833
@s_van_riy4833 2 жыл бұрын
ладно
@anon_y_mousse
@anon_y_mousse 2 жыл бұрын
Am I the only one that h4t3s rust? I'd love to see you do this in pure C. That would be impressive, and more fun.
@jakimoretti7771
@jakimoretti7771 2 жыл бұрын
as a rust enjoyer, what do you not like about rust?
@anon_y_mousse
@anon_y_mousse 2 жыл бұрын
@@jakimoretti7771 For a start, the syntax. They steal from multiple languages for that, and not in a good way. Their style guide, while not forced upon anyone, suggests a style I h4t3, and everyone has decided to use it. As a non-legacy language they could've gone anywhere with the keywords, and where they went annoys me. These are all personal gripes, and not even all of them, but no one seems to agree, so whatever.
@sebastiangudino9377
@sebastiangudino9377 2 жыл бұрын
@@anon_y_mousse I mean, you can literally just code in Rust like you code in C. The fact that rust give you more idiomatic tools to archive the same results in a better more readable more consice way I spired by declarative programing should no be bad thing, you can literally just not use any of the things rust brings to the table
@anon_y_mousse
@anon_y_mousse 2 жыл бұрын
@@sebastiangudino9377 That's part of the problem. If I'm going to use a language that has operator overloading and templates and classes, I'm going to want to use those. I want those things, but not the way Rust or C++ give them to me. I'm not saying we should only ever use C, but rather if we use a new language it should actually be better. That's why I'm writing yet another programming language, only this time, I'll like it. Even if I'm the only one using it.
@proloycodes
@proloycodes 2 жыл бұрын
@@anon_y_mousse it is better tho
@totlajos587
@totlajos587 2 жыл бұрын
What Is your IQ??
@bereck7735
@bereck7735 2 жыл бұрын
A new tsoding video. Made my day today. First viewer too.
Rust Macros (Noq Ep.02)
1:57:02
Tsoding Daily
Рет қаралды 33 М.
The purest coding style, where bugs are near impossible
10:25
Coderized
Рет қаралды 859 М.
ДЕНЬ РОЖДЕНИЯ БАБУШКИ #shorts
00:19
Паша Осадчий
Рет қаралды 4,7 МЛН
О, сосисочки! (Или корейская уличная еда?)
00:32
Кушать Хочу
Рет қаралды 8 МЛН
WHY DOES SHE HAVE A REWARD? #youtubecreatorawards
00:41
Levsob
Рет қаралды 34 МЛН
Когда на улице Маябрь 😈 #марьяна #шортс
00:17
Rust is easy... (we make it hard)
10:11
Let's Get Rusty
Рет қаралды 114 М.
Rust vs Java: A Staff Engineer's perspective
25:04
Dario
Рет қаралды 10 М.
Rust for TypeScript devs : Borrow Checker
8:49
ThePrimeagen
Рет қаралды 211 М.
Rust Functions Are Weird (But Be Glad)
19:52
Logan Smith
Рет қаралды 124 М.
Rust's most wanted feature just arrived!
3:50
Let's Get Rusty
Рет қаралды 119 М.
Why JavaScript Devs are Switching to Rust in 2024
10:35
warpdotdev
Рет қаралды 242 М.
Giving Personality to Procedural Animations using Math
15:30
t3ssel8r
Рет қаралды 2,4 МЛН
I visited the world's hardest math class
12:50
Gohar Khan
Рет қаралды 179 М.
What Makes Rust Different?
12:38
No Boilerplate
Рет қаралды 195 М.
AMD больше не конкурент для Intel
0:57
ITMania - Сборка ПК
Рет қаралды 504 М.
3D printed Nintendo Switch Game Carousel
0:14
Bambu Lab
Рет қаралды 4,7 МЛН