Code Monkey home page Code Monkey logo

Comments (4)

bpfoley avatar bpfoley commented on May 29, 2024 1

I'm working on this and have gotten to the point where I can use the system version of tcl/tk 8.6 itcl/itk 3.4 on Ubuntu. I've some polishing up to do, but hopefully it shouldn't take too much longer.

from bsc.

bpfoley avatar bpfoley commented on May 29, 2024

It's a bit worse than that. bsc currently vendors 8.5.4 which is from 2008. The latest version of 8.5 is 8.5.19 from 2016.

From talking to a former bsc developer, I believe the vendored Tcl/Tk has patches to the core Tcl code to allow the Bluesim/Haskell integrationrather than doing it with a Tcl extension. We need to verify if this is the case, but if it is, we need to resolve this before we can use the/a system Tcl.

from bsc.

thoughtpolice avatar thoughtpolice commented on May 29, 2024

There seems to be two main differences between a stock version of tcl 8.5.4 and what is shipped in this repository:

diff --no-dereference -u -r ./upstream/tcl8.5.4/generic/tclIO.c ./tcltk8.5.4/tcl8.5.4/generic/tclIO.c
--- ./upstream/tcl8.5.4/generic/tclIO.c 2008-05-23 16:10:43.000000000 -0500
+++ ./tcltk8.5.4/tcl8.5.4/generic/tclIO.c       2020-02-06 13:52:29.621490343 -0600
@@ -6232,6 +6232,7 @@
        SetFlag(statePtr, CHANNEL_EOF);
        statePtr->inputEncodingFlags |= TCL_ENCODING_END;
     } else if (nread < 0) {
+        if (result == 512) result = EAGAIN; /* work around Linux kernel bug */
        if ((result == EWOULDBLOCK) || (result == EAGAIN)) {
            SetFlag(statePtr, CHANNEL_BLOCKED);
            result = EAGAIN;

and

diff --no-dereference -u -r ./upstream/tcl8.5.4/unix/Makefile.in ./tcltk8.5.4/tcl8.5.4/unix/Makefile.in
--- ./upstream/tcl8.5.4/unix/Makefile.in        2008-08-14 12:31:38.000000000 -0500
+++ ./tcltk8.5.4/tcl8.5.4/unix/Makefile.in      2020-02-06 13:52:29.682491436 -0600
@@ -6,6 +6,12 @@
 #
 # RCS: @(#) $Id: Makefile.in,v 1.229.2.8 2008/08/13 23:07:16 das Exp $

+# Bluespec added:
+# Use vfork instead of fork, as this is much more efficient especially
+# for large memory images in bluewish.
+# fork/vfork is used in the exec tclcommand, to launch other processes.
+EXTRA_CFLAGS += -DUSE_VFORK
+
 VERSION                = @TCL_VERSION@
 MAJOR_VERSION          = @TCL_MAJOR_VERSION@
 MINOR_VERSION          = @TCL_MINOR_VERSION@

The "linux kernel bug" is entirely unclear, and the usage of vfork(2) is more obvious but still somewhat unexplained by what parameters it can be triggered under, as the Linux memory manager probably changed a lot since this was initially patched.

At the very least, this is hopefully an indication that using the system tcl isn't impossible/extremely difficult, but some more investigation/testing would be needed.

from bsc.

bpfoley avatar bpfoley commented on May 29, 2024

Done by PR #78. This will need to be tested with OSes other than Ubuntu 16.04/18.04

from bsc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.