14 ms·
Wapp – a single-file web framework by the creator of SQLite
- tomcam 9y agoThere are two versions, one with SQLite built in. The choice of TCL is super interesting given its pedigree and could easily bring TCL back from its quiescent state.
- simcop2387 9y agoIt's likely tcl because the origins of sqlite we're an extension of tcl.
- deleted 9y ago[deleted]
- TheAceOfHearts 9y agoSeems unlikely, IMO. I tried Tcl/Tk and wanted to like it, but it's all over the place. Half the docs you find are outdated, and figuring out how certain pieces connect together is a bit like walking through a maze. Worse yet, a lot of the tools aren't open source or freely available, even for tinkering. I'll happily pay for a license if I end up using it for business, but I'm not going to pay hundreds of dollars up front just to play around with a niche language. There's lots of great languages out there which include completely free and open source tools. Maybe I'm spoiled.
- andrewshadura 9y agoWhat you’re saying it quite the opposite to what it actually is. All docs are in one place (well, two places both hosted at tcl.tk), one of them is the actual docs (also installed as manpages on your system), and the other one is the wiki, a huge source of useful information written by both developers and other users. I can't think of how Tcl/Tk docs can be massively outdated given that Tcl/Tk maintains almost 100% backwards compatibility, so most of the old advice works just as is. Regarding open source, nearly all tools are not only open source, but usually under very permissive licenses (e.g. Expat or BSD-2), and there are in fact very few commercial closed-source tools (basically Komodo, what else?). Are you sure you actually tried Tcl/Tk and not something else?
- zwischenzug 9y agoI worked for the company that powered most of the world's (legitimate) online gambling companies. We had a C application server and used TCL as a business logic language. It was a great fit for writing code fast and ease of maintenance. You can hear me get a laugh when I say we use TCL in a talk I did here: https://www.youtube.com/watch?v=zVUPmmUU3yY https://www.youtube.com/watch?v=zVUPmmUU3yY
- symisc_devel 9y agoCurious to know if this C application server is an open project or home crafted closed code?
- tpm 9y agoIf the company in question is Openbet, it's closed source.
- zwischenzug 9y agoI wish it were opened up. It was a thing of beauty.
- markroseman 9y agoThis (or anything else) isn't going to bring back a resurgence in Tcl use. A simple web app framework like this is something many languages have, and I think in this case it's best seen not so much about the web framework being the centrepiece. Instead, for the existing (and generally aging) body of people who have a good sized chunk of their work in Tcl, this becomes another utility to build an interface to that other code. As an aside, Tcl was influential as a source of inspiration in the early days, ranging from event-driven programming, to web servers big (AOLserver) and small (Brent Welch and Stephen Uhler's <200 line server/HTML parser) back when "normal" was forked CGI scripts.
- gnachman 9y agoAolserver’s legacy lives on?
- elvinyung 9y agoI hate to be the young whippersnapper parrotting buzzwords, but CGI is theoretically supposed to lend itself really easily to deployment onto serverless runtimes, right?
- hamandcheese 9y agoCGI predates serverless by quite a bit. It’s basically a standard interface for a web server to let any arbitrary executable handle a HTTP request. https://en.m.wikipedia.org/wiki/Common_Gateway_Interface https://en.m.wikipedia.org/wiki/Common_Gateway_Interface
- symisc_devel 9y agoNote that Hipp before working on SQLite was a member of the TCL core board and wrote something similar in the early 2001: A database-driven web server in a self-contained executable named TWS where dynamic content is served from TCL. http://www.hwaci.com/sw/tws/index.html http://www.hwaci.com/sw/tws/index.html
- djhworld 9y agoThere's a bug on the site, if you click "files" then scroll down and click one of the links under "Further Information", you get a 404
- SQLite 9y agoThanks for reporting this. It is an interesting problem, that I'm not sure how to solve (being yet early and I without coffee). The README.md file is the homepage. It is intended to be displayed using the URL https://wapp.tcl.tk/index.html/doc/trunk/README.md https://wapp.tcl.tk/index.html/doc/trunk/README.md and the hyperlinks are relative to that URL. When you click on the File menu, it shows the README.md file using a different URL - http://wapp.tcl.tk/index.html/dir?ci=tip http://wapp.tcl.tk/index.html/dir?ci=tip - and the hyperlinks don't work for that URL. Perhaps the right solution is to rename the README.md file to something different so that it is not displayed by default from the Files menu...
- lazyjones 9y agoPerhaps a ``<base>`` tag (set to directory of the included file, i.e. that of README.md) would suffice, since all other URLs on the page seem to be anchored to the site's root?
- Intermernet 9y agoFIX: Get Coffee.
- crncosta 9y agoThe "everything is a string" mantra Will be back!?! The Millenial programmer will try to comment out a line of code while the TCL interpreter Will insists that is a validade code... Come on guys, let some technologies dies peacefully, Ok? We don't want those days back :)
- setquk 9y agoI was quite happy with those days!
- pjmlp 9y agoMe too, it was the foundation ground of our .com wave startup.
- kees99 9y agoNot to disagree with you, but - what "modern" alternative would you recommend as a replacement for "wapptclsh", which is a compact statically-linked binary with wapp and sqlite libraries baked in? Binary "wapptclsh" + your .tcl script + optionally .sqlite file, just 2-3 files are sufficient to make an app chroot/jail/container, if I understood correctly section 2.0 here: https://wapp.tcl.tk/index.html/doc/trunk/docs/compiling.md https://wapp.tcl.tk/index.html/doc/trunk/docs/compiling.md
- jerf 9y agoFor those concerns, I'd say Go. You can statically link in any pure-Go library trivially. SQLite specifically may require a C file because of its nature, but for accessing databases that take network connections there's a pure-Go driver for most things you've heard of, and there are other static database options for Go if you want them (though they tend more towards NoSQL; if that's really a problem personally I'd just bite the bullet and include the SQLite's library).
- mhd 9y agoI really liked programming in Tcl way back when. The ease of producing utility UI programs with Tk was a benefit even if the main part of the program was purely server-based (I used it for data management, reporting etc.). And while the language had its warts, the syntax was relatively easy to comprehend, so even if things went southwards, it didn't take long to see where you made your mistakes. As long as you didn't upvar and uplevel the heck out of it. Also very easy to create DSLs with it and drop down to C if you needed a function to be a bit faster. Tcl would be a lot more popular if it weren't for Sun's divided interests, and if they managed to get something CPAN/GEM/NPM-ish up waaaaaay earlier.
- SlowBro 9y agoI like the idea but I’m not quite ready to learn a new language at the moment. Can anyone recommend something similar in Python? The single-file part is less important to me than the simple API. I’m a simple guy and my app will be simple as well :-)
- eeZah7Ux 9y agoBottle is truly single-file, no dependencies and faster than Flask.
- luibelgo 9y agoFalcon has good performance characteristics, nice API: https://falconframework.org https://falconframework.org
- cjalmeida 9y agoIIRC Falcon only does REST, it has no template rendering. (To me, that's a plus)
- aserafini 9y agoThe equivalent framework in Python is probably bottle.py: https://bottlepy.org/docs/dev/ https://bottlepy.org/docs/dev/
- dpwm 9y agoBottle [0] is single file, simple web framework for Python. It's pretty easy to use and well documented. It has no dependencies outside the standard library but can optionally use a number of more robust web servers. Flask [1] has similarities and IIRC the author of Flask, Armin Ronacher, has in the past proposed merging it with Bottle. However, the single file and dependencies thing is where the author of each framework disagrees. Flask has tools that help with structuring larger apps and seems to be more widely used than Bottle. Personally, I prefer bottle for things I know will remain small, just for the lack of dependencies and that I personally find the documentation easier to read. [0] http://bottlepy.org/docs/stable/ http://bottlepy.org/docs/stable/ [1] http://flask.pocoo.org/ http://flask.pocoo.org/
- speedplane 9y agoI get it that TCL is often the tool of choice with programmers that want to build a simple UI that gets things done. It's easy and cross-platform. But I have yet to see a beautiful TCL application. Web apps today can't just work, they have to be user-friendly and familiar to a wide audience. Would love to be proven wrong, but TCL does not seem to fit the bill.
- StevePerkins 9y agoThis is more or less a TCL version of Node's Express. I'm not necessarily advocating for that... but what on earth does anyone's choice of server-side framework have to do with the "user-friendliness" or "familiarity" of the client-side UX? You can serve up a bleeding edge Vue.js app from a PHP backend, or you could serve up a bowl of jQuery spaghetti from Rust or whatever new language comes out next week. These matters can sometimes be tangentially related, but are largely orthogonal.
- speedplane 9y agoI'm probably misreading this article. I've always known TCL as the quick-and-dirty user interface of choice. I guess that's not the focus here.
- StevePerkins 9y agoI honestly doubt you clicked the link at all before commenting, and likewise doubt that you've actually had any first-hand exposure to Tcl in the past. You SEEM to be referencing the "Tk" portion of Tcl/Tk. Tk is the desktop GUI framework that comes with most distributions of Tcl. But it has no apparent relevance to this or any other Tcl-based web framework. This is kinda like dismissing a Java server-side web framework because Swing is ugly, or dismissing C# on the web because you don't like WPF.
- speedplane 9y agoOkay, happy to admit when I'm not fully informed, and this is one of those times. I have interacted with TCL/TK and have made small programs with it, but I have not used TCL directly in the past. In fact, did not even realize TCL was a full language. When I read this article, given my background with TCL/TK, I understood it to be a web framework using a weird desktop GUI... which would be quite odd.
- SwellJoe 9y agoOne of the things I like about Mojolicious (a pretty full-featured async web framework in Perl in an incredibly small amount of code) is that it has a Lite variant, which allows building your whole app (routes, app functions, helper functions, models, data, etc.) in a single file. Once you've gotten it off the ground and the one small file starts to become one big file and it starts feeling hairy, you switch to the full version, and break out all the pieces into the usual directory layout (which can be done mostly automatically). With regard to Wapp and some of the comments here disparaging Tcl...I've often said Tcl gets much more hate than it deserves. For a lot of tasks, it's fine. I wouldn't pick it for anything, but I understand why some folks still do. And, I did build my current companies first website with Tcl (OpenACS+AOLServer) more than a decade ago. It was more enjoyable to work with than all of the PHP CMS-based sites I've built for the company since then. I wouldn't rule it out, if there were some project I wanted to use that happened to be written in Tcl.
- nopacience 9y agoMojolicious is fantastic! A plus is that its complete and has zero dependencies on other modules. So its very quick to install. It is good to see mojolicious be mentioned here at HN. Mojolicious::Lite docs http://mojolicious.org/perldoc/Mojolicious/Lite#SYNOPSIS http://mojolicious.org/perldoc/Mojolicious/Lite#SYNOPSIS
- giancarlostoro 9y agoI've not tried Perl since, but when I did it was the only web framework I ever tried and it was pretty nice.
- f055 9y agoMojolicious is beyond fantastic! I have a hard time touching anything else, as every step of the way I think "damn this could have been so much easier with mojo..."
- smrtinsert 9y agoI miss my aolserver days. It ns_put itself into my heart perfectly.
- operatorequals 9y agoOur savior, save as from bloated package management, API inconsistencies and Server-side Javascript. Thank you!
- sigzero 9y agoI love Tcl. The community is great. I watch the TCT (Tcl Core Team) and they are very meticulous about what changes are being made in the language. Tcl has added some things in the last few years as well. It has an object oriented framework built in (TclOO) now, which most people don't know about. I think I love it because it IS so different.
- markroseman 9y agoThis. It's like watching master craftsmen work on some parts for the sheer joy and challenge. (Pity the parts that don't have the craftsmen working on them mind you)
- scruple 9y agoI really enjoyed working with it when I was writing Expect scripts (a long, long time ago) and found myself writing some Tcl scripts alongside the Expect-specific bits. What sorts of things are you using it for?
- sigzero 9y agoI use it for sysadmin scripts and quick Tk gui utility stuff. I have some ideas that I want to express in Tcl as well.
- rhemgla_corp 9y agoMojolicious is great! Here are some useful lite docs: https://2no.co/1QyvB6 https://2no.co/1QyvB6
- nohope 9y agoI'm not a web developer but the times I tried to do some web development I found all the things cool kids talked about overly complicated and fell back to simple things like simple scripts on the server side and simple javascript on the client side or even semi dynamic/static webpages. I always found interesting how the Tcl community solve things, using simple and powerful Tcl metaprogramming features (see beautiful examples on wiki.tcl.tk). I've done a couple of small business solutions in Tcl/Tk as desktop applications. Now I feel more encouraged to try to develop new ones for the web :-)