nirum-lang / nirum

Nirum: IDL compiler and RPC/distributed object framework for microservices
https://nirum.org/
GNU General Public License v3.0
121 stars 28 forks source link

Behind names for types make no sense #260

Open dahlia opened 6 years ago

dahlia commented 6 years ago

Unlike fields, tags, methods, and method parameters, type names don't play any role in transportation. Types have names, and "_type" hint field in serialization format, but they're only for human programmers. These "_type" hints are ignored when a program interprets a serialized value.

So the parser should disallow to add a behind name to type declarations.

Currently it even raises an error if two types have the same behind name (but two different facial names) for no reason:

record foo/dup (text x);
record bar/dup (text y);
examples/type-behind-name.nrm:4:1:
the behind type name `dup` is duplicated

^
dahlia commented 6 years ago

It might be better to remove "_type" field too?