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

Lua spike (placeholder) #3290

Open
wants to merge 49 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
e879143
checkpoint
alexswan10k Aug 21, 2021
236131f
Using babel ast
alexswan10k Aug 21, 2021
ab0bdd2
checkpoint
alexswan10k Aug 23, 2021
5b336c9
basic stuff working
alexswan10k Aug 24, 2021
915bb97
Records
alexswan10k Aug 25, 2021
3874c07
Anon records
alexswan10k Aug 25, 2021
4b3b0ba
ternary
alexswan10k Aug 25, 2021
e79bab0
unions
alexswan10k Aug 25, 2021
aea3275
checkpoint
alexswan10k Aug 26, 2021
45522da
Add lib path
alexswan10k Aug 27, 2021
6a794d4
cleanup
alexswan10k Aug 27, 2021
686e62f
Structural equality
alexswan10k Aug 28, 2021
20cf879
Some/none and match unions
alexswan10k Aug 28, 2021
d82be52
progress
alexswan10k Aug 31, 2021
b7d3052
imports
alexswan10k Sep 3, 2021
c1909c0
Merge branch 'beyond' into lua-spike
alexswan10k Sep 6, 2021
7048aac
ProjectCracker default path added
alexswan10k Sep 6, 2021
1fae7d5
Equality operators
alexswan10k Sep 6, 2021
25750e0
Implement while loop
alexswan10k Sep 6, 2021
8d5301c
ex control flow (excluding ex pattern matching)
alexswan10k Sep 6, 2021
9d7e875
Migrate to lua 5.2. Util generated from ts
alexswan10k Sep 10, 2021
b9a1833
progress
alexswan10k Sep 10, 2021
2c849c5
Merge branch 'main' into lua-spike
voronoipotato Dec 8, 2022
0926983
tidying
voronoipotato Dec 8, 2022
f873b04
updated package-lock to align with main
voronoipotato Dec 8, 2022
e50fa35
updated launch.json to use .net 6
voronoipotato Dec 8, 2022
9a14ff4
lua spike, getting there
voronoipotato Dec 8, 2022
c7f2313
only warnings now
voronoipotato Dec 8, 2022
6c0e120
build succeeds compiling lua fails
voronoipotato Dec 8, 2022
1738ac7
no more warnings
voronoipotato Dec 8, 2022
568dd26
might delete later, but it builds well
voronoipotato Dec 8, 2022
a22eec3
Merge branch 'main' into lua-spike
voronoipotato Dec 9, 2022
340bf63
objects, initial attempt
voronoipotato Dec 9, 2022
749c8e1
Merge branch 'fable-compiler:main' into lua-spike
voronoipotato Dec 30, 2022
15bef01
Merge branch 'main' into lua-spike
voronoipotato Apr 1, 2023
1ae6c2e
merged develop into lua-spike
voronoipotato Jun 4, 2023
5a3ce75
fixing signature for lua
voronoipotato Jun 4, 2023
844d3d5
:Merge branch 'main' into lua-spike
voronoipotato Aug 7, 2023
2a2385e
Need to rewrite class definitions in terms of lua objects
voronoipotato Aug 7, 2023
47e96f0
merging
voronoipotato Jun 4, 2024
2b6714f
minor merging things
voronoipotato Jun 4, 2024
a43aa91
fixing small errors
voronoipotato Jun 5, 2024
d3ae15a
fixed formatting
voronoipotato Jun 5, 2024
a951493
fixed some ionide analyzer warns
voronoipotato Jun 5, 2024
057518b
updated build project to include lua
voronoipotato Jun 5, 2024
704c928
added reminder to fix quicktest
voronoipotato Jun 5, 2024
a52c1c4
tidying making it more similar to Fable.Expr, ensuring completeness
voronoipotato Jun 7, 2024
673fa7c
didn't need to emit unknown for macros
voronoipotato Jun 7, 2024
e07d3d1
making a few more things work
voronoipotato Jun 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,17 @@
"cwd": "${workspaceRoot}/../fable-test",
"stopAtEntry": false,
"console": "internalConsole"
},
{
"name": "BuildLuaTest",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/Fable.Cli/bin/Debug/net6.0/fable.dll",
"args": ["watch", "--cwd", "tests/Lua", "--exclude", "Fable.Core", "--outDir", "build/tests/Lua", "--lang", "Lua", "--fableLib", "build/tests/Lua/fable-lib"],
"cwd": "${workspaceFolder}",
"stopAtEntry": true,
"console": "internalConsole"
}
]
}
55 changes: 54 additions & 1 deletion build_old.fsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#load "src/Fable.PublishUtils/PublishUtils.fs"

//This is old, please use build project via build.cmd or build.sh
open System
open System.Text.RegularExpressions
open PublishUtils
Expand Down Expand Up @@ -282,6 +282,33 @@ let buildLibraryPy () =

removeDirRecursive (buildDirPy </> "fable_library/fable-library")

let buildLibraryLua () =
let libraryDir = "src/fable-library-lua"
let projectDir = libraryDir + "/fable"
let buildDirLua = "build/fable-library-lua"

cleanDirs [ buildDirLua ]

runFableWithArgs
projectDir
[
"--outDir " + buildDirLua </> "fable"
"--fableLib " + buildDirLua </> "fable"
"--lang Lua"
"--exclude Fable.Core"
"--define FABLE_LIBRARY"
]
// Copy *.lua from projectDir to buildDir
copyDirRecursive libraryDir buildDirLua

runInDir buildDirLua ("lua -v")
//runInDir buildDirLua ("lua ./setup.lua develop")
let buildLuaLibraryIfNotExists () =
let baseDir = __SOURCE_DIRECTORY__

if not (pathExists (baseDir </> "build/fable-library-lua")) then
buildLibraryLua ()

let buildLibraryPyIfNotExists () =
let baseDir = __SOURCE_DIRECTORY__

Expand Down Expand Up @@ -658,6 +685,29 @@ let testPython () =
// Testing in Windows
// runInDir buildDir "python -m pytest -x"

let testLua () =
buildLuaLibraryIfNotExists () // NOTE: fable-library-py needs to be built separately.

let projectDir = "tests/Lua"
let buildDir = "build/tests/Lua"

cleanDirs [ buildDir ]
copyDirRecursive ("build" </> "fable-library-lua" </> "fable") (buildDir </> "fable-lib")
runInDir projectDir "dotnet test"

runFableWithArgs
projectDir
[
"--outDir " + buildDir
"--exclude Fable.Core"
"--lang Lua"
"--fableLib " + buildDir </> "fable-lib" //("fable-library-lua" </> "fable") //cannot use relative paths in lua. Copy to subfolder?
]

copyFile (projectDir </> "luaunit.lua") (buildDir </> "luaunit.lua")
copyFile (projectDir </> "runtests.lua") (buildDir </> "runtests.lua")
runInDir buildDir "lua runtests.lua"

type RustTestMode =
| NoStd
| Default
Expand Down Expand Up @@ -970,6 +1020,8 @@ match BUILD_ARGS_LOWER with
| "test-rust-threaded" :: _ -> testRust Threaded
| "test-dart" :: _ -> testDart (false)
| "watch-test-dart" :: _ -> testDart (true)
| "test-lua" :: _ -> testLua ()


| "quicktest" :: _ ->
buildLibraryTsIfNotExists ()
Expand Down Expand Up @@ -1028,6 +1080,7 @@ match BUILD_ARGS_LOWER with
| ("fable-library-dart" | "library-dart") :: _ ->
let clean = hasFlag "--no-clean" |> not
buildLibraryDart (clean)
| ("fable-library-lua" | "library-lua") :: _ -> buildLibraryLua ()

| ("fable-compiler-js" | "compiler-js") :: _ ->
let minify = hasFlag "--no-minify" |> not
Expand Down
Loading
Loading