#ot1-perplexing-regexing
1 messages · Page 491 of 1
i do not know haskell
but probably the easiest way to see if it is correct is to see if it works
hey
Nope
Oh, academies of loudoun
I'm in the USA
Same
oh
Im in loudoun county, virginia
No need to be that specific
Its a high school for smart people
@rough sapphire Its pretty big, i doubt you'll find me
It stretches like 2 hours apart
ohhhhhh
lol
I didn't know you needed to take an entry exam for High School (obviously for colleges though_
No, its not a normal high school, you go there two days a week
half of your classes are there
There are two courses
Academies of engineering and technology
Wait if you're in Loudoun then you must be close to DC
and academies of science
Yeah i am, its half and hour from where I live
I applied for academies of engineering and technology
which is basically a course which teaches you about coding
Omg Loudoun is bigger than DC
all the math is coding related
all the classes are coding related and whatnot
521 mi²
my county is only 500 mi²
Im on the border, like near farifax and prince william
Cool[
Lets probably stop discussing our location, someone could be watching
Lol
DC is 10 square miles lol
NYC is 302.6 mi²
takes like an hour to get from one side to teh other
I've been to nyc
its pretty nice
dc is just supposed to be the capital it isnt supposed to have as many citisens as it does
lol
I've been this year
Cool
oh you only gone 13
My county borders NYC
Cool
i'm gonna delete the message I said about going to NYC 35-37 times so that no one knows my county
I remember, I was in 5th grade, and I went to times square, and they were doing this conga line, and this dude just grabbed me and put me in the middle of the line
And I couldn't get out
wth
It freaked me out
Llol
They just grabbed me
and stuck me in the middle of their conga line
NYC people are weird
Also why is NYC so dense
it's a city lol
Where I am, it's like 260 times less dense
Cool, you calculate that?
lol
it's 6:47, and I still haven't gone Trick-or-treating
Oof, its 647 for me to
idek if I want to go this year
Well, imma be safe and not
Lol
Also my birthday was literally last week (I have a late birthday in the year)
Im sorta socially akward, I remember freaking out every time I talked in this server
Oh cool, happy (late) birthday
My bdays in december
it was the 24th
ye
i think im a programmer because my goal in life is to be as lazy as possible but still suceed
Lol
basically, i want to cheat as efficiently as possible
but the real cheating was the friends we made along the way
just kidding, i have no friends
you dont need to cheat to get friends'
dont mean that
when i mean cheating, i just mean using apis to do school for me
i just switch whenever i want to
nope
the only math ive used is trig
and thats only because i needed to figure out inverse kinematics or whatever tf
nah when you go in-depth to programming like the inner workings i think you need math
ah i see
but also converting vector2s to angles
youre still in highschool?
middle
ah no wonder. i get it
only thing, none of that stuff was taught to me
huh
i think most of everything that is taught in k-12 in america can be googled
i think most of everything that is taught in k-12 in america can be googled
@winter terrace i am in a k-12 curriculum
because philippines
oof
ah fuck.. i knew it. haha i should not have auto timed my snapshots or it will lag and use disk space on my pc
still btrfs is nice 😄
git switch vs git checkout hmmm
hey
spooky scary skeletons -
git switchvsgit checkouthmmm
I always confuse the 2 for some reason.
checkout is one of those weird commands that do multiple things depending on context
spooky is gone
I have literally never used git switch ever
Same lol
I wish there was git delete yourself because this repository is broken and needs to be reinitialized
well according to people, git switch is relatively new
Rest in peace Wii Shop Channel.
This is just a fan tribute, I don't own the original composition.
Original composition by Kazumi Totaka.
The Wii and Wii Shop Channel is property of Nintendo.
Check out my other social medias!
https://twitter.com/Dominic_Ninmark
https://www.t...
this is the definition of "waits faster"
I wish there was
git delete yourself because this repository is broken and needs to be reinitialized
cd ..
rm -rf <repo folder>
git clone <repo url>
When you got a specific repo you can put that as alias nuke or something
You can also just delete .git, init and repull the remote data
rm -rf ./.git
git init
git remote add origin <url>
git fetch```and then make the current branch point to the right remote branch
there's also the wipe technique :)
git clean -df
git reset --hard HEAD
hard head?
quite
comeon anyone here?!?!?!
?
?
@edgy crest dont read. ignore them, or you will get their bad habits
reeet
the java equivalent is
System.out.println ("EEEEEE");
(today's topic is non-practical code)
console.log("EEEEEE");```
eval('console.log("EEEEEE")');
s = "EEEEEE"
print s
``` oof
python2 👀
did you forget the actual way of conversing in proper english
nu
me brain cells ded
me make brain cells ded
brain cells you cant make, body designed way that
me no grammer
go learn peethon, dont mingle here too long braa
me just done cooding
me don't no js
Hi
anybody knows why <Space>h takes some times to load?
I tried let mapleader = " " and mapped both <Space>h and <leader>h :wincmd h in my init.vim but it takes some moments to load/apply
that command
like it's waiting for <leader>h[Some else Command]
and why gd will be converted to space
also another book is really short but good..on compilers in c and understand how langs like python and lua and ruby..etc were created
@hoary steppe is it okay if i ask what the book is. it seems interesting
oh ok
@topaz aurora
Here's your reminder: Spooktober Part 2.
[Jump back to when you created the reminder](#ot1-perplexing-regexing message)
no.
Oh what
@solid pollen @topaz aurora
Here's your reminder: need a free ping? ☕.
[Jump back to when you created the reminder](#ot1-perplexing-regexing message)
@tribal aurora you should probably look at the #❓|how-to-get-help channel to see how to use the help system. the offtopic channels are not the best place for those types of questions.
Not particularly, but thank old (young?) myself
ah, it's a vim question. try #tools-and-devops instead.
lol, Your old self is very wise @solid pollen
lol
!remind 698956264629207121 1y are you owner yet?
Sorry, you can't do that here!
kek
python
@rough sapphire you’ll have to do that I. #bot-commands hahah
yeah i did
Very well
@narrow pecan are western cucumbers better than normal cucumbers?
They are (jk, we’re equal no matter the direction)
oooo
(Vivek Gurkan is the best Gurkan)
u are a cucumber?
He is
What suggests otherwise? Maybe you need to be a bit more imaginative but your nickname doesn't isspire much hope in me
wow apparently this was the first message in this server #bot-commands message
thats still around
u actually spent the time to find it lol
Sort by oldest exists
nice
john was the original owner btw
hello
where is john today
joe where are you
@neon shoal how did you resolve this was the oldest message
I did before: 2017-11-02 to be able to see that message you showed
theres no way thats the oldest
yes.. if only I could get paid for these bugs
haha
recently raised a bug for them to remove an emoji punching pregnant women..
and they were like.. oh.. you can block this person.. and I was like.. that's not the issue here
yeah that seems hard to enforce though
how do you make sure all emojis are ok
tough
go through an approval process
eh I guess
do you know anything about c#
I just decompiled a bunch of dll files and see the code, but I'm not sure if it's all the code
don't know a thing about c#.. have used a bit of c++ before.. can you tell me something
yeah I have no idea
I think there is an official c# server
you might be able to ask there
ok then
this invite will probably get zapped but http://aka.ms/csharp-discord
or not
zapped?
oh you mean because you link another server.. I think mods are ok as long as it's not self promotion
I think the bot deletes them automatically
but this is a redirect so I guess it doesnt see it
I cant grasp my head around the fact that so many schools hinder students to use higher lvl functions than what the "class level" is.
It's this leave no one behind mentality.
Thing is: it is better for the group to leave some super slow students behind. And even with the leave no one behind mentality you can allow students to experiment with higher lvl stuff. I would be pretty tilted to get denied an opportunity to develop. It also causes geniouses to not develop properly because they dont have room to improve
you mean things like common core?
most schools are meant to keep kids stupid.. so they can grow up to pay taxes
the American way
critical thinking, finances, programming.. it's not a priority unless it's a really good school and most people around the world don't get those opportunities
THIS. THIS OTN IS TRUEST.
@manic bloom if your regex doesn't summon a demon, it's not dank enough
oh yes, that's by far my favorite answer on stackoverflow
oh yes, that's by far my favorite answer on stackoverflow
@manic bloom i just read it. can confirm i've never seen anything like that ever written on stack before
👍
Ready to start writing my essays on monkey type
gooood
Will it still save the text?
goodluck jackoo
you will be able to yeah
Could someone explain to me what IRC is?
If I Recall Correctly
IRC - internet relay chat
iirc
it's like an old timey discord
the older members of this server will be familiar
ohh
can someone send me his output of time nvim
@soft violet https://www.youtube.com/watch?v=zaszWqOU2pc
Photo slideshow (real animals) to the song come to Australia by the scared weird little guys
Magpies == demons
only the australian ones
@tribal aurora https://i.imgur.com/kYSplRG.png
:^)
jokes aside, on the WSL https://i.imgur.com/29cddjd.png
let's start a speedrun challenge, real time reported, how fast can you exit vim
Best I can do
Vim Exit% Speedrun WR Pace
🤔
a nice trick is to enable caps lock to save shift mashing
or just make a vimrc that binds exit to something else
lol
got 0m0.302s 
ZZ is op
spent way too long on this
https://i.imgur.com/rj0jOmU.png this is as good as it's going to get for me
440ms is a bit sluggish but nothing crazy if it's not a very powerful system
esp. if you have a lot of startup overhead, I don't know when vim loads plugins
so not good?
is this cheating?
depends if you cheated
well, no. I exited it properly
but it is vi, not vim
which is lighter and starts up faster
time nano
nano is no joke
I don't have nano 🙂
how did you press enterZZ in 20ms
wdym its in escape mode already so just ZZ
you need enter to start vim
Best I can do
@graceful basin I mapped <space>q for that
Lak that's cheating
yea lol
yeah, was just curious how fast it would be
holy shit dude
my teacher just said "we make our fields private in java to protect them from people changing them"
"say you have a bank account and some disgruntled employee just gives everyone a million dollars"
yikes
I am so sorry for you
this is quite bad
So if private is to protect the fields, what is protected for?
to protect from all but ones own progeny
That person was Lilo.
oh
Guys is there any way to write a c program for swapping two nunbers using inbuilt function?
I was asked this in an interview
You can use a 3rd variable to store it temporarily
you should use a third variables
Yeah i knew it but the interviewer has asked to do it with using inbuilt function
There is std::swap in c++
Kind of an odd interview question tbh, not sure how that reflects on your prowess as a programmer
Yeah i knew the cpp function
Kind of an odd interview question tbh, not sure how that reflects on your prowess as a programmer
@stark prawn but i got selected in that interview for next round
Another way to do it would be to use an xor swap.
But I don't think that would be considered a builtin function
Another way to do it would be to use an xor swap.
@stark prawn yeah thanks i will try this now
xor swap is also worse in every way in C.
And only works on distinct values
Wow, a completely random person who doesn't share any servers with me just DMd me to say that they would give me a BitCoin
I am so so so so lucky
Let's give them my credit card number
Haha
don't forget the three numbers at the back!
Well, they probably left the server they shared with you
Are you in a lot of public servers?
You make a procedural stuff each day using only nodes for the whole of November
That is really interesting
I’m not sure if I’m skilled enough to make something at least meaningful haha
Haha I'm trying myself, though others are just way too good like this 😭
https://twitter.com/simonthommes/status/1323185049492140033
#01 - Cookie
And so it starts again...
Single sphere with a procedural shader.
Will post more about it later.
#b3d #nodevember #nodevember2020 https://t.co/Xdm3b4J2CX
1163
bruh blender pros lol
I can run blender but will take a lot of time to build that
mins? hours?
oof
well there we go nodevnovember
I am still 20
wow, they finally did it, it looks better than real... I think when the Play Station 5 comes out I gonna leave reality and live in unreality https://www.youtube.com/watch?v=Y6ZOWWs6rNE
PS5 First Real-Time 4K Gameplay Next-Gen Graphics Demo on PlayStation 5 using Unreal Engine 5 (2020)
SUBSCRIBE → https://goo.gl/wiBNvo
subscribe for the latest PS4, Xbox One and PC, Gameplay, Trailers, Walkthrough and Games News.
looks unreal
it's pretty damn impressive that's for sure
i do wonder how well the tech demo is going to translate into games
looks unreal
@quick ledge like my engine
Unreal Engine 5
Dude. That's both an insanely crazy engine and computer
That's literally more real than real life
the PS5 definitely has some serious power under the hood
yeah
I've never gotten into gaming (maybe I get to blame my Mac?), but that's just crazy imoressive
this has been a very long console cycle
hmm... maybe not. about the same time gap to the PS3
thought it was 5 years not 7.
by the time we are old and living in a nursing home, we can just put on VR headsets and think we're in a different world again
when youre demented you cant tell the difference at all anymore
<@&267629731250176001> ^
Omnibrain, I'm curious about 4K gaming claims
just because every time consoles have claimed AWESOME RESOLUTION it never seems to work out that way
last gen, 1080P at 60FPS (Every game runs at 800P at 30FPS with frame drops)
eh, "4K"
massive massive quotes around PS4 "4K"
more like 1440p that we claim is 4k because "HAND WAVE"
i still get bugged about 30fps capped games
Haha I'm trying myself, though others are just way too good like this 😭
https://twitter.com/simonthommes/status/1323185049492140033
@cosmic lotus Simon Thommes is crazy! great guy
#01 - Cookie
And so it starts again...
Single sphere with a procedural shader.
Will post more about it later.
#b3d #nodevember #nodevember2020 https://t.co/Xdm3b4J2CX
1385
He is! He is apparently also working at Blender
Why not!
Yes!
Oh he's working at Blender now?
That's awesome to hear
3D artist / generalist at Blender Studio
oh yeah!
Could someone help me with a remove function in binary search tree ?
is it implemented in python?
@rough sapphire you will get a better answer in a help channel
Could someone help me with a remove function in binary search tree ?
@rough sapphire bruh this is very tricky
sure
Ok so my hand has a little bit of hair
pretty sikmple
Its all black like space
and I use it to walk
and by hand mean my paw
So what is the point of this
Joe r u here
JOE
Ok, I am glad he is not spying on me
I cant believe Im a hostage
hello joe
greetings
Joe killed John, and then hid his body. Right Joe?
John seems to have disappeared around 2019
I've been here for a while, I've never seen him
not long enough :)

i kinda wonder what is he doing right now after he left PyDis
cyber stalking 👀
what lol?
I'm jokingly saying, it's time for some cyber stalking
okay gotta make a video presentation for our research
👍
Hi
Are people basically good or are people basically shit?
I side with locke on this
I hear you there
Everyone knows the internet is the best place to have a respectful discussion on philosophy :D
hah
i kinda wonder what is he doing right now after he left PyDis
@mild abyss i don't think he left cause he still has the developers role
locke
good guy
I prefer Nietzsche
I stumbled across a video about Nietzsche the other day lol
lmao, that's a great way of putting it
lol
hey does anyone know of a good Discord bot for preventing raids?
I'm in a LGBT discord local to my school and we get trolls now and then
don't really know of a good bot that can just help prevent that
pydis mods
@deep drum this can be fairly tricky. I am not familiar with other bots, but you can maybe look to our bot to see how we handle this stuff.
!source
@royal lake does not handle raids well lol
lol ez fix just ban anyone that talks
not yet
wdym not yet
not never 
is that a bot?
Why would it not be named after a type of python....
I guess you could say it's the overlord of the bots, even surpassing the likes of @remote socket
SeasonalBot is going to be Cobra some day
@rattlesnake
No bot is close to passing xith in computing power
But a cobra is not a type of python :c
there are types of Pythons?
It's a snake :>
!!
ii
Metricity is the only odd one out
metricity is joes favorite
and the hidden IRC bot
Ok you did: ball pythons, children's pythons, carpet pythons, woma pythons...
those would not be great names lol
I am aware, ill keep brainstorming
anyway, the reason why raids last only a matter of minutes here nowadays is because the spam has a pretty clear pattern
we can then create a quick int eval which bans everyone matching that pattern
and raid is over

eval(ban)
There are so many pythons
@eternal wing CPython, PyPy, MicroPython, Jython 😎
Cython and Brython!
ironpy
that's old
BFython whn
Lol
FBIthon when
Well, you just summoned them with that namedrop
hey would this be the place to ask a question about html lol
Yeah, you could. You can also try #web-development but i dont mind answering one here personally
Do you need to actually get the pixel value?
In general you can use vw to reference the width of a screen.
The !shhh command is a very useful one though
shhh
It stands for view width
As in 100vw == the full width of the users viewport
It is styling for css:
body{
width: 100vw;
}
Np
You can also use width: 100% which will be the screens full width if all the containers are also width 100%
hey
howdy

howdy
Hey! Thats my line 😠
haida
Howda mista linux
I started learning python today,
I feel cheated that people use this language.
It's too easy coming off of C++
I wish I learnt python before😭
I mean C++ is very useful as well
Little to do with use tbh
All languages are useful
Its just that python is very user friendly
Hey! Thats my line 😠
@eternal wing it's mine now 🙃
@narrow pecan HOWDY WESTEEN COCOOMBEER
HOWDY
@dapper bolt
ok thx
yw
looks cool
and for reference here's vsc @dapper bolt
yea i actually use vsc right now but don't really like it that much
I prefer it over others, but in general I like minimalistic stuff - I've had pycharm make scripts not work before due to it interfering
do all debugging thru cmd which is honestly p easy
Wait does sublime not have an actual debugger
🤔
Is golang's syntax closer to python or c?
closer to C I would say, though it is pretty foreign from both
debugging is so much work
:o
@desert flume
I just rewrote a python function in clojure and it worked the first time I ran it
Is it snowing?
no
is it for u ?
i have seen snow only once, in 2012
when i went to north, it never snows here 🤷
the second function took some debugging, but only because of an annoying typo. But it works now https://hastebin.com/raw/jewawiqudi
We haven’t seen snow in 7 years now I think, but trump said that global warming is a joke, so....
No need to worry. Climate change is fake, of course :D
Oh no, I remember this ot name
yes it is definitely fake.
Definiteali
Good luck haha
why are you installing a processor
idk if thats a joke or

well it is i3-wms fault for its naming
I just rewrote a python function in clojure and it worked the first time I ran it
@graceful basin whats clojure? another lang?
why are you installing a processor
@cosmic lotus yeah, you should be downloading it
Then you use the Upgradinator 3000™ 🔨
Grammar.ly is just ReSharper for English
I wanted to test that feature
I'm thinking of making a language called Quazi
My main inspiration is JS but I'm incorporating many Python features too
Here's a hello-world example
print("Hello there!");
Here's a function example
addTwoNums(x: Number, y: Number) = x + y;
Types are required unless they can be inferred
The goal is to minimize runtime errors and allow for fluent, elegant code
It also supports built-in function options
Why do you want to end lines with semi colons in 2020 
func(x: 1, y: 2)
@solid pollen semi-colons are optional
i'm just used to them
Import statements are like this
import x from 'module';
import { y } from 'module';
import x, { y } from 'module';
Basically similar to JS imports
Here's all the ways to create functions
func = (x: Number, y: Number) => x + y;
func(x: Number, y: Number) = x + y;
function func(x: Number, y: Number) {
return x + y;
}
func: Function<Number, Number> = <#0 + #1>;
what is the =>?
=> is anonymous functions
(x, y) => x + y is the same as lambda x, y: x + y in python
oh its js
oh nice
One of the most useful features is the <> anonymous function
You don't have to specify argument names
So you can have simple logic like
It looks good
seq
.map<# * 5>
.filter<# > 15>;
ye
there's also going to be concrete types
just like python
so there will be a String class, a Number class, a Boolean class, etc
the == operator will be just like the Python one, not the JS one
the === operator will be just like the Python is
import { Client, Embed } from 'discord';
client = new Client()
.on('ready', () => {
log('I am ready!');
})
.on('message', message => {
if content == 'how to embed'; //Automatically exits the block if the condition fails
embed = new Embed(
title: 'A slick little embed',
color: 0xff0000,
description: 'Hello, this is a slick little embed!'
);
message.channel.send(embed);
})
.login('your token here');
Types can be inferred
nothing should be like the == from js
@little wolf even tho JS is my favorite language
JS had a lot of bad design decisions
like
== is terrible in JS
why can you add numbers and strings
etc
but I still really like JS method chaining, JS prototypes, JS anonymous functions
if i was giving out that vibes
Quazi is sort of Python + TypeScript
and ik
the goal is also to minimize runtime errors
a lot like elm
but also for fluent and easy code
you can even do stuff like this in Quazi
x = 5;
if x == 5;
log("5");
If you don't specify a block for if
Then it'll just exit the current block if the condition fails
So you could do stuff like
is log the console.log in this language?
as a print debugger i like the lenth of this
also
a lot of times you won't have to deal with messy runtime errors
since there will be powerful type checking
and type inferring
x = 5;
x = '5'; //Fails because the first definition of x is as a number.
so yeah
there will also be top-level await
and await will be more like JS promises then Python coroutines
also you know about threads right?
and thanks
quazi will have thread support which is asyn
so stuff like
const MyThread = new Thread(() => {
//Do a large calculation
x = 0;
while (x < 100000) {
x += 1;
}
return x;
});
let res = await MyThread;
log(res); //logs 100000
or you could do
uh........
const MyThread = new Thread(() => {
//Do a large calculation
x = 0;
while (x < 100000) {
x += 1;
}
return x;
});
MyThread.then(log); //logs 100000
@little wolf ?
also you know about threads right?
oh
well anyways, i hope it'll be a neat language
i don't expect people to use it
it's just meant to be a nice side-project
no im not calling it bad, im just saying i have no idea what threads mean lol
i would love a mixture of js and python
alr
@little wolf well, quazi is gonna have a lot of that
alongside types too
so you can't make silly mistakes like this
x: Number;
x = 1;
x = '5'; //Won't work, only allows numbers to be saved to the variable
anyone knows Typescript here?
Which is better?
that actually depends but a lot of times
If you want type safety go for TS
typescript is better since it saves you from a lot of errors
@tribal aurora JS is easier to write
but TS can save you from a lot of errors
and ensure type safety
I was looking to learn TS because it has lots of features and it's superset of JS
But I see there isn't really HUGE community for TS
@tribal aurora I think around 20% of the JS developers use TS
and there's still a pretty big one
big companies like Microsoft and Google use TS too I think
hm
But I see there isn't really HUGE community for TS
@tribal aurora i know a typescript server, and its pretty active
can you send it to me pls
sure
i couldn't find one for js lol
thanks
lol
But, again, it's not Huge as javascript
I mean , there aren't enough asked questions in stackoverflow
im not sure
but i think javascript works on typescript
so if you get a js solution
its most probably gonna work on ts too
and the most famous js develouper uses typescript
so i wouldn't worry too much about its popularity
How?
How?
?
but i think javascript works on typescript
And how do you know
and the most famous js develouper uses typescript
it doesn't?
I don't know , I'm new
And do you know TS?
nope
:/
i am probably a bad influence
JS?
so?
i like realtime error correction
if you are beggining
start with just javascript
but give typescript a shot
when you are decent at javascript
So for Quazi
I want to make it very easy to infer types
The goal is to minimize types as much as possible
I'm hoping the only area you'd need to specify types
Would be functions
So stuff like the following is inferred
Does this channel have a topic? I hope not?
function func(x: Number) {
return x + 5; //Return type is inferred
}
x = 5; //Infers 'x' to be a Number.
y = func(x); //Infers 'y' to be a Number.
z = new Class(); //Infers 'z' to be an instance of Class;
a = x * 2; //Infers 'a' to be a Number.
Take a wild guess lol
so those are some plans for Quazi, my programming language in-progress
automatic type inference
@wise thistle uh I guess it has a topic right now since
i'm talking about my programming language here
I’ll refer you to this message #ot0-psvm’s-eternal-disapproval message
Oh CMON....I wanted to talk about my finger
hey is anyone here good at html?
cuz I just have a question
function func(x: Number) {
return x + 5; //Return type is inferred
}
x = 5; //Infers 'x' to be a Number.
y = func(x); //Infers 'y' to be a Number.
z = new Class(); //Infers 'z' to be an instance of Class;
a = x * 2; //Infers 'a' to be a Number.
So here's how I plan for it to infer types
Primitives are easy to infer
5 is obviously a Number
functions get a bit tricky
In a function, you have to specify the types of the arguments
But then you can use those to infer types
function func(x: Number) {
return x + 5; //Return type is inferred
}
Since we know x has to be a Number, and a number plus another number is a number, it infers it to be a Number
So it infers the functions return type to be a number
y = func(x); //Infers 'y' to be a Number. Allowing it to infer this to also be a number
z = new Class(); //Infers 'z' to be an instance of Class; We can easily infer that an instance of a class is well... a value with the type being that class.
a = x * 2; //Infers 'a' to be a Number. As you know, x is a number
So we can infer a to also be a number
and that allows for powerful type inference
Quazi's standard lib, when I make it
function func(x: Number) {
return x + 5; //Return type is inferred
}
x = 5; //Infers 'x' to be a Number.
y = func(x); //Infers 'y' to be a Number.
z = new Class(); //Infers 'z' to be an instance of Class;
a = x * 2; //Infers 'a' to be a Number.
@opaque anchor what is this?
I mean what language is it
@tribal aurora That's type inference
And it's a language I'm making
Called Quazi
waoh
Combining features of JS, TS, and Python
so you're expert
I guess
The goal is for the same flexibility of like
Python and JS
But also the same benefits of typing
So it can catch a lot of errors before they even happen
Ok so
Something I noticed in TypeScript is the interface
I think Quazi should automatically generate and assume interfaces
So
If you do this
obj = {
a: 1,
b: 2
};
It'll automatically assume that obj is an Interface { a: Number, b: Number }
huh, return type inference is interesting. Do you have union types?
@graceful basin yep
String | Number
This is still just an early idea, but the goal is to infer as much as possible
so with union types
it should be able to infer the exact type at some point
so in order to have a union, you need to explicitly specify its type?
yep, unless it can be inferred
so
function func(x: String | Number) {
return x;
}
The function's return type is String | Number
but when you call the function
func(5)
it will infer that the return type for that call is Number
function func(x: String, y: String | Number) {
arr = [];
arr.push(x);
arr.push(y);
return arr;
}
so this could be an example of List[String | Number] | List[String]
then
func(1, 2);
i'm not sure if it'll be able to infer that
since [] is just a plain array
if it could infer that
it would need to scan the function
look at arr
then detect arr.push(x), and see what type x is
which is string
so then that makes it List[String]
and if y is a Number, it becomes List[String | Number]
otherwise it stays to List[String]
I think that should be possibly to infer too but I'm not sure
another thing is casting
I don't think this language will have explicit casts
So if you have a union type
You'd probably have to check it
x: String | Number;
x = x as String; //This is impossible. You can't cast directly
The only way to cast would be to use an if with instanceof
x: String | Number;
if (x instanceof String) {
//Use x as a String within this body
}
So @graceful basin
It might not be able to infer it
And in that case
You'd need to explicitly use the union type
And check which type it matches
If it matches List[String] or
List[String | Number]
or even
iterate over the List[String | Number]
and check if each value is a string or a number
because for union types, you cannot act on the data unless you check its direct type with instanceof
the issue is something like
x = ["Hello"]
y = x
z: List[String] = x
y.push(8)
that would fail
x is automatically defined as a List[String] from ["Hello"]
so if you want to do that
you'd need it to be x: List[String, Number] = ["Hello"]
yeah, that is smart
everything would be valid
up to y.push(8)
but
if you do this x: List[String, Number] = ["Hello"]
z: List[String] = x then this will fail
yeah, that is required
the goal is to minimize a lot of the runtime errors
so casting is removed except through instanceof checks
since if you try to use string-only methods on an Object type
there's a chance it could fail
x: List[String | Number] = [1, 2, '3', 4, '5', '6'];
//INVALID
for (i of x) {
if (i.length == 1) {
log(i);
} else if (i > 8) {
log(i);
}
}
//VALID
for (i of x) {
if (i instanceof String) {
if (i.length == 1) log(i);
} else if (i instanceof Number) {
if (i > 8) log(i);
}
}
so this showcases that
in typescript
const x: string | number = '5';
if (x.startsWith('5')) {
console.log(x);
}
this is valid
but that wouldn't be valid in Quazi
unless you check if x is a String
before operating on it
hi
is there any way to create cluster of 2 servers and combine the resources so they act like a single system
oh hi mark
you may want to look into something called a beowulf cluster, pretty neat at least. Not necessarily server related.
overall you would probably just want to delegate resources between servers though.
I don't like how the return function for my LISP jumps unconditionally, but it's something I can live by for simplicity I guess
This is valid, for one
(loop [(return 42)])
When it evaluates the vector, it performs the side-effect of making the return propagate
I could write it in the spec that it's imperative but oh well
My WiFi ded
says someone who messaged my wifi ded
mObOL DAyTA is A tHInG
Current 2020 Presidential Election Standings: (Biden) 238, (Trump) 213. 270 needed to win.
@royal rune no needs to post that in all 3 channels, we heard your point
k
confusion lol
6 actually
I change it up a lot, always have a full screen
music, discord, text editor, tutorial video, cmd, and the website I'm coding
other times it's music, video editor, files, maybe youtube
how do i block this specific script using tampermonkey or soemthing
i am sorry if this is offtopic but ive tried using noscript, and ublock origin advanced options
with no sucess
wait...




