[ 
https://issues.apache.org/jira/browse/THRIFT-5587?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17617194#comment-17617194
 ] 

Yuxuan Wang commented on THRIFT-5587:
-------------------------------------

Actually there's option 3, which might be the easiest to implement and good 
enough:

3. the compiler should validate the uuid string literal is in the 8-4-4-4-12 
canonical form (via regular expression or something else), so that even though 
the language code still _might_ cause runtime exceptions, they _should not_ in 
reality in compiler generated code as long as they correctly supported 
canonical form parsing.

> Introduce uuid as additional builtin type
> -----------------------------------------
>
>                 Key: THRIFT-5587
>                 URL: https://issues.apache.org/jira/browse/THRIFT-5587
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Compiler (General)
>            Reporter: Jens Geyer
>            Assignee: Jens Geyer
>            Priority: Major
>             Fix For: 0.18.0
>
>          Time Spent: 2h 10m
>  Remaining Estimate: 0h
>
> I hereby propose to add *{{uuid}}* as an additional built-in basic type.
> *Rationale:*
>  * Uuids (or Guids) are a state of the art and well-understood way to 
> identitify data entities.
>  * There is support in next to all languages' runtimes to generate, convert 
> and store such data.
>  * Although conversion to and from string or binary is certainly possible, it 
> is also rather cumbersome.
>  * A distinct datatype enables us to sent it in the most suitable way across 
> the wire: JSON=text, Compact=binary
> *Remarks*
>  * -I am open to discuss the term "guid" vs "uuid". Coming from NET platforms 
> I would tend to guid, but I am open to uuid (or even both) as well. That's 
> just a detail.-
>  * If no significant concern is raised, I would move on and implement C#, 
> Delphi and Haxe bindings (as sub-tasks) myself and leave the rest to the 
> community.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to