From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Ian Price Newsgroups: gmane.lisp.guile.user Subject: Compilation to JS [Update] Date: Wed, 9 Aug 2017 16:20:21 +0100 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1502292122 4398 195.159.176.226 (9 Aug 2017 15:22:02 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 9 Aug 2017 15:22:02 +0000 (UTC) To: "guile-user@gnu.org" Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Wed Aug 09 17:21:54 2017 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dfSnu-0000T0-FG for guile-user@m.gmane.org; Wed, 09 Aug 2017 17:21:50 +0200 Original-Received: from localhost ([::1]:48237 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dfSny-00055t-P1 for guile-user@m.gmane.org; Wed, 09 Aug 2017 11:21:54 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34344) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dfSmY-0004Py-Rt for guile-user@gnu.org; Wed, 09 Aug 2017 11:20:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dfSmW-00089F-W6 for guile-user@gnu.org; Wed, 09 Aug 2017 11:20:26 -0400 Original-Received: from mail-ua0-x234.google.com ([2607:f8b0:400c:c08::234]:36084) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dfSmW-00086e-PL for guile-user@gnu.org; Wed, 09 Aug 2017 11:20:24 -0400 Original-Received: by mail-ua0-x234.google.com with SMTP id k43so29747332uaf.3 for ; Wed, 09 Aug 2017 08:20:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=J+bTY64py/w65LNu9DzeKNUNNRNqq2CBVIhZ6AYY3qw=; b=huqqX9lyEU0cFP0QiutTu4APBcliuujiqsz/ThMZyMfBs+2I8ljKgtAh6+l4G/9KDa eMh+W8Yf+hXz99JL+V/MMlN/KeOFZ5jrehvv6qgK/84oipO7gtbnwzgUK+F3paCseT/p eXW2nq986uvH8dLVT9squ+60mBFbWhS2GtkYKANsN+LK2oKoqo/Lq4x3wVRpRRhjVYb6 DOW1iWrTaO3wGD8ulc8PQONe4DAaD8AJqnNA78f5V5vp1Ig7GrS5jKbFbyKyjgjlxFdI 2XAD0ZyT3o2CEBw2XVwUrRTBxTBFaQJRKXF8PrMjJjIpa9Py31x1GrRO0q1PV/K/xtZU 1t6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=J+bTY64py/w65LNu9DzeKNUNNRNqq2CBVIhZ6AYY3qw=; b=qiLFQREdzzUIcLS2F2yO/TQcNezpHrhyrqFb98/zU4vzdpwlJUYZfA76BRWgU+ArtQ Gp7SwqkcTcW1y21TaewGyKa5r/k86z1n4QWlbkZ0q4l2+IvuNWyk6eQj2KRHzWxbEcBw FqIcGrmfTp4kstjPpvA0u1I8eWfagbAJZfGiDs2k69+iRj58GMOD3Kahypgws8lX2WLs f7mlj/REpQBkfbMQFTv2ywGTa+xdJhsBBfaYWRQhuKNJwxmo0db0IpeSED/dZulXaDts Sdn7EhTt+lyLR+LnN3KL8rMz+614VkafMqwJwqTzBa4Yacvq+a4YR9vuCu+WztuNxcuj QEuw== X-Gm-Message-State: AHYfb5huYaFaMjqucWzTd8Nnf5wh5/jrGEc/2LBDOnFSEEYScvuroUaU vUDVWdM4odazciH1qlhc4VlvJhQMhg3ql9U= X-Received: by 10.176.4.198 with SMTP id 64mr5401829uaw.141.1502292022326; Wed, 09 Aug 2017 08:20:22 -0700 (PDT) Original-Received: by 10.31.224.5 with HTTP; Wed, 9 Aug 2017 08:20:21 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400c:c08::234 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:14026 Archived-At: Hello Guilers, I am long overdue an update on the state of affairs of guile-js (the last was at the end of June). Last time I spoke, I had completed task 1 (cps old -> cps soup), and was starting work on task 2 (port boot-9[1]). I made a lot of headway on this task, and would categorise it as "nearly done". I ran into some trouble with my initial module representation, and this has been blocking further progress, but I hope to have this remedied soon. Those interested can read language/js-il/runtime.js in [2] to see what the current "base" runtime looks like, but it is absolutely dwarfed by the compiled output of ice-9/boot-9, which I do not recommend you look at. Due to time constraints, task 3 (Cheney on the MTA) is not going to be accomplished before the deadline. I apologise for this, and would like to add support for it after the summer, but in any case, we can all take some comfort in the increased support for proper tail calls from JS implementations is making this much less necessary. As for task 4, I have written a script to "link" JS modules with their dependencies, which should make it easier for you to test. For instance, you might have a program merge.scm which sorts a list (e.g. http://shift-reset.com/pastes/merge.html). You can compile this file with guild in the usual way guild compile merge.scm --output=merge.js --to=javascript which you can assemble into a "real" program by including the runtime [3] with guild jslink merge.js --output=main.js --no-boot and then run with node (other js interpreters are available). You will not see any output because that file does not print anything, and ports are a big thing that are not supported yet, but can you can replace the initial (identity) continuation with one that prints the return value (I should probably add a switch for this). jslink is very rough, and I do not intend for this to be the final interface for creating Javascript "bundles", but merely the simplest thing works for now. Better solutions will come from getting all the linker improvements Andy has suggested into Guile [4]. I still don't think this is ready for you all to play with, but once I am happy boot-9 is in good shape, I will declare open season. From now till the deadline, I intend to continue working on getting boot-9 done, and in documenting what is already done. I will post a final summary of the project, including some of the lessons from this project, missing functionality, known bugs, etc. in a few weeks time. Ian [1]. Actually, It was a misnomer to refer to this work as porting, since boot-9 is compiled like any other .scm file, what it really involves is reimplementing guile builtins. [2]. https://gitlab.com/ijp/guile/tree/compile-to-j-2017 [3]. Due to the aforementioned issue with boot-9, --no-boot is used to prevent the inclusion of boot-9 and its dependencies. [4]. https://wingolog.org/archives/2016/02/04/guile-compiler-tasks