Functional Programming (Tcler's Wiki)
Tcl 是個很奇妙的語言,就如同下面說的:
As with many things, Tcl is rather unique in this area.
Commands themselves can not be passed as arguments to other commands,
but their names can, which provides something very similar to first-class functions.
Additionally, apply can be used to
interpret a value as a function and evaluate it,
providing the equivalent of lambda functions.
Tcl 的表達方式與波蘭表示法 (Polish notation) 一樣,和 Lisp 的 S-expression 的精神十分相像,特點是操作符置於操作數的前面(就是如果是一連串資料所組合成的述句,Tcl 述句的第一個是一個 command,後面是 command 要處理的資料)。
Tcl 也跟 Lisp 一樣,並不是純粹的 Functional Language,而是支援多重典範的語言。
2019-06-02
2018-11-29
HTTP/3 explained
HTTP/3 explained
HTTP/3 協定出爐
The Road to QUIC
HTTP/3
可以開始閱讀 HTTP/3 相關的文件。
HTTP/3 主要在 UDP 上建立一個新的協定,QUIC (Transfer protocol over UDP)。
HTTP/3 協定出爐
The Road to QUIC
HTTP/3
可以開始閱讀 HTTP/3 相關的文件。
![]() |
| From https://http3-explained.haxx.se/images/quic-stack.png |
HTTP/3 主要在 UDP 上建立一個新的協定,QUIC (Transfer protocol over UDP)。
2018-09-26
Java 11 Released
Java 11 Released
JDK 11
Java Is Still Free
Do not fall into Oracle's Java 11 trap
The future of Java and OpenJDK updates without Oracle support
Java依舊免費?
但是 Java 加快了開發的循環以後,對我而言,tclBlend 要使用哪一個 JDK 版本就變成一個麻煩的問題。
我已經在之前將我自己使用的 RPM spec 設為 java-11-openjdk-devel,而在下個 JDK 版本(也就是 12)來臨之前,應該有六個月的時間可以考慮。
另外一個考慮的重點是如果我升上 openSUSE LEAP 15.1,我就會以 openSUSE Leap 15.1 為主要的考量點。
更新:
另外,目前 OpenJDK 與 Oracle JDK 在技術上來說已經一致,所以接下來在六個月之後的長期更新版本負擔將會在 OpenJDK 上。但是如果六個月就要跳一次版本,這會是個麻煩的議題。
JDK 11
Java Is Still Free
Do not fall into Oracle's Java 11 trap
The future of Java and OpenJDK updates without Oracle support
Java依舊免費?
但是 Java 加快了開發的循環以後,對我而言,tclBlend 要使用哪一個 JDK 版本就變成一個麻煩的問題。
我已經在之前將我自己使用的 RPM spec 設為 java-11-openjdk-devel,而在下個 JDK 版本(也就是 12)來臨之前,應該有六個月的時間可以考慮。
另外一個考慮的重點是如果我升上 openSUSE LEAP 15.1,我就會以 openSUSE Leap 15.1 為主要的考量點。
更新:
另外,目前 OpenJDK 與 Oracle JDK 在技術上來說已經一致,所以接下來在六個月之後的長期更新版本負擔將會在 OpenJDK 上。但是如果六個月就要跳一次版本,這會是個麻煩的議題。
2018-05-24
Tcl and SWIG as a C/C++ Development Tool
Tcl and SWIG as a C/C++ Development Tool
SWIG and Tcl (3.0 doc)
Swig (Tcler's Wiki)
接下來我會花一點時間使用看看 SWIG,然後看能不能成功的將我需要的 C library 部份轉成 Tcl interface。因為不是很急迫,所以我只是開始收集資料而已。
SWIG and Tcl (3.0 doc)
Swig (Tcler's Wiki)
接下來我會花一點時間使用看看 SWIG,然後看能不能成功的將我需要的 C library 部份轉成 Tcl interface。因為不是很急迫,所以我只是開始收集資料而已。
2017-11-26
NaviServer: enable gzip compression
參考連結:
How to enable gzip compression
NaviServer 在 nsd-config.tcl 中的 ns/server/${server} 加入下列的設定,動態網頁 ADP 的部份就可以支援 gzip compression:
一開始的時候我以為和 AOLServer 一樣,需要 nszlib module,但是我寫好了 RPM spec 並且安裝好了以後,才發現 NaviServer 已經整合了 zlib 的部份,所以在一開始 configure 的時候就需要 --with-zlib 設定才行(我是往前翻安裝的筆記並且參考連結以後才發現不用安裝 nszlib module)。
經過實測,NaviServer 只要針對 ADP 的部份進行 gzip compression,而靜態網頁看起來是沒有壓縮的(PS. 我只有加這篇文章的設定進行測試)。
How to enable gzip compression
NaviServer 在 nsd-config.tcl 中的 ns/server/${server} 加入下列的設定,動態網頁 ADP 的部份就可以支援 gzip compression:
ns_section "ns/server/default"
# Compress response character data: ns_return, ADP etc.
#
ns_param compressenable on ;# false, use "ns_conn compress" to override
ns_param compresslevel 4 ;# 4, 1-9 where 9 is high compression, high overhead
ns_param compressminsize 512 ;# Compress responses larger than this
# ns_param compresspreinit true ;# false, if true then initialize and allocate buffers at startup
一開始的時候我以為和 AOLServer 一樣,需要 nszlib module,但是我寫好了 RPM spec 並且安裝好了以後,才發現 NaviServer 已經整合了 zlib 的部份,所以在一開始 configure 的時候就需要 --with-zlib 設定才行(我是往前翻安裝的筆記並且參考連結以後才發現不用安裝 nszlib module)。
經過實測,NaviServer 只要針對 ADP 的部份進行 gzip compression,而靜態網頁看起來是沒有壓縮的(PS. 我只有加這篇文章的設定進行測試)。
2017-01-04
OpenGL with C and Tcl/Tk
OpenGL with C and Tcl/Tk
很有趣的是,這篇文章其實指出了一個很有用的用法,就是拿到 HWND/XWindow ID 以後,我們就可以內嵌一些內容到一個 Tk 的 frame 內。
關鍵是 It involves making a frame widget in Tcl, and then passing its HWND to C to initialize the OpenGL rendering context.
而我猜不只是 OpenGL,具有類似方法的函式庫也可以這樣使用。
因為沒有真的實作過,所以還不確定這個技巧的可用性有多高,但是我直覺認為,這個方法可以結合不少外部函式庫來使用。
很有趣的是,這篇文章其實指出了一個很有用的用法,就是拿到 HWND/XWindow ID 以後,我們就可以內嵌一些內容到一個 Tk 的 frame 內。
關鍵是 It involves making a frame widget in Tcl, and then passing its HWND to C to initialize the OpenGL rendering context.
而我猜不只是 OpenGL,具有類似方法的函式庫也可以這樣使用。
因為沒有真的實作過,所以還不確定這個技巧的可用性有多高,但是我直覺認為,這個方法可以結合不少外部函式庫來使用。
2016-09-21
GO and Tcl
gothic - Tcl/Tk Go bindings
Example of a Tcl extension in Go
在 Tcler's Wiki 上有人新增加了一些 GO 與 Tcl 的資料,我做一下記錄。其中 gothic 是從 GO 呼叫 Tcl/Tk。
Example of a Tcl extension in Go
在 Tcler's Wiki 上有人新增加了一些 GO 與 Tcl 的資料,我做一下記錄。其中 gothic 是從 GO 呼叫 Tcl/Tk。
2015-01-29
2014-06-27
Tcl Modules
Tcl Modules
TIP #189: Tcl Modules
TIP #190: Implementation Choices for Tcl Modules
TIP #191: Managing Tcl Packages and Modules in a Multi-Version Environment
A Tcl module is a package in a single file that can be sourced. (DLLs may still be embedded in that). There is no pkgIndex.tcl file, the package name and version are expressed in the module filename itself, so that version 3.14 of package foo must be named foo-3.14.tm.
"Tcl Modules" on the other hand is designed with less flexibility in mind and to allow implementations to glean as much information as possible without having to perform lots of accesses to the filesystem.
Additional benefits of the proposed design are a simplified deployment of packages, akin to the way starkits made application deployment simple, and from that an easier implementation and management of repositories.
Tcl Modules (.tm) 檔案的文件。
TIP #189: Tcl Modules
TIP #190: Implementation Choices for Tcl Modules
TIP #191: Managing Tcl Packages and Modules in a Multi-Version Environment
A Tcl module is a package in a single file that can be sourced. (DLLs may still be embedded in that). There is no pkgIndex.tcl file, the package name and version are expressed in the module filename itself, so that version 3.14 of package foo must be named foo-3.14.tm.
"Tcl Modules" on the other hand is designed with less flexibility in mind and to allow implementations to glean as much information as possible without having to perform lots of accesses to the filesystem.
Additional benefits of the proposed design are a simplified deployment of packages, akin to the way starkits made application deployment simple, and from that an easier implementation and management of repositories.
Tcl Modules (.tm) 檔案的文件。
2014-06-18
Catenation and Operand Specialization for Tcl Virtual Machine Performand
Catenation and Operand Specialization for Tcl Virtual Machine Performand
A Masters thesis by Benjamin Vitale, 2004, from Parsing, Bytecodes and Execution
A Masters thesis by Benjamin Vitale, 2004, from Parsing, Bytecodes and Execution
2009-06-27
Scripting: Higher Level Programming for the 21st Century
這是由 John K. Ousterhout 所寫的文章,而從現在 PHP/Perl/Python/Ruby/Tcl 各種 scripting language 的發展來看,似乎也是如 John K. Ousterhout 所推測的一樣。當然,自由軟體所帶來的效應,可能也是其中的一個原因之一。
Scripting language 的缺點就是慢,但是開發快速而且除錯方便,但是當硬體的速度愈來愈快的時候,Scripting language 的缺點也就不太算是缺點了,各種 Scripting language 只會愈來愈重要。
Scripting language 的缺點就是慢,但是開發快速而且除錯方便,但是當硬體的速度愈來愈快的時候,Scripting language 的缺點也就不太算是缺點了,各種 Scripting language 只會愈來愈重要。
2009-06-24
A Slightly Skeptical View on Scripting Languages
A Slightly Skeptical View on Scripting Languages
一篇對於 Scripting Language 的文章。
比較語言的差異與優缺點是浪費時間,因為每個語言都有其優缺點,挑順手的就好了(除非是因為 project 還是 Boss 要求)。
不過就算是現在,我還是覺得 Tcl 很棒(雖然用的人沒有很多),因為 Tcl 的語言規則很簡單但是卻又變化無窮,John Ousterhout 真的好強啊~~~
訂閱:
文章 (Atom)
