Skip to content

Consider shortening the output #95

@ekrich

Description

@ekrich
Member

Currently in hand generated code there are tricks to make the code shorter and cleaner such as use of imports. A good example is the following:
https://github.com/scala-native/scala-native/blob/master/nativelib/src/main/scala/scala/scalanative/posix/dirent.scala

The keys points are the imports that eliminate the native. and Nat. prefixes. Also, in hand generated code the struct is just named dirent.

Activity

jonas

jonas commented on Jul 3, 2018

@jonas
Member

Related with #32

The generated code is longer and more explicit by design to avoid having to keep track of whether declarations in the generated code shadows a declaration being imported.

ekrich

ekrich commented on Jul 3, 2018

@ekrich
MemberAuthor

It seems that you have already covered this issue. I hoped the native.XXX could be shortened to XXX. Also, there is an issue in Scala Native related. scala-native/scala-native#1197

kornilova203

kornilova203 commented on Jul 3, 2018

@kornilova203
Member

I think that it is a good idea.
Shorter code may be a default option since names in native and Nat are not common in C, but there also might be an option to generate code with all prefixes.
It will just take some time to make sure that bindgen always generates valid code.

jonas

jonas commented on Jul 3, 2018

@jonas
Member

Okay, let's keep it open, but I think we should give it pretty low priority for now since there are a lot of more important things to address.

ekrich

ekrich commented on Aug 7, 2018

@ekrich
MemberAuthor

I found another thing that might help. When functions are generated they are given parameter names as anonymous0, anonymous1, ... anonymousn. This could probably be p0, p1, ... pn for params.

kornilova203

kornilova203 commented on Aug 8, 2018

@kornilova203
Member

I agree, I also do not like anonymous...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bindgenBinding generator

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @jonas@ekrich@kornilova203

        Issue actions

          Consider shortening the output · Issue #95 · scala-native/scala-native-bindgen