-
Notifications
You must be signed in to change notification settings - Fork 301
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
Lua spike (placeholder) #3290
base: main
Are you sure you want to change the base?
Lua spike (placeholder) #3290
Conversation
My end goal would be semi-human readable lua. Here's the style I'm aiming for for classes. -- example object
Account = {balance = 0}
function Account:new (o)
o = o or {}
setmetatable(o, self)
self.__index = self
return o
end
function Account:deposit (v)
self.balance = self.balance + v
end
function Account:withdraw (v)
if v > self.balance then error"insufficient funds" end
self.balance = sel |
Need to merge and update. Then add objects |
Personal life got a bit busy for a minute there, things have calmed down I'll put some effort in tonight. It would be really fun if we could mod games like noita (my fav) or others with F#. |
type Expr = | ||
| Ident of LuaIdentity | ||
| Const of Const | ||
| Unary of UnaryOp * Expr |
Check notice
Code scanning / Ionide.Analyzers.Cli
Verifies each field in a union case is named. Note
type Expr = | ||
| Ident of LuaIdentity | ||
| Const of Const | ||
| Unary of UnaryOp * Expr |
Check notice
Code scanning / Ionide.Analyzers.Cli
Verifies each field in a union case is named. Note
| Ident of LuaIdentity | ||
| Const of Const | ||
| Unary of UnaryOp * Expr | ||
| Binary of BinaryOp * Expr * Expr |
Check notice
Code scanning / Ionide.Analyzers.Cli
Verifies each field in a union case is named. Note
| Ident of LuaIdentity | ||
| Const of Const | ||
| Unary of UnaryOp * Expr | ||
| Binary of BinaryOp * Expr * Expr |
Check notice
Code scanning / Ionide.Analyzers.Cli
Verifies each field in a union case is named. Note
| Ident of LuaIdentity | ||
| Const of Const | ||
| Unary of UnaryOp * Expr | ||
| Binary of BinaryOp * Expr * Expr |
Check notice
Code scanning / Ionide.Analyzers.Cli
Verifies each field in a union case is named. Note
| Return of Expr | ||
| Do of Expr | ||
| SNoOp | ||
| ForLoop of string * start: Expr * limit: Expr * body: Statement list |
Check notice
Code scanning / Ionide.Analyzers.Cli
Verifies each field in a union case is named. Note
| Fable.StringConstant(s) -> Const(ConstString s) | ||
| Fable.BoolConstant(b) -> Const(ConstBool b) | ||
| Fable.UnitConstant -> Const(ConstNull) | ||
| Fable.CharConstant(c: char) -> Const(ConstString(string c)) |
Check warning
Code scanning / Ionide.Analyzers.Cli
Checks if the `string` function call is type annotated. Warning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be a bug in IonideAnalyzers because I can't think of a different way to annotate it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nojaf Any idea what is reported here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I can't believe I missed that in retrospect.
let transformOp = transformOp com | ||
|
||
match expr with | ||
| Fable.IdentExpr i when i.Name = "" -> Unknown "ident" |
Check warning
Code scanning / Ionide.Analyzers.Cli
Verifies testing for an empty string is done efficiently. Warning
next TODO is making type parameters either go away or do something useful |
I didn't even realize this while working on it but this would be actually quite nice for neovim scripting.... |
It could indeed, only "problem" I see is that from my POV Vim people are often focused on performance. So perhaps, they will not like having a dependency like |
I do think a lot of F# I'd write for neovim probably would translate to relatively straightforward lua, and I might be able to trim the library to parts that are being used after compiling. |
This is @alexswan10k 's work, though they have decided to prioritize rust, I'd like to keep this PR #2509 available so that work may continue on it, and people interested can contribute to it. I personally would love to contribute, and have played with it some but haven't yet made meaningful contribution. I wasn't able to find the branch @alfonsogarciacaro was referencing in the pr so I just used main as a placeholder for now.