Search
Setup for Free
S
Silk.NET
•
3y ago
Aqua
and then whatever the fuck the last 127 numbers of ascii are called
and then whatever the fuck the last 127 numbers of ascii are called
Silk.NET
Join
A Discord server for the Silk.NET - your one-stop-shop for high-speed .NET multimedia, graphics, and compute. FOSS.
1,790
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
A
Aqua
OP
•
10/7/23, 10:36 PM
which is apparently not utf
-8 because why would be it
A
Aqua
and then whatever the fuck the last 127 numbers of ascii are called
M
Maxine
•
10/7/23, 10:36 PM
theyre called nothing
M
Maxine
•
10/7/23, 10:36 PM
because they dont exist
L
Lyris the Kitori
•
10/7/23, 10:36 PM
you shouldnt index strings since that doesnt
really
makes sense and could mean 8 million things
P
Perksey
•
10/7/23, 10:36 PM
ASCII is 7
-bit
L
Lyris the Kitori
•
10/7/23, 10:36 PM
iterate over codepoints or unicode scalar values
M
Maxine
•
10/7/23, 10:36 PM
ASCII is 7
-bit clean
, it doesn
't specify what goes in the other bit
, or if one exists
P
Perksey
•
10/7/23, 10:37 PM
which is probably why it was so easy to model UTF
-8 on a napkin
P
Perksey
•
10/7/23, 10:37 PM
which is actually how it was invented
M
Maxine
•
10/7/23, 10:37 PM
better than the best thing i
've done on a napkin
T
TechPizza
•
10/7/23, 10:37 PM
apparently
"str
"
.chars
(
)
.nth
(1
) works
L
Lyris the Kitori
you shouldnt index strings since that doesnt *really* makes sense and could mean...
A
Aqua
OP
•
10/7/23, 10:37 PM
all i wanna do is go
if string[1] == 'c'
if string[1] == 'c'
like
why is this so hard
T
TechPizza
apparently "str".chars().nth(1) works <:when:968512924698169415>
A
Aqua
OP
•
10/7/23, 10:37 PM
it does yes
A
Aqua
OP
•
10/7/23, 10:37 PM
but that also iterates through the entire damn string
A
Aqua
all i wanna do is go `if string[1] == 'c'` like *why is this so hard*
L
Lyris the Kitori
•
10/7/23, 10:37 PM
because langauge is hard
A
Aqua
OP
•
10/7/23, 10:37 PM
every time you call it
L
Lyris the Kitori
•
10/7/23, 10:37 PM
its just not that simple
P
Perksey
which is probably why it was so easy to model UTF-8 on a napkin
M
Maxine
•
10/7/23, 10:37 PM
of course it was a sad day for everyone using the
"extended ASCII
" encodings
M
Maxine
•
10/7/23, 10:38 PM
or non
-ASCII
A
Aqua
all i wanna do is go `if string[1] == 'c'` like *why is this so hard*
T
TechPizza
•
10/7/23, 10:38 PM
simple
, just don
't
A
Aqua
OP
•
10/7/23, 10:38 PM
dfjkghlsjdfg
M
Maxine
•
10/7/23, 10:38 PM
step 1
. delete rust
step 2
. use c
#
P
Perksey
•
10/7/23, 10:39 PM
wow that codegen is laughable
https://godbolt.org/z/zv9McWTEK
Compiler Explorer - Rust (rustc 1.72.0)
pub fn bb
(i
:
&str
)
-
> bool
{
i
.chars
(
)
.nth
(1
)
=
= Some
(
'c
'
)
}
A
Aqua
OP
•
10/7/23, 10:39 PM
step 3
. delete c
#
step 4
. return to c
P
Perksey
•
10/7/23, 10:39 PM
that
's with maximum optimisation
M
Maxine
•
10/7/23, 10:39 PM
what the fuck
A
Aqua
OP
•
10/7/23, 10:39 PM
yep
M
Maxine
•
10/7/23, 10:39 PM
this shit is in firefox
?
?
A
Aqua
OP
•
10/7/23, 10:39 PM
y e p
A
Aqua
OP
•
10/7/23, 10:39 PM
the best way to do this is genuinely to allocate an entirely new damn array
P
Perksey
•
10/7/23, 10:40 PM
marginally better
https://godbolt.org/z/87vjddjY3
A
Aqua
step 3. delete c# step 4. return to c
L
Lyris the Kitori
•
10/7/23, 10:40 PM
now get the 2nd char in a C string
A
Aqua
OP
•
10/7/23, 10:40 PM
which just is major pain
P
Perksey
•
10/7/23, 10:40 PM
Major Pain
M
Maxine
•
10/7/23, 10:40 PM
do what all c
+
+ programmers do and roll your own string type
L
Lyris the Kitori
now get the 2nd char in a C string
A
Aqua
OP
•
10/7/23, 10:40 PM
simple
,
thing[1]
thing[1]
and if you have a japanese character then just
just
give up
perfect
!
!
!
L
Lyris the Kitori
now get the 2nd char in a C string
M
Maxine
•
10/7/23, 10:41 PM
there are algorithms for this
L
Lyris the Kitori
•
10/7/23, 10:41 PM
correct
P
Perksey
•
10/7/23, 10:41 PM
unrelated but i found that someone made a SIMDified masked v
-byte encoding
P
Perksey
•
10/7/23, 10:41 PM
(where one bit is a marker bit for the rest of the data
)
M
Maxine
•
10/7/23, 10:41 PM
in english
, four
-eyes
/ref
P
Perksey
•
10/7/23, 10:41 PM
https://github.com/lemire/MaskedVByte/blob/master/src/varintdecode.c
M
Maxine
•
10/7/23, 10:42 PM
what
A
Aqua
OP
•
10/7/23, 10:42 PM
i
'm convinced making simd work well is akin to magic
M
Maxine
•
10/7/23, 10:42 PM
is vbyte a variable
-length integer
P
Perksey
•
10/7/23, 10:43 PM
yep
M
Maxine
•
10/7/23, 10:43 PM
oh okay
A
Aqua
OP
•
10/7/23, 10:43 PM
ooh
M
Maxine
•
10/7/23, 10:43 PM
that explains a lot
M
Maxine
•
10/7/23, 10:43 PM
looked it up and just got bitcoin stuff
Next page
Similar Threads
State of code gen
S
Silk.NET / help-and-questions
4y ago