[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip / qa] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: Java_vs_Kotlin-1200x995.png (142 KB, 1200x995)
142 KB
142 KB PNG
Why are language wrappers not more common?
>>
>>101545415
money.
>>
>>101545415
Wrappers make sense for most common purposes, but the base language is always going to be at least slightly ahead in terms of features and documentation.
Programming can also get confusing if you have to include non-wrapped dependencies and all of the APIs are documented with different syntax.
I don't think wrappers are necessarily worse, and actually use them when it makes sense.
>>
>>101545537
>but the base language is always going to be at least slightly ahead in terms of features and documentation.
True, but in practice those cutting edge features aren't utilized at all.
>>
Because it's yet another standard and injrcts another complexity layer to the build process.
>>
>>101545501
>money.
You are correct I think.

There are very few companies willing to spend years of coder time on developing new and novel languages.
>>
>language wrapper
you wouldn't need that if you had proper macro system
>>
Cause they are either slow or a pain to debug. This is because the wrapper will generate code for the language you are building on top of. This means you cannot debug in the language you are programming. If they bothered to write validation into the wrapper then the wrapper will be slower because you now have added 2 extra steps to get to compilation.
>Kotlin
Kotlin isn't really a wrapper language. Kotlin produces java byte code not Java itself. It just uses the JVM. Vala would be a better example of a wrapper language.
>>
>>101545415
these two are in fact not equivalent because the kotlin example uses val which makes the property name not reassignable, while the java code has a setName method
>>
>>101545597
>aren't utilized at all.
Says you
>>
>>101545415
It's not like I'm typing that out either way if I'm writing Java. Boilerplate templates will get autofilled for you by any halfway decent IDE and you don't have to carry any extra dependency
>>
Your pic is very outdated. Java has had var for ages. Record is getting widespread too. Sadly record is very lackluster but at least lombok still works for data classes when need one.
>>
>>101546833
If you are going to express your opinion in English, please learn the basics of the language, Pajeet.
>>
They are more common. They are just called meta programming, and exist within the same language. In other words, what >>101545775 wrote, which was the only correct answer you got.
>>
>>101546833
records are not data classes
>>
>>101545415
Records have been introduced in earlier Java versions, if you must stick to an older version you can use the Lombok plugin which you let add the @Data annotation then all fields will be final, have getters, a constructor, etc...
>>101547694
retard
>>
>>101547730
records don't have setters, idiot
>>
File: 2024-07-24_12-38.png (56 KB, 912x549)
56 KB
56 KB PNG
>>101545415
>Why are language wrappers not more common?
because they are only useful for a short time until the sane language catches up, keeping only the good parts
>>
why do people use getters and setters
>>
>>101545415
What i want is a c++ wrapper lang that takes all that retarded ::<-> stupid forward declarations and the rest of the verbose bullshit and gets rid of it for a clean, simple D-like syntax, add tuples, discriminated unions, and dynamic typing at the syntax level.
That would be the perfect lang. Like what vala does for glib
>>
>>101549331
OOP principles
>>
>>101545415
Retarded image to bait illiterate ni/g/gers. You could just as well use records in Java and get the same result.
public record Person (String name) {}
>>
>>101549331
You are supposed to hide state in OOP but it's useless if every field has a getter and setter. The c++ way is better, just make a POD a struct with all public members.
>>
>>101545415
>poo joo



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.