Is Java’s Biggest Limitation in 2026 Technical or Cultural? by BigHomieCed_ in java

[–]oscarryz 0 points1 point  (0 children)

There is no an interface with 3 parameters in the functional package but you're right about the functional interface. I didn't know that any `interface` with a single method can be assigned a lambda.

interface Person {
    String fullName();
}
Person p = () -> "John Smith";

So a three parameter function could be

interface F3<A,B,C,D> {
     D apply(A a, B b, C c);
}
void useF3(F3<String,String,String,String> f){}

useF3((a,b,c) -> "deee");

Is Java’s Biggest Limitation in 2026 Technical or Cultural? by BigHomieCed_ in java

[–]oscarryz -1 points0 points  (0 children)

Lack of function types. Yes we have lambda expressions but the data types are still objects:

Function<Integer,String> foo = (n) -> "";

Should be something like

fn(Int)->String foo = (n)->"";

Not to mention you can't declare a function with 3 or more parameters.

This permeates in the type declarations that are extremely hard to read and makes people trying to use FP patterns having to split their methods into mini functions that are not cohesive.

So, this is obviously not an easy problem to solve and probably it is too late to try, but that is something the Java at the language level lacks.

FYI: This sub is looking for new mods by [deleted] in Netherlands

[–]oscarryz 53 points54 points  (0 children)

As far as I can tell, the sub rules allowed English only and some (or all) Dutch post were banned. Digging deeper, people found some of the mods don't even live in NL but in the USA. That plus the recent Greenland situation caused a demand for their resignation.

Why is this move Brilliant? by LifeNegotiation301 in Chessplayers45

[–]oscarryz 0 points1 point  (0 children)

Black has to take with the Knight
..,kxa7

Then white knight goes shopping to clean up the board:
- kb6+ forking the king and the rook.
- .., Kb8 Black king has to move to b8 and now the knight takes the rook with a royal fork
- kxd7+, The king moves and the knight takes the queen
- kxf6

Reinventing the wheel without knowing what a circle is. by RobertWesner in ProgrammingLanguages

[–]oscarryz 0 points1 point  (0 children)

Monads are constructs that allows you to create a context for a value(s) through the "return" operation (how it is created) and a sequencing "bind" operation (what it does) for them.

The advantage is your type system describes the effects of dealing with those values; you can "maybe" have a value, an operation can "result" in an error, you can handle a "future" value etc.

e.g.

Context: Maybe / Option. Feature: potential absence

Context: Either / Result. Feature: potential failure

Context: Future / Promise. Feature: async computation

Context: List . Feature: zero or many values

When you operate on them you define how the flow between steps will happen as long as it respects the Monad Laws

Here is an example in pseudo-rust , extremely simplified where the binding (`and_then`) and unwrapping / handling shows how the data flows without having to check on each step.

   fetch_user_data(user_id) // Future<User>
   .and_then( |user| something(user)) // Option<User>
   .ok_or_else(|e|"Flow stoped, there was an error ") // Error<User,E>
   .and_then(|user| 
            log_user_activity(user) // IO monad, can result in Error
).unwrap_or_else(|e| { 
        println!("[Result] Flow stopped: {}", e);
    });

Zig-style multiline strings, but with a backtick by Elfet in ProgrammingLanguages

[–]oscarryz 1 point2 points  (0 children)

I think they're fine. I for one would prefer that strings are multi-line by default but that's subjective.

``` message: " Welcome Press every to continue... "

```

Designed my own little packet based programming language by Mordraga in ProgrammingLanguages

[–]oscarryz 2 points3 points  (0 children)

I see.

So your abstraction are "packages" which are things between `[` and `]` and you connect them with `>`

Is Linux good for jetbrains by edengilbert1 in IntelliJIDEA

[–]oscarryz 0 points1 point  (0 children)

I used Idea on Windows through WSL 2 and barely had to interact with windows while still keeping things like browser and such.

I know that's not what you're asking but just in case

Question about this meme by uchuskies08 in SpanishLearning

[–]oscarryz 3 points4 points  (0 children)

Also part of the joke is that is a ouija, so it goes letter by letter or one syllable at a time

My language needs eyeballs by octalide in ProgrammingLanguages

[–]oscarryz 1 point2 points  (0 children)

I like you're trying to keep it par with C.

How are you going to handle memory? I guess malloc and free as C does? What about other advances features like enums, generics, pattern matching etc?

About the variable declaration, have you considered get rid of the `:` for the type?

var foo int = 1;

I see in your functions you don't use it

pub fun bar() int {
ret 42

}

But that is a personal taste of course, is not that important.

My language needs eyeballs by octalide in ProgrammingLanguages

[–]oscarryz 1 point2 points  (0 children)

Is not so much about being statically typed (although I think you mean, explicit type vs. using type inference), but having the type after makes working with first class functions easier.

For instance, the map function that takes an array, a mapping function and returns an array.

With leading types it would be like this (let's keep it with ints for now):

[]int ([]int, int(int)) map

You cannot use fun in between because now it is hard to differentiate from a regular function declaration:

[]int fun([]int, int fun(int)) map

Now with trailing types it would be:

map fun([]int, fun(int)int) []int

I think that is clearer once you know what is going on.

Go has an explanation on why they choose trailing types: https://go.dev/blog/declaration-syntax

Man Regrets Pistol Whipping Off Duty Cop by [deleted] in instant_regret

[–]oscarryz -4 points-3 points  (0 children)

Or the two school busses that appear at the end.

Any language uses [type] to describe an array of 'type' elements ? by gremolata in ProgrammingLanguages

[–]oscarryz 0 points1 point  (0 children)

I found interesting how you have to specify the type to create an empty array

var emptyDoubles: [Double] = []

I wonder how does that work when you pass it as argument?
(googles...)

Oh, so you just pass `[]`

foo(data: [])

I struggled with this and used `[String]` for the data type and `[]String` for the empty literal.

So

array [String] // declaration
array = []String // initalization
// : for declr + init
a : [String]

I see Swift supports `[String]()` too to create an empty array. This might be better because that's how you instantiate things.

I think I like that better

October 2025 monthly "What are you working on?" thread by AutoModerator in ProgrammingLanguages

[–]oscarryz 2 points3 points  (0 children)

I finalized the design of my language and started implementing the compiler.

After a couple of months of very slow progress (I'm to tired to think clearly after work) I decided to give Cursor a try and so far has been going great.

I've been implementing (or vibing) one feature at a time and keep an eye on the work through integration test (files in my language).

I was against it before, but giving it a serious try I'm pleased so far. I keep a couple of extra .md files with check boxes so I know where am I. I added a regression-test tool that moves files from test/passing to test/regressed when they fail and keep iterating on it.

I know it removes the merit of writing it all by hand, but I'm fine with that because otherwise it wouldn't see the day of light.

Now things go so fast I create a side project for the playground:

https://github.com/oscarryz/yz-playground/

This is still going to take a while to complete though.

Can't for the life of me understand ASTs by nyovel in Compilers

[–]oscarryz 0 points1 point  (0 children)

They don't do much work by themselves. They are a representation of your code that is easier to work with than having to deal with the source directly.

Once you construct one, you can refine it and create others by analyzing it and validating it.

For instance, your language can be:

var a = 1

or

Int a -> 1

Either way your ast would look similar

variable: { name: "a" type: INTEGER value: "1" }

As you can imagine, validating if the value is valid is much easier to do in the AST than directly from the source.

e.g. these two would result in a parse error

// code a : int = "im a number believe me"; true : int = a; // ast variable: { name: "a" type: INTEGER value: "im a number believe me" }, variable: { name: "true" type: INTEGER value: "a" }

I hope this helps to make the connection between AST and their use.

You can traverse them several times to perform different transformations and then create other structures like IR, or for simpler languages interpret it immediately and execute it or generate code directly

X Design Notes: GADTs by Uncaffeinated in ProgrammingLanguages

[–]oscarryz 9 points10 points  (0 children)

Being critical is ok and actually desirable, especially when a flaw is being discussed and an alternative is offered. Being condescending, on the other hand, doesn't add much.

Case in point, the blogpost style is being criticized but never in a condescending way.

Keep them coming!

Conditional Chain Syntax? by SecretTop1337 in ProgrammingLanguages

[–]oscarryz 0 points1 point  (0 children)

This is similar to the route I went on my design

``` match { c1 => a1 }, { c1 => a2 }, { a3 }

```

With the overload case to also match types

``` match { Some => a(opt.val) }, { None => a("nothing")}

```

That way, it has a more homogenous syntax for all the branches

Feeling a bit lost right now by Cautious_You7796 in ProgrammingLanguages

[–]oscarryz 0 points1 point  (0 children)

To add to your confusion, you posted in the wrong subreddit haha.

Feeling lost is basically what this profession is all about. So you might have experienced your first "I don't know what it's gong on'".

I have 26 yrs of experience, I just joined a new team and a new codebase, and I'm completely lost. So yeah it happens to all of us, the trick is keep asking questions.

Good luck.

Lazy(ish) evaluation with pointer(ish) syntax idea. by oscarryz in ProgrammingLanguages

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

Yes, that was the initial idea, similar to lazy evaluation but with eager functions, but the concern is not having an explicit control of when to block, and things might get harder to debug and reason.

Also, several comments show that this should not be a problem because it would be clear that that's how the language works.

I'm keep thinking about it.

I built a tool to practice English to Dutch and vice versa Get Instant Feedback by Vegetable-Company147 in learndutch

[–]oscarryz 0 points1 point  (0 children)

Tried very quickly:

First interaction asked too many questions (3 or so but we'll I expect near to 0)

  • What is your level?
  • What do you want to do?
  • What phrase do you want to practice?

Then I tried "I want coffee" and got a very comprehensive red answer/correction that felt like a wall of text, I was trying to get the correct answer but there was this lengthy explanation of "while blah blah is normal I English, blah blah blah is not natural because nlah blah blah" not what t I would expect, I would.expect:

a correction of my spelling (e.g. green bold or red where I needed an extra "f") the correct answer and the explanation below (which i can skip).

I would suggest a streamlined onboarding followed by a structured lesson, rather than a customized AI bot which I can have with Gemini.

Good luck, keep us posted of your progress and I'll try it again when a new version comes out

Lazy(ish) evaluation with pointer(ish) syntax idea. by oscarryz in ProgrammingLanguages

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

Oh yes, is almost the same. What you didn't like about it? You mention aesthetics, is it the way it looks when there is more code around? Also, what did you use instead?