├── logo
├── Julia-Embedded-logo.png
└── Julia-Embedded-logo-small.png
├── LICENSE
└── README.md
/logo/Julia-Embedded-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Julia-Embedded/Julia-Embedded-Master/HEAD/logo/Julia-Embedded-logo.png
--------------------------------------------------------------------------------
/logo/Julia-Embedded-logo-small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Julia-Embedded/Julia-Embedded-Master/HEAD/logo/Julia-Embedded-logo-small.png
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Julia-Embedded
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Julia-Embedded-Master
2 |
3 |
4 |
5 |
6 |
7 | An organization for bringing Julia to embedded processors.
8 |
9 | # Goals
10 | * Building executable
11 | * Making lib/dll libraries.
12 | * A lot of the drivers and libraries are written in C, so we also can try embedding Julia in an already written C code (like writing the main computational function in Julia).
13 | * Building on desktop (Windows, etc) for ARM.
14 |
15 | # Background
16 | Julia is a high-level language with convenient interfaces for libraries in other languages (e.g. C, C++, etc), and also it is possible to embed Julia in an already written project.
17 |
18 | # Motivation
19 | We were interested to try to build and try some programs using Julia for embedded processors. Also, make some examples for others to use as templates for embedded programming in different situations.
20 | As Julia 1.2 added 32bit binaries we decided to start this work:
21 | * all of the ARM Cortex-M processors (https://en.wikipedia.org/wiki/ARM_Cortex-M) which are highly used in many embedded applications are 32 bit.
22 | * all of the ARM Cortex-R processors (https://en.wikipedia.org/wiki/ARM_Cortex-R) for mission-critical applications are 32 bit.
23 | * a lot of ARM Cortex-A processors are 32 bit (https://en.wikipedia.org/wiki/ARM_Cortex-A).
24 | However, this work will be useful for any embedded system.
25 |
26 |
27 | # Discourse Forum
28 | https://discourse.julialang.org/t/bring-julia-code-to-embedded-hardware-arm/19979/27
29 |
30 | # Notes on Cross-compiling and static compilation
31 |
32 | Here are some miscellaneous notes on cross-compiling and static compilation in Julia:
33 |
34 | * *CUDAnative* -- [CUDAnative](https://github.com/JuliaGPU/CUDAnative.jl) is the state of the art for cross-compiling to a limited platform. It uses [LLVM.jl](https://github.com/maleadt/LLVM.jl) to help generate appropriate LLVM code. I've copied the approach for [WebAssembly](https://github.com/tshort/ExportWebAssembly.jl) (still very limited or nonworking). This approach is also being used for [AMD GPU's](https://github.com/JuliaGPU/AMDGPUnative.jl). This approach works great, but compatible Julia code is very limited. There has been the talk of separating out the codegen portions of CUDAnative into a separate package, but it hasn't happened, yet.
35 |
36 | * *PackageCompiler / tree shaking* -- The approach to static compilation that runs the most code is probably with something like [PackageCompiler](https://github.com/JuliaLang/PackageCompiler.jl). [Tree shaking](https://en.wikipedia.org/wiki/Tree_shaking) is a way to reduce the size of the compiled system image. See [this](https://github.com/JuliaLang/julia/pull/32273#issuecomment-503628124) for more information. The main hurdles with this approach are that tree-shaking doesn't exist, and it's not set up for cross-compilation.
37 |
38 | * *Codegen advances* -- Jameson is working on changes to allow the CUDAnative approach to compile more code: https://github.com/JuliaLang/julia/pull/25984.
39 |
40 | * *LLVM support* -- Julia's version of LLVM doesn't include targets of interest for embedded applications.(https://github.com/maleadt/LLVM.jl)
41 |
42 | * *libjulia* -- If used, `libjulia` will need to be cross-compiled. Another option is to write a more minimal version of `libjulia` (hopefully in Julia), and swap out the `ccall`s to `libjulia` functions as needed.
43 |
44 | * *ccalls and cglobal* -- When Julia compiles code CUDAnative style, `ccall` and `cglobal` references get compiled to a direct pointer. These need to be converted to symbol references for later linking. Prototype described [here](https://github.com/tshort/ExportWebAssembly.jl/issues/13).
45 |
46 | * *Global variables* -- A lot of code gets compiled with global variables, and these get compiled to a direct pointer. One way to handle this is with a serialize/deserialize approach. Prototype described [here](https://github.com/tshort/ExportWebAssembly.jl/issues/13).
47 |
48 | * *Initialization* -- If `libjulia` is used, some init code needs to be run to set up GC and other things. It's not clear how to do that from outside. May need PR's to base Julia to help here.
49 |
50 | # Related C/C++ packages:
51 | https://github.com/JuliaInterop/Clang.jl
52 |
53 | https://github.com/JuliaInterop/CEnum.jl
54 |
55 | https://github.com/JuliaInterop/CxxWrap.jl
56 |
57 | https://github.com/JuliaInterop/libcxxwrap-julia
58 |
59 | https://github.com/JuliaInterop/Cxx.jl
60 |
61 | https://github.com/JuliaComputing/llvm-cbe
62 |
63 | https://github.com/maleadt/LLVM.jl
64 |
65 | ## Some possibly useful repositories from other languages:
66 | https://github.com/uraimo/buildSwiftOnARM
67 |
68 | https://github.com/uraimo/SwiftyGPIO
69 |
70 | https://github.com/rust-embedded/docs
71 |
72 | https://github.com/micropython/micropython
73 |
--------------------------------------------------------------------------------