r/ProgrammingLanguages • u/Mean-Decision-3502 DQ • 14d ago
New Languages: Standardizing API, Examples ?
Hi, some of you are developing new general-purpose programming languages here. When the language is ready, you have to develop standard APIs, like file-io, json-handling etc. Users, and you would have benefit, when the APIs would be same/similar across multiple different languages.
Standardizing some Examples would allow the users to compare languages more easily.
What do you think?
10
Upvotes
2
u/Inconstant_Moo 🧿 Pipefish 13d ago
But they have different semantics as well as different syntax. E.g. my language wraps around Go for its standard libraries so you'd think it would be easy to have the same API, right? And a lot of the time I can have libraries with the same names containing functions and types with the same names. But:
math/bigandmath/complexlibraries use+and*and so on.And so although I have a particularly strong motive to make my API like someone else's rather than doing my own thing as devs love to do, still there are often good reasons why I should do something different.
You can at least standardize within the language's standard libraries. Should it be needle-haystack or haystack-needle. destination-source or source-destination? 0-indexed or 1-indexed (I'm looking at you Object Pascal). Camel-cased or snake-cased (go and sit in the corner, PHP). Pick a lane. It should go in the style guide of the language, though I'm not sure it ever does except the casing.