36 ms·
Why create a new language, rather than use an established programming language like Go where you can actually write an implementation too?
by Splizard 2y ago
Why create a new language, rather than use an established programming language like Go where you can actually write an implementation too?
- seivan 2y ago[dead]
- skybrian 2y agoSchemas that support multiple languages are useful when you actually use more than one language. This is more common in large organizations and between organizations. But it might also happen if you have code on multiple platforms, for example for mobile apps.
- bterlson 2y agoMoreover, compiling an IDL to N languages is substantially easier than compiling implementation code across N languages, especially when generating idiomatic code is a requirement. A language purpose-built for this task is going to produce better results while having substantially lower complexity. (My $0.02 as someone who works on TypeSpec)
- jimbobimbo 2y agoSorry, could you elaborate? If I'm creating an API using, say, ASP.NET Core or Go, I can generate OpenAPI spec out of actual implementation. How this "IDL" fits into the workflow? Is this another output in addition to OpenAPI spec?
- BillyTheKing 2y agoIn my (limited) experience so far with TypeSpec - it really shines in an API first approach, so you define your API before you implement it, but not so much the other way around.
- bterlson 2y agoTypeSpec is designed primarily as an API first tool as opposed to being an output. In the context of ASP.NET and HTTP/REST APIs, our goal is that you can write your spec and generate much of the service implementation and clients. From this same source of truth you could also emit clients or service implementations in other API definition formats like OpenAPI, schemas like JSON Schema, and other things besides.
- seanmcdirmid 2y agoI would have expected a bit more than type specifications, maybe some behavior specifications also? Something like Daan’s type states. But I get why we are still splitting hairs over data types.
- waern 2y agoI've been working on an API spec language where state changes can be modeled with linear logic: https://apilog.net/docs/why/ https://apilog.net/docs/why/ It doesn't have "schemas" yet though. Which may seem odd given they are a crucial part of this type of languages. :-) But it is because I am experimenting with different designs on that front.
- neonsunset 2y agoBecause Go is a bad language, and imposing the requirement to use it on the teams is absurd.