[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.
  • You may highlight syntax and preserve whitespace by using [code] tags.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


[Advertise on 4chan]


File: 1736983214939414.png (60 KB, 1138x416)
60 KB
60 KB PNG
here's your programming language bro
>>
>>106448121
what's the problem?
>>
>>106448121
I hate niggers that write unreadable garbage like this, rife with shorthand and non-descriptive variable names. If your code looks like minified JS then you should kys.
>>
>>106448121
Stop using ligatures you web shitting vibe coder pajeet
>>
Unironically better than C++ btw
>>
>>106448391
One must be retarded to be unable to read this code.
>>
>>106448433
I'm not opening 10 fucking documentation pages to learn what ' or ? or &[<'_>] or -> or => mean and how much match syntax differs from normal code. i would rather stay retarded than be deranged
>captcha: rrgrr
>>
>>106448121
>
&[Sel<'_>]

jfc
>>
>>106448471
>what the fuck I can't understand a language I don't know, so it's "unreadable"
You are fucking retarded
>>
>>106448471
If you don't understand what 'a, ? or &[] means you don't even understand the absolute basics. What a stupid complaint.
>>
>>106448433
I CAN read shitty, obtuse code. It just takes longer than it does to read well-written code. It's retarded to write something that needs to be deciphered before it becomes intelligible, when there is no benefit to doing so.

(You) aren't smarter than the compiler. It's going to optimize the code anyways. The only thing you're doing with shit like this is making your code harder to read and making your code files literal bytes smaller.
>>
>>106448508
>any other sane language
>can be read, the meaning of instructions is clear and laconic
>rust
>if you dont know X Y Z you cant know whats going on!
>wdym this is unreadable? this is readable! just learn you fucking retard, subhuman, idiot nigger ass
>>
>>106448580
I’m assuming this is rust?
It’s always funny seeing what language developers come up with being ignorant of 50 years of computer language development and notation.
It’s like trying to communicate with a child raised by wolves for 10 years.
>>
>>106448655
You can write unreadable code in any language. C and C++ function pointers are unreadable gibberish no matter how you write them, many languages would let you write everything on a single line.
>>
>>106448580
The absolute basics of rust-specific "features", you mean? Then op's thread is directed at you who write rust, which he should've specified. It's sheer delusion to think that only fellow rustfags're gonna answer otherwise
>>
>>106448655
>>106448688
> doesn't understand lifetimes
> doesn't understand references
> why is this unreadable?
>>
>>106448401
Ligatures are based nignog fagboy
>>
>>106448121
wtf does K and I do? some type cast? I can't fucking read this
>>
>>106448722
it cur gets k?,, anon
>>
>>106448722
K and I are variants of the Sel enum.
>>
>>106448715
Sure they are Rapejesh, now go back to vibe coding your fifth Go project saar
>>
>>106448121
this makes cppreference.com look like plain english.
>>
>>106448737
don't you have to do Sel::K and Sel::I? I've literally had Rust yell at me in the past when trying to directly reference members
>>
>>106448618
People who use one character variable names that aren’t for X and Y coordinates and similar should be shot. The only exception is for maths heavy code where it’s all maths variables that represent abstract shit anyway.

Even if you’re wanting to stick to the 80 column limit for readability, there’s a ton of ways to nicely format shit. It’s mostly a hold over from punchcards and terminals that couldn’t scroll
>>
>>106448759
You can import the variant names (with use) so you can access them directly.
>>
sepplesfags be like
>rust is le unreadable!!!
meanwhile sepples:
template <std::__poo_in_the_loo _T, gnu::_retarded_snake_case_spam _XzzT> 
requires India<>() && nigger_t;
[[gnu::autism]]
[[=gnu::IndiansWroteThisCode]]
constexpr consteval constinit const noexcept void std::type_info() operator[](void*& a, boost::benchod::india_t^^ reflexpr _T b) noexcept throw(std::bad_alloc) new delete stackalloc^^ {
if [[likely]] constexpr (std::same_as_t<b, 135, _XzzT>(b)) {
b = new gnu::getopt::Program<>();
delete a;
} else [[unlikely]] [[clang::msvc::_MicrosoftWindowsReactStartMenu<>()]] {
#ifndef DURGASOFT_H
#define DURGASOFT_H
export poo.in.the.loo.durgajeet;
import java.util.ArrayList;
import java.io.*;
std::io::IOException e = { 2.718 };
throw panic!^^(@poop);
delete op_post;
}
return nigger_language == std::_internal::nlohnann::json();
}
>>
>>106448121
this is STILL better than c++
>>
>>106448802
>[[likely]]
cool
https://doc.rust-lang.org/beta/std/hint/fn.likely.html
>>
>>106448802
holy shit anon
lmao
thanks i laughed, saving this one
>>
>>106448802
>constexpr consteval constinit const
I love that C++ has like 18 const variants and still nothing will actually be const.
>>
>>106448471
All these symbols are commonly used in programming, it doesn't take a genius to understand them. The only fairy unique syntax here is 'a but considering that Rust is known for explicit lifetimes and that this notation is used next to reference symbol, it should be very simple to deduce its meaning.

tl;dr skill issue
>>
File: 1711100977090717.png (418 KB, 568x568)
418 KB
418 KB PNG
>>106448802
>import java.io.*;
holy ROFL
>>
>he doesn't use `Box<[T]>` rather than `Vec<T>` when interacting with data that is contiguouss and never re-sized
>>
>>106448740
Go is also based fagboy
>>
>>106449175
>has a HTTP server in stdlib
>no sets
lmao
>>
>>106448765
How about i, j and k for counting?
>>
section .data
null dq 0

section .text
global at_opt
at_opt:
push rbp
mov rbp, rsp
mov r12, rdi ; v (first arg: value)
mov r13, rsi ; path (second arg: array of selectors)
mov r14, rdx ; path_len (third arg: length of path)
mov r15, r12 ; cur = v

.loop:
cmp r14, 0
je .done
cmp r15, 0
je .return_none
mov rax, [r13] ; load current selector
cmp byte [rax], 0 ; type check (0 for K, 1 for I)
je .key_case
; index case (I)
mov rsi, [rax + 1] ; get index
call [r15 + 8] ; call cur->get with index
jmp .next
.key_case:
; key case (K)
mov rsi, [rax + 1] ; get key string
call [r15 + 8] ; call cur->get with key
.next:
mov r15, rax ; update cur
add r13, 8 ; move to next selector
dec r14 ; decrement path length
jmp .loop

.done:
cmp r15, 0
je .return_none
mov rax, r15 ; return Some(cur)
leave
ret

.return_none:
xor rax, rax ; return None (null)
leave
ret
>>
>>106448121
fn at_opt<'a>(v: &'a Value, path: &[Sel<'_>]) -> Option<&'a Value> {
path.iter().try_fold(v, |cur, s| match s {
K(k) => cur.get(k),
I(i) => cur.get(*i),
})
}
>>
>>106448121
Can someone post this code with non-retarded variables and function names that actually tell you what they are supposed to be?
>>
>>106449354
thats just how rust works
>>
Just because everyone has dealt with annoying syntax doesn’t mean that we should continue to consume this garbage
It’s like Rust is designed by ultimate autismos, just because you care to deal with annoying shit doesn’t make you more intelligent
It makes you a curmudgeon and a retard unable to cope with sensible changes
It’s being a luddite and again socially blunted and again RETARDED
All these concepts can be handled and parsed with less terse syntax
If I am having constantly to hold the shift key you have failed to move this shit forward into a sensible direction

I also not here to do this job for you I don’t need this language and will definitely be less interested in this shit going forward if it becomes adopted by you losers
>>
your all gay and retarded
>>
>>106449210
i, j, k, l and so on are based for loop iterators.
>>
>>106448121
no clue what i'm looking at, thankfully i can ask chat gpt to write everything verbose and with commentary
>>
>>106449366
I get that, and it looks horrible, but maybe if the freetard who wrote the code didn't use 1 letter variable and function names, I could at least understand what it's supposed to do and appreciate the part that's Rust's retardation
>>
How would you write that in your language?
>>
>>106449354
Not that hard when you know the syntax. It's basically a program that controls the intensity of a vibrator based on the amount of fecal matter present in the bussy.
>>
>>106449438
The sooner the LLMs kill this stupid proffession filled with social mongoloids the better
All this shit just brings sukdeep and chang to america fuck off turn the whole internet off fuck it
>>
>>106449467
>URMMM AKSHUALLLY..
this is what I am talking about
jump off a bridge you cunt
>>
>>106448802
sepplestrannies seething but this is unironically what any standard library function implementation looks like lmao
>>
File: zero.png (15 KB, 653x475)
15 KB
15 KB PNG
>>106448508
Any code should be readable to the point that you can at least estimate what's going on. That's the fucking point of using languages consisting of English words.
Unless you're writing in an esoteric language that's supposed to be unreadable if you don't know the principles.
>>
>>106448802
Kek
Still looks nicer than Rust
>>
I know literally nothing about the Rust syntax, what the fuck is this doing?
The best I can figure out based on my limited monkey brain is that cur is set to the value member of a and from there it is trying to match some part of a path variable to get k and i before doing some other thing with Some(cur)?
>>
>>106448121
honestly i'm a fan. nice ligatures btw.
>>
>>106448802
Nobody said you had to use templates homo
Instead of making this thread stick a dildo up your ass you queerboy
>>
>>106448802
still more readable than your soilanguage
>>
everybody know rust is and forever will be associated with insane unstable disgusting trannies
i would rather program in javascript
>>
>>106448121
Looks like the grammar for my schizo autistic brother's imaginary autism language
>>
>>106448121
Fuck this garbage.....
>>
>>106448401
Das rite, fuck this stupid & shit, real coders write et.
>>
>>106448121
This is even worse than JavaScript slop C++ will never go away kek
>>
>let
>>
>>106448121
Eww wtf is this? This can't be a real language, what are those runes?
>>
>>106449544
Yeas, and people just don't get it. They don't want this quality it seems and instead decide to throw nigerppp as a comparison. Lol, even rustshit is better than modern nigerppp.
>>
>>106448618
This. 100% unequivocally this.
Couldn't have said it better.
>>
>>106449544
>every language should bend over backwards to help my lazy ass
No, fuck off. Take any 10+ lines C function, go outside, and start asking random non-programmers what it does. English keywords won't help them.
The target audience of a programming language is not anyone that knows english, it's programmers who can sit their ADHD ass down and learn it.
you are a lazy nigger
>>
>>106448674
>I'm a dumb nigger who expended all of his brain plasticity on learning C, so refusing to limit the language to what I already know is "ignoring 50 years of computer language development and notation"
>>
File: images(1).png (17 KB, 351x143)
17 KB
17 KB PNG
>>106448655
Is this readable for you?
>>
>>106450984
Should've shown latin
>>
>>106449563
'a is a generic lifetime, not a value
First it sets cur (current value) to v.
Then it iterates over path which is a slice (known size array in memory) of Sel (-ection, I assume). For each Sel s it matches whether it is a K(-ey) or I(-ndex). If it's K it binds it's contents to variable k (presumably some string type), then calls cur.get(k), if it fsils the whole function returns None. Analogous thing is done for I, with i being some index type.
If whichever path was taken got a value from get then cur is set to that value.
After the loop ends cur is wrapped in Some because the function returns an Option, which can either be None, could be returned earlier to indicate failure, or Some, which is used now to indicate success. Function returns the last statement

In short it takes some Value and a path and tries to navigate to a sub Value at it
>>
>>106451110
That makes sense, thanks anon.
>>
>>106449259
unironically most readable in the thread
>>
>>106451179
i concur
if a high level language is less readable than fucking asm then its a mission succesfully failed
>>
>>106448802
KEK
>>
>>106450940
>moving the goalposts to non-programmers
you're an idiot, anyone with a brain can grasp that having verbosity is a detriment to proper programming, regardless of their skill level. the whole point of a language is to abstract away the core constraints that the machine architecture of a computer demands so that you can focus on defining the underlying behaviour you're trying to make it achieve. anything that impedes that is bad design. it's not up for debate. just because you're willing to jump through hoops because you want to seem like smart little script kiddie is irrelevant.
>>
>>106448121
Language should have low mental burden on reading. Words are easier to read. I can read regex, but it's faster to parse a sentence then scanning character at a time. If you are not illiterate you can read 3 to 5 words at a time. It's more efficient and effortless in comparison to scanning character by character without spaces. There is a reason why we make spaces between words, use interpunction and form words instead of using continuous series of pictograms. Chinese is an exception, but they encapsulate meaning into a single symbol or in a sequence of them, but they don't overload these symbols I guess. It still looks harder to read.

I prefer languages that have fucking words for syntax and sensible operators that don't overload much. Abbreviations like fn for function are good though. C is a the sweet spot between explicit syntax and low verbosity. Rust and C++ looks tiring af to read with all of these symbols and brackets. Ironicaly I like Perl, but I write it mostly like C so only the sigils are extra which don't make it as busy as C++.
>>
>>106448121
I can read it, but like if I was in a prod team and this was how they wanted their codebase to look, I would not work there very long.
>>
>>106448121
Jesus
HolyC is more readable than rustanistan
>>
File: 1736234131077944.png (797 KB, 869x1776)
797 KB
797 KB PNG
>>106448391
this is you
>>
>>106451641
>Implying that wanting code to not be niggerlicious means it has to be non-functional bullshit
>>
>>106448121
In Perl this is just
sub at_opt{my($v,$p)=@;my$c=$v;for(@$p){ref&&return undef;ref$c eq'HASH'&&exists$c->{$}?$c=$c->{$}:ref$c eq'ARRAY'&&/^\d+$/&&$<@$c?$c=$c->[$_]:return undef}$c}
>>
>>106449042
>>106448433
Rust should just use Perl for its Turing-Complete Type system at this point.
>>
>>106451791
How would you incorporate Perl into Rust exactly? They are very different languages
>>
>>106448802
Truer words have never been spoken.
>>
>>106448771
you can but you really shouldn't, especially when the base enum is just a short name like Sel anyways
if you do this and the enum you're using ever gets a member removed then the member name you have written will become a valid identifier and implicitly and silently match everything which will skip execution for subsequent match statements
it's explicitly called out in the api best practices book and i think is even a clippy lint
>>
>>106451277
>Any code should be readable to the point that you can at least estimate what's going on. That's the fucking point of using languages consisting of English words.
I don't see "by people who know programming" anywhere there. The point of using english words is that you can estimate what's going on. Well, C uses english words. They know english. They should be able to estimate what a C function does. No cheating with comments or function names.

>the whole point of a language is to abstract away the core constraints that the machine architecture of a computer demands so that you can focus on defining the underlying behaviour
Defining how? In english words? Only in things YOU already understand? World ain't about you faggot. Code in op has 12 non-whitespace characters that don't define the behaviour of the function. Just because YOU can't understand something because you don't know the fucking language doesn't mean it's too verbose or unreadable.
I don't give a fuck about a blind person's opinion on how good a graph conveys information and I don't care about an illiterate niggers opinion on how good code conveys information
>>
>>106451641
This is all the illiterate niggers ITT



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.