-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.html
35 lines (31 loc) · 1.6 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
---
is_index: true
layout: default
comments: false
plusone: true
---
<p>
This is the home page of the project Kepler, an ongoing effort towards bringing compile-time metaprogramming to Scala.
Our flavor of macros is reminiscent of Lisp macros, adapted to incorporate type safety and rich syntax.
Unlike infamous C/C++ preprocessor macros, Scala macros: 1) are written in full-fledged Scala,
2) work with expression trees, not with raw strings, 3) cannot change syntax of Scala.
</p>
<p>
<b>Macros are functions that are called by the compiler during compilation</b>.
Within these functions the programmer has access to compiler APIs.
For example, it is possible to generate, analyze and typecheck code.
You can learn more about macros from <a href="/documentation/index.html">documentation</a>.
</p>
<p>
<b>Macros are shipping with the official Scala compiler</b>.
Since 2.10.0 Scala includes macros that can be enabled
with <code class="scala">import language.experimental.macros</code> on per-file basis
or with <code class="scala">-language:experimental.macros</code> on per-compilation basis.
Numerous commercial and research projects are already using macros.
</p>
<p>
<b>Macros are good for code generation, static checks and domain-specific languages</b>,
which makes them a tool of choice for a multitude of <a href="/usecases.html">real-world use cases</a>.
Scenarios that traditionally involve writing and maintaining boilerplate can be addressed with macros in a concise and maintainable way.
Therefore we believe that macros are a valuable asset to the Scala programming language.
</p>