Skip to content

Commit 9acda34

Browse files
committed
Add Kotlin language basics
Added language_basics.json for Kotlin 1.5 covering: - Type system (statically typed) - Paradigms (OOP, functional, procedural) - Abstraction level (high-level) - Execution method (compiled) - Memory management (automatic/GC) - Entry points (main function, script files) - Comments (single-line, multi-line, KDoc, special) - Library support (standard libs, frameworks) - Hello World minimal program Resolves #737
1 parent 2583690 commit 9acda34

File tree

1 file changed

+97
-0
lines changed

1 file changed

+97
-0
lines changed
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
{
2+
"meta": {
3+
"language": "kotlin",
4+
"language_version": "1.5",
5+
"language_name": "Kotlin",
6+
"structure": "language_basics"
7+
},
8+
"concepts": {
9+
"statically_typed": {
10+
"code": "val x: Int = 5"
11+
},
12+
"dynamically_typed": {
13+
"not-implemented": true
14+
},
15+
"procedural_language": {
16+
"code": "fun calculateSum(a: Int, b: Int): Int {\n return a + b\n}"
17+
},
18+
"functional_language": {
19+
"code": "val numbers = listOf(1, 2, 3, 4, 5)\nval doubled = numbers.map { it * 2 }"
20+
},
21+
"object_oriented_language": {
22+
"code": "class Person(val name: String, val age: Int)"
23+
},
24+
"low_level_language": {
25+
"not-implemented": true
26+
},
27+
"high_level_language": {
28+
"code": "println(\"Hello, World!\")"
29+
},
30+
"compiled_language": {
31+
"code": "// Kotlin compiles to JVM bytecode or native code",
32+
"comment": "Kotlin is compiled to JVM bytecode, JavaScript, or native binaries"
33+
},
34+
"interpreted_language": {
35+
"not-implemented": true
36+
},
37+
"general_purpose_language": {
38+
"code": "// Kotlin can be used for Android, web, server-side, desktop, etc."
39+
},
40+
"domain_specific_language": {
41+
"not-implemented": true
42+
},
43+
"manual_management": {
44+
"not-implemented": true
45+
},
46+
"automatic_management": {
47+
"code": "// Kotlin uses JVM's garbage collector",
48+
"comment": "Memory is managed automatically by the JVM garbage collector"
49+
},
50+
"first_generation": {
51+
"not-implemented": true
52+
},
53+
"second_generation": {
54+
"not-implemented": true
55+
},
56+
"third_generation": {
57+
"code": "// Kotlin is a modern third-generation language"
58+
},
59+
"fourth_generation": {
60+
"not-implemented": true
61+
},
62+
"main_function": {
63+
"code": "fun main() {\n println(\"Hello, World!\")\n}"
64+
},
65+
"custom_function": {
66+
"not-implemented": true
67+
},
68+
"script_file": {
69+
"code": "// Kotlin supports scripting with .kts files",
70+
"comment": "Kotlin scripts (.kts files) execute from top to bottom"
71+
},
72+
"single_line": {
73+
"code": "// This is a single line comment"
74+
},
75+
"multi_line": {
76+
"code": "/* This is a\n multi-line comment */"
77+
},
78+
"documentation": {
79+
"code": "/**\n * This is a KDoc documentation comment\n * @param name the person's name\n * @return a greeting message\n */\nfun greet(name: String): String {\n return \"Hello, $name!\"\n}"
80+
},
81+
"special": {
82+
"code": "//TODO: Implement this feature\n//FIXME: Bug in this code",
83+
"comment": "Kotlin recognizes TODO, FIXME and other special comment markers"
84+
},
85+
"standard_libraries": {
86+
"code": "import kotlin.math.sqrt\nimport kotlin.collections.*",
87+
"comment": "Kotlin has extensive standard library available without external dependencies"
88+
},
89+
"extensive_frameworks": {
90+
"code": "// Gradle dependency example\n// implementation(\"org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0\")",
91+
"comment": "Kotlin uses Gradle or Maven for dependency management"
92+
},
93+
"hello_world": {
94+
"code": "fun main() {\n println(\"Hello World\")\n}"
95+
}
96+
}
97+
}

0 commit comments

Comments
 (0)