Mercurial Hosting > luan
diff website/src/learn.html.luan @ 1929:31f006c64782
translation
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 01 May 2025 18:31:05 -0600 |
parents | 1461449b6074 |
children | 047e4dde22b4 |
line wrap: on
line diff
--- a/website/src/learn.html.luan Sun Apr 27 04:24:08 2025 -0600 +++ b/website/src/learn.html.luan Thu May 01 18:31:05 2025 -0600 @@ -1,17 +1,19 @@ local Luan = require "luan:Luan.luan" local error = Luan.error local Io = require "luan:Io.luan" -local Http = require "luan:http/Http.luan" +local Site_translator = require "luan:gpt/Site_translator.luan" +local get_lang = Site_translator.get_lang or error() +local text_writer = Site_translator.text_writer or error() local Shared = require "site:/lib/Shared.luan" local head = Shared.head or error() local header = Shared.docs_header or error() return function() - Io.stdout = Http.response.text_writer() + Io.stdout = text_writer() %> <!doctype html> -<html> +<html lang="<%=get_lang()%>"> <head> <% head() %> <title>Learning Luan</title> @@ -22,7 +24,7 @@ <h1>Learning Luan</h1> -<p>To understand the idea behind Luan, you must read <a href="/scripting.pdf">Ousterhout's paper</a>. In terms of this paper, Luan is the scripting language and Java is the system programming language. In other words, these two languages are a pair of tools that work together. Luan is the tool for writing applications, and Java is the tool for writing libraries.</p> +<p>To understand the idea behind Luan, you must read <a href="scripting.html">Ousterhout's paper</a>. In terms of this paper, Luan is the scripting language and Java is the system programming language. In other words, these two languages are a pair of tools that work together. Luan is the tool for writing applications, and Java is the tool for writing libraries.</p> <p>No other modern scripting language (except Tcl) follows this model. This means that you are limited to whatever functionality the scripting language provides. Of modern scripting languages, only Python is big enough to really have enough functionality through libraries. But tiny Luan has as much functionality as Python does because Luan has access to all of the functionality available in Java.</p> @@ -32,14 +34,14 @@ Luan_table.luan_function = JavaClass.javaFunction </code> -<p>In other cases, there is a very thin layer between Luan and Java. And if you know Java, then this code is easy to read. This means that the Luan source code is actually perfectly suitable documentation for the Luan API. If I was to document all of the Luan API, I would actually be mostly duplicating the <a href="https://docs.oracle.com/javase/8/docs/api/overview-summary.html">Java API documentation</a>. So while I will continue to expand the <a href="/manual.html">Luan Reference Manual</a>, this is not my top priority. To use Luan, you must get <a href="https://hg.reactionary.software/repo/luan/">the source</a> and get a basic understanding of the API which is in <a href="https://hg.reactionary.software/repo/luan/file/tip/src/luan/modules">luan/src/luan/modules</a>.</p> +<p>In other cases, there is a very thin layer between Luan and Java. And if you know Java, then this code is easy to read. This means that the Luan source code is actually perfectly suitable documentation for the Luan API. If I was to document all of the Luan API, I would actually be mostly duplicating the <a href="https://docs.oracle.com/javase/8/docs/api/overview-summary.html">Java API documentation</a>. So while I will continue to expand the <a href="manual.html">Luan Reference Manual</a>, this is not my top priority. To use Luan, you must get <a href="https://hg.reactionary.software/repo/luan/">the source</a> and get a basic understanding of the API which is in <a href="https://hg.reactionary.software/repo/luan/file/tip/src/luan/modules">luan/src/luan/modules</a>.</p> <p>Here are my suggested steps for learning Luan:</p> <ol> <li>Follow my <a href="https://www.reactionary.software/learn.html">Learn Reactionary Programming</a> course up to and including <b>Java 8</b>.</li> - <li>Read <a href="/pil.html">Programming in Lua</a>. It is actually an excellent book which means that I don't have to write an extensive Luan tutorial. Then read <a href="/diff.html">How Luan differs from Lua</a>.</li> - <li>Next read the short <a href="/tutorial.html">Luan Tutorial</a>.</li> + <li>Read <a href="pil.html">Programming in Lua</a>. It is actually an excellent book which means that I don't have to write an extensive Luan tutorial. Then read <a href="diff.html">How Luan differs from Lua</a>.</li> + <li>Next read the short <a href="tutorial.html">Luan Tutorial</a>.</li> </ol> <p>What comes next depends on whether you want to do web development or desktop development.</p> @@ -48,7 +50,7 @@ <p>For desktop development, you need to learn the relevant Java tools which include <a href="https://docs.oracle.com/javase/tutorial/uiswing/">Swing</a>, <a href="http://www.miglayout.com/">MigLayout</a>, <a href="https://www.formdev.com/flatlaf/">FlatLaf</a>, and <a href="https://docs.oracle.com/javase/tutorial/2d/">2D Graphics</a>. Then you can look at examples in <a href="https://hg.reactionary.software/repo/luan/file/tip/src/luan/modules/swing/examples">luan/src/luan/modules/swing/examples</a>. And then get <a href="https://hg.reactionary.software/repo/editor/">Luan Editor</a>. This is a fully functional text editor. It will show you how to use Swing in Luan.</p> -<p>With popular programming languages, you can get help from ChatGPT. But ChatGPT doesn't know Luan. ChatGPT can help you understand Java, but that's all. So for Luan questions, just <a href="/support.html">contact me</a>.</p> +<p>With popular programming languages, you can get help from ChatGPT. But ChatGPT doesn't know Luan. ChatGPT can help you understand Java, but that's all. So for Luan questions, just <a href="support.html">contact me</a>.</p> </div> </body>