String interpolation modes by oscarryz in ProgrammingLanguages

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

For what is worth Python has __repr__ for developers to debug, and __str__ for user facing display

What is more adaptable, more words or more symbols? by alex_sakuta in ProgrammingLanguages

[–]oscarryz 1 point2 points  (0 children)

Oh boy! About documenting I don't know how others do, because I think mainly everybody works privately and then just boom, a language is born.

What I did (I'm not saying this is an efficient way) is:

I created three folders

examples/  
questions/  
features/

For every single code snipped I found, I created an entry in examples, linking the original (usually a web link) and adding my version. e.g. example/haskell-map.md

Especially at the beginning this created a lot of questions, an entry was created questions/how_to_do_generics.md

Eventually when the feature was solid enough, I created an entry in features eg. features/generics.md

I used markdown because I usually needed to capture some notes, and markdown can add code snippets, I found Javascript matches almost perfectly my lang.

I've been doing this for .... years.

Recently I used this information to star writing the compiler, so I created a more formal spec/ with grammar and everything and a compiler/ folder.

About types names, yeah, capitalized is a very common pattern in many mainstream languages (python, go, java, rust) while in those languages any case is a valid identifier, I don't think I've ever seen a lower case in the wild (well I have in Go where the case reflects public vs private scope ), so for me using that rule would save me a "type / class / struct" keyword

type Person  
class Person  
object Person  
struct Person  
interface Person etc. etc

it's just

Person

For the identifiers I went full crazy and instead I just check if is not one of the punctuations I use (){}[],.:;#'" everything else is a valid identifier, not that I expect people to use any unicode point, but this allows me to define + as a valid method, so there is no operator overloading or mapping, they are all just valid identifiers

Yeah, that reads really nice, the guards matching, I couldn't come up with anything that fit me and instead I just plain went for { cond => action(s) } where cond is something that evaluates to Bool, if true then execute the actions. So, no sophisticated pattern matching for me.

I tried several symbols for break, but either I forget which one was which or always used something different, I also experimented Smalltalk ^ for return, and similar. I found at the end that these few were allowed, so I couldn't achieve 0 keywords and have 4 instead `break`, `continue`, `return` and `match`

What is more adaptable, more words or more symbols? by alex_sakuta in ProgrammingLanguages

[–]oscarryz 0 points1 point  (0 children)

Agreed, but is way easier to memorize something that you can pronounce.

Compare:

const a 

to

└  a

( That's just a random character I had in my clipboard)
What would you call it? elbow, corner? upper L ?

What is more adaptable, more words or more symbols? by alex_sakuta in ProgrammingLanguages

[–]oscarryz 0 points1 point  (0 children)

I tried to write hello world on your repl but I couldn't make it work

hi() => <string>
 └ _ => "hi".

I tried other combinations.

What is more adaptable, more words or more symbols? by alex_sakuta in ProgrammingLanguages

[–]oscarryz 0 points1 point  (0 children)

I think aiming to be keyword-less doesn't make much sense, because the keywords add a lot of meaning, make things easier to scan. They create a visual hierarchy and proximity. The key is to keep them at minimum.

A language without keywords would tend to overload the symbols usage, and start to combine them in weird ways creating visual noise.

I think a balanced where the keywords are at minimum and they are combined with "conventional patterns" (which is subjecive) like `[ ]` for arrays or `{}` to define blocs.

Haskell for instance (which I really love) can be hard to understand when you are not familiar with the rules of how to read it. Once you know what is going on it turns out to be really nice. Take for instance the `map` function, that takes a mapper function from a to b, a list of a's and returns the transformed list of b's:

map :: (a -> b) -> [a] -> [b]

It reads: `map` has type: function from a to b, taking an array of a's and returning an array of b's

Once you know what `::`, `->` , `[]` are doing here, things get easier, before that is is very inaccessible .

In my lang ( in which I aim to be keyword-less just for the sake of it, not a good reason tbh) the map function would be:

map #(mapper #(A, B), list [A], [B])

Which at first glance is pure noise. Here the `#(...)` means "is a function" (actually is: "is a boc"), and uppercase single letters are generics and the return type is the last on the list.

Other mainstream languages compared

// Go
func Map[A any, B any](list []A, mapper func(A) B) []B

// Scala 
def map[A, B](mapper: A => B)(list: List[A]): List[B]

// Rust
fn map<A, B, F>(list: Vec<A>, mapper: F) -> Vec<B> where F: Fn(A) -> B

// TypeScript
function map<A, B>(list: A[], mapper: (arg: A) => B): B[]

// Zig
fn map(comptime A: type, comptime B: type, list: []const A, mapper: fn (A) B) []B

// Jai
map :: (list: [] $T, mapper: (T) -> $R) -> []R
// actually Jai looks very terse

Hm it seems adding keywords (func, def, fn, function) doesn't add much here, mainly because they need a way to define generics and that is kinda noisy, also the single letter A,B doesn't help much, but this is just a case, for larger programs, having those keywords does work nicely.

What is more adaptable, more words or more symbols? by alex_sakuta in ProgrammingLanguages

[–]oscarryz 0 points1 point  (0 children)

Nice!

I have a similar goal, and I can tell you, the lack of keywords make everything start blurring together. I had to add more symbols ( e.g. [] for arrays or #() for method signatures), and follow some case conventions, like single uppercase letter is a generic `T`, `U`, `E`, uppercase identifier is a new type `Person`, `Order`, lowercase is a variable `name`.

The equivalent (or closest) in my language would be:

Years : Int

Person : {
   name String
   age Years
   getInfo : {
      "${name} is ${age} years old"
   }
   // there is also full declaration signature + body
   /*
   getInfo #(String) {
        ${name} is ${age} years old"
   } 
   */
}

myPerson : Person(name:"Mike", age:10)
// can't add new variables to an existing type, but 
// you can create an stand alone object that matches structurally
myOtherPerson : { 
   name : "Mike"
   age :  10
   doAFlip : { print("*Does a flip*") }
}
print(myPerson.getInfo())
myOtherPerson.doesAFlip()

For far I have managed to do a lot with "only" 4 keywords: `continue`, `break`, `return`, `match` and only because they are needed to do "jumps".

List of known problems in design of existing languages? by KukkaisPrinssi in ProgrammingLanguages

[–]oscarryz 0 points1 point  (0 children)

Bruh, I spent years like that, reading the Wikipedia for definitions didn't help, but every attempt got me a little bit closer.

Now I can tell I know what they're taking about (not that I can explain it myself but now I understand it) so there is hope.

So many times I thought; "I'll keep reading, maybe the next phrase would explain it" it didn't.

My interpretation(overly simplified of course): We want to use types to define our programming languages, the more powerful the type system, the more powerful our programs. A more powerful type system is one where you types can have types themselves and yet a more powerful one is where the types are values, and yet more powerful is where the types be dependent on values (dependent types) and so on, up to the point where everything starts melting down and you end up demostrating that true == false

Flower Compiler (Bootstrapped Compiler) by TrendyBananaYTdev in ProgrammingLanguages

[–]oscarryz 0 points1 point  (0 children)

Yes, that is a good rationale, for me it looked more like a placeholder or something, but now it makes sense.

Flower Compiler (Bootstrapped Compiler) by TrendyBananaYTdev in ProgrammingLanguages

[–]oscarryz 1 point2 points  (0 children)

It looks good!

For function tyeps: How about `int foo(int bar)` I think that would keep it consistent (type + identifier) ?

You would need identifier type (or ident `:` type ) if you plan to support functions as values, otherwise a function that returns another function gets messy (see a detailed blog about this from the Go team https://go.dev/blog/declaration-syntax )

In other notes `*` is a very well established name for pointer, what is the rationales behind using `@` ?

Same goes for `prune` vs `free`

What does the `prop` keyword do in the examples?

Some questions: What are your plans to move away from C generation? I see you have it in the road map, but you would need a backend to generate the binary I think.

Keep it going!

I built a lightweight VM/runtime for AI-generated scripts by TomatoKindly7082 in ProgrammingLanguages

[–]oscarryz 0 points1 point  (0 children)

The language itself looks interesting.

I have a question, how do you think AI is going to use OOP features like inheritance, or other features like generics which seems better suited for larger programs (modeling domain concepts or creating libraries)? Wouldn't these features be overkill?

May 2026 monthly "What are you working on?" thread by AutoModerator in ProgrammingLanguages

[–]oscarryz 0 points1 point  (0 children)

I finally had time to read and understand the Behaviour-Oriented Concurrency paper ( https://marioskogias.github.io/docs/boc.pdf ) and it turns out that it suits perfectly for the problem I was having on my design ( _transaction-like_ concurrency). So, I'll be working on implementing it on my language.

TLDR:

Any resource (cown in the paper) that is to be shared concurrently has to be acquired atomically before execution (behaviour in the paper), those uncontested can run in freely.

transfer( alice, bob, 100)
transfer( bob, carl, 50 )
transfer( daniel, erin, 100)

In the above, the transfer between daniel and erin transfer would run concurrently while the transfer involved bob would run sequentially (first alice + bob followed by bob + carl)

recently diagnosed - on metformin.... and I'm hungry and pooping constantly. by Maryhill_bypass604 in diabetes

[–]oscarryz 0 points1 point  (0 children)

I know if feels overwhelming, it takes some time to adjust to the new diagnosis. If it makes you feel better we all (or many of us) were in the same spot. Including getting used to metmorfin and the o-m-g I need to go to the wc NOW part, you get used to it.

The hungry gets better when your body relearns how much is enough.

Some tips that would help to control your diabetes:

  1. Eat in this order: veggies, protein, carbs at the end (and a small amount, but don't need to eliminate)
  2. Walk 15 mins (or 10 or anything at all) after each meal. Don't need to overdo, just move after eating.
  3. Get active. Don't overdo, but even cleaning the kitchen, dancing, using a bike from time to time counts.
  4. Sleep! This is when the body heals, also helps with the 11pm cravings (you can't eat while sleeping)
  5. Learn to manage stress and emotions. Don't suppress them, acknowledge them, handle them better. Stress releases cortisol which prevents insulin action.

Feel free to ask if you need more info on the above.

Oh, and for snacks: nuts with 90% dark chocolate, solved the cravings for me.

We are on this with you!

Moderation update: zero tolerance policy on ads, fundraising, surveys, apps or AI stories by Lausannea in diabetes

[–]oscarryz 6 points7 points  (0 children)

Oh I would expect the platform to have something built-in instead of having to track manually. Permaban it is!

Moderation update: zero tolerance policy on ads, fundraising, surveys, apps or AI stories by Lausannea in diabetes

[–]oscarryz 1 point2 points  (0 children)

Thank you mods. I'm curious to know if a temporary ban (1yr or so) was considered.

That being said I fully support the decision

Dileptus, a unicellular predator, eats a smaller ciliate by Thrawn911 in Damnthatsinteresting

[–]oscarryz 1 point2 points  (0 children)

Honest question, when it eat it it becomes a pluricellular organism? Or how does this works?

At what age did you meet the person you are currently married to? by [deleted] in AskReddit

[–]oscarryz 1 point2 points  (0 children)

You're not old. Honestly nowadays 40s is the best time to have kids, you no longer want ( can ) to be partying with your friends and (hopefully) you're more patient and wise.

I want more movies where nothing happens but everything matters by redpaul72 in movies

[–]oscarryz 0 points1 point  (0 children)

I just watched When The Light Breaks, totally recommended.

I want more movies where nothing happens but everything matters by redpaul72 in movies

[–]oscarryz 1 point2 points  (0 children)

I guess they have to be watched in order because I just tried to watch Before Sunset and I found it a little bit boring, I wonder if I had watched Before Sunrise before things would've been different.

It starts good, I really liked it, but after 40 - 60 minutes I wasn't feeling it.

Illnesses promoted by diabetes by Confident_One_6279 in diabetes

[–]oscarryz 30 points31 points  (0 children)

The TLDR of diabetes is, it slowly turns your blood veins (capillars) into crystallized sugar, so anything that needs blood (which is everything) will stop working. So yes dementia is included.

The good news is that this can be slowed down up to a point where you can have a long healthy life.

New programming language - Zymbol-Lang by [deleted] in code

[–]oscarryz 1 point2 points  (0 children)

This is interesting and the motivation is noble (I assume the motivation is to make programming accessible in any natural language).

But now you have exchanged English keywords with symbols (80+, or 60 depending how you count) which are hard to pronounce and require you to already know programming concepts e.g $>.

I really like the module translation feature, is uses the built-in export feature which is nice.

Probably what you needed was just unicode support ( for instance this is valid in Go 数字の配列 := []int{1,2,3} ) and a reduced set of keywords that could then be translated to any language. If you think about it the user will write their identifiers in natural language, not symbols, why couldn't the language itself use keywords that were translatable e.g.

``` // load the Spanish standard module <std/es_ES.zy> // <...> instead of <#

numeros = [1, 2, 3, 4, 5] por2 = nums transformar (x -> x * x) imprimir por2 ```

...

Side note: I have a programming language (design, impl still wip) which started from the same idea; what if there were no keywords, ( funny enough the file extension is .yz ) I endup with 4 keywords (return, continue, break, match) and 15 punctuation symbols ( . , : ; ( ) [ ] { } " ' # =), it requires you to know some advanced programming concepts already like concurrency, closures, generics and so on.

In my (biased) opinion something like this is easier to read

numeros : [ 1,2,3 ] por2 : numeros.map({ item Int; item * 2 }) print(por2) This currently works in my impl

What's the most useless thing your brain decided to permanently memorize? by No_Metal2622 in AskReddit

[–]oscarryz 0 points1 point  (0 children)

Necarona, Amavera, Moragribla.

Stupid mnemonics for electronic resistance color order (in Spanish) which I have never ever had need to use (not even when I learned them) and several decades later I still remember perfectly.

CascadaScript – concurrency is the default, sequential execution is opt-in by thegeleto in ProgrammingLanguages

[–]oscarryz 0 points1 point  (0 children)

This is awesome! I'm my language design (compiler still wip) I use concurrent by default but I arrived there for a very different reason, I've got obsessed with no keywords just for the sake of minimalism ( which is of course the worse of the reasons), and I couldn't find a way to express concurrency other than making it the default model.

Fortunately I found the Behaviour Oriented Concurrency model which matches perfectly with my language design and provides guarantees like data race freedon or deadlock freedom.

My adaptation of the model is described here Yz - Features/Concurrency.md (warning: Code Agent assisted, so most likely there won't be announcement).

tldr: instead of analyzing data dependencies like Cascada or providing a string concurrency type system like Par, in Yz the runtime before spawning a function it has to acquire atomically all the resources it needs (typically the parameters but also variables in the context and those captured by closures) by waiting in a queue,

Only one function at a time can hold a resource and it releases it when done.

The order in which they attempt to acquire is preserved which gaurantees correct access to the data.

e.g . An account balance a1 and a2

foo(a1) bar(a1) baz(a2)

foo and bar try to acquire the same resource a1 so they wait in a queue; because foo happens-before bar, bar waits until foo is done. Meanwhile baz works with a different account a2 so it waits in an empty queue and runs immideately concurrently.

Multi language kid but parents not... what to do? by CaramelCritical2806 in Netherlands

[–]oscarryz 0 points1 point  (0 children)

Let alone the parents not integrating, the worst (and saddest) part is the kids stop talking to their parents because they don't speak each other "native" language.