-
Notifications
You must be signed in to change notification settings - Fork 0
/
atom.xml
158 lines (122 loc) · 8.18 KB
/
atom.xml
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title><![CDATA[Ocheyedan Blog]]></title>
<link href="http://blog.ocheyedan.net/atom.xml" rel="self"/>
<link href="http://blog.ocheyedan.net/"/>
<updated>2012-02-20T09:10:40-05:00</updated>
<id>http://blog.ocheyedan.net/</id>
<author>
<name><![CDATA[Brian Langel and Trevor Smith]]></name>
</author>
<generator uri="http://octopress.org/">Octopress</generator>
<entry>
<title type="html"><![CDATA[Running Kotlin Code]]></title>
<link href="http://blog.ocheyedan.net/blog/2012/02/19/running-kotlin-code/"/>
<updated>2012-02-19T22:35:00-05:00</updated>
<id>http://blog.ocheyedan.net/blog/2012/02/19/running-kotlin-code</id>
<content type="html"><![CDATA[<p>Setting up Kotlin, compiling and running Kotlin code in the IntelliJ IDE plugin is well documented
<a href="http://hadihariri.com/2012/02/17/the-kotlin-journey-part-i-getting-things-set-up/">here</a>,
but running Kotlin code from the command line is not described.</p>
<p>Given that Kotlin is a young project, there are going to be bugs that are IDE specific.
We wanted a way to compile and run Kotlin from the command line.</p>
<p>One can compile Kotlin code using a variety of build tools documented
<a href="http://confluence.jetbrains.net/display/Kotlin/Kotlin+Build+Tools">here</a>.</p>
<p>There are two things one needs to know to <em>run</em> Kotlin code from the command line:</p>
<ul>
<li>The class path needs to include your compiled code as well as the Kotlin runtime jar</li>
<li>The main class gets compiled into something called <em>namespace</em></li>
</ul>
<p>Below is an example using Ant. It assumes you have <a href="https://github.com/jetbrains/kotlin">built</a>
the Kotlin runtime jar and the root Kotlin src directory is set to an environmental
variable <em>KOTLIN_HOME</em>.</p>
<p>Example Kotlin main:</p>
<div><script src='https://gist.github.com/1867613.js?file='></script>
<noscript><pre><code>fun main(args : Array<String>) {
println("hello, from Kotlin code!")
}</code></pre></noscript></div>
<p>Relevant Ant snippet:</p>
<div><script src='https://gist.github.com/1867624.js?file='></script>
<noscript><pre><code> <path id="classpath.run">
<pathelement path="${output}/"/>
<pathelement path="${env.KOTLIN_HOME}/dist/kotlinc/lib/kotlin-runtime.jar"/>
</path>
<target name="run">
<java classname="namespace">
<sysproperty key="file.encoding" value="UTF-8"/>
<classpath refid="classpath.run"/>
</java>
</target></code></pre></noscript></div>
<p>Complete Ant file:</p>
<div><script src='https://gist.github.com/1867619.js?file='></script>
<noscript><pre><code><project name="Kotlin" default="compile">
<property environment="env"/>
<taskdef file="${env.KOTLIN_HOME}/build-tools/ant/src/org/jetbrains/jet/buildtools/ant/antlib.xml">
<classpath>
<fileset dir="${env.KOTLIN_HOME}/dist/kotlinc/lib" includes="*.jar"/>
</classpath>
</taskdef>
<property name="output" value="${basedir}/dist"/>
<target name="clean">
<delete dir="${output}"/>
</target>
<target name="compile">
<kotlinc src="${basedir}/src/main/kotlin/" output="${output}"/>
</target>
<path id="classpath.run">
<pathelement path="${output}/"/>
<pathelement path="${env.KOTLIN_HOME}/dist/kotlinc/lib/kotlin-runtime.jar"/>
</path>
<target name="run">
<java classname="namespace">
<sysproperty key="file.encoding" value="UTF-8"/>
<classpath refid="classpath.run"/>
</java>
</target>
</project></code></pre></noscript></div>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Kotlin: A Nice Blend of Theory and Practice?]]></title>
<link href="http://blog.ocheyedan.net/blog/2012/02/19/kotlin-blend-theory-practice/"/>
<updated>2012-02-19T18:06:00-05:00</updated>
<id>http://blog.ocheyedan.net/blog/2012/02/19/kotlin-blend-theory-practice</id>
<content type="html"><![CDATA[<h2>Why We’re Interested in a New Language</h2>
<p>In college we were introduced to SML and OCaml. We became enamored with
functional programming and strong static type systems. “Bugs are found for you!” is an expression one frequently
hears from the <em>new functional convert</em>. After school, we began programming large and complex systems with other developers.
The amazing functional languages we loved suddenly seemed lacking: e.g. OCaml isn’t widely used, suffers from poor library support,
and lacks good supporting tools.</p>
<p>We ended up programming a lot of Java. We’ve found that there’s a lot to like:
strong community support, great libraries (<a href="http://netty.io/">Netty</a>, <a href="http://code.google.com/p/guava-libraries/">Guava</a>,
<a href="http://cglib.sourceforge.net/">cglib</a>, <a href="http://joda-time.sourceforge.net/">Joda</a>), excellent tools (build, test,
continuous integration, code coverage) and the JVM is an amazing piece of software. This ecosystem should not be understated:
the gestalt is enormous gains in productivity and allows developers to ship high quality code. However, we are continually
left unsatisfied with the Java language – algebraic data types? Nope.</p>
<p>Clearly our frustration isn’t new. These points are hitting on well tread territory. Others have appreciated the high quality that
the JVM ecosystem provides, but were frustrated by Java – these people created new languages on the JVM. Clojure and Scala are two
which initially excited us. Clojure has some nice features (lisps can be fun), but we cannot get behind a dynamic type system.
Scala has many awesome ideas, but too many. So much of our lives are spent making decisions about the interesting
problems we program on, we don’t want to be spending time deciding what subset of a language to use. The language should make it clear.</p>
<h2>Enter Kotlin</h2>
<p><a href="http://confluence.jetbrains.net/display/Kotlin/Welcome">Kotlin</a> is a new (beta) JVM-based language from Jetbrains.
We were very excited when we read about Kotlin. Kotlin is an object oriented language
incorporating functional paradigms. Kotlin appears to have an eye on the kind of theory we like: higher-order functions, algebraic data types,
function literals, type aliases, and <a href="http://blog.jetbrains.com/kotlin/2012/01/the-road-ahead/">more</a>.
Kotlin also has an eye towards pragmatism: there are numerous features which are backed up by real world usage patterns. The inclusion
of many of the features show that the developers have experience writing software e.g. <em>first-class delegation</em> (see <a href="http://confluence.jetbrains.net/display/Kotlin/Classes+and+Inheritance">Delegation</a>),
<em>classes do not allow inheritance by default</em> (see <a href="http://confluence.jetbrains.net/display/Kotlin/Classes+and+Inheritance">Inheritance</a>).</p>
<p>The designers of Kotlin have aesthetics which appear to be in line with our own: the exciting thing about programming is
the ability to make magic a reality. Computer Science gives us theory that allows us to talk about magic,
we need programming tools which help us make that magic. Kotlin’s proposed language features, the choice to run on the JVM and its
blending of programming language theory with a motivation to get things done make us super excited to see where this project goes.</p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Hello.]]></title>
<link href="http://blog.ocheyedan.net/blog/2012/02/18/hello/"/>
<updated>2012-02-18T18:42:00-05:00</updated>
<id>http://blog.ocheyedan.net/blog/2012/02/18/hello</id>
<content type="html"><![CDATA[<p>This is our blog. We’re excited it is up.</p>
]]></content>
</entry>
</feed>