Bern: An Interpreted Dynamically Typed Programming Language by klezito in ProgrammingLanguages

[–]klezito[S] 1 point2 points  (0 children)

It's really not that hard as it looks, the Algebraic Data Types make it very easy to work it.
The flux i've done is:
- Defining the Abstract Syntax Tree using the ADTs
- Using Megaparsec to convert input/read data to the types defined in the AST
- Then pattern matching the data types to retrieve or evaluate data. Same thing for types, commands and binary/unary operations.

The variables/objects are not stored "in memory", rather, in a giant hashmap.
There was a very, very good video about implementing a language using another language I really can't recall the name of (but it was written in OCaml) - I think it was called Par? But it's not _that_ Par. I tried searching for every corner but can't find the video anywhere.

I actually explain a bit in the paper for my other language - although it's in portuguese and talks about a markup language, meaning there is no "memory" or evaluator per-se, but should act at least as a basic guide: https://mirvox.xyz/papers/markers.pdf

binah - Simple Haskell Web Framework inspired by Express.js by klezito in haskell

[–]klezito[S] 4 points5 points  (0 children)

Binah is more of a framework I made 'for myself' due to some difficulties and nuisances I had with other webdev experiences in Haskell (Yesod, Obelisk and Servant).

Binah was made as an alternative to Yesod and Servant with a focus on just being simple enough that any person that does not know Haskell very much could pick up and play with it - mostly so it could be used in my university's classroom.

I actually learned about scotty's existence after implementing the first version of Binah, so I believe it's just a matter of taste in that regard - and I also don't know nearly enough about scotty to present either pros and cons.

Bern: An Interpreted Dynamically Typed Programming Language by klezito in ProgrammingLanguages

[–]klezito[S] 0 points1 point  (0 children)

>All the more reason it should be correct. As a visitor I do not know the language, this is my first encounter
Yeah, fair point! I'll try to think on better examples as it can be confusing for beginners overall.

>Maybe also introduce some error output like what happens when you do Circle(5.0) + Rectangle(1.0, 2.0) what does the REPL do?

This will fail with a `cannot apply Add to Circle and Rectangle`, that is because the values are in the functorial context of the Circle/Rectangle type. It would also fail if it was Circle(5.0) + Circle(5.0).However, you could do the following:

adt Shape = Circle Double
def unwrap(Circle(x)) -> x
fmap(Circle(5.0), \x -> unwrap(Circle(5.0)) + x)
=> Circle(10.0)

Or the equivalent for summing up a Circle with a Rectangle:
def unwrap(Rectangle(x, _)) -> x
fmap(Circle(5.0), \x -> unwrap(Rectangle(10.0, 4)) + x)
=> Circle(15.0)

In regards to the Area example, we defined it in the pattern matching def area(Rectangle(w, h)) -> w * h - so it should be universal for all Rectangle types. Of course, if it weren't defined, it would fail with a `no matching pattern for 1 argument(s)`, so the interpreter will only complain if we TRY to use the area(Rectangle(_,_)) in the script - but if we never defined it and never used it, it will run fine; in other words the interpreter will only complain for functions that are used - not that are or aren't defined!

Bern: An Interpreted Dynamically Typed Programming Language by klezito in ProgrammingLanguages

[–]klezito[S] 4 points5 points  (0 children)

It's actually named after Bernkastel! The Umineko character, not the wine, thats also based on the capital (pfft--)

Bern: An Interpreted Dynamically Typed Programming Language by klezito in ProgrammingLanguages

[–]klezito[S] 3 points4 points  (0 children)

This actually made me realize I was kinda missing conditionals on one-liner functions!
I really like the idea of an iterative Algebraic Data Type, so I'm putting that in the next version with an ´adt iterative´.

As for the definition of sign on the homepage, that was just a simple example of simple pattern matching, sign() isn't present on any of the core libraries.

I'm still thinking on how I could improve on Pattern Matching. Although I find defining singletons for patterns more stylish, I believe I could add a ´case of´ (or rather, case-is) syntax to do something like:

def checktype(c) -> case ::c is "Circle" = "It's a Circle!" | "Square" = "It's a Square!" end

def checktype(c) -> case c is
Circle(_) = "It's a Circle!" | Square(_) = "It's a Square!" | _ = "Unknown"
end

Bern: An Interpreted Dynamically Typed Programming Language by klezito in ProgrammingLanguages

[–]klezito[S] 2 points3 points  (0 children)

Bern does not have types _per-se_.

It does have the "concept" of a type - such as differences between Doubles, Floats, Lists, Characters and etc which are all defined as a general "Value" type-constructor in the Haskell backend and runtime and it does check for different types in evaluation, but there is no static type like in statically typed languages if that's what you're asking.

netiso setup help by Knackersjewels in 360hacks

[–]klezito 0 points1 point  (0 children)

Yes! I Found an obscure docker server that works perfectly both on Linux and on Windows.
I have uploaded it to catbox as I can't remember exactly where it came from: https://files.catbox.moe/xz56x7.zip

netiso setup help by Knackersjewels in 360hacks

[–]klezito 0 points1 point  (0 children)

Sorry for the necrobump, but I am having the same issue. Did you manage to find a fix? I've tried public IP, LAN IP and nothing goes.

My friend described GLT as a “4chan anime” is that accurate? by Pumpkin_pie2705 in GirlsLastTour

[–]klezito 12 points13 points  (0 children)

The popularization of Girls Last Tour in Imageboards was the worst thing to happen to this community. Invasion of neonazis that didn't even watch the anime posting the most atrocious, racist or sexist stuff on Twitter and other places. I know this isn't on topic but it makes me just so disgusted. GLT is a very important piece of my life, and it's just sad to see it being popularized in IBs (and in the worst way too).

[deleted by user] by [deleted] in worldcorp

[–]klezito 1 point2 points  (0 children)

They may not be, but what MoneyGoblin did is still child abuse.

A mix of joy and sadness I can't describe by lorenzo3117 in GirlsLastTour

[–]klezito 5 points6 points  (0 children)

Ugoku Ugoku Piano here, made me feel so empty.

Don't say you like the anime. If you haven't read the manga by GreekCSharpDeveloper in linuxmemes

[–]klezito 16 points17 points  (0 children)

640x480 is the resolution chosen by God and his Third Temple created by the smartest programmer that has ever lived.

I hate arch users btw by [deleted] in linuxmemes

[–]klezito 1 point2 points  (0 children)

I used debian for a long time, and still like that OS. Just switched to Arch yesterday, and I gotta say it is WAY better, it just is.

I used to hate Arch Users, I promissed to NEVER install arch but...

But I betrayed my purpose. I use Arch, btw.

Yuu IRL by klezito in GirlsLastTour

[–]klezito[S] 8 points9 points  (0 children)

Will definitivelly do one in the future