#πͺ -progaming
1 messages Β· Page 37 of 1
naah
i need to start working on the voice assistant again 
and now im adding multi language support to the correspondence seminar xddd
azalea
oh you sent it nvm
i desperately want to use icps to script the voice assistant but i dont think i have enough time
would be extremely cool
yeah uh this was when he was experimenting with changing around azalea
itd just require shell integration
you can do that like really easily
just dmca him
lol
theres a function in libc called system
why his repo has 28 starts
it also requires a complete language
its exactly what you want and very easy to use
i genuinely dont know
i just started working on the interpreter part
cause when ppl look for sparxmath solver they see his repo
rename urs to sparxmaths and dmca him
i dont care enough to rename it to sparxmaths but ill dmca him
ugh i have to fill out another one of those stupid forms
its pretty easy to dmca takedown on github
u want ppl to use it right
of course you did
2023-11-10-azalea.md: Line 4
i did too
cool
wtf
so its the same person right?
because when you open the links it redirects you
c0lide is a different person but theyre working together
he is just posing now
am i yapping
whatever
i filed it
i dont care anymore
i just want this stupid thing to be done
there the repo is called sparxmaths now
hopefully the chrome search index doesnt push that scam anymore
gn guys
gn
gm
Gm
argh why is [u8] in rust not the same as [u8; 4]
i kinda get why you canβt convert [u8] to [u8; 4] but i donβt get why you canβt pass [u8] into a [u8; 4] parameter assuming both are 4 bytes
Because &[u8] might not be &[u8; 4]?
[u8] doesnt have the Sized trait i assume
^
the compiler doesnt know how big the slice is at compile time
it does know how big [u8; 4] is tho
You can TryFrom it if you want https://doc.rust-lang.org/stable/std/primitive.array.html#impl-TryFrom<%26[T]>-for-%26[T;+N]
A fixed-size array, denoted [T; N], for the element type, T, and the non-negative compile-time constant size, N.
you can just do this surely
fn other(x: impl Into<[u8; 4]>) {
dbg!(x.into()[2]);
}
fn main() {
other([255, 255, 1, 223]);
}
or well
yeah try into
use std::convert::TryInto;
fn other(x: impl AsRef<[u8]>) {
let array: [u8; 4] = x.as_ref().try_into().unwrap();
dbg!(array[2]);
}
fn main() {
other(&[255, 1, 255, 1]);
}
``` something like that
although i think the temporary value created is of type &[{integer}; 4]
you can do this ```rs
use std::convert::TryInto;
fn other(x: impl AsRef<[u8]>) {
let array: [u8; 4] = x.as_ref().try_into().unwrap();
dbg!(array[2]);
}
fn main() {
let x: &[u8] = &[255, 1, 255, 1];
other(x);
}
try from/into is pretty much the only way to convert slices into arrays
How curious, that the trait for fallible conversion is the way to perform a fallible conversion
:clueless:
elle's type system is actually powerful enough to represent phantom types
i loveeeeeeeeee
i can probably take advantage of this for the file abstraction im planning to make
File<Open> vs File<Closed>
Are namespaces types now
namespaces have always been types
theyre opaque structs
structs with no fields and so 0 sized
I guess that kinda makes sense, in a way
because i made it so the compiler doesnt let you define just struct Foo {} as thats not really a valid thing
Why
in the IR you cant have a struct type with no members
namespaces are removed when generating the IR
And why are you letting IR limitations affect your language design
but you can do this
use std/libc/mem;
namespace HeapAllocator;
global pub;
fn HeapAllocator::new() {
return (HeapAllocator *)nil;
}
fn HeapAllocator::alloc(HeapAllocator *self, i32 size) {
return mem::malloc(size);
}
fn HeapAllocator::realloc(HeapAllocator *self, void *ptr, i32 new_size) {
return mem::realloc(ptr, new_size);
}
fn HeapAllocator::free(HeapAllocator *self, void *ptr) {
return mem::free(ptr);
}
fn HeapAllocator::free_self(HeapAllocator *self) {}
``` because T * decays to `l` and doesnt need the inner type
i mean its not really an IR limitation i think its a C ABI limitation
but yeah either way you can define these phantom types and the compiler will never generate any IR for them
Still letting implementation details affect your design
the only options i have are
- throw an error when you make a struct with no fields
- artificially add a field
- remove the empty structs when generating IR
creating a struct with no fields throws an error, creating a namespace doesnt but removes the struct when generating IR
One of those is completely ridiculous, one is what C (or at least C++) does, and one is the sane one
Well dunno if it's literally adding a field, but zero-field structs are one byte large
if you write this program
struct Foo;
fn main() {
let x = Foo {};
}
``` and the struct doesnt exist in the IR it will throw a compilation warning
Write better ir then
lmao
not an error??
what the fuck
what even is a namespace in the first place
its original purpose was to make methods without creating a corresponding struct
like where you can do
namespace Foo;
fn Foo::add(i32 a, i32 b) {}
``` etc
here the add function is namespaced under Foo
but its representation internally is a struct with no fields and size 0 which is removed by the compiler when generating IR
So instead of making zst structs work, you make a completely different kind of item for zsts
i didnt like the idea of adding a field so yes
it just seems kinda weird that i have to explicitly tell the compiler that an array i create in code has the same size as the one i initialized. i mean:
// this one wonβt work
let buf: [u8] = [0xff, 0xff, 0xff, 0xff];
u32::from_le_bytes(buf);
// this one will work
let buf: [u8; 4] = [0xff, 0xff, 0xff, 0xff];
u32::from_le_bytes(buf);```
like shouldnβt it be *obvious* for the compiler that the array of 4 u8βs will have the size of u8*4
It is, unless you explicitly tell it otherwise
let buf = [0xff, 0xff, 0xff, 0xff];
u32::from_le_bytes(buf); // works
You are explicitly telling the compiler that this is an unsized slice
youre trying to cast a sized type to an unsized type
Oh
that works because rust infers the type of buf to be [u8; 4] lol
also sorry whatβs the difference between a sized and and unsized array? iβm not sure what unsized is supposed to mean. like the array is unlimited?
It means the size is not statically known, but only at runtime
dont add the type annotation 
also i kinda wish types like u32, u16, f32, etc. had a mutual trait (apologies if itβs wrong terms, i donβt know much) which included from_le_bytes and similar methods
yeah ig itβs the only workaround. thatβs kinda neat you can even do that with rust
btw is there method overloading
No
got it
no there isnt thats why you have unwrap and unwrap_or
if there was method overloading you could just have unwrap be an overload for whether you pass an argument into it
i mean you can do method overloading
but its not really inuitive
with a bit of generic magic and Fn impl

this allows different number of arguments
if you have a constant number of arguments in your overloads then you can use generics and trait bounds
i dont have the code rn but i used generics + trait bounds to make a set function that takes either T or a clousure/fn that returns T
got it, thank yβall. i think iβm starting to get a better understanding of how things work in rust. it doesnβt seem like a pita to do what i want. rust seems fun
yop rust is great
i love it when esbuild cant bundle a package for node 
that's fairly common
so far for me only webpack bundles for node correctly
and by relation, rspack
why is everything failing 
school lan is crazy
wtf thats crazy
internet speed is like golf right?
lower number = better
Wow mine doesn't even start
guhhh i love when my makefile doesnt work on windows
POWERSHELL IS INSANE
WHO WOULD USE WINDOWS
ah yes, im piping cd
i want all that bullshit
yeah windows sucks βββββββββββββββββββββββββββββββββββββ
how is powershell 180 MB
iirc it has a lot of built-in modules
also this will only work if zsh is installed, which it isn't always
just sh -c "find src -name '*.cpp'"
linux users can cry about it
(i didnt know find was a thing until i wrote this and someone told me)
also ```powershell
Get-ChildItem src -Name -Recurse -Filter "*.cpp"
i think google lied to me
gives you only filenames, without src/ though
oh, you know the fun thing about those
the only way to remove them is to add a line to the top of your $profile
for each alias
because they cant be removed permantly
powershell sucks βββββββββββββββββββββββββββββββββββββββ
what did you expect
oh god βββββββββββββββββββββββββββββββββββββββββββββββββ
@still jolt i swear grep came with windows, but i was wrong
this is the final version
Get-ChildItem -Path . -Filter *.c -Name -Recurse | Select-String -Raw -NoEmphasis ^src
our teacher disallows the use of powershell in IT classse
this would be so much easier to do with just cmd βββββββ
never touching that with a 10 foot pole
how can he stop you, anyways
well some flags in e.g. dir in cmd and dir in powershell differ
so im forced to use cmd anyways
the one thing powershell does have is good docs
me when I man
man i love man
wdym
i wouldnt say so
The result was too large, so here it is as a file:
31k characters documenting something as shrimple as grep
it remote fetches the docs anyways
at least I don't have to google "powershell <insert command name>"
which makes it easier when you're on pty/tty only
eh t3 and primeagen are annoying βββββββββββββββββββββββ
i mean they basically only react to articles
but actually primeagen does something useful on streams
t3 I just ignore cause he's annoying, primeagen I click into the description and read the article myself
yea lol
they are very useful for finding new shit
then reading about it urself instead of watching their slop
guys i was wondering, do you think its better to do database/any remote queries from wrapping server component or should i just do it inside the useeffect inside of the client component?
like this i mean
i mean the difference should be basically that one will perform before mount and one will perform during mount, right? but that should be the only difference
what
man exists
in my experiecne, windows docs have always been better than man pages
not saying man pages are bad, just windows docs are better
true
true
@placid cape
hm?
What are you making 
voice assistant diploma thesis
@placid cape i think i might learn solana
id love a rust job and like 80% of them are solana
i got the frontend and communication to work
what is solana
niceee
rust blockchain

ohh
It's a cool one but bash is superior
i personally hate how long the names of most of the functions are
I think the Single-KebabCamelCase is stupid
yeah this too
takes too much time too type
it sucks so much that basically the only two shells that are on windows (cmd & pwsh) are both not good enough for me
you can technically use git bash or wsl, but yeah outside of cmd and pwsh theres nothing designed specifically for windows
i tried using bash via msys2 but its package repository lacks of bunch of stuff and i'm not sure you can use others as i think the uh apps need to be compiled in some way so they are compatible with msys2(?)
will stick with wsl prolly
but it always consuming 1.5gb of ram is kinda meh
also i found that https://fishshell.com mentions this
A smart and user-friendly command line shell
not sure if it's any good
i use both cmd with clink and git bash with oh my zsh
clink lets me use the starship prompt and adds autocomplete
HUSKKKKK
WHY DOES THE VSCODE POWERSHELL EXTENSION HARDCODE THE BINARY PATH

(unstable.vscode.fhsWithPackages (
pkgs: with pkgs; [
powershell
]
))
use sane system

you're mad
use better distro where this doesn't happen
π₯
insane

"[$(Get-Content $(Get-ChildItem -Path dist -Filter *.json -Name -Recurse | perl -pE 's/^/dist\//'))]" -replace '.{2}$', ']' > .\compile_commands.json
what is this powershell horror
i made two, one to download the headers i need to build
the other generates a compile_commands.json
the downloader is the real horror
I don't think it does now that curl comes standard
it does
unless you do full path, curl is an alias to iwr
I just used powershell and that was real curl
I had to add Remove-Item Alias:\curl to $HOME\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 to get the real curl
On my system, I have coreutils installed and I had to put them at the top of the path to get some of them to work
rm -rf /*
can you do on windblows
@hoary sluice can you perhaps help me with LaTeX tables?
im getting this shit everywhere
@dense sand does thas not work?
well i fixed that problem
i think this is the table issue overall
cause im getting this here
imo its caused by the overful hbox of the table itself
oh its 1 single nable?
table
i just noticed
what if you delete everthing besides the first paragraph
you mean the header row or what
or like this?
it still says overful hbox
oh wow, for some reason adding tabularx package breaks the bibtex
RM is Powershell Alias
Also I just installed rimraf a while ago because Remove-Item didn't work
nvm i have skill issue and was closign tag weirdly
you used to be a windows user
hey, does anyone know on how to put a message in the message box so the user can send it?
look at any plugin that does that
im going skiing next week so i won't be able to work on blom :(
I broke into FAANG by learning Java, hereβs everything I did so you can copy me #coding #codingforbeginners #learntocode #codingtips #cs #cs #computerscience #java #faang #softwareengineer #bigtech
"to deal with their legacy code"
The whole channel seems to be a big commedy
estrogen
Is supabase the best alternative to Firebase currently
depends on ur needs
pocketbase exists, and doesnt take 6 work days to set up k8s for, instead ~15 mins
but its also proprotionally limited
your API is your database structure, you can create custom query endpoints, but not with insane levels of customization, its also sqlite, so doing external operations on the db sucks, you can do auth levels, but its annoying to implement
tho personally i almost always go with PB, because of the sheer amt of time it saves, its legit 15 mins to have a working database with an api and auth
horrid cross-platform makefile
.DEFAULT_GOAL:=all
CSRC=$(shell find src -name '*.c')
COUT=$(patsubst src/%, dist/%, $(CSRC:.c=.o))
CXXSRC=$(shell find src -name '*.cpp')
CXXOUT=$(patsubst src/%, dist/%, $(CXXSRC:.cpp=.o))
export CFLAGS=
export CXXFLAGS=--std=c++2b
FLAGS=-ggdb3 -O0
OUTFILE=dist/libsadan.so
LIBS=
export WINDOWS_SHELL?=pwsh
ifeq ($(OS),Windows_NT)
powershell_ver=$(shell $(WINDOWS_SHELL) -Command 'if ($$host.version.major -lt 7) { echo "powershell seven is required";exit -1;}')
ifneq ($(powershell_ver),)
$(error $(powershell_ver))
endif
FLAGS+=-I windowsHeaders -D_WIN32 -D_WIN64
OUTFILE=dist/libsadan.dll
CC=clang
export CC
CXX=clang++
export CXX
LIBS+=-L windowsLibs -llibcef
else
LIBS+=-lcapstone
endif
export FLAGS
clean:
rm -r dist || :
all: $(outfiles)
$(MAKE) $(MAKEFLAGS) -f c.mk
$(MAKE) $(MAKEFLAGS) -f cpp.mk
$(CXX) $(FLAGS) $(COUT) $(CXXOUT) -shared -o $(OUTFILE) $(LIBS)
ifeq ($(OS),Windows_NT)
$(shell $(WINDOWS_SHELL) ./generateCompileCommands.ps1)
endif
github is so funny cause
- why does it label them with βcontributorβ even though they have merge perms
- why am i as a regular contributor able to disable auto-merge :/
are you the pr creator?
yea
makes sense
if there's some changes you still need to make then of course you'd be able to disable auto merge on your own PR
same result as marking it draft
oh youβre right
what is happening here βββββββββββββββββββββββββββββββββ
namespace Program {
class Entry {
public static void Main(string[] args) {
Console.Write("Enter a string -> ");
string? res = Console.ReadLine();
Console.WriteLine($"{res} {(IsValid(res) ? "is" : "is not")} valid.");
}
static bool IsValid(string? value)
{
if (value == null || value.Length < 5 || value.Length > 7 || value.ToUpper() != value
|| value.Distinct().ToArray().Length != value.Length)
{
return false;
}
int sum = value.Select((x) => (int)x).Aggregate((int res, int cur) => res + cur);
return sum >= 420 && sum <= 600;
}
}
}
``` i wrote this code during an exam lmfao
insane
Peak c#
randoms on scribble cant guess ac/dc from that
also wouldn't've been able to guess ββββββββββββββββββββ
@woven mesa @native spruce hi sorry can any of you help me understand the way this twitter mod for ios works? i found about some neofreebird and was trying to understand how it works but got kinda confused. the patch-it-yourself md file says to just drag and drop Patches folder into extracted decompiled IPA file. how, how does it even work. like the only files in the repo i could find are mostly assets or loc strings and this nib file
they seem to just be patching compiled assets
but the mod definitely has some code or whatever
they just inject bhtwitter as part of the ipa reassembly
yeah nothing crazy
just unzip, replace assets, zip
then inject tweak and install
oh so this mod itself is just cosmetic?
yeah that github repo is cosmetic stuff
i see thank you both !
i still wonder how one would find out an ipa code. like @woven mesa taught me how to extract headers but what am i supposed to do with it without knowing what it does :/
the ipas in releases contains it cosmetically "patched" including having bhtwitter injected
the bhtwitter source code isnt in there
but u can find it on another repo online
Charging money for icon library is wild ngl
yeah i got this part. i mean in bhtwitter or in any other mod you can find the %hook something pieces in the source codes but how can i be sure what a specific class and method does in the original ipa (like twitterβs ipa in our case) if we only have the headers without any impl
people don't have actual code to it xd, its all extracting headers and guesswork
ohhh :/
they could also use stuff like FLEX to see what they need to hook
FLEX?
apple >>>
love
it takes quite a bit of work to make a ton of icons
i don't think its unreasonable to charge for it
its 5000 icons
as someone that's made icons before its a huge undertaking
especially if it needs to be part of a set
By the way, in react, is there any way to just store index to some element in array instead of storing the object itself?
wha
Isnβt react just JS? Why canβt you just do that in a array or am I stupid?
wrong, a real java project would have
class Authentication
class FailedAuthentication extends Authentication
class SuccessfulAuthentication extends Authentication
class AuthenticationRequest extents Authentication
class AuthenticationBuilder
just store the index?
whats the question
wait im probably stupid af
lmao
so i can have defaultValue={currentSlide !== undefined ? presentation.slides[currentSlide].html : ""}
given currentSlide is a number | undefined
oh it works
nice
i dont know why it didnt before
i was gonna say to get rid of the !== undefined
it would fail if 0
then i remembered undefined, null, and false all coalesce to 0
yeah
then i had the idea to make the condition typeof currentSlide === βnumberβ which i guess is very slightly better than what you have but literally pointless
yea but i mean i dont think the readability would really improve a lot
yeah
wow use transition is so useful
bruh
@woven mesa how does appstorage work
bad property wrapper for storing userdefaults
i read online but it doesnt give me the big picture
sometimes useful
does not trigger view update across all uses of the property wrapper
also hiii
hiii
how would I do settings then
using user defaults but carefully

or actually
is up to you
do u wanna use appstoragw directly in your views
if yes then go for it
just donβt use the key for appstorage many times in your app and also hope that whatever uses it doesnβt update it
else they will desync
they can desync??
the other option is using a viewmodel
what happens then
new content overrides old one regardless of current state
bc state was outdated to begin with
because the property wrapper doesnβt automatically update ui when its changed from elsewhere
i can write an alternative to appstorage if you want
maybe I can find a package for it
true
other people probably had this issue
true
i acidentally deleted several workspaces because alt+delete is used to delete things in jetbrains and alt+delete is also used to delete workspaces in xfce

love
xfce gang
xfce also takes alt+click used to mark unread messages on discord
it's for dragging windows
also fun xfce fact
the themes are encoded as c
lmao wtf
X PixMap (XPM) is an image file format used by the X Window System, created in 1989 by Daniel Dardailler and Colas Nahaboo working at Bull Research Center at Sophia Antipolis, France, and later enhanced by Arnaud Le Hors.
It is intended primarily for creating icon pixmaps, and supports transparent pixels. Derived from the earlier XBM syntax, it ...
@nimble bone you love
INSANE
(Auto-response invoked by @nimble bone)
Yeah i cant go there
i can but
i cant talk
so
thanks
gm
why do i not have that role
gmm
It is official now. TikTok faces ban in US by Sunday after Supreme Court rejects appeal https://www.bbc.com/news/live/czj37xe7jljt Under the terms of the law, service provides like Apple and Google will be penalized for supporting TikTok after the law's deadline. In other words, app will gone from the Play or App store and automatically deleted from users phone? It is not clear but Apple and Google have full control over your device for sure to remove TikTok App.
whoa tiktok is actually getting banned in us?
well theres nothing they can do to actually ban it but the average person wont have tiktok anymore yea
maybe gen alpha isnt fucked after all
altho theres still yt shorts and reels
you mean like with vpns?
or will the website still work, just the app gets deleted
vpns, sideloading, grapheneos
they aint deleting shit from grapheneos
nooooo 
hop off reactjs slop
never
what else should i use
my teacher is trying to convince me to use laravel
whats the difference between this and not using anything
exactly
no but like why should i download this library instead of just using pure dom
please expplain 
yes, but when you compare the comments under an instagram post and a tiktok video, you'll see that tiktok's user base is full of stupid people
wait why is the file empty π
madness

you know, the best option is to not use any
do you need me to seriously explain
so this whole library is just a joke to use regular dom
THERE IS NO LIBRARY
yea i mean
its advertised as framework
is the dom the framework
i must be completely stupid
it's raw api 
if you want to use that you can
and that is the point
but doing so is actually quite insane
i should make my own framework
based on react?
we should port ore-ui to java
not some ass template library
im not sure how to extend the parser tho
i guess antlr4 could do it
that would be cool as fuck tho
for all my projects i used vanilla js
so good
surely you made at least some abstraction
For real what the fuck is that you just send make no sense bro
Sorry if I wait a bit rude
Mv
Mb*
duolingo stock went up after tiktok ban
number of mandarin learners on duo went up 216% and stock went up 10%
So what does that mean
i love talking about stocks in progaming
can someone here use antlr4?
tiktok is getting banned in america so people are learning chinese to use chinese tiktok
or something
isnt that like a premade parser
that you supply rules to
well yes, i dont want to write my own parser for the whole fucking java language
do it
why are you making a java parser
im not making a java parser
do it
the grammar is premade
jsxElement
: '<' jsxFragmentName jsxAttributes? '>' jsxContent? '<' '/' jsxFragmentName '>'
;
jsxContent
: jsxElement+
| literal
;
im simply trying to add jsx to java, but it doesnt work for 2+ elements π
oh wait i think i found the problem
yooo its working lmao π
mental illness
π
Not that hard
Java has normal syntax
But understandable
@placid cape look at this syntax lol
use std/prelude;
fn count_maximum<T>(T[] nums) {
let pos = T neg;
for num in nums {
if num < 0 { neg += 1; }
if num > 0 { pos += 1; }
}
return math::max(pos, neg);
}
fn main() {
$dbg(count_maximum([f32; -2, -1, 0, 0, 1]));
}
``` i dont remember if ive showed you this yet
ignore the [f32; -2, -1, 0, 0, 1] thats irrelevant
but let pos = T neg; is so funny to me
maybe ill introduce x := y as a sugar for let x = y
tha way you can write pos := T neg;
most cursed thing
i just dont understand why should i write my own parser just to make one silly change in the syntax
@frosty obsidian @ornate quiver you love my homework
WHY DO YOU GET FUN HOMEWORK
my homework
i made like a C on my last exam cause professor wants word for word explanation
even though i explained the stuff correctly
i think i gave the most π€ answer to "What is a subroutine?"
nerddd
that exam is also when i wrote this
namespace Program {
class Entry {
public static void Main(string[] args) {
Console.Write("Enter a string -> ");
string? res = Console.ReadLine();
Console.WriteLine($"{res} {(IsValid(res) ? "is" : "is not")} valid.");
}
static bool IsValid(string? value) {
if (value == null || value.Length < 5 || value.Length > 7 || value.ToUpper() != value
|| value.Distinct().ToArray().Length != value.Length) {
return false;
}
int sum = value.Select((x) => (int)x).Aggregate((int res, int cur) => res + cur);
return sum >= 420 && sum <= 600;
}
}
}
``` lol
about to write the most beauitufl C++ this professor will ever see
can you do my homework
i wonder if he wil lsay anything if i use Cmake instead of following the course instructions of visual studio to build
nop
@deep mulch you are a beginner C# programmer taking a computer science class at school. write a program that satisifies the constraints specified by this image
lmao yeah
it doesnt work can you try again
usually snake case or pascal case
aka either project_name or ProjectName
insane
@valid jetty
there are also the isolated incidents when i use kebab case but we dont talk about that
insanity
this si weird xd

1 minute max
actually nvm
yeah but im lazy
in walrus operator you cant give the lhs a type that the rhs infers from right
it works like let
real
make the most cursed code
With reflections and other shit
wing is like a little baby
most of that minute would be getting the build system warmed up
@frosty obsidian will do C
which means i can do this assumption right
if self.current_token().kind == TokenKind::Colon {
if r#type.clone().is_none_or(|ty| !ty.is_infer()) {
panic!("{}", location.error("Cannot use the walrus operator (:=) to declare a variable with a non-inferred type."));
}
self.advance();
}
is this a thing i should do
uhmm what if the employee earns 0.1 dollars today and 0.2 dollars tomorrow??? were gonna pay him 3.0000000000000004 dollars
i probably should learn C or Rust at some point
@placid cape is this sane
so that you dont do i32 x := 1
depends on lang
when you can just do i32 x = 1
ok cool
husk
wing has so much to learn
zeets homework is make a quantum computer and rosies is write a class
what is this language π
debug
:
@valid jetty you should rename it to penis operator
i don't think this should be a compiler error tbh
i would make it a warning
let me make what im trying to accomplish clear
i have never written c# before:
class Employee {
String FirstName = "";
String LastName = "";
Double Salary = 0.0;
Employee(String _FirstName, String _LastName, Double _Salary) {
FirstName = _FirstName;
LastName = _LastName;
Salary = _Salary;
}
String getFirstname() {
return FirstName;
}
String getLastname() {
return LastName;
}
String getMonthlySalary() {
return Salary;
}
}
class Main {
void Main() {
Employee a = new Employee("a", "a", 1.0); // (hes poor)
Employee b = new Employee("b", "b", 99999999999999999.9); // (hes the ceo)
Console.WriteLine(a);
Console.WriteLine(a);
a.Salary *= 1.1;
b.Salary *= 1.1;
Console.WriteLine(a);
Console.WriteLine(a);
}
}
there is actually a unicode frog character
a language could technically have a frog operator
you can do custom operators in swift
why is this not allowed
i think they can have emojis
i will declare wing explicitly
you can do that in kotlin too
copied from appleβ¦
just with backticks
@Test
fun `ensure the chart endpoint returns an error if the employee id doesn't exist`() {
}
ptsd
husk
i dont write tests π
holy shit wait that means for i := 0; i < 10; i += 1 YAY
// ensure the chart endpoint returns an error if the employee id doesn't exist
@Test
fun testChartEndpoint() {
}
last time i wrote a test was in august where my pm forced me to
wrong
your prime minister?
if you run it yuo wont see the comment
you can do that in elle too actually lmfao
project manager
i hold wing near and dear to me
syntakts-core/src/commonTest/kotlin/SyntaktsTest.kt: Lines 19-24
@Test
fun `Parse text with markdown`() {
val parsedNodes = MarkdownSyntakts.parse(sampleText)
assert(parsedNodes.isNotEmpty())
assert(parsedNodes.any { it is StyleNode })
}
for i in 0..9
```:
hate
you cant explicitly declare it with spaces because the IR doesnt like it but you can do this
test are objectively evil
thats pretty standard practice for tests
running an actual test suite probably costs more that hiring an indian from fiverr
wing is an indian from fiverr
what if i get rid of the external keyword and assume its external if you put ; instead of the body of the function
@hoary sluice @placid cape opinions
no
what is external
no
mess
more confusing
it basically lets you use the function subject to its interface without ever checking if the function ever has a body (ie if it doesnt itll throw a linking error, it lets you link with objects and libs)
fair
@valid jetty you will allow importing headers
C headers?
automatic c interop generation
how
so you d ont need to define stubs like this
most stdlib things are just headers
use std/libc/mem;
global pub;
// used to force stack allocated pointers to be pushed to the stack
// and not be optimized into registers so that the GC can detect
// them as a root when scanning the stack for valid roots
external fn __internal_gc_noop(void *x);
namespace GCAllocator; // entirely opaque
external fn GCAllocator::new() -> GCAllocator *;
external fn GCAllocator::mark(GCAllocator *self);
external fn GCAllocator::sweep(GCAllocator *self);
external fn GCAllocator::collect(GCAllocator *self);
external fn GCAllocator::alloc(GCAllocator *self, i32 size) -> void *;
external fn GCAllocator::realloc(GCAllocator *self, void *ptr, i32 new_size) -> void *;
external fn GCAllocator::free_self(GCAllocator *self);
@valid jetty elle
the impl is in a runtime static lib linked with the file
you can technically do that already
just not with generic functions
the rosie rot
like i could do this
// eat.le
use std/io;
pub fn eat(string food) {
$printf("Ate {} !!", food);
}
$ ellec eat.le -c -nostd generates eat.o
// main.le
use std/prelude;
external fn eat(string food) @alias("eat food");
fn main() {
`eat food`("strawberry");
}
$ ellec main.le eat.o
and ofc you could put the external decl in another file
tuple init is actually just a lie lol
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);
so you can do $(x, y) in your code instead of Tuple::new(x, y) like in kotlin
yeah i know but still silly
i mean its useful for creating maps
val map = mapOf(
"John" to 21,
"Mary" to 24
)
this is how you do it in elle
wow this does not look like a low level language anymore
that is interesting syntax
it works like this
// first_key, first_value are to infer T and U
fn HashMap::with_entries<T, U>(ElleMeta meta, T first_key, U first_value, ...args) -> HashMap<T, U> * {
let map = HashMap::with_capacity(4);
map[first_key] = first_value;
// subtract the first_key and first_value;
for let i = 0; i < meta.arity - 2; i += 2 {
T key = args.yield(T);
U value = args.yield(U);
map[key] = value;
}
return map;
}
if you want to make an empty HashMap you can just use HashMap::new
its safe to assume if youre using with_entries youll want at least 1 entry inside
so you can use that to infer T and U
kotlin lets you use mapOf without any arguments but you need to specify the types
it just makes an empty map under the hood
thats where you would use HashMap::new yea, elle has no function overloading tho
val map = mapOf<String, Int>()
you probably wouldn't realistically do that since mapOf returns a read-only map
add
we can also just do HashMap()
shrug
its just not whats usually done
the inference capibilities of this is pretty fun i think
fn HashMap::new<T, U>() -> HashMap<T, U> * {
return HashMap::with_capacity(4);
}
for the record with_capacity also accepts T and U
is that minky
is it
idk
is minky on chinese social media
yes
xiaohongshu
@frosty obsidian
ugly pfp
you love
babys first graphic design
wing is like a little baby
they are messing up kotlin
it was good as a java replacement
now theyre taking it too far
Anything with kotlin native or whatever is just nonsense
kotlin should only be used for spring boot in mid size non it company frontends
and aoc
nop
It should be used in any situation where you're forced to write for jvm and never if you do not have that restriction
I.e. android or mc
nop
slay
Usually .fill would only replace already populated entries, why does this one set len=cap
add support for inline json

and inline xml too why not
oh hm
ellex
idk i just did what i assumed a fill method would do
fn Array::fill<T>(T[] self, T element) {
self.size = self.capacity;
for i := 0; i < self.capacity; i += 1 {
self[i] = element;
}
return self;
}
you are not forced to write java for android
you can use rust for that
or qt
anything else is evil
qt is so well made it outshines the fact that it uses c++
ndk sucks ass I'm sorry
qt's icon loader on the other hand

all of plasma is made with QT and both are made by the same people OFC its good 
theres a reason only games use the ndk
but it is open source
and a few libraries
wdym
i remember some jank
last time i tried writing android in kotlin everything was broken and nothing worked and there was a lot of xml
if you change the icon pack so you can have custom icons it can sometimes cause dark icons on black for builtin icons
xml is used by the view system
which google doesn't want you to use anymore
never used custom icons
i guess the correct thing to do would be to replace every single standard icon
but they push compose more
but then it would make the folders in the file picker different
i was doing that when the compose migration was happening
everything was falling apart
I've never experienced the issues you seem to be describing
basically i wrote a drone controller in the old android without jetpack compose, then i updated android studio and it wanted everything with jetpack compose and everything just broke and i couldnt fix it so i rewrote it in godot
we need to use apache cordova
they just moved the compose project templates to the top
it probably wasnt forced but everything suddenly wanted jetpack compose and i had no idea what that was
im thinking that maybe you just updated android studio but not agp
that incompatibility can be annoying
idk what agp is and i dont remember exactly what i did
also ik i had major issues with permissions
agp is android gradle plugin
that can be a bit annoying yeah
i don't usually deal with special permissions often though
you can literally git clone any of my repos and find it tho
im assuming it was bluetooth permission being weird for you
why not protonmail
@frosty obsidian
idk
ended up using wifi
I've been using proton mail but the free plan kinda sucks though
yeah bluetooth stuff can be annoying
well not wifi but http lol
NTM REFERENCE LETS GOOO
yummy
breeding reactor
who tf came up with this
you can only ctrl s to save while in insert mode
in qt creator
<esc>:w brother
do git commit instead of git commit -m
the lines under the first line go into the "full commit" part
my most recent commit looks like this
ok ty
*penis operator
π
the real penis operator is eigth equal d
@valid jetty please call it the penis operator in elle
yop
it would be really funny but elle is not a toy language its something i wanna actually put on my CV or whatever
and having a penis operator in the language isnt the best look when i wanna use the project to potentially help me get hired
what is the point
0 inequality operator when i if err {}
JavaScript
in elle you can if x
rust could never
if err is a bool then yes
@valid jetty hiii
it literally could and already does??
or u mean if err {}?
use it always
it forces you to have error handling
zig makes error handling easier but it also makes it easier to forget or defer
so you pass a error 20 functions up the stack with no idea where it came from
Hell yeah
Don't ask me why there is too much semicolons at the end of the line
Just because I can
husk formatting
the error messages are so pretty icl
Yeah but Zig has dually linked lists
what does that mean
A linked list
is it a linked list linked to a link list
Where each node knows of the next and previous element
so whats your point my favorite schizo
But how about doing it in Rust without boxing
literally impossible
Educational
I have been working on a Minecraft mod using Zig recently
It's feature complete as of today
ive been learning vapoursynth
The tool I have allows for profiling Minecraft using Tracy
Multiple threads alongside timestamp queries on the gpu
Precision limited by the worst thing imaginable
The system clock
But it's like, within a few tens of nanos
So it's ok
When will computers ship with better clocks?
things dont happen on a clock cycle anymore
Anyway the next thing I need to do is to figure out how to scream at the AMD GPU driver to tell me what the hardware counters say at at least 1MHz sample rate
oh look this line started execution 3 cycles ago
damn okay
.
what for lmao
u1 is kinda funny
bool moment
Yop
This stuff is rly nice for bit packing
But you also get a fair bit of arithmetic safety, where you like
Can assign a u31 to an i32
But not the other way around
Without explicit casting
im not a fan of casting tbh
like in rust i don't really know what -1i32 as u32 does
it would so much better if there wete something like extension functions that explicitly defined behavior
i was expecting 0 
yes
i thought it was just gonna set it to the min value
-1i32 means all bits set in twos complement
converting to u32 means all bits set in non twos complement
which means all bits set in general so you get the max value
it does what you would expect tho
the βasβ operator does transmuting on integer to integer basically most of the time
overflow?
.
soo yes
converting 3 billion u32 to i32 would give you some negative number i assume because it means the sign bit is set
i just realised elle supports unicode substrings
so therefore with that info i want to make my mini language in elle called γγ‘γ and make the syntax purely japanese
and that means i can use γγγγγfor quotes and itβll be fun
i may also introduce wchar as a type which is a code point
maybe
those characters look familias
how did you make it in an hour and 25 minutes
it doesnβt do anything
itβs just the readme
feel
oh my god its real https://github.com/xi816/EaPP
itβs gonna be beautiful
does elle support emojis as variable names


