sona-lang 0.13.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (244) hide show
  1. sona_lang-0.13.0/LICENSE +44 -0
  2. sona_lang-0.13.0/MANIFEST.in +3 -0
  3. sona_lang-0.13.0/PKG-INFO +613 -0
  4. sona_lang-0.13.0/README.md +576 -0
  5. sona_lang-0.13.0/pyproject.toml +145 -0
  6. sona_lang-0.13.0/setup.cfg +4 -0
  7. sona_lang-0.13.0/setup.py +88 -0
  8. sona_lang-0.13.0/sona/__init__.py +31 -0
  9. sona_lang-0.13.0/sona/__main__.py +6 -0
  10. sona_lang-0.13.0/sona/ai/__init__.py +27 -0
  11. sona_lang-0.13.0/sona/ai/ai_backend.py +95 -0
  12. sona_lang-0.13.0/sona/ai/batcher.py +169 -0
  13. sona_lang-0.13.0/sona/ai/cache.py +137 -0
  14. sona_lang-0.13.0/sona/ai/capability.py +75 -0
  15. sona_lang-0.13.0/sona/ai/claude_chatbot_components.py +355 -0
  16. sona_lang-0.13.0/sona/ai/claude_conversation_engine.py +339 -0
  17. sona_lang-0.13.0/sona/ai/claude_conversation_main.py +534 -0
  18. sona_lang-0.13.0/sona/ai/claude_like_chatbot.py +414 -0
  19. sona_lang-0.13.0/sona/ai/code_completion.py +285 -0
  20. sona_lang-0.13.0/sona/ai/cognitive_assistant.py +414 -0
  21. sona_lang-0.13.0/sona/ai/enhanced_cli.py +456 -0
  22. sona_lang-0.13.0/sona/ai/gpt2_integration.py +324 -0
  23. sona_lang-0.13.0/sona/ai/gpt2_integration_claude.py +240 -0
  24. sona_lang-0.13.0/sona/ai/local_models.py +176 -0
  25. sona_lang-0.13.0/sona/ai/natural_language.py +428 -0
  26. sona_lang-0.13.0/sona/ai/ollama_integration.py +154 -0
  27. sona_lang-0.13.0/sona/ai/quality_evaluator.py +386 -0
  28. sona_lang-0.13.0/sona/ai/real_ai_provider.py +462 -0
  29. sona_lang-0.13.0/sona/ai/retry.py +127 -0
  30. sona_lang-0.13.0/sona/ai/sona_language_adapter.py +421 -0
  31. sona_lang-0.13.0/sona/ai/sona_specialized_gpt2.py +280 -0
  32. sona_lang-0.13.0/sona/ast_nodes.py +1766 -0
  33. sona_lang-0.13.0/sona/cli.py +3381 -0
  34. sona_lang-0.13.0/sona/control/__init__.py +7 -0
  35. sona_lang-0.13.0/sona/core/__init__.py +29 -0
  36. sona_lang-0.13.0/sona/core/result.py +177 -0
  37. sona_lang-0.13.0/sona/errors.py +473 -0
  38. sona_lang-0.13.0/sona/flags.py +114 -0
  39. sona_lang-0.13.0/sona/grammar.lark +260 -0
  40. sona_lang-0.13.0/sona/interpreter.py +3660 -0
  41. sona_lang-0.13.0/sona/lockfile_manager.py +178 -0
  42. sona_lang-0.13.0/sona/lsp_server.py +701 -0
  43. sona_lang-0.13.0/sona/parser_v090.py +2344 -0
  44. sona_lang-0.13.0/sona/persisted_env.py +70 -0
  45. sona_lang-0.13.0/sona/policy.py +188 -0
  46. sona_lang-0.13.0/sona/receipts.py +2045 -0
  47. sona_lang-0.13.0/sona/runtime/__init__.py +1 -0
  48. sona_lang-0.13.0/sona/runtime/memory/__init__.py +53 -0
  49. sona_lang-0.13.0/sona/runtime/memory/advanced.py +76 -0
  50. sona_lang-0.13.0/sona/runtime/memory/audit.py +328 -0
  51. sona_lang-0.13.0/sona/runtime/memory/compliance.py +200 -0
  52. sona_lang-0.13.0/sona/runtime/memory/consolidation.py +385 -0
  53. sona_lang-0.13.0/sona/runtime/memory/enums.py +52 -0
  54. sona_lang-0.13.0/sona/runtime/memory/goal_loop.py +1192 -0
  55. sona_lang-0.13.0/sona/runtime/memory/ids.py +22 -0
  56. sona_lang-0.13.0/sona/runtime/memory/inspection.py +357 -0
  57. sona_lang-0.13.0/sona/runtime/memory/intake.py +153 -0
  58. sona_lang-0.13.0/sona/runtime/memory/internal.py +26 -0
  59. sona_lang-0.13.0/sona/runtime/memory/models.py +358 -0
  60. sona_lang-0.13.0/sona/runtime/memory/payloads.py +277 -0
  61. sona_lang-0.13.0/sona/runtime/memory/policy.py +551 -0
  62. sona_lang-0.13.0/sona/runtime/memory/promotion.py +360 -0
  63. sona_lang-0.13.0/sona/runtime/memory/retrieval.py +586 -0
  64. sona_lang-0.13.0/sona/runtime/memory/schema.py +206 -0
  65. sona_lang-0.13.0/sona/runtime/memory/sqlite_store.py +1007 -0
  66. sona_lang-0.13.0/sona/runtime/memory/storage.py +173 -0
  67. sona_lang-0.13.0/sona/sona_transpiler.py +1008 -0
  68. sona_lang-0.13.0/sona/spm.py +556 -0
  69. sona_lang-0.13.0/sona/stdlib/__init__.py +6 -0
  70. sona_lang-0.13.0/sona/stdlib/assert.py +470 -0
  71. sona_lang-0.13.0/sona/stdlib/async.py +231 -0
  72. sona_lang-0.13.0/sona/stdlib/benchmark.py +362 -0
  73. sona_lang-0.13.0/sona/stdlib/bitwise.py +294 -0
  74. sona_lang-0.13.0/sona/stdlib/boolean.py +267 -0
  75. sona_lang-0.13.0/sona/stdlib/cache.py +687 -0
  76. sona_lang-0.13.0/sona/stdlib/cli.py +291 -0
  77. sona_lang-0.13.0/sona/stdlib/collection/__init__.py +16 -0
  78. sona_lang-0.13.0/sona/stdlib/collection/dict.py +117 -0
  79. sona_lang-0.13.0/sona/stdlib/collection/list.py +106 -0
  80. sona_lang-0.13.0/sona/stdlib/collection/set.py +72 -0
  81. sona_lang-0.13.0/sona/stdlib/collection/tuple.py +82 -0
  82. sona_lang-0.13.0/sona/stdlib/collection.py +419 -0
  83. sona_lang-0.13.0/sona/stdlib/color.py +404 -0
  84. sona_lang-0.13.0/sona/stdlib/comparison.py +424 -0
  85. sona_lang-0.13.0/sona/stdlib/compression.py +352 -0
  86. sona_lang-0.13.0/sona/stdlib/config.py +280 -0
  87. sona_lang-0.13.0/sona/stdlib/cookies.py +190 -0
  88. sona_lang-0.13.0/sona/stdlib/crypto.py +234 -0
  89. sona_lang-0.13.0/sona/stdlib/csv.py +413 -0
  90. sona_lang-0.13.0/sona/stdlib/date.py +515 -0
  91. sona_lang-0.13.0/sona/stdlib/decorator.py +384 -0
  92. sona_lang-0.13.0/sona/stdlib/dns.py +99 -0
  93. sona_lang-0.13.0/sona/stdlib/emotion.py +270 -0
  94. sona_lang-0.13.0/sona/stdlib/encoding.py +207 -0
  95. sona_lang-0.13.0/sona/stdlib/env.py +223 -0
  96. sona_lang-0.13.0/sona/stdlib/fs.py +533 -0
  97. sona_lang-0.13.0/sona/stdlib/ftp.py +122 -0
  98. sona_lang-0.13.0/sona/stdlib/functional.py +865 -0
  99. sona_lang-0.13.0/sona/stdlib/graph.py +400 -0
  100. sona_lang-0.13.0/sona/stdlib/hashing.py +118 -0
  101. sona_lang-0.13.0/sona/stdlib/heap.py +301 -0
  102. sona_lang-0.13.0/sona/stdlib/http.py +298 -0
  103. sona_lang-0.13.0/sona/stdlib/io.py +219 -0
  104. sona_lang-0.13.0/sona/stdlib/iterator.py +391 -0
  105. sona_lang-0.13.0/sona/stdlib/json.py +645 -0
  106. sona_lang-0.13.0/sona/stdlib/jwt.py +222 -0
  107. sona_lang-0.13.0/sona/stdlib/logging.py +252 -0
  108. sona_lang-0.13.0/sona/stdlib/markdown.py +307 -0
  109. sona_lang-0.13.0/sona/stdlib/math.py +506 -0
  110. sona_lang-0.13.0/sona/stdlib/matrix.py +408 -0
  111. sona_lang-0.13.0/sona/stdlib/migration.py +442 -0
  112. sona_lang-0.13.0/sona/stdlib/mock.py +313 -0
  113. sona_lang-0.13.0/sona/stdlib/native_bridge.py +59 -0
  114. sona_lang-0.13.0/sona/stdlib/native_csv.py +228 -0
  115. sona_lang-0.13.0/sona/stdlib/native_date.py +151 -0
  116. sona_lang-0.13.0/sona/stdlib/native_emotion.py +92 -0
  117. sona_lang-0.13.0/sona/stdlib/native_env.py +122 -0
  118. sona_lang-0.13.0/sona/stdlib/native_fs.py +196 -0
  119. sona_lang-0.13.0/sona/stdlib/native_io.py +165 -0
  120. sona_lang-0.13.0/sona/stdlib/native_json.py +185 -0
  121. sona_lang-0.13.0/sona/stdlib/native_math.py +307 -0
  122. sona_lang-0.13.0/sona/stdlib/native_path.py +60 -0
  123. sona_lang-0.13.0/sona/stdlib/native_receipt.py +66 -0
  124. sona_lang-0.13.0/sona/stdlib/native_regex.py +143 -0
  125. sona_lang-0.13.0/sona/stdlib/native_string.py +375 -0
  126. sona_lang-0.13.0/sona/stdlib/native_time.py +115 -0
  127. sona_lang-0.13.0/sona/stdlib/numbers.py +298 -0
  128. sona_lang-0.13.0/sona/stdlib/oauth.py +275 -0
  129. sona_lang-0.13.0/sona/stdlib/operators.py +429 -0
  130. sona_lang-0.13.0/sona/stdlib/orm.py +655 -0
  131. sona_lang-0.13.0/sona/stdlib/password.py +237 -0
  132. sona_lang-0.13.0/sona/stdlib/path.py +255 -0
  133. sona_lang-0.13.0/sona/stdlib/permissions.py +172 -0
  134. sona_lang-0.13.0/sona/stdlib/pool.py +291 -0
  135. sona_lang-0.13.0/sona/stdlib/process.py +321 -0
  136. sona_lang-0.13.0/sona/stdlib/profiler.py +347 -0
  137. sona_lang-0.13.0/sona/stdlib/promise.py +362 -0
  138. sona_lang-0.13.0/sona/stdlib/proxy.py +141 -0
  139. sona_lang-0.13.0/sona/stdlib/query.py +552 -0
  140. sona_lang-0.13.0/sona/stdlib/queue.py +252 -0
  141. sona_lang-0.13.0/sona/stdlib/random.py +171 -0
  142. sona_lang-0.13.0/sona/stdlib/redis.py +736 -0
  143. sona_lang-0.13.0/sona/stdlib/regex.py +814 -0
  144. sona_lang-0.13.0/sona/stdlib/scheduler.py +337 -0
  145. sona_lang-0.13.0/sona/stdlib/search.py +234 -0
  146. sona_lang-0.13.0/sona/stdlib/secrets.py +231 -0
  147. sona_lang-0.13.0/sona/stdlib/session.py +257 -0
  148. sona_lang-0.13.0/sona/stdlib/shell.py +329 -0
  149. sona_lang-0.13.0/sona/stdlib/signal.py +299 -0
  150. sona_lang-0.13.0/sona/stdlib/smtp.py +225 -0
  151. sona_lang-0.13.0/sona/stdlib/sort.py +217 -0
  152. sona_lang-0.13.0/sona/stdlib/sqlite.py +417 -0
  153. sona_lang-0.13.0/sona/stdlib/stack.py +232 -0
  154. sona_lang-0.13.0/sona/stdlib/statistics.py +354 -0
  155. sona_lang-0.13.0/sona/stdlib/string.py +641 -0
  156. sona_lang-0.13.0/sona/stdlib/template.py +147 -0
  157. sona_lang-0.13.0/sona/stdlib/test.py +409 -0
  158. sona_lang-0.13.0/sona/stdlib/thread.py +288 -0
  159. sona_lang-0.13.0/sona/stdlib/time.py +407 -0
  160. sona_lang-0.13.0/sona/stdlib/timer.py +222 -0
  161. sona_lang-0.13.0/sona/stdlib/toml.py +288 -0
  162. sona_lang-0.13.0/sona/stdlib/tree.py +482 -0
  163. sona_lang-0.13.0/sona/stdlib/type.py +435 -0
  164. sona_lang-0.13.0/sona/stdlib/url.py +289 -0
  165. sona_lang-0.13.0/sona/stdlib/uuid.py +143 -0
  166. sona_lang-0.13.0/sona/stdlib/validation.py +901 -0
  167. sona_lang-0.13.0/sona/stdlib/websocket.py +256 -0
  168. sona_lang-0.13.0/sona/stdlib/xml.py +280 -0
  169. sona_lang-0.13.0/sona/stdlib/yaml.py +293 -0
  170. sona_lang-0.13.0/sona/type_config.py +221 -0
  171. sona_lang-0.13.0/sona/type_system/__init__.py +135 -0
  172. sona_lang-0.13.0/sona/type_system/inference.py +112 -0
  173. sona_lang-0.13.0/sona/type_system/inference_simple.py +112 -0
  174. sona_lang-0.13.0/sona/type_system/runtime_checker.py +1099 -0
  175. sona_lang-0.13.0/sona/type_system/simple.py +35 -0
  176. sona_lang-0.13.0/sona/type_system/simple_minimal.py +35 -0
  177. sona_lang-0.13.0/sona/type_system/types.py +234 -0
  178. sona_lang-0.13.0/sona/type_system/types_simple.py +234 -0
  179. sona_lang-0.13.0/sona/utils/__init__.py +1 -0
  180. sona_lang-0.13.0/sona/utils/debug.py +14 -0
  181. sona_lang-0.13.0/sona/utils/error_explainer.py +266 -0
  182. sona_lang-0.13.0/sona/utils/suppress.py +14 -0
  183. sona_lang-0.13.0/sona/vm/__init__.py +20 -0
  184. sona_lang-0.13.0/sona/vm/benchmark_analysis.py +235 -0
  185. sona_lang-0.13.0/sona/vm/bytecode.py +309 -0
  186. sona_lang-0.13.0/sona/vm/comprehensive_benchmark.py +806 -0
  187. sona_lang-0.13.0/sona/vm/day2_final_test.py +212 -0
  188. sona_lang-0.13.0/sona/vm/day3_advanced_features.py +506 -0
  189. sona_lang-0.13.0/sona/vm/day4_exception_handling.py +539 -0
  190. sona_lang-0.13.0/sona/vm/day5_module_system.py +585 -0
  191. sona_lang-0.13.0/sona/vm/focused_benchmark.py +746 -0
  192. sona_lang-0.13.0/sona/vm/optimized_v081_performance.py +397 -0
  193. sona_lang-0.13.0/sona/vm/performance_test.py +217 -0
  194. sona_lang-0.13.0/sona/vm/simple_test.py +143 -0
  195. sona_lang-0.13.0/sona/vm/sona_language_benchmark.py +1166 -0
  196. sona_lang-0.13.0/sona/vm/sona_v081_extended_30.py +970 -0
  197. sona_lang-0.13.0/sona/vm/sona_v081_production_fix.py +571 -0
  198. sona_lang-0.13.0/sona/vm/sona_v081_release.py +395 -0
  199. sona_lang-0.13.0/sona/vm/sona_v082_ai_enhanced.py +650 -0
  200. sona_lang-0.13.0/sona/vm/stack.py +244 -0
  201. sona_lang-0.13.0/sona/vm/vm.py +388 -0
  202. sona_lang-0.13.0/sona/vm/vm_final_optimized.py +307 -0
  203. sona_lang-0.13.0/sona/vm/vm_optimized.py +415 -0
  204. sona_lang-0.13.0/sona/vm/vm_super_optimized.py +351 -0
  205. sona_lang-0.13.0/sona_lang.egg-info/PKG-INFO +613 -0
  206. sona_lang-0.13.0/sona_lang.egg-info/SOURCES.txt +242 -0
  207. sona_lang-0.13.0/sona_lang.egg-info/dependency_links.txt +1 -0
  208. sona_lang-0.13.0/sona_lang.egg-info/entry_points.txt +3 -0
  209. sona_lang-0.13.0/sona_lang.egg-info/requires.txt +22 -0
  210. sona_lang-0.13.0/sona_lang.egg-info/top_level.txt +2 -0
  211. sona_lang-0.13.0/stdlib/__init__.py +0 -0
  212. sona_lang-0.13.0/stdlib/csv.smod +48 -0
  213. sona_lang-0.13.0/stdlib/date.smod +116 -0
  214. sona_lang-0.13.0/stdlib/env.smod +92 -0
  215. sona_lang-0.13.0/stdlib/fs.smod +125 -0
  216. sona_lang-0.13.0/stdlib/hashing.smod +64 -0
  217. sona_lang-0.13.0/stdlib/io.smod +14 -0
  218. sona_lang-0.13.0/stdlib/json.smod +130 -0
  219. sona_lang-0.13.0/stdlib/math.py +5 -0
  220. sona_lang-0.13.0/stdlib/math.smod +244 -0
  221. sona_lang-0.13.0/stdlib/path.smod +73 -0
  222. sona_lang-0.13.0/stdlib/queue.smod +252 -0
  223. sona_lang-0.13.0/stdlib/random.smod +273 -0
  224. sona_lang-0.13.0/stdlib/regex.py +5 -0
  225. sona_lang-0.13.0/stdlib/regex.smod +522 -0
  226. sona_lang-0.13.0/stdlib/stack.smod +180 -0
  227. sona_lang-0.13.0/stdlib/string.py +5 -0
  228. sona_lang-0.13.0/stdlib/string.smod +322 -0
  229. sona_lang-0.13.0/stdlib/time.smod +94 -0
  230. sona_lang-0.13.0/stdlib/utils/convert.smod +125 -0
  231. sona_lang-0.13.0/stdlib/utils/validate/validate.smod +28 -0
  232. sona_lang-0.13.0/stdlib/uuid.smod +184 -0
  233. sona_lang-0.13.0/tests/test_cli_errors.py +25 -0
  234. sona_lang-0.13.0/tests/test_cognitive_monitor.py +68 -0
  235. sona_lang-0.13.0/tests/test_cognitive_statements_parser.py +28 -0
  236. sona_lang-0.13.0/tests/test_emotion_module.py +210 -0
  237. sona_lang-0.13.0/tests/test_focus_blocks.py +42 -0
  238. sona_lang-0.13.0/tests/test_lockfile_manager.py +51 -0
  239. sona_lang-0.13.0/tests/test_receipt_integrity.py +1123 -0
  240. sona_lang-0.13.0/tests/test_runtime_smoke.py +30 -0
  241. sona_lang-0.13.0/tests/test_smod_metadata_contracts.py +87 -0
  242. sona_lang-0.13.0/tests/test_smod_native_modules.py +176 -0
  243. sona_lang-0.13.0/tests/test_smoke_imports.py +8 -0
  244. sona_lang-0.13.0/tests/test_stdlib_verification.py +21 -0
@@ -0,0 +1,44 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 WayCore Inc. / NetCore Solutions LLC
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
+
23
+ ---
24
+
25
+ ## tl;dr
26
+
27
+ You can do whatever you want with this code as long as you include the original
28
+ copyright and license notice in any copy of the software/source.
29
+
30
+ ## What this means for developers:
31
+
32
+ ✅ Use it in your projects (personal or commercial)
33
+ ✅ Modify and distribute it
34
+ ✅ Fork it and make your own version
35
+ ✅ Sell software that includes this code
36
+ ✅ Use it in proprietary software
37
+
38
+ 📝 Just keep the copyright notice when you redistribute
39
+
40
+ ## Questions?
41
+
42
+ Hit me up on GitHub: @Bryantad
43
+ Found a bug? Open an issue!
44
+ Want to contribute? PRs welcome!
@@ -0,0 +1,3 @@
1
+ include LICENSE
2
+ recursive-include sona *.lark
3
+ recursive-include stdlib *.smod *.py
@@ -0,0 +1,613 @@
1
+ Metadata-Version: 2.4
2
+ Name: sona-lang
3
+ Version: 0.13.0
4
+ Summary: Sona Programming Language with Cognitive Accessibility and Neurodivergent-First Features
5
+ Home-page: https://github.com/Bryantad/Sona.git
6
+ Author: Sona Development Team
7
+ Author-email: "WayCore Inc." <info@waycore.com>
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3.11
10
+ Classifier: Programming Language :: Python :: 3.12
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Intended Audience :: Developers
13
+ Requires-Python: >=3.11
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Requires-Dist: lark-parser>=0.12.0
17
+ Requires-Dist: pygls<2,>=1.3.1
18
+ Provides-Extra: ai
19
+ Requires-Dist: torch>=2.2; platform_system != "Windows" and extra == "ai"
20
+ Requires-Dist: transformers>=4.43; extra == "ai"
21
+ Requires-Dist: accelerate>=0.33; extra == "ai"
22
+ Provides-Extra: toml
23
+ Requires-Dist: tomli-w>=1.0.0; extra == "toml"
24
+ Provides-Extra: dev
25
+ Requires-Dist: ruff>=0.5; extra == "dev"
26
+ Requires-Dist: black>=24.4; extra == "dev"
27
+ Requires-Dist: pytest>=8.0; extra == "dev"
28
+ Requires-Dist: coverage>=7.5; extra == "dev"
29
+ Requires-Dist: pytest-cov>=5.0; extra == "dev"
30
+ Requires-Dist: mypy>=1.10; extra == "dev"
31
+ Requires-Dist: hypothesis>=6.100; extra == "dev"
32
+ Requires-Dist: pytest-randomly>=3.15; extra == "dev"
33
+ Dynamic: author
34
+ Dynamic: home-page
35
+ Dynamic: license-file
36
+ Dynamic: requires-python
37
+
38
+ # 🎵 Sona v0.10.1
39
+
40
+ **AI-Native Programming Language with 91-Module Standard Library**
41
+
42
+ [![Version](https://img.shields.io/badge/version-0.10.1-blue.svg)](https://github.com/Bryantad/Sona)
43
+ [![Python](https://img.shields.io/badge/python-3.11+-green.svg)](https://www.python.org/)
44
+ [![License](https://img.shields.io/badge/license-MIT-yellow.svg)](LICENSE)
45
+
46
+ Sona is a modern, expressive programming language designed for rapid development with built-in AI capabilities. Perfect for automation, data processing, web services, and AI-assisted applications.
47
+
48
+ ---
49
+
50
+ ## What's New in v0.10.1
51
+
52
+ - **Cognitive Preview** — intent, decision provenance, trace, and cognitive scopes.
53
+ - **Cognitive reports** — exportable report artifacts and linting (runtime + LSP).
54
+ - **Profile annotations** — ADHD/dyslexia profile metadata surfaced in the editor.
55
+ - **Version sync** — packaging/runtime/docs aligned on v0.10.1.
56
+
57
+ [See Full Release Notes](docs/release-notes/v0.10.1.md)
58
+
59
+ ---
60
+
61
+ ## Cognitive Features
62
+
63
+ Example 1: Intent anchors
64
+
65
+ ```sona
66
+ @intent "parse user config safely";
67
+ ```
68
+
69
+ Example 2: Focus blocks with validation
70
+
71
+ ```sona
72
+ import json;
73
+
74
+ func validate(cfg) {
75
+ return cfg;
76
+ }
77
+
78
+ @intent "parse user config safely";
79
+ focus {
80
+ let cfg = json.parse(text);
81
+ validate(cfg);
82
+ }
83
+ ```
84
+
85
+ Example 3: Explainable checkpoints
86
+
87
+ ```sona
88
+ cognitive_trace(enabled=true);
89
+ explain_step(note="checkpoint before export");
90
+ ```
91
+
92
+ Note: Each `@intent` is recorded as an intent entry in cognitive reports.
93
+
94
+ ---
95
+
96
+ ## 🚀 Quick Start
97
+
98
+ ### Installation
99
+
100
+ ```powershell
101
+ # 1. Clone or download
102
+ git clone https://github.com/Bryantad/Sona.git
103
+ cd Sona
104
+
105
+ # 2. Create virtual environment
106
+ python -m venv .venv
107
+ .\.venv\Scripts\Activate.ps1 # Windows
108
+ # source .venv/bin/activate # Linux/macOS
109
+
110
+ # 3. Install dependencies
111
+ pip install -r requirements.txt
112
+
113
+ # 4. Install Sona
114
+ pip install -e .
115
+ ```
116
+
117
+ ### Your First Program
118
+
119
+ Create `hello.sona`:
120
+
121
+ ```sona
122
+ // Simple greeting
123
+ print("Hello from Sona v0.10.1!");
124
+
125
+ // Use stdlib
126
+ import json;
127
+ let data = {"version": "0.10.1", "modules": 91};
128
+ print(json.stringify(data));
129
+ ```
130
+
131
+ Run it:
132
+
133
+ ```bash
134
+ python run_sona.py hello.sona
135
+ ```
136
+
137
+ ---
138
+
139
+ ## 🎯 Core Features
140
+
141
+ ### ✅ All Tier 1 Features (Production Ready)
142
+
143
+ | Feature | Description | Status |
144
+ | ------------------ | ------------------------------------- | ------ |
145
+ | **Variables** | `let x = 10;` `const PI = 3.14;` | ✅ |
146
+ | **Functions** | `func add(a, b) { return a + b; }` | ✅ |
147
+ | **Control Flow** | `if`, `when`, `match`, `while`, `for` | ✅ |
148
+ | **Loop Control** | `break`, `continue`, `repeat` | ✅ |
149
+ | **Collections** | Lists, Dicts, Sets, Tuples | ✅ |
150
+ | **Destructuring** | `let [a, b] = [1, 2];` | ✅ |
151
+ | **Error Handling** | `try/catch` blocks | ✅ |
152
+ | **Modules** | `import json;` `export func;` | ✅ |
153
+ | **Classes** | OOP with inheritance | ✅ |
154
+ | **Operators** | Arithmetic, logical, comparison | ✅ |
155
+
156
+ ---
157
+
158
+ ## 📦 Standard Library (91 Modules)
159
+
160
+ ### 🔵 Core System (7 modules)
161
+
162
+ ```sona
163
+ import json; // JSON parsing/serialization
164
+ import math; // Mathematical operations
165
+ import string; // String manipulation
166
+ import regex; // Regular expressions
167
+ import boolean; // Boolean utilities
168
+ import type; // Type checking
169
+ import comparison; // Comparison utilities
170
+ ```
171
+
172
+ ### 📊 Data Structures (7 modules)
173
+
174
+ ```sona
175
+ import collection; // Collections namespace
176
+ import queue; // Queue operations
177
+ import stack; // Stack operations
178
+ import graph; // Graph algorithms
179
+ import tree; // Tree structures
180
+ import heap; // Min/Max heaps
181
+ import matrix; // 2D matrices
182
+ ```
183
+
184
+ ### 📁 I/O & Formats (8 modules)
185
+
186
+ ```sona
187
+ import fs; // File system operations
188
+ import path; // Path manipulation
189
+ import io; // Input/output
190
+ import csv; // CSV processing
191
+ import yaml; // YAML serialization
192
+ import toml; // TOML configuration
193
+ import compression; // Gzip/zip compression
194
+ import xml; // XML parsing/building
195
+ ```
196
+
197
+ ### 🌐 Network & Web (9 modules)
198
+
199
+ ```sona
200
+ import http; // HTTP client
201
+ import url; // URL parsing/building
202
+ import cookies; // Cookie management
203
+ import session; // HTTP sessions
204
+ import websocket; // WebSocket client
205
+ import dns; // DNS resolution
206
+ import smtp; // Email sending
207
+ import proxy; // HTTP proxy
208
+ import ftp; // FTP client
209
+ import oauth; // OAuth2 flows
210
+ ```
211
+
212
+ ### 💾 Database & Storage (6 modules)
213
+
214
+ ```sona
215
+ import sqlite; // SQLite database
216
+ import cache; // In-memory cache
217
+ import redis; // Redis client
218
+ import orm; // Simple ORM
219
+ import query; // SQL query builder
220
+ import migration; // Database migrations
221
+ ```
222
+
223
+ ### 🔒 Security & Auth (6 modules)
224
+
225
+ ```sona
226
+ import jwt; // JWT tokens
227
+ import crypto; // Cryptographic hashing
228
+ import password; // Password hashing
229
+ import hashing; // General hashing
230
+ import secrets; // Secure random
231
+ import permissions; // RBAC system
232
+ ```
233
+
234
+ ### ⚡ Async & Concurrency (5 modules)
235
+
236
+ ```sona
237
+ import async; // Async utilities
238
+ import thread; // Threading
239
+ import process; // Process management
240
+ import pool; // Thread/process pools
241
+ import promise; // Promise/Future pattern
242
+ ```
243
+
244
+ ### 🧪 Testing & Quality (5 modules)
245
+
246
+ ```sona
247
+ import test; // Test framework
248
+ import assert; // Assertions
249
+ import mock; // Mock objects
250
+ import benchmark; // Performance testing
251
+ import profiler; // Code profiling
252
+ ```
253
+
254
+ ### 🛠️ Utilities (13 modules)
255
+
256
+ ```sona
257
+ import env; // Environment variables
258
+ import date; // Date operations
259
+ import time; // Time operations
260
+ import timer; // Timer utilities
261
+ import random; // Random generation
262
+ import encoding; // Base64/URL encoding
263
+ import uuid; // UUID generation
264
+ import validation; // Input validation
265
+ import statistics; // Statistical functions
266
+ import sort; // Sorting algorithms
267
+ import search; // Search algorithms
268
+ import numbers; // Number utilities
269
+ import operators; // Operator utilities
270
+ ```
271
+
272
+ ### 🤖 Automation (7 modules)
273
+
274
+ ```sona
275
+ import cli; // CLI argument parsing
276
+ import logging; // Logging system
277
+ import config; // Configuration management
278
+ import scheduler; // Task scheduling
279
+ import signal; // Event system
280
+ import shell; // Shell commands
281
+ import bitwise; // Bitwise operations
282
+ ```
283
+
284
+ ### 🔧 Functional Programming (4 modules)
285
+
286
+ ```sona
287
+ import functional; // Composition, currying
288
+ import decorator; // Common decorators
289
+ import iterator; // Iterator utilities
290
+ import color; // Color manipulation
291
+ ```
292
+
293
+ ### 📝 Templates & Processing (3 modules)
294
+
295
+ ```sona
296
+ import template; // Template engine
297
+ import markdown; // Markdown to HTML
298
+ import xml; // XML processing
299
+ ```
300
+
301
+ ---
302
+
303
+ ## 💡 Code Examples
304
+
305
+ ### Web Scraping with Sessions
306
+
307
+ ```sona
308
+ import session;
309
+ import json;
310
+
311
+ // Create HTTP session
312
+ let s = session.create();
313
+ s.set_header("User-Agent", "Sona/0.10.1");
314
+
315
+ // Make requests
316
+ let response = s.get("https://api.example.com/data");
317
+ let data = json.parse(response.body);
318
+
319
+ print("Fetched " + data.length + " items");
320
+ ```
321
+
322
+ ### Database Operations
323
+
324
+ ```sona
325
+ import sqlite;
326
+ import orm;
327
+
328
+ // Connect to database
329
+ let db = sqlite.connect("app.db");
330
+ db.execute("CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT, email TEXT)");
331
+
332
+ // Insert data
333
+ db.insert("users", {"name": "Alice", "email": "alice@example.com"});
334
+ db.insert("users", {"name": "Bob", "email": "bob@example.com"});
335
+
336
+ // Query
337
+ let users = db.query("SELECT * FROM users WHERE name LIKE ?", ["A%"]);
338
+ for user in users {
339
+ print(user.name + ": " + user.email);
340
+ }
341
+ ```
342
+
343
+ ### JWT Authentication
344
+
345
+ ```sona
346
+ import jwt;
347
+ import password;
348
+
349
+ // Hash password
350
+ let hashed = password.hash("secretpassword");
351
+ print("Hashed: " + hashed);
352
+
353
+ // Create JWT token
354
+ let payload = {
355
+ "user_id": 123,
356
+ "username": "alice",
357
+ "role": "admin"
358
+ };
359
+
360
+ let token = jwt.encode(payload, "my-secret-key", exp_minutes=60);
361
+ print("Token: " + token);
362
+
363
+ // Verify token
364
+ let decoded = jwt.decode(token, "my-secret-key");
365
+ print("User ID: " + decoded.user_id);
366
+ ```
367
+
368
+ ### Graph Algorithms
369
+
370
+ ```sona
371
+ import graph;
372
+
373
+ // Create graph
374
+ let g = graph.create();
375
+ g.add_edge("A", "B");
376
+ g.add_edge("B", "C");
377
+ g.add_edge("A", "C");
378
+ g.add_edge("C", "D");
379
+
380
+ // Find shortest path
381
+ let path = g.shortest_path("A", "D");
382
+ print("Path: " + path.join(" -> ")); // A -> C -> D
383
+
384
+ // Check for cycles
385
+ let has_cycle = g.has_cycle();
386
+ print("Has cycle: " + has_cycle);
387
+ ```
388
+
389
+ ### Testing with Assertions
390
+
391
+ ```sona
392
+ import test;
393
+ import assert;
394
+
395
+ // Create test suite
396
+ let suite = test.suite("Math Tests");
397
+
398
+ suite.add_test("addition", func() {
399
+ let result = 2 + 2;
400
+ assert.equal(result, 4);
401
+ });
402
+
403
+ suite.add_test("division", func() {
404
+ let result = 10 / 2;
405
+ assert.equal(result, 5);
406
+ });
407
+
408
+ // Run tests
409
+ let results = suite.run();
410
+ print("Passed: " + results.passed + "/" + results.total);
411
+ ```
412
+
413
+ ### Template Rendering
414
+
415
+ ```sona
416
+ import template;
417
+
418
+ // Create template
419
+ let tmpl = "Hello {{name}}, you have {{count}} messages.";
420
+
421
+ // Render
422
+ let output = template.render(tmpl, {
423
+ "name": "Alice",
424
+ "count": 5
425
+ });
426
+
427
+ print(output); // Hello Alice, you have 5 messages.
428
+ ```
429
+
430
+ ### Functional Programming
431
+
432
+ ```sona
433
+ import functional;
434
+
435
+ // Function composition
436
+ let add_one = func(x) { return x + 1; };
437
+ let double = func(x) { return x * 2; };
438
+
439
+ let f = functional.pipe(add_one, double);
440
+ let result = f(5); // (5 + 1) * 2 = 12
441
+
442
+ print("Result: " + result);
443
+
444
+ // Currying
445
+ let multiply = func(a, b) { return a * b; };
446
+ let triple = functional.curry(multiply)(3);
447
+ print("Triple 7: " + triple(7)); // 21
448
+ ```
449
+
450
+ ---
451
+
452
+ ## 📚 Documentation
453
+
454
+ - **[Quick Start Guide](QUICK_START.md)** - Get up and running in 5 minutes
455
+ - **[API Reference](API.md)** - Complete API documentation
456
+ - **[Release Notes](docs/release-notes/v0.10.1.md)** - What's new in v0.10.1
457
+ - **[Examples](examples/)** - Sample projects and code snippets
458
+
459
+ ---
460
+
461
+ ## ✅ Verification
462
+
463
+ Run the comprehensive test suite:
464
+
465
+ ```powershell
466
+ # PowerShell
467
+ .\run_all_tests.ps1
468
+
469
+ # Or run test file directly
470
+ python run_sona.py test_all_097.sona
471
+ ```
472
+
473
+ Expected output:
474
+
475
+ ```
476
+ ✅ ALL 91 MODULES VERIFIED SUCCESSFULLY!
477
+
478
+ Module Categories:
479
+ • Core System: 7 modules
480
+ • Data Structures: 7 modules
481
+ • I/O & Formats: 8 modules
482
+ • Network & Web: 9 modules
483
+ • Database: 6 modules
484
+ • Security: 6 modules
485
+ • Async: 5 modules
486
+ • Testing: 5 modules
487
+ • Utilities: 13 modules
488
+ • Automation: 7 modules
489
+ • Functional: 4 modules
490
+ • Templates: 3 modules
491
+ ────────────
492
+ TOTAL: 91 modules
493
+ ```
494
+
495
+ ---
496
+
497
+ ## 🏗️ Architecture
498
+
499
+ ### Zero Dependencies
500
+
501
+ Sona's standard library has **zero external dependencies**. Everything is built on Python's standard library, ensuring:
502
+
503
+ - ✅ Fast installation
504
+ - ✅ No version conflicts
505
+ - ✅ Maximum stability
506
+ - ✅ Easy deployment
507
+
508
+ ### Module Design
509
+
510
+ Each module follows consistent patterns:
511
+
512
+ ```python
513
+ # Comprehensive docstrings
514
+ def function(param: type) -> type:
515
+ """
516
+ Description of what function does.
517
+
518
+ Args:
519
+ param: Description of parameter
520
+
521
+ Returns:
522
+ Description of return value
523
+
524
+ Example:
525
+ >>> result = function(value)
526
+ >>> print(result)
527
+ """
528
+ # Implementation
529
+ pass
530
+ ```
531
+
532
+ ### Category Organization
533
+
534
+ Modules are organized into 12 logical categories:
535
+
536
+ 1. **Core System** - Fundamental operations
537
+ 2. **Data Structures** - Collections and algorithms
538
+ 3. **I/O & Formats** - File and format handling
539
+ 4. **Network & Web** - HTTP, WebSocket, DNS, etc.
540
+ 5. **Database & Storage** - Data persistence
541
+ 6. **Security & Auth** - Cryptography and authentication
542
+ 7. **Async & Concurrency** - Parallel execution
543
+ 8. **Testing & Quality** - Test and debug tools
544
+ 9. **Utilities** - Common helper functions
545
+ 10. **Automation** - CLI, logging, scheduling
546
+ 11. **Functional Programming** - FP patterns
547
+ 12. **Templates & Processing** - Text processing
548
+
549
+ ---
550
+
551
+ ## 🛣️ Roadmap
552
+
553
+ ### v0.10.x (Cognitive Preview)
554
+
555
+ - Cognitive report schema stabilization
556
+ - LSP cognitive diagnostics depth
557
+ - Export workflow integrations
558
+ - Runtime coverage consistency
559
+
560
+ ### v1.0.0 (Target: Q2 2024)
561
+
562
+ - Production-grade stability
563
+ - Comprehensive test coverage
564
+ - Package manager (npm-like)
565
+ - VS Code extension
566
+
567
+ ---
568
+
569
+ ## 🤝 Contributing
570
+
571
+ Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
572
+
573
+ ### Areas for Contribution
574
+
575
+ - 📝 Documentation improvements
576
+ - 🧪 Additional test cases
577
+ - 🐛 Bug fixes
578
+ - ✨ New module proposals
579
+ - 🌍 Internationalization
580
+
581
+ ---
582
+
583
+ ## 📄 License
584
+
585
+ Sona is released under the MIT License. See [LICENSE](LICENSE) file for details.
586
+
587
+ ---
588
+
589
+ ## 🙏 Acknowledgments
590
+
591
+ Built with ❤️ using:
592
+
593
+ - **Python** - Core runtime
594
+ - **Lark** - Parser generator
595
+ - **Community feedback** - Feature requests and bug reports
596
+
597
+ ---
598
+
599
+ ## 📞 Support
600
+
601
+ - **Issues**: [GitHub Issues](https://github.com/Bryantad/Sona/issues)
602
+ - **Discussions**: [GitHub Discussions](https://github.com/Bryantad/Sona/discussions)
603
+ - **Documentation**: [docs/](docs/)
604
+
605
+ ---
606
+
607
+ <div align="center">
608
+
609
+ **Sona v0.10.1** - 91 Modules, Zero Dependencies, Infinite Possibilities
610
+
611
+ Made with 🎵 by the Sona Team
612
+
613
+ </div>