Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Aiken Language #6991

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Add Aiken Language #6991

wants to merge 6 commits into from

Conversation

rvcas
Copy link

@rvcas rvcas commented Aug 12, 2024

supersedes #6520

Description

There was an attempt before to add this language but we decided that it's best to wait until the grammars stabilized. We have reached that point and a general availability release is imminent, so we felt it was appropriate to revisit this with a fresh pull request in favor of the one linked above.

It seems we have reached the appropriate thresholds and there are many repositories with Aiken source code. Untyped Plutus Core is the target lambda calculus that Aiken compiles to. The Aiken vscode extension packages a grammar for Untyped Plutus Core as well so it should already be included by including the Aiken grammar. Although Untyped Plutus Core isn't normally written by hand, it's highly human readable and seems to also be present in a substantial number of repositories. I've included Untyped Plutus Core within this pull request as a matter of convenience but if it's a no-go, then I can make the necessary adjustments.

Aiken is a fast growing smart contract programming language that targets the virtual machine inside of the Cardano network. It has become the de-facto standard for developing smart contracts on Cardano.

Checklist:

  • I am adding a new language.
    • The extension of the new language is used in hundreds of repositories on GitHub.com.
      • Search results for each extension:
    • I have included a real-world usage sample for all extensions added in this PR:
    • I have included a syntax highlighting grammar: https://github.com/aiken-lang/vscode-aiken
    • I have added a color
      • .ak
        • Hex value: #640ff8
        • Rationale: picker used to extract a color from a random position on the logo
      • .uplc
        • Hex value: #36adbd
        • Rationale: picker used to extract a color from the center of the logo
    • I have updated the heuristics to distinguish my language from others using the same extension.

@rvcas rvcas changed the title Add Aiken Language Latest Add Aiken Language Aug 12, 2024
@rvcas rvcas marked this pull request as ready for review August 12, 2024 21:22
@rvcas rvcas requested a review from a team as a code owner August 12, 2024 21:22
Copy link
Member

@lildude lildude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops. Looks like your editor has changed indentation on the languages.yml file making it incredibly hard to review. Please reverse these changes.

Several of your samples are too big too. If the diff suppresses them, they're too big. Please replace these.

@rvcas
Copy link
Author

rvcas commented Aug 13, 2024

@lildude oh whoops, sorry about that. Total accident. Will fix

@rvcas rvcas requested a review from lildude August 13, 2024 17:44
Copy link
Member

@lildude lildude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linguist only accepts TextMate compatible grammars. This is mentioned a little further down in the CONTRIBUTING.md file. You should have encountered an error when attempting to add the grammar using the script/add-grammar script which should have alerted you to there being problems with the grammar repo.

The lines in script/list-grammars are for grammars maintained directly in the highlighting engine completely independently of Linguist. Only GitHub staff know which grammars these are which is why this list exists.

There is currently no way to submit tree-sitter grammars.

Please replace the grammar with a TextMate-compatible grammar.

@lildude lildude changed the title Latest Add Aiken Language Add Aiken Language Aug 14, 2024
@rvcas
Copy link
Author

rvcas commented Aug 14, 2024

@lildude I have added text mate grammars from the VSCode extension. I simply also added a link to the tree-sitter one that we ALSO have cause I saw that list there. But the thing linked as a sub module is indeed a textmate grammar.

I can simply just remove the link from that list. It's not linked as a submodule.

@rvcas rvcas requested a review from lildude August 14, 2024 12:46
@KtorZ
Copy link

KtorZ commented Aug 15, 2024

Note: Aiken seems to be a quite popular name in some part of the world, and it's apparently also a file format for writing quizzes (!). For these reasons, I usually prefer the following query which is more strict for filtering out actual Aiken projects.

I went ahead and checked results found from Github to ensure we are above the 200 threshold mentioned in the CONTRIBUTING.md. I discarded repositories that were empty or had actually no Aiken (.ak) files in them, but were only mentioning Aiken.

See final list

The final list arrives just above the threshold at 212!


@lildude This PR is also adding support for the .uplc format which is commonly used around Aiken projects, but far less popular (in the sense that it is rarely committed and pushed on repositories, so likely much below the required threshold for popularity). Shall we split it out of this PR; and come back later once there's a higher need for it?

@lildude
Copy link
Member

lildude commented Aug 15, 2024

I went ahead and checked results found from Github to ensure we are above the 200 threshold mentioned in the CONTRIBUTING.md.

See #5756

This PR is also adding support for the .uplc format which is commonly used around Aiken projects, but far less popular (in the sense that it is rarely committed and pushed on repositories, so likely much below the required threshold for popularity). Shall we split it out of this PR; and come back later once there's a higher need for it?

If this is less likely to reach the usage requirements, then yes, remove it from this PR and add later when it does meet requirements.

@KtorZ
Copy link

KtorZ commented Aug 15, 2024

@lildude: See #5756

Ho! Didn't see that. So I take it that this is deemed not popular enough due to the lack of files per extension. I crunched the number through the GitHub search API, and I arrive at a grand total of 1605 files which seems indeed insufficient 😞. I suppose we'll have to encourage people to share a bit more of their code in open source.

See data
repository count
https://github.com/0eau/elude 5
https://github.com/ADAOcommunity/cardano-vesting-dApp 6
https://github.com/Achyut770/AikenSupplyChain 2
https://github.com/AdaSouls/Cardano-Soulbound 4
https://github.com/AgustinBadi/aiken-merkle-tree 1
https://github.com/Ali-Hill/blueprint-experiments 18
https://github.com/Anastasia-Labs/aiken-design-patterns 17
https://github.com/Anastasia-Labs/aiken-linked-list 6
https://github.com/Anastasia-Labs/aiken-merkle-tree 2
https://github.com/Anastasia-Labs/aiken-trie 5
https://github.com/AngeYobo/htlc-contract-aiken 1
https://github.com/Astodialo/unLearn 4
https://github.com/Banele78/hello-world-aiken 1
https://github.com/Cardano-Fans/acca 36
https://github.com/Charli3-Official/oracle-integration-aiken 1
https://github.com/Cornucopias/mint-contract 4
https://github.com/CryptoSnowPrince/aiken_hello_world 1
https://github.com/CryptoSnowPrince/aiken_vesting 1
https://github.com/Danogo2023/bond-dex 19
https://github.com/Danogo2023/bond-issue 28
https://github.com/Danogo2023/daken 39
https://github.com/Deadairx/aiken-hello-world 1
https://github.com/Eibbie/hello-world-aiken 1
https://github.com/ErickRomeroDev/aiken-example-node 1
https://github.com/EzePze/automatic-octo-palm-tree 2
https://github.com/FaizanShaikh-3033/Aiken 4
https://github.com/Halalend/protocol-analysis 5
https://github.com/HeptaSean/aiken-trivial 1
https://github.com/Jidooochan/aiken-hello-world 1
https://github.com/Jidooochan/aiken-vesting 1
https://github.com/KtorZ/aiken-fuzz 11
https://github.com/MeshJS/aiken-next-ts-template 1
https://github.com/MeshJS/mesh 13
https://github.com/MeshJS/mesh-pbl-student-library 1
https://github.com/Modulo-P/Cardano-Semaphore 21
https://github.com/Modulo-P/ak-128 1
https://github.com/Modulo-P/ak-381 1
https://github.com/Modulo-P/hydra-node-plutusv3 1
https://github.com/Modulo-P/zk-mastermind-aiken 4
https://github.com/MynthAI/cnt-burn 12
https://github.com/MynthAI/mint-chocolate-chip 1
https://github.com/MynthAI/myusd 7
https://github.com/NicholasMaselli/SimpleCardanoContract 5
https://github.com/NoumenaDigital/carbon-accounting 0
https://github.com/OpShin/pyaiken 0
https://github.com/OptimFinance/clean-code 16
https://github.com/PaimaStudios/paima-engine 11
https://github.com/PaimaStudios/projected-nft-whirlpool 1
https://github.com/Piefayth/aiken-blog-1-code 4
https://github.com/Piefayth/aiken-ide 0
https://github.com/Sebpereira33/CoffeeDAO 1
https://github.com/SilV-1951742/MP_aiken 2
https://github.com/SundaeSwap-finance/aicone 2
https://github.com/SundaeSwap-finance/checkpoint-demo 1
https://github.com/SundaeSwap-finance/cosponsor 1
https://github.com/SundaeSwap-finance/merkle-patricia-forustry 0
https://github.com/SundaeSwap-finance/mint-chocolate-chip 1
https://github.com/TienTung2501/Aiken-Document 0
https://github.com/TienTung2501/Aiken-Learn 4
https://github.com/TienTung2501/Aiken-MintNFT 1
https://github.com/Vortecsmaster/Aiken_Auction 2
https://github.com/Vortecsmaster/EA_AikenExamples 8
https://github.com/WinChitiphat/aiken-vesting 1
https://github.com/aadafinance/aada_v1_aiken 8
https://github.com/actions-marketplace-validations/aiken-lang_setup-aiken 0
https://github.com/adacapital/ak-hellow-world 1
https://github.com/adalicious/aiken-gift-card 1
https://github.com/adrian052/cardano-betting-system 4
https://github.com/adrian052/examples-aiken 6
https://github.com/aiken-extra/auxlib 4
https://github.com/aiken-extra/string_util 5
https://github.com/aiken-extra/time_util 11
https://github.com/aiken-extra/tx_util 1
https://github.com/aiken-lang/aiken 147
https://github.com/aiken-lang/aiken-mode 0
https://github.com/aiken-lang/aikup 0
https://github.com/aiken-lang/auplc 7
https://github.com/aiken-lang/awesome-aiken 0
https://github.com/aiken-lang/branding 0
https://github.com/aiken-lang/editor-integration-nvim 0
https://github.com/aiken-lang/fuzz 2
https://github.com/aiken-lang/homebrew-tap 0
https://github.com/aiken-lang/marlowe 2
https://github.com/aiken-lang/merkle-patricia-forestry 6
https://github.com/aiken-lang/play 0
https://github.com/aiken-lang/prelude 2
https://github.com/aiken-lang/setup-aiken 0
https://github.com/aiken-lang/site 0
https://github.com/aiken-lang/stdlib 17
https://github.com/aiken-lang/tree-sitter-aiken 0
https://github.com/aiken-lang/trees 2
https://github.com/aiken-lang/vscode-aiken 0
https://github.com/aiken-lang/zed-aiken 0
https://github.com/aleksey-makarov/aiken-auction 1
https://github.com/anhoangphuc/aiken_lang-gift_card 1
https://github.com/antibody-cardano/singly-satisfiable 4
https://github.com/ariady-putra/lock_unlock 0
https://github.com/ariady-putra/morbid 7
https://github.com/ariady-putra/more_aiken_examples 9
https://github.com/ariady-putra/stakable_aiken 5
https://github.com/ariady-putra/world 12
https://github.com/ava-orange-education/Ultimate-Cardano-Smart-Contracts 8
https://github.com/bWorksApp/aiken-hello-world 1
https://github.com/bWorksApp/paas-aiken-contracts 120
https://github.com/bloxbean/aiken-java-binding 0
https://github.com/bloxbean/aiken-jna-wrapper 0
https://github.com/bmoore117/aiken-dates 1
https://github.com/bsovdat/aiken-smart-contracts 19
https://github.com/buixuandinh711/aiken-to-lucid 0
https://github.com/buixuandinh711/cardano_counter 1
https://github.com/cardano-foundation/aiken-lucid-yaci-dev-kit-starter-kit 1
https://github.com/cardano-foundation/cardano-ibc-incubator 142
https://github.com/cardano-foundation/cf-cardano-ballot 1
https://github.com/cardano-foundation/merkle-tree-java 2
https://github.com/cardano-miners/fortuna 15
https://github.com/cardano-scaling/aiken-doom 8
https://github.com/carlos53093/Aiken_NFT 1
https://github.com/cdev-meetup/hello_aiken 3
https://github.com/coinecta/staking-contracts 7
https://github.com/deltadefi-protocol/hft-aiken-prototype 28
https://github.com/encryptedcoins/encoins-core-aiken 3
https://github.com/ernest404/hello-world-aiken 1
https://github.com/fabianbormann/aiken-payment-splitter 1
https://github.com/fallen-icarus/cardano-aftermarket 7
https://github.com/fallen-icarus/cardano-loans 13
https://github.com/fallen-icarus/cardano-swaps 8
https://github.com/free-honey/naumachia 9
https://github.com/gclaramunt/AikenExploration 1
https://github.com/gimbalabs/ppbl-2024-aiken-examples 6
https://github.com/golddydev/aiken-gift-card 1
https://github.com/golddydev/aiken-tutorial 2
https://github.com/hammadzubair/Auction-dApp 2
https://github.com/hammadzubair/Cardano-Aiken 2
https://github.com/ilap/bls 6
https://github.com/independenceee/aiken-tutorial 15
https://github.com/independenceee/cip68 0
https://github.com/independenceee/demarket 4
https://github.com/iog-edu-argentina-2024/cardano-dev-2024 28
https://github.com/jackchuong/test-smart-contract-aiken 0
https://github.com/jpg-store/contracts-v3 4
https://github.com/kayvank/rust-aiken-flake 0
https://github.com/ken-underscore/cardano_loans_aiken 1
https://github.com/keyan-m/cardano-recorded-mint 1
https://github.com/krszktc/aiken 1
https://github.com/lenfiLabs/lenfi-smart-contracts 22
https://github.com/levietcuong2602/aiken-tutorials 1
https://github.com/linconvidal/vesting_pycardano 1
https://github.com/logicalmechanism/aiken-order-book 16
https://github.com/logicalmechanism/assist 22
https://github.com/logicalmechanism/bundle-sale 13
https://github.com/logicalmechanism/distributed_representation 9
https://github.com/logicalmechanism/tx_simulation 5
https://github.com/mach-diamond/token-metadata-validator 10
https://github.com/marlowe-contrib/marlowe-oracle-service 12
https://github.com/mathiramilo/aiken-hello-world-lucid 1
https://github.com/micahkendall/distributed-set 4
https://github.com/micdurodola/aiken-cardano-typescript 1
https://github.com/ngocht-ibl/aiken-hello-world 1
https://github.com/ngocht-ibl/aiken-vesting 1
https://github.com/nhatcaoo/aiken-learn 1
https://github.com/nikhils9/aiken-mesh-examples 3
https://github.com/nikhils9/cip68-nfts 4
https://github.com/nikhils9/rewards-distribution 2
https://github.com/not-known-person/Aiken-Scripts 1
https://github.com/orcfax/orcfax-aiken 6
https://github.com/perturbing/mod-exp-bench 0
https://github.com/pgrange/aiken_backtrace 1
https://github.com/projectNEWM/contracts 16
https://github.com/projectNEWM/newm-aipoph 19
https://github.com/projectNEWM/newm-minter 9
https://github.com/realdecimalist/aiken-contracts 3
https://github.com/reeshavacharya/multisig-aiken 8
https://github.com/renanvalentin/cardano-gift-card 2
https://github.com/rhystmorgan/mesh 1
https://github.com/rhystmorgan/okapi-aiken 20
https://github.com/rhystmorgan/raiders-contracts 2
https://github.com/rober-m/ppp-contracts-in-aiken 13
https://github.com/scarmuega/aiken-cli-hello-world 1
https://github.com/scisamir/aiken-lang 1
https://github.com/sergi10/aiken-argentina-2024 1
https://github.com/sidan-lab/aiken-content-ownership 24
https://github.com/sidan-lab/aiken-example 2
https://github.com/sidan-lab/aiken-game-account 19
https://github.com/sidan-lab/aiken-pbl-hk-student-examples 27
https://github.com/sidan-lab/aiken-poker-game 1
https://github.com/sidan-lab/mesh-lower-level-api-demo 2
https://github.com/sidan-lab/vodka 33
https://github.com/sma11world/DomSwap 3
https://github.com/solidsnakedev/aiken-template 0
https://github.com/sonson0910/Aiken-Tutorial 27
https://github.com/sonson0910/Demarket-Contract 4
https://github.com/spacebudz/nebula 7
https://github.com/spacebudz/tokens 17
https://github.com/strike-finance/options-smart-contracts 3
https://github.com/surajsingla333/mynth-assignment 1
https://github.com/t0anh/aiken-stringify 3
https://github.com/thuannguyen2010/aiken-debug 2
https://github.com/trwa/cardamove 33
https://github.com/vacuumlabs/cardano-ctf 31
https://github.com/waalge/aiken-bench-comp 6
https://github.com/waalge/aiken-fail-example 8
https://github.com/waalge/aiken-play 0
https://github.com/waalge/aiken-test-params 4
https://github.com/waalge/aiken-tests 4
https://github.com/waalge/hello-aiken 1
https://github.com/waalge/plutus-data 1
https://github.com/wattsmainsanglais/hello-world 1
https://github.com/wisconic/learning-aiken 2
https://github.com/wowica/jungle_vault 3
https://github.com/zenGate-Global/winter-cardano-contracts 4
https://github.com/zing-rsa/aiken-playground 7
--- ---
total 1605

@lildude: If this is less likely to reach the usage requirements, then yes, remove it from this PR and add later when it does meet requirements.

It is indeed. The .uplc is a compilation target which turns out to be a typed lambda calculus for which there's a textual syntax. But given that it really is a compilation target, it's not meant to be written by humans. Let's revisit this addition to later @rvcas to not needlessly block the PR for Aiken.

@rvcas
Copy link
Author

rvcas commented Aug 15, 2024

No problem. Let's wait and see. We're pretty close for both I believe. It'll be time soon. I'll keep this in sync with master in the meantime.

@lildude lildude dismissed their stale review August 29, 2024 14:10

Changes applied. Pending popularity now.

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

Successfully merging this pull request may close these issues.

4 participants