Skip to content

Commit

Permalink
minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
mertcandav committed Sep 19, 2024
1 parent a7742b5 commit 126dfca
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/integrated-jule/api/api-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,21 @@ fn main() {

The `magicheader.hpp`:
```cpp
#ifndef MAGICHEADER_HPP
#define MAGICHEADER_HPP

#include <iostream>
#include "api/jule.hpp"

jule::Int magic_calculation(jule::Int, jule::Int);

void printMagic() {
jule::Int x = 42;
jule::Int y = 89;
std::cout << magic_calculation(x, y) << std::endl;
}

#endif
```

In the code example above, the Jule function with identifier `magicCalculation` is passed to the backend with identifier `magic_calculation`. It is called by a function in the backend with C++ interoperability. In this way, a bidirectional use can be achieved.
Expand Down
2 changes: 1 addition & 1 deletion src/integrated-jule/interoperability/jule-wrappers.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Jule wrappers are a recommended approach for linking C/C++ definitions. This app

**Cons:**

- Can add significantly to the code base
- May add significantly to the code base
- Developing additional Jule Wrappers has a time cost
- Wider IR

Expand Down

0 comments on commit 126dfca

Please sign in to comment.