xgeek116
Generating general AST syntax from Elixir app
I need to create an authorization system in Elixir, to do it I will generate a policy containing some permissions but in AST syntax and there will be many client consumers (in different languages JavaScript, Python, Elixir etc..) to verify that permissions (after transforming the ASTs to code).
So my question us, is there some generic AST syntax for all programming languages ? or a syntax per language ?
Marked As Solved
LostKobrakai
Languages often don’t share even more basic things like supported datatypes. AST of languages is made up of datatypes supported by each individual language. Therefore ASTs usually are not sharable.
E.g. elixir uses atoms extensively, which are a concept only available on the beam. There are some languages, which have similar datatypes to atoms, but there are also many, which don’t have anything comparable.
You’re probably better sharing data (e.g. json is commonly supported) + language specific code parsing/using that data, rather than trying to abstract through some AST.
Also Liked
benwilson512
There is not. Most languages have their own AST representations.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








