Code Monkey home page Code Monkey logo

Comments (5)

brendanzab avatar brendanzab commented on May 20, 2024 1

One weird idea:

foo : {| x : Int, y : String |}
foo = (| x = 1, y = "hello" |)

from pikelet.

brendanzab avatar brendanzab commented on May 20, 2024

Reposting some comments from Gitter:

@aatxe https://gitter.im/pikelet-lang/Lobby?at=5af303ad00dc488804a8994d

I'm inclined to say the second option [sig/struct] then since I think my preference is something like "no keywords > lowercase single word keywords > anything else"

@brendanzab https://gitter.im/pikelet-lang/Lobby?at=5afad494e0b50c2d05c3612f

One annoying thing about sig/struct is that they are really different in length. Looks kinda icky.
Also I find record to be a prettier word

@evincarofautumn https://gitter.im/pikelet-lang/Lobby?at=5afb2d7ef04ce53632dd1ad3

This is a hard one because it’s kind of an abstract distinction in English—what something is (thing/existence) versus what it is (type/attributes). Difference between “I am Jon” and “I am a human”.

record { .. } : record of { .. }
rec { .. } : rectype { .. }
data { .. } : datatype { .. }
{ .. } : {| .. |}
{| .. |} : { .. }
{ .. } : type { .. }

For the last one, type could put the parser in “type mode” to disambiguate. (In Kitten I was careful to make sure that it’s always clear whether you’re parsing a term or a type, so I can have overlapping grammars without ambiguity.)

from pikelet.

canndrew avatar canndrew commented on May 20, 2024

I don't really like the record syntax. It will make it extremely ugly to write nested records. Would it be better to use a different syntax for implicit args instead? Maybe you could use a sigil like

id: ?(a: Type) -> (x: a) -> a
id: '(a: Type) -> (x: a) -> a

(Sorry if this was already discussed on gitter. Also, this looks like a really cool project 👍 💯.)

from pikelet.

brendanzab avatar brendanzab commented on May 20, 2024

Yeah, no worries!

It will make it extremely ugly to write nested records.

I agree too fwiw. A different sigil for implicit args could definitely be a solution. 🤔

from pikelet.

brendanzab avatar brendanzab commented on May 20, 2024

(Sorry if this was already discussed on gitter. Also, this looks like a really cool project 👍 💯.)

Don't worry about repeating stuff from Gitter. I try to make sure stuff eventually ends up on Github in a less ephemeral form, so appreciate the chatting and discussions on here! I realise that it's sometimes easier for people to dip in and out of the issues at their leisure rather than keeping up to date with the chat. Also, I appreciate the compliments, it means a lot!

from pikelet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.