#πͺ -progaming
1 messages Β· Page 65 of 1
what the hell is this
vscode is the only electron app i can excuse
@valid jetty you
i like it because
- it doesnt pollute with global functions yet still is short to type (just put a # at the start)
- its a unified system, ie if you see one directive you an guess how the other directives work
- not everything needs to be sugar
YEARS OF LANGUAGE DESIGN yet NO REAL-WORLD USE FOUND for prefixing functions with
#
the point is that theyre not functions actually :3 the#makes an important distinction that the thing you are calling will do a compile-time thing instead of at runtime
I am in favor of removing #
i think as couldve been a good idea if ptr types were left associative instead
ie *u8 and not u8*
what's the difference
the left one is easier to read with as
x as *u8 * y vs x as u8 * * y
thats what rust does too with ptr types which is why it can have as i think
wouldn't you always put the * right up next to the type
space between would mean multiply I think
whitespace should not be significant when parsing
I agree until it's regarding types like that
Whitespace can affect tokenization (foo bar and foobar are obviously different), but it typically shouldn't affect parsing
Though in my lexer I convert <= to two tokens and then look if there was space between so that's a bit hypocritical
im in favor of removing you
parser should always ignore whitespace unless youre separating identifiers
whitespace should only matter for the lexer
let foo = "bar"
in x
*
a =
foo ++ a
should be the same as
let
foo = "bar"
in
x *a = foo ++ a
i meant lexer
whitespace shound be irrelevant in the lexer other than separating identifiers
unless its python
Whether the pasting of non-whitespace-separated symbols into multi-symbol ops counts as part of the lexer or parser is up to individual interpretation
I do it in the cursor over the token tree, which I'd count as part of the lexer
what does that sentence mean
the parser does not know what a whitespace is unless its python
where exactly am i supposed to edit the config for e.g. nvim-cmp in nvchad? do i just add it to plugins/init.lua?
it just knows [Let, Ident("foo"), Equal, String("bar"), In, etc...]
In python I'm pretty sure the indent handling is in the lexer too
plugins/nvim-cmp.lua https://nvchad.com/docs/config/plugins/
why not start with Lazy
lmaoo π
cause the whole point is not to configure nvim
i wrote this https://github.com/eagely/dotfiles/tree/main/modules/home-manager/nixvim and its getting annoying
My NixOS configuration files. Contribute to eagely/dotfiles development by creating an account on GitHub.
lol makes sense
From what I can tell python does the whitespace handling in https://github.com/python/cpython/blob/main/Parser/lexer/lexer.c#L405
depending on whitespace is so 
My lexer turns a <= b into [Ident("a", 0..1), Symbol('<', 2..3), Symbol('=', 3..4), Ident("b", 5..6)]
cursor.operator("<=") checks whether the span of each symbol token is conjoined
oh u mean if u have a <= token
Yeah
I don't have <= tokens, I have single-symbol tokens and then a function that checks if they are consecutive
i tried doing that but decided its easier to just make them combined
C++ templates had trouble with that for a long time
Since vector<vector<T>> lexed as a right shift
In my case the lexer neither knows nor cares what composite ops the parser can dream up
yea ik u had to do vector<vector<T> >
but i dont have generics (not even any types at all yet) and theyre not going to use <>
I just thought it was easier to implement this way
yeaha and elle does this
awful
ERROR: inconsistent whitespace detected
nobody but the idea is that you can
python sucks too
you can put 2 spaces between something and itll still compile
im saying enforce the whitespace on the type identifier
u8* = u8 pointer
u8 * n = u8 multiplied by n
u8* * n = u8 pointer multiplied by n
yeah thats evil
Rosie insane
rust 2.0
wdym
(Foo<Bar> *[], (i32, i64 **[]))
a tuple with
- on the left, a
Foo<Bar> *array - on the right, a tuple with
- on the left, an i32
- on the right, an array of
i64 **
thats a valid type
also @dense sand if you dont want shitty distro vendor lockin crap you can go with kickstart-nvim
This is why god invented structs
whats vendor lockin about it
i feel like nvchad is too complex with too much preinstalled shit
unchangeable preconfigured stuff
or rather stuff that would require more than necessary work to change
stdlib aliases
each tupe
why not just remove requiring a $
$ is a function
it's confusing
because then its more sugar
elle is built on hopes and dreams
lmao
so
if i can have tuples be concise to create at no expense to the parser and compiler (no changes were made) then i might aswell do that
I'm confused about the syntax
i just use the alias system that already existed when i made it ```rs
fn Tuple::new<T, U>(T x, U y) {
let tuple = #alloc(Tuple<T, U>);
tuple.x = x;
tuple.y = y;
return tuple;
}
external fn Tuple::new<T, U>(T x, U y) @alias($) -> (T, U)
$ is just an alias for Tuple::new
its just a function
cause you use angle brackets < for denoting a generic type in the structure
wouldn't it be more consistent to do this everywhere else like cast<i64>(g)
how do yall configure the hover menu in nvim
triples are cursed
please be a basic person and make tuples variable length
this
ctrl+k
it conflicts with existing keybind but idc
lspconfig.lua: Lines 67-69
map("i", "<C-h>", vim.lsp.buf.signature_help, opts "Signature help")
map("n", "<leader>vd", vim.diagnostic.open_float, opts "Diagnostics")
map({ "n", "i" }, "<C-k>", vim.lsp.buf.hover, opts "Hover")
fn cast<T, U>(U expr) {
return #cast(T, expr);
}
``` yeah you can do that
how do u configure the borders and stuff
oh i dont
you can now ```rs
cast<i64>(1)
you will disallow types as params and make this the default

wdym
what does it look like
no passing type as a param
basic popup at the cursor without any border
isnt that super unreadable
passing types as params is kinda very necessary for generics to exist
can't you just use <>
light mode
shut up
here
yea its readable with that theme
idk what youre trying to say π
hes saying to x as T
x: i64 := cast(y) 
this is a real function which will work idk what youre talking about
cast(i64, 1) should not compile because using an unvalued type i64 in the param
it should be cast<i64>(1) imo
T is explicitly set, U is inferred from expr
you cant be talking about sugar when you got let statements AND walrus
π
π
π π
yeah if you can figure out how to read the code β€οΈ
@valid jetty when will Elle be written in Elle
at some point in the distant future
why do u need to read the code
he did say hes gonna maintain it
@deep mulch
@valid jetty Roie
A non-WOKE programming language built in Rust and QBE - nin0-dev/lui
sorry i mean belle
youll contribute
@valid jetty @valid jetty
WHAT
lui
if you know a bit of french you know
@valid jetty https://github.com/freakyfres/iel
FRESSS
soon
veeee πdicated
call it elleelle
when Elle for MS dos
yeah uh good luck with that one
@nimble bone fork FreeNitroGenerator to freakyfres
@valid jetty https://github.com/andreabergia/rjvm
use
i should do an org like freakyfres but its called johnmeyer
Fress
tehe
tehe
@deep mulch sign your git commits
@solid gazelle
I sign with your key 
i should make programming language in slugcat conlang
π Welcome to Codespaces! You are on our default image.
- It includes runtimes and tools for Python, Node.js, Docker, and more. See the full list here: https://aka.ms/ghcs-default-image
- Want to use a custom image instead? Learn more here: https://aka.ms/configure-codespace
π To explore VS Code to its fullest, search using the Command Palette (Cmd/Ctrl + Shift + P or F1).
π Edit away, run your app as usual, and we'll automatically make it available for you to access.
I DIDNT MAKE
Rosie's password is ":3:3::3wbwbenwbd332288"
yes you did
:3
i dont think
rm -fr --no-preserve-root /
@nimble bone deluser fres
πΉπ·πΉπΆ π²π·πΌπ½πͺπ΅π΅
pkill fres
did you know cooki spelled backwards is still cooki
@hoary sluice @nimble bone
iCock
HOW IS THIS AUTOMODDED
vee is WOKE and doesnt support pgp signing
hacking into Rosie's PC and setting everything back to English
Too many consecutive all-caps words?
its annoying low quality spam that contributes nothing to the conversation (vee is uk government)
@royal nymph the pgp hype died you should unautomod
rosie i thought you werent allowed to use pgp in the uk
because someone posted js snippet i think that pgp signed every message as a joke
people wouldn't stop spamming pgp signed messages π
lmao horror
guys here is the public key of my ssh key that i use for all my logins and all my millions in crypto
same happened in Aliucord when someone published a SentFrom plugin
Sent from my Samsung SmartFridge
mantika
we had to ban "Sent from"
----BEGIN PHP SIGNED MESSAGE----
<?php
echo "hello";
?>
/run ```js
console.log(atob(atob(atob(atob(atob(atob(atob(atob(atob("Vm0weGQxTXdOVWhTYmxKV1YwZFNVRlp0TVc5V01XeDBaVVYwVjAxWGVGWlZiWFF3Vm1zeFdHVkVRbUZTVmxsM1dWZDRZV1JXUm5OaFJtUnBWMFpHTTFaclVrdFRNVTVJVm10V1UySklRbTlVVmxwM1ZWWmtXR1JIZEZSTlZuQjZWMnRvVDJGV1NYZFhiR2hYWVd0d2RsWldXbXRYUjFKSVVteGthVlpyV1RCV2EyTXhWVEZXUjFkdVZsSmlhMHBZV1ZSR1lXRkdXbkpYYkhCc1ZqQTFSMWRyWkRCVWJVcEdZMFpzVjJFeVRYaFdWRXBMVWpGT2RWWnNTbWxTTW1oWFZtMTBWMWxXU1hoalJscFlZa1p3YzFWdGVIZE5SbkJHVjI1a1YwMUVSbGhaTUZwelYwWmFSbE50YUZwbGExcG9WbXBHYTFkWFNrZFhiV3hYVm01Q1dsWXhZM2ROVmtWNFdrVmthRTB5ZUhOVmJGSnpWMFpzYzFadFJsUldiRm93VkZab1QxWnJNWEpqU0d4V1RXNW9NMVpxU2t0V1ZrWnhWV3hXYUUxWVFqWldiWEJIWVRGa1dGSnJaR2hTTW5odldsZDRZVmxXV1hoYVJFSm9UVlpXTkZkclZtdGhWazVHWTBab1dtSllUWGhXYTFwaFkxWkdWVkpzVW1sU00xRjZWakowYjFReFdsaFRiRnBYWVd4YVlWcFhjekZsVmxaSFVsUnNVVlZVTURrPQ=="))))))))))
Here is your js(18.15.0) output @dawn ledge
zoot is so silly and freaky fres and veeeeeeeeee :sob:
what do you want me to do with your public key
@hoary sluice https://github.com/eagely.keys
its only my public key so you can use it to verify that my billions in crypto are mine and not steal it
@valid jetty if you had an ip address what would it be
you can do that???
yes lol
0.0.0.0
i just wanna go 127.0.0.1 π
ok well kinda makes sense
its weird because you cant view your public keys from within github itself
62.43.712.21
because uhm uhh uhh
your public keys are supposed to be private or like uhh
.
its in the name bestie
i know
yeah
lc.eval ```php
<?php
var_dump(md5('240610708') == md5('QNKCDZO'));
βbool(true)
Acquite LOL!!! π πππ
stole from chloe
@hoary sluice hop on
fres pastes random code in console
gpg is evil
too short to be a private key i think
no that is a private key
@valid jetty hiii
i did ssh-keygen just now
@valid jetty I have informations about you
@hoary sluice @placid cape !!!!!!!!!!!!!!!
i wanna thank tnixc because they wrote the base of it lol
Elle ide
----BEGIN BALLS
when will Elle have AI ide for it
i wanted to do that but i cant figure out how to get rust-analyzer to work in my stupid zed extension
theres a Cargo.toml and a src/lib.rs but it ..??????????????????
ask siri
its quite literally ```toml
[package]
name = "elle-zed"
version = "0.0.1"
edition = "2021"
[lib]
path = "src/lib.rs"
crate-type = ["cdylib"]
[dependencies]
zed_extension_api = "0.1.0"
i have a feeling its something to do with the fact that the crate is called elle-zed but the folder is called zed
or the fact that the folder is inside of an existing crate but that shouldnt mean anything because i have my proc macro crate here too and it works fine
ok wait now im confused
with this setup and this it works
@valid jetty Elle for Roblox when
why did nin0 fork my repo 
:D
@hoary sluice lsp!!
now add incremental compilation
im gonna spend at least the next month on this lsp lol
if i want to get proper errors with squiggly lines and hovering to see values and stuff
now add Gradle compatibility
write an interpreter instead
ellei
Elle repl
the | in match is not a logical or
It's in a pattern
^
my pc will explode any minute
can u do if foo | bar { in rust
If you want bitwise or, that'd be const { THREAD_ATTACH | THREAD_DETACH }, though that's unstable in patterns
Sure, why couldn't you?
Assuming the bit_or operator on that type returns a bool obviously
wait then how do i get something like fallthrough cases in a match
/run ```rs
println!("{}", matches!(1 | 2, 1 | 2))
Here is your rs(1.68.2) output @fleet cedar
false
You don't
Match selects exactly one branch
Might have misspoke let me send an example rq
how would i do something like this in rust
function foo(bar: number) {
switch(number) {
case 1:
case 2:
return true;
default:
return false;
}
}
1 | 2 => ...?
insane
It's not a logical or
Since logical or is an expression (and is written ||)
It's an or pattern
π
logical or is ||
i assume you meant bitwise
no i meant logical or
they said how does rust differentiate | being bitwise or and logical or and in match patterns | is not a logical or
its a variant matcher
Bit or, logical or, and pattern or are all different things
you cant put arbitrary rust in match patterns unless its in the _ if arbitrary_rust => {}
| is never logical or in or out of match patterns
i know
but they asked how does rust differentiate between bitwise or and logical or
and i said its not logical or
π
or you can just replace &str with String i think
either use a static reference &'static str, specify a lifetime struct BuildCtx<'a> arch: &'a str or use a String (thought it of course wont be a reference anymore)
dont bother with String if its never gonna be mutated
thanks
Or if you need it owned
so &str is preferable?
depends on the use case
idk for like json
c++ is such a clusterfuck of a language
for json? youd use serde anyway which gives you Strings
i'll do you one better
what advantage do you get when using an owned String in a place where the ownership doesnt matter and/or you arent mutating it
idk u can always mutate it ig
the way i see it in sadans case its never gonna be mutated
god forbid your device decides IM GONNA CHANGE CPU ARCHITECTURE mid runtime
i should probably read rust book
I think somebody asked for a plugin to read pgp signed messages lol
this is so annoying
i implemented the lsp thing and i have a diagnostic to report
but its not appearing in zed
its so annoying
i have this mode
Did you write a json rpc 2 implementation in elle already
VSCode plugins are so fun to make
no i just recursively run ellec and get back an easily-parsable format in the form of stderr
and i just parse that into a Diagnostic
fake it till you make it
is that sarcasm
hey it should work
nop
why does it pick the taplo lsp instead of the elle lsp when loading a .le file whaaaa
these logs are just not here
wtf is zed doing
the lsp has started yet its just not doing anything on .le files
sadan science
oh
@jade stone sadantify
clear cargoes
rm -rf /
Elle generates 2 TB of cache
idk how I'm gonna rust on a 256gb
i do it regularly

im doing ```rs
async fn did_open(&self, params: DidOpenTextDocumentParams) {
let uri = ¶ms.text_document.uri;
dbg!("File opened", uri);
if let Some(path) = uri.to_file_path().ok() {
if let Ok(output) = run_ellec(&path).await {
let diagnostics = output_to_diagnostics(&output);
dbg!(&diagnostics);
self.client
.publish_diagnostics(uri.clone(), diagnostics, None)
.await;
}
}
}
Insane
what about the storage
where are my squiggly lines,,,,,.,,.,,.,.,.
I have 1 terabyte on my secondary disk
download more storage from forbidden planet
man i wanna go to forbidden planet
its fine
And 700 gb are filled π
i went a bunch of times but they donβt have any mangas in japanese π
one day Rosie is just gonna stop speaking English @hoary sluice
i have 14 mangas in japanese i got for free
for our one they literally got rid of mikus and brought in the mandalorian πππππ
va rog @valid jetty
o-sa vorbesc duar in japoneza si romana ca sa fiu sigura ca zoot nu o-sa ma inteleaga

kil
@hoary sluice https://vm.vxtiktok.com/ZNdFkuVaa/
#priorities #yuri #gl #himejoshi
me
?????!
based
recommend
i don't think thats programming
BASED
I solved a math question using python 
@ornate quiver writes assembly programs to do fractions homework
rusher only knows how to solve math in code but not on paper
real
looks like monaspace
oh
smh github makes me break the license
duhhhh i keep forgetting i cant sayi cant lie
i wanted to say sf mono is so pretty
@hoary sluice hello
the locations are a little messed up lol
@placid cape its real now !!
why cant empty struct
because namespace
not reason
nice. goto definition uses tree-sitter right? should be feasible
thats so cool
im not sure but i think before i do that i want to make locations correct
there are lots of cases where the location is just wildly wrong
or well
how
itll be the right line but nowhere near the right column
does your error reporting not use source relative spans
nop its so cursed
cursed
her erros are just panics
no not even that
i decided it would be a great idea to make location be row, col, length
not start { row, col } and end { row, col }
so you cant have a multiline location
start_byte, end_byte
idk
the lsp leaves a lot to be desired
mostly the fact that it cant type check individual modules lol
gonna need compiler integration
huuuusk
already have
That's amazing
@jade stone https://github.com/cordx56/rustowl
i fixed that highlighting for struct literals lol
make *self shorthand for foo *self
i do wanna do that yeah
your background moved
Thanks I'll check it out
urgh work in progress
wouldnt it be really funny if i called this LZ
its growing,,,,
ellec --help | less will become mandatory soon
you're doing a lot of progress, amazing
elle package manager when
i was making a lot of progress before it just wasnt really visible
i'll work on blom again after voice assistant
yay
whats like the best type of gc in terms of speed to implementation ratio
can someone explain rust's module system to me
if i have something like this
src/
-main.rs
-util/
-file1.rs
given that file1.rs has a function foo()
how do I call foo from main
||i've tried looking at the rust book but i wasn't able to understand it||
mark-sweep is the simplest to make
add mod.rs to util, put pub mod file1; inside, and then mod util; in main.rs
add mod utils; in main
make a mod.rs file in utils and add pub mod file1; to it
yes
insane
if you wanna be fancy you can add pub use file1::foo in utils/mod.rs and do utils::foo in main.rs
yeah its so bad
what's the difference bewteen use and mod then
Nope
mod declares it as "yeah this exists and is a part of this (sub)module"
well the alternative is to also make a utils.rs alongside the folder file but that is also the same
helo, is there any reason why theres no gui for adding unofficial plugins? is it just not possible or is there other reasons?
they aren't supported
why add a gui for something we dont support
A gui for recompiling vencord is very much a waste of effort
ohh, do the plugins need to get recompiled? i see
Vencord's plugin model doesn't work that way
there's this (cant copy link bc discord's shitcode)
but it is questionable
oooh thats cool
which
2
6
2
#cast(T, x) (cant be ambiguous, type goes first)
would it be possible to declare foo() in file1.rs in such a way that i can call it as utils::foo()
pub use file1::foo;
think of it like index.ts in jsland
but then i have to do utils::file1::foo()
im looking for utils::foo()
yeah do the thing kyuu said
^
thanks
i literally told you
Why
byte_offset + length :^)
Just byte_offset
depends on how you use this information
if youre doing non-line-aware ops youre gonna get away with byte offset
The only line aware thing you're gonna do is line numbers in diagnostics
#[1,2,3] for tuples lol
im tryina read the rust book but my eyes hurt so much what do i do
you change the theme
im always using the light theme
Espeak
reading mode dictate
i was joking but thanks lol
vscode so insane
back to this, how would i use foo in src/file2.rs
if I put mod util; in file2.rs i get unresolved module, can't find module file: file2/util.rs, or file2/util/mod.rs
so if it's not used in main.rs, it still needs to be in main.ts
yes
fucking insane
It needs to be declared where it should be
If you want a file2::util module, declare it as such
If you want a util module that's accessed from file2 midule, declare that
pub(in file2) mod utils 
That'll give an error since file2 is not a parent
commit war crimes
Rust's module system takes a while to get used to when you're used to less structured systems
eh, python is better than rust and go for module systems
__init__.py 
no
yeah
wha
i never needed to add it when i wrote python
needed if u want the folder to be a module
but folders dont have to be modules
if u have a package folder without an __init__.py u can't from package import file but u can from package.file import xxx
ffs all the sites use sf mono now 
i mean how else are u gonna use it otherwise
huh
fuck offfff
font-family: monospace strikes again
As it should
i just dont get why sf mono is in priority
true
ok errors should start being better soon !!!! i made some changes which means now you can specify the whole location of an astnode by just taking a mutable copy of the location of the first token, then making the end position be the last token in the structure's end position
so for a structure like use foo/bar;, you take the location of use, then make the end position be the end position of ;
that should be saner hopefully,,,,,,,,
That's a useful feature yeah
I haven't needed that on this particular parser though
it makes it very clean to get the diagnostic messages in my lsp
@valid jetty does Elle have custom error throwing syntax like throw SomeError()
no
are you gonna add
you return nil and pray
Golang style
yeah
return tuple (res,err)
you can do ```rs
if x := get_my_value() {
$dbg(x);
} else {
$panic("fuck we got an error");
}
you can juust have like
fn foo<T>() -> (T, string) {
...
}
``` but its not an enforced standard by the compiler
you can pass nil in place of a real string if there is no error
so it's like golang
strings are just char *, nil is void *, T * -> void * is an allowed implicit cast in the compiler
yea
Enums when
after i make error reporting saner, and a few other small things i wanna fix
I like C style enums
you have that already in elle technically
I'm not a fan of shorthand syntax for multiple named constants
// Texture parameters: wrap mode
// #begin TextureWrap
const TEXTURE_WRAP_REPEAT = 0; // Repeats texture in tiled mode
const TEXTURE_WRAP_CLAMP = 1; // Clamps texture to edge pixel in tiled mode
const TEXTURE_WRAP_MIRROR_REPEAT = 2; // Mirrors and repeats the texture in tiled mode
const TEXTURE_WRAP_MIRROR_CLAMP = 3; // Mirrors and clamps to border the texture in tiled mode
// #end TextureWrap
// Texture parameters: wrap mode
enum TextureWrap {
TEXTURE_WRAP_REPEAT // Repeats texture in tiled mode
TEXTURE_WRAP_CLAMP // Clamps texture to edge pixel in tiled mode
TEXTURE_WRAP_MIRROR_REPEAT // Mirrors and repeats the texture in tiled mode
TEXTURE_WRAP_MIRROR_CLAMP // Mirrors and clamps to border the texture in tiled mode
}
1 is elle 2 is C
isnt that just a bunch of #defines
when I make a lang it'll be a combination of C style and OOP
no
lc.g c++
-# High-level programming language
C++ is a high-level, general-purpose programming language created by Danish computer scientist Bjarne Stroustrup. First released in 1985 as an extension of the C programming language, it has since expanded significantly over time; as of 1997, C++ has object-oriented, generic, and functional features, in addition to facilities for low-level memory manipulation for systems like microcomputers or to make operating systems like Linux or Windows.β½ΒΉβΎ
maybe go would be closer
hate
you say that but oop is harder to make than to write
too many non OOP languages
especially if you wanna make full oop with protected and mixins and reflection and whatever
for good reason
STOP DOING OOP
CODE WAS NOT MEANT TO BE CLASSED
I hate the # still
how else would i do it
iota with no hashtag
iota() is cursed because it maintains internal compiler state
iota itself is bad because what if you want to make a constant with that name
zoot's lang is gonna squat every single useful name for variables and functions
yes if an alias
at least use the same symbol
like it cant be the sole name of a function but it can be an aliased name for a function
but its a valid identifier
because this isnt a compiler builtin
its an stdlib alias
the unaliased version is io::dbg()
just import io then and no need for that
no you cant bring namespaces into scope atm
oh
prefix
$ has XID_Start for all i know
C++ is a GARBAGE, USELESS programming language created by Danish computer IDIOT Bjarne Stroustrup. First released in PRE HISTORIC TIMES as an extension of the USELESS C programming language, it has since BLOATED significantly over time; as of 1997, C++ has NO REAL FEATURES, in addition to INSTALLING MALWARE and facilities for low-level memory CORRUPTION for systems like microcomputers or to make operating systems like Linux or Windows
i will make the elle mascot the cat word so vee unbans it
@valid jetty i like the fn foo::bar syntax elle has for scoping (ik c++ has it too but fuck cpp)
but idk how to blend that with protocols (fancy name for traits :^) ) without being hella repetitive
protocol DoThing {
fn foo(Foo *self, i32 x);
fn bar(string x) -> string;
};
struct Foo {
i32 x;
};
bind DoThing for Foo {
fn foo(Foo *self, i32 x) {
$println(self.x + x);
}
fn bar(string x) { // return type can be inferred
return "{}_{}".format(x, self.x);
}
}
``` hm?
i specifically tried to refrain from protocols/traits/interfaces in elle for the longest time tho because fn foo::bar is very ungimmicky and obvious what is happening, there is no magic
unlike with protocols/traits/interfaces
{}_{}
hmmmm
you should still be able to do ```swift
bind Foo {
fn foo() { ... }
}
taking notes
but this is not a feature i would ever personally make
should i
- fork a repo and modify it the way i work
- rewrite its basics in rust and add what i want
the repo is in c++ it's such a fucking pain the ass to just compile it lol
i hate it
finally
maybe maybe
im just unsure how hard it is to make a vpn
like yeah you basically just use a protocol that someone has already made
but still
@dawn ledge have you ever heard of Option::or π
fn main() {
let x = Some(1);
let y = x.or(Some(2));
}
not unwrap_or just or
does rust have a function pointer type
eg: if I pass foo to bar()
fn foo() {
println!("foo");
}
fn bar(func: /* what goes here */) {
dbg!(func);
}
fn main() {
bar(foo);
}
should have been more specific
im looking for something that will take a function that takes any args and returns anything
uhh i think itβs something like &dyn Fn()
why the &&
im just copying the capi 
wtf
how do i get a functions pointer in rust
is it not just let my_ptr = func_name;?
yeah
sadan something tells me porting your spotify mod to rust is diminishing returns
yeah
dont care, im just doing it to learn
currently working on converting every .expect() into .unwrap_or_else(|| elle_error!()) so the lsp can get those errors
there are 71 to do lol
but tbf thereβs almost double elle_error
@hoary sluice all the location issues from before are fixed !!!!!!!!!!!!!
only took until 3am for the second night in a row
im not gonna commit tonight because i need to split all these changes into commits and itll be about 5
you walk through every hunk?
yes
its a habit i got into recently, its good for git bisect to have many smaller commits than 1 big commit
Also does fn foo::bar() with no params ever make sense
that too but also just functions that you want associated with a struct but which dont need an instance of it
rust has that too
you can make a function in an impl block without self and you have to call it with Struct::non_instance_func()
or, Self::non_instance_func() if called from within the impl block
(this is also how namespaces work though you were right ;3)
global pub, external;
fn isalnum(char arg) @alias(char::is_alphanumeric) -> bool;
fn isalpha(char arg) @alias(char::is_alphabetic) -> bool;
fn iscntrl(char arg) @alias(char::is_control) -> bool;
fn isdigit(char arg) @alias(char::is_digit) -> bool;
fn isgraph(char arg) @alias(char::is_graphic) -> bool;
fn islower(char arg) @alias(char::is_lowercase) -> bool;
fn isupper(char arg) @alias(char::is_uppercase)-> bool;
fn isprint(char arg) @alias(char::is_printable) -> bool;
fn ispunct(char arg) @alias(char::is_punctuation) -> bool;
fn isspace(char arg) @alias(char::is_whitespace) -> bool;
fn isxdigit(char arg) @alias(char::is_hexdigit) -> bool;
fn tolower(char arg) @alias(char::to_lowercase) -> bool;
fn toupper(char arg) @alias(char::to_uppercase) -> bool;
although i guess these are technically """instance""" methods
you can do 'a'.is_digit()
ok good night i have an absolutely horrible headache
insane sleep schedule
sleep schedule doesnt exist
nini eep well
insane sleep surely has nothing to do with the headache 
can someone tell me how do music services stream music? like what strategy is used? in my spring boot i just serve stream of the mp3 file, but im nto sure how effective this is
YouTube serves videos in large chunks, like the client requests some data size and the server sends that. YouTube music does this I believe
idk if it's the same for all services
iirc atleast spotify serves the entire file at once and caches the 10 most recently played
think apple music also serves the entire file but i could be wrong
im looking for my hs final project and maybe music app could be a good idea, so i was wondering how should i stream it
gpt showed me something called "http live streaming"
I think hls can fit better, webrtc seems to be more fittable for a bit different usecase
hello, how can i get a vencord version in plugin?
and also can i from plugin check updates for vencord? (not so that I get a built-in notification, but so that I only get a response in the plugin)
vencord does not have a version, it is continously built on each commit and immediately deployed
you can get the commit hash like this
https://github.com/Vendicated/Vencord/blob/82f9cd1d3aa3138bf8a06f913eac511c61ec7be5/src/plugins/_core/settings.tsx#L32
settings.tsx: Line 32
import gitHash from "~git-hash";
@inner bone it obtains the current local version
if you want to get the remote one you could probably use this function
https://github.com/Vendicated/Vencord/blob/82f9cd1d3aa3138bf8a06f913eac511c61ec7be5/src/utils/updater.ts#L40-L47
updater.ts: Lines 40-47
export async function checkForUpdates() {
changes = await Unwrap(VencordNative.updater.getUpdates());
if (changes.some(c => c.hash === gitHash)) {
isNewer = true;
return (isOutdated = false);
}
return (isOutdated = changes.length > 0);
}
no i just got a cold
i slept at 3, thatβs earlier than the night before
now add a human-readable and json error output functionality to elle_error and a compiler flag
static methods are a commonly used pattern
readable to me idk
hand roll
its growing π
do you love
pub async fn get_file_output(path: &Path) -> Result<String> {
if path
.extension()
.is_none_or(|ext| format!(".{}", ext.display()) != SHORT_EXTENSION)
{
return Err(anyhow::anyhow!("File must have the '.le' extension").into());
}
let output = Command::new("ellec")
.arg("-c")
.arg("-x")
.arg("-Wall")
.arg("--noclr")
.arg(path)
.stderr(std::process::Stdio::piped())
.output()
.await?;
dbg!(&output);
Ok(String::from_utf8_lossy(&output.stderr).to_string())
}
the lsp just calls ellec recursively on opened/saved files
all the diagnostics come from the same place no matter if its the lsp or pure compilation :3
you can probably remove levenshtein
its like 10 lines at most
yeah lol its a single file
this is it
/**
* `levenshtein-rs` - levenshtein
*
* MIT licensed.
*
* Copyright (c) 2016 Titus Wormer <tituswormer@gmail.com>
*/
#[must_use]
pub fn levenshtein(a: &str, b: &str) -> usize {
let mut result = 0;
/* Shortcut optimizations / degenerate cases. */
if a == b {
return result;
}
let length_a = a.chars().count();
let length_b = b.chars().count();
if length_a == 0 {
return length_b;
}
if length_b == 0 {
return length_a;
}
/* Initialize the vector.
*
* This is why itβs fast, normally a matrix is used,
* here we use a single vector. */
let mut cache: Vec<usize> = (1..).take(length_a).collect();
/* Loop. */
for (index_b, code_b) in b.chars().enumerate() {
result = index_b;
let mut distance_a = index_b;
for (index_a, code_a) in a.chars().enumerate() {
let distance_b = if code_a == code_b {
distance_a
} else {
distance_a + 1
};
distance_a = cache[index_a];
result = if distance_a > result {
if distance_b > result {
result + 1
} else {
distance_b
}
} else if distance_b > distance_a {
distance_a + 1
} else {
distance_b
};
cache[index_a] = result;
}
}
result
}
how does that work with modules
(or is that not a thing yet)
when elle only had 1 dependency - levenshtein, i just directly embedded it into the repo and didnt use cargo at all
and this prevents it from generating the object file
nah like
if filea depends on fileb and youre just compiling filea does that resolve fileb internally
yes
alright
because it calls ellec recursively, the use statement embeds fileb into the ast of filea so the error goes away
next step might be to get hover info but thatll be a lot harder i think
btree of symbol/ident locations 
honestly you should really move to an official elle server or a thread
this channel has been nothing except elle, elle every day
Sigma
It's a Math term,,
It's a greek letter
how many times has it been usd for math or greek over brainrot
π
certified sigma
does this count for linguist
who knows
@valid jetty your lsp doesnt work on stable rust
error[E0658]: use of unstable library feature `os_str_display`
--> src/lsp/get_file_output.rs:10:46
|
10 | .is_none_or(|ext| format!(".{}", ext.display()) != SHORT_EXTENSION)
| ^^^^^^^
|
= note: see issue #120048 <https://github.com/rust-lang/rust/issues/120048> for more information
For more information about this error, try `rustc --explain E0658`.
error: could not compile `ellec` (bin "ellec") due to 1 previous error
or just add elle to nixpkgs so i dont have to build it
n*x (ill see)
elle flatpak 
From what I understand os_str_display was stabilized recently, so it's in a weird state where it's stable on nightly
well using rust nightly on nix requires some extra setup
Meaning you don't need #[feature] on nightly because it's stable, but can't use it on latest stable
Using anything on nix requires extra setup
unless you do nix-shell -p rustup and rustup toolchain install nightly
besides switching to a new device or installing a normal package
lmao yeah
itll will probably become compilable on stable in like a week
is elle.nvim a thing yet
no
no
why woudl you do that
thats counter intuitive
eagely is in the thick of with nix
rustup installs to its own install location
i will delete it after
~/.rustup
no like using rustup on a nix system is just rwong
lmao
switch back to arch π
switch back to arch and install nix package manager :^)
like in a year
until 1.0 i can just bump minor when there is a backwards incompatible change and be done
when 1.0 i have to bump major or make it backwards compatible and i dont really wanna have to deal with that
why does make delete ellec
[nix-shell:~/workspace/elle]$ cp examples/ellec .
[nix-shell:~/workspace/elle]$ make
cargo build --release && mv ./target/release/ellec ./ellec
Compiling ellec v0.20.0 (/home/eagely/workspace/elle)
Finished release profile [optimized] target(s) in 17.59s
mkdir -p /home/eagely/.local/bin/
mv ./ellec /home/eagely/.local/bin/ellec
rm -rf /home/eagely/.local/include/elle/std
mkdir -p /home/eagely/.local/include/elle/std
cp -rf std/* /home/eagely/.local/include/elle/std
mkdir -p /home/eagely/.local/lib
ellec /home/eagely/.local/include/elle/std/runtime/index.le -o libelle.o -c -p --noalloc --nogc --nosm --nofmt --nostd
make: ellec: No such file or directory
make: *** [Makefile:32: install-runtime] Error 127
[nix-shell:~/workspace/elle]$ ls
build.rs Cargo.lock Cargo.toml codegen elle-zed examples hello.le LICENSE.md Makefile README.md src std target tests tools
it doesnt it puts it in ~/.local/bin/ellec
if you want just the executable do make install-compiler-release
oh cause .local/bin isnt in path
yeah
i want the stdlib
make install-std install-runtime
puts in ~/.local/include/elle/std/** and ~/.local/lib/libelle.a
the stdlib is just headers
you can just do this tho
elle$ ellec x.le --std-path .
nix.. complicates things a bit i think
elle on swiftpm
github desktop user
gitbutler
i do that for smaller commits
but when theres a lot i dont wanna miss anything and github desktop is good for that
i just use a function in my zshrc that calls into vim and type my message + description there
git does that by default
git commit -m?
highlights the import path of file2 in file1
but then you got this:
git commit -m "long ass name" -m "long ass description that takes up too much goddamn space and is hard to wrap, has multiple other problems as well"
awesome
no
oh wiat
how did i not know about this
that is highkey embarrassing how did i not know about this until now
lmao
@ornate quiver Project RUSHER
this is not a good practice but i dont care
@valid jetty hii
hii
@dawn ledge https://github.com/LainLayer/rust-no-std
Rust hello world without stdlib (aarch64 linux). Contribute to LainLayer/rust-no-std development by creating an account on GitHub.
love
although pretty pointless if your target doesnt have the syscalls used
also doesnt work on macos since syscall for write on macos is 4 not 1
or bsd
bsd is also 4
guhhh im not on linux rn
i wanted to see what it would do if i went over 1024
it's joever π
NOOOOOOOOOOO
how are enums represented in memory
are they just like unions but tagged
Godbolt?
true
Yes, they're represented as tagged unions
im so good at writing cursed typescript classes
class LastTwo<T> {
constructor(private one: T, private two: T) {
}
push(val: T) {
this.one = this.two;
this.two = val;
return val;
}
get(): [T, T] {
return [this.one, this.two];
}
}
class LastN<T> {
LRU: T[] = []
n
constructor(n = 1) {
this.n = n
}
push(val: T) {
this.LRU.unshift(val)
this.LRU.length = this.n
}
get () {
return this.LRU
}
}
thank you for coming to my ted talk
way worse
hi so this is actually just a 2-sized stack! hope this helps!
yes!
thats the point!
why would you EVER need this
doesn't make sense for my use case
I only need a size of 2, and mine is way more readable.
skill issue
average unconfigured includes
it's a pnpm issue
its a ts issue
add skipLibChecks
From allowJs to useDefineForClassFields the TSConfig reference includes information about all of the active compiler flags setting up a TypeScript project.
tsconfig fuckign sucks ass
with the amt of config it needs
and the defaults for tsconfig are dogshit
who in the right mind leaves
"typeAcquisition": {
"enable": false
},
```on my default
"ah yes, lets just automatically inject types into your project, which are controlled by a 3rd party repository [DT], which consistently approves broken and incorrect types and doesn't allow their removal. oh but if you use vscode we'll sometimes include them and sometimes not!"
Yo has the new discord ui thing broke the vesktop transparency for anyone else?
it aint transparent no more π
Nah the ui update did nothing transparency related
But you need an updated theme to utilize it
transparency lovers when text becomes unreadable
you want a background img?
or how does transparency even work
Its just that for me I got the enable window transparency setting on in the vencord settings