From b850f7d1690a3e05cd4ccb73f012500151fb924a Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sun, 20 Dec 2015 14:39:50 -0500 Subject: Return to working version mode --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index a8060104..e0249a75 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_INIT([urweb], [20151220]) -WORKING_VERSION=0 +WORKING_VERSION=1 AC_USE_SYSTEM_EXTENSIONS # automake 1.12 requires this, but automake 1.11 doesn't recognize it -- cgit v1.2.3 From 681382fbe032e10137d78f2308d239483c3e5731 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sun, 20 Dec 2015 15:00:10 -0500 Subject: Imported to Git from Mercurial --- .gitignore | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .hgignore | 80 ------------------------------------------------------------ Makefile.am | 6 ----- README.md | 19 +++++++++++++++ configure.ac | 2 +- 5 files changed, 98 insertions(+), 87 deletions(-) create mode 100644 .gitignore delete mode 100644 .hgignore create mode 100644 README.md (limited to 'configure.ac') diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..b30fa842 --- /dev/null +++ b/.gitignore @@ -0,0 +1,78 @@ +*~ +.cm +src/.cm + +bin/* + +src/urweb.cm +src/urweb.mlb + +*.lex.* +*.grm.* +*.o +.deps +.libs +*.lo +*.la +*.mlton.grm +*.mlton.lex + +src/config.sml + +*.exe + +*.cache +*.log +*.status + +demo/out/*.html +demo/demo.* + +demo/more/out/*.html +demo/more/demo.* + +doc/*.html +doc/*.out + +*.sql +*mlmon.out + +*.aux +*.dvi +*.pdf +*.ps +*.toc + +.depend +Makefile.coq +*.vo +*.v.d +*.glob + +xml/parse +xml/entities.sml + +Makefile.in +src/c/Makefile.in +ar-lib +*.m4 +m4/libtool.m4 +m4/lt*.m4 +config.* +configure +depcomp +compile +install-sh +ltmain.sh +missing + +tests/*.db + +syntax: regexp + +Makefile +src/c/Makefile +libtool +include/urweb/config.h +include/urweb/config.h.in +include/urweb/stamp-h1 diff --git a/.hgignore b/.hgignore deleted file mode 100644 index 20e290b8..00000000 --- a/.hgignore +++ /dev/null @@ -1,80 +0,0 @@ -syntax: glob - -*~ -.cm -src/.cm - -bin/* - -src/urweb.cm -src/urweb.mlb - -*.lex.* -*.grm.* -*.o -.deps -.libs -*.lo -*.la -*.mlton.grm -*.mlton.lex - -src/config.sml - -*.exe - -*.cache -*.log -*.status - -demo/out/*.html -demo/demo.* - -demo/more/out/*.html -demo/more/demo.* - -doc/*.html -doc/*.out - -*.sql -*mlmon.out - -*.aux -*.dvi -*.pdf -*.ps -*.toc - -.depend -Makefile.coq -*.vo -*.v.d -*.glob - -xml/parse -xml/entities.sml - -Makefile.in -src/c/Makefile.in -ar-lib -*.m4 -m4/libtool.m4 -m4/lt*.m4 -config.* -configure -depcomp -compile -install-sh -ltmain.sh -missing - -tests/*.db - -syntax: regexp - -^Makefile$ -^src/c/Makefile$ -^libtool$ -^include/urweb/config.h$ -^include/urweb/config.h.in$ -^include/urweb/stamp-h1$ diff --git a/Makefile.am b/Makefile.am index ab11999e..9ab31acd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -105,12 +105,6 @@ uninstall-local-main: uninstall-local: uninstall-local-main uninstall-emacs -package: - hg archive -t tgz -X tests "/tmp/urweb-$(VERSION).tgz" - -reauto: - ./autogen.sh - EXTRA_DIST = demo doc lib/js lib/ur xml \ src/coq src/*.sig src/*.sml src/*.mlb src/config.sml.in src/elisp src/*.cm src/sources src/*.grm src/*.lex \ CHANGELOG LICENSE urweb.ebuild include/urweb/*.h bin diff --git a/README.md b/README.md new file mode 100644 index 00000000..af4201bc --- /dev/null +++ b/README.md @@ -0,0 +1,19 @@ +# The Ur/Web Programming Language + +Implementation of a domain-specific functional programming language for web applications. Please see [the Ur/Web project web site](http://www.impredicative.com/ur/) for much more information! Here's a summary: + +Ur is a programming language in the tradition of ML and Haskell, but featuring a significantly richer type system. Ur is functional, pure, statically typed, and strict. Ur supports a powerful kind of metaprogramming based on row types. + +Ur/Web is Ur plus a special standard library and associated rules for parsing and optimization. Ur/Web supports construction of dynamic web applications backed by SQL databases. The signature of the standard library is such that well-typed Ur/Web programs "don't go wrong" in a very broad sense. Not only do they not crash during particular page generations, but they also may not: + +* Suffer from any kinds of code-injection attacks +* Return invalid HTML +* Contain dead intra-application links +* Have mismatches between HTML forms and the fields expected by their handlers +* Include client-side code that makes incorrect assumptions about the "AJAX"-style services that the remote web server provides +* Attempt invalid SQL queries +* Use improper marshaling or unmarshaling in communication with SQL databases or between browsers and web servers + +This type safety is just the foundation of the Ur/Web methodology. It is also possible to use metaprogramming to build significant application pieces by analysis of type structure. For instance, the demo includes an ML-style functor for building an admin interface for an arbitrary SQL table. The type system guarantees that the admin interface sub-application that comes out will always be free of the above-listed bugs, no matter which well-typed table description is given as input. + +The Ur/Web compiler also produces very efficient object code that does not use garbage collection. These compiled programs will often be even more efficient than what most programmers would bother to write in C. For example, the standalone web server generated for the demo uses less RAM than the bash shell. The compiler also generates JavaScript versions of client-side code, with no need to write those parts of applications in a different language. diff --git a/configure.ac b/configure.ac index e0249a75..6d4b7233 100644 --- a/configure.ac +++ b/configure.ac @@ -91,7 +91,7 @@ if test [-z $SQHEADER]; then fi if test [$WORKING_VERSION = "1"]; then - VERSION="$VERSION + `hg identify || (cat .hg_archival.txt | grep 'node\:') || echo ?`" + VERSION="$VERSION + `git log -1 --format="%H" || (cat .hg_archival.txt | grep 'node\:') || echo ?`" fi # Clang does not like being passed -pthread, since it's implicit on OS X. -- cgit v1.2.3 From e7c13d8091aa060a2ed7a769d9b6885dfd6b2b6e Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sun, 20 Dec 2015 15:06:14 -0500 Subject: Remove old Mercurial reference --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 6d4b7233..1b7e8aa5 100644 --- a/configure.ac +++ b/configure.ac @@ -91,7 +91,7 @@ if test [-z $SQHEADER]; then fi if test [$WORKING_VERSION = "1"]; then - VERSION="$VERSION + `git log -1 --format="%H" || (cat .hg_archival.txt | grep 'node\:') || echo ?`" + VERSION="$VERSION + `git log -1 --format="%H" || echo ?`" fi # Clang does not like being passed -pthread, since it's implicit on OS X. -- cgit v1.2.3 From 6155dea6b97d066f148439bcc93134bc9f566a11 Mon Sep 17 00:00:00 2001 From: Jason Gross Date: Wed, 30 Dec 2015 16:13:58 -0500 Subject: Move some things around in configure.ac This supresses "WARNING: `missing' script is too old or missing" --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 1b7e8aa5..9f7aebbc 100644 --- a/configure.ac +++ b/configure.ac @@ -5,10 +5,10 @@ AC_USE_SYSTEM_EXTENSIONS # automake 1.12 requires this, but automake 1.11 doesn't recognize it m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) +AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([-Wall -Werror foreign no-define]) AC_PROG_CC() AC_PROG_LIBTOOL() -AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADERS([include/urweb/config.h]) AX_PTHREAD([echo >/dev/null], [echo "Your C compiler does not support POSIX threads."; exit 1]) @@ -160,7 +160,7 @@ Ur/Web configuration: include directory: INCLUDE $INCLUDE site-lisp directory: SITELISP $SITELISP C compiler: CC $CC - Extra CC args: CCARGS $CCARGS + Extra CC args: CCARGS $CCARGS Extra MLTON args: MLTONARGS $MLTONARGS Postgres C header: PGHEADER $PGHEADER MySQL C header: MSHEADER $MSHEADER -- cgit v1.2.3 From f5f93f6efc15ade5945e8572d889f22d198611b9 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Thu, 31 Dec 2015 17:54:12 -0500 Subject: Upgrade M4 macros for pthreads and remove custom workaround --- configure.ac | 18 ----------- m4/m4_ax_pthread.m4 | 90 +++++++++++++++++++++++++++++++++++------------------ 2 files changed, 60 insertions(+), 48 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 9f7aebbc..fc7ba433 100644 --- a/configure.ac +++ b/configure.ac @@ -94,24 +94,6 @@ if test [$WORKING_VERSION = "1"]; then VERSION="$VERSION + `git log -1 --format="%H" || echo ?`" fi -# Clang does not like being passed -pthread, since it's implicit on OS X. -# So let's get rid of that! Here's to hoping it doesn't break Clang -# on other platforms. -AC_MSG_CHECKING([if compiling with clang]) -AC_COMPILE_IFELSE( -[AC_LANG_PROGRAM([], [[ -#ifndef __clang__ - not clang -#endif -]])], -[CLANG=yes], [CLANG=no]) -AC_MSG_RESULT([$CLANG]) - -if test [$CLANG = "yes"]; then - PTHREAD_CFLAGS="" - PTHREAD_LIBS="" -fi - # Check if pthread_t is a scalar or pointer type so we can use the correct # OpenSSL functions on it. AC_MSG_CHECKING([if pthread_t is a pointer type]) diff --git a/m4/m4_ax_pthread.m4 b/m4/m4_ax_pthread.m4 index a6bf596c..d383ad5c 100644 --- a/m4/m4_ax_pthread.m4 +++ b/m4/m4_ax_pthread.m4 @@ -82,7 +82,7 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 16 +#serial 21 AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) AC_DEFUN([AX_PTHREAD], [ @@ -103,8 +103,8 @@ if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) - AC_TRY_LINK_FUNC(pthread_join, ax_pthread_ok=yes) - AC_MSG_RESULT($ax_pthread_ok) + AC_TRY_LINK_FUNC([pthread_join], [ax_pthread_ok=yes]) + AC_MSG_RESULT([$ax_pthread_ok]) if test x"$ax_pthread_ok" = xno; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" @@ -145,8 +145,8 @@ ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mt # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) -case "${host_cpu}-${host_os}" in - *solaris*) +case ${host_os} in + solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based @@ -159,11 +159,25 @@ case "${host_cpu}-${host_os}" in ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags" ;; - *-darwin*) + darwin*) ax_pthread_flags="-pthread $ax_pthread_flags" ;; esac +# Clang doesn't consider unrecognized options an error unless we specify +# -Werror. We throw in some extra Clang-specific options to ensure that +# this doesn't happen for GCC, which also accepts -Werror. + +AC_MSG_CHECKING([if compiler needs -Werror to reject unknown flags]) +save_CFLAGS="$CFLAGS" +ax_pthread_extra_flags="-Werror" +CFLAGS="$CFLAGS $ax_pthread_extra_flags -Wunknown-warning-option -Wsizeof-array-argument" +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int foo(void);],[foo()])], + [AC_MSG_RESULT([yes])], + [ax_pthread_extra_flags= + AC_MSG_RESULT([no])]) +CFLAGS="$save_CFLAGS" + if test x"$ax_pthread_ok" = xno; then for flag in $ax_pthread_flags; do @@ -178,7 +192,7 @@ for flag in $ax_pthread_flags; do ;; pthread-config) - AC_CHECK_PROG(ax_pthread_config, pthread-config, yes, no) + AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no]) if test x"$ax_pthread_config" = xno; then continue; fi PTHREAD_CFLAGS="`pthread-config --cflags`" PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" @@ -193,7 +207,7 @@ for flag in $ax_pthread_flags; do save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS $ax_pthread_extra_flags" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we @@ -219,7 +233,7 @@ for flag in $ax_pthread_flags; do LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" - AC_MSG_RESULT($ax_pthread_ok) + AC_MSG_RESULT([$ax_pthread_ok]) if test "x$ax_pthread_ok" = xyes; then break; fi @@ -245,54 +259,70 @@ if test "x$ax_pthread_ok" = xyes; then [attr_name=$attr; break], []) done - AC_MSG_RESULT($attr_name) + AC_MSG_RESULT([$attr_name]) if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then - AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name, + AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], [$attr_name], [Define to necessary symbol if this constant uses a non-standard name on your system.]) fi AC_MSG_CHECKING([if more special flags are required for pthreads]) flag=no - case "${host_cpu}-${host_os}" in - *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; - *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; + case ${host_os} in + aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";; + osf* | hpux*) flag="-D_REENTRANT";; + solaris*) + if test "$GCC" = "yes"; then + flag="-D_REENTRANT" + else + # TODO: What about Clang on Solaris? + flag="-mt -D_REENTRANT" + fi + ;; esac - AC_MSG_RESULT(${flag}) + AC_MSG_RESULT([$flag]) if test "x$flag" != xno; then PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" fi AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT], - ax_cv_PTHREAD_PRIO_INHERIT, [ - AC_LINK_IFELSE([ - AC_LANG_PROGRAM([[#include ]], [[int i = PTHREAD_PRIO_INHERIT;]])], + [ax_cv_PTHREAD_PRIO_INHERIT], [ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[int i = PTHREAD_PRIO_INHERIT;]])], [ax_cv_PTHREAD_PRIO_INHERIT=yes], [ax_cv_PTHREAD_PRIO_INHERIT=no]) ]) AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"], - AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], 1, [Have PTHREAD_PRIO_INHERIT.])) + [AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.])]) LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" - # More AIX lossage: must compile with xlc_r or cc_r - if test x"$GCC" != xyes; then - AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC}) - else - PTHREAD_CC=$CC + # More AIX lossage: compile with *_r variant + if test "x$GCC" != xyes; then + case $host_os in + aix*) + AS_CASE(["x/$CC"], + [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6], + [#handle absolute path differently from PATH based program lookup + AS_CASE(["x$CC"], + [x/*], + [AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])], + [AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])]) + ;; + esac fi -else - PTHREAD_CC="$CC" fi -AC_SUBST(PTHREAD_LIBS) -AC_SUBST(PTHREAD_CFLAGS) -AC_SUBST(PTHREAD_CC) +test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" + +AC_SUBST([PTHREAD_LIBS]) +AC_SUBST([PTHREAD_CFLAGS]) +AC_SUBST([PTHREAD_CC]) # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$ax_pthread_ok" = xyes; then - ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1]) + ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1]) : else ax_pthread_ok=no -- cgit v1.2.3 From 3044fbedd58961f8c1168eb3bc2eeeb8a2b0b60e Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sat, 13 Feb 2016 09:51:30 -0500 Subject: New release --- CHANGELOG | 9 +++++++++ configure.ac | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'configure.ac') diff --git a/CHANGELOG b/CHANGELOG index 097ece99..701e9c03 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,12 @@ +======== +20160213 +======== + +- .urp 'library' directive: only process a given library the first time it is referenced +- For maintenance of Ur/Web project source code, switched from Mercurial to Git +- Added Travis integration +- Bug fixes and improvements to type inference and compatibility + ======== 20151220 ======== diff --git a/configure.ac b/configure.ac index fc7ba433..351d1129 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ -AC_INIT([urweb], [20151220]) -WORKING_VERSION=1 +AC_INIT([urweb], [20160213]) +WORKING_VERSION=0 AC_USE_SYSTEM_EXTENSIONS # automake 1.12 requires this, but automake 1.11 doesn't recognize it -- cgit v1.2.3