Giter VIP home page Giter VIP logo

jzignet's People

Contributors

greenfork avatar iacore avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

jzignet's Issues

(sh/exec-slurp) returns nil

I don't understand why this is happening.

here's the program. res is Janet nil.

const std = @import("std");
const janet = @import("janet");

pub fn main() !void {
    try janet.init();
    const env = janet.Environment.coreEnv(null);
    // var env_ = janet.Table.initDynamic(0);
    // env_.proto = core_env.toTable();
    // const env = env_.toEnvironment();
    // janet.gcRoot(env_.wrap()); // this doesn't fix the problem either

    _ = try env.doString("(import spork/sh)", "embed");
    _ = try env.doString(
        \\(pp (sh/exec-slurp "uname"))
    , "embed");
    const res = try env.doString(
        \\(sh/exec-slurp "uname")
    , "embed");
    _ = res;
    @breakpoint();
}

To reproduce this problem:

First clone the repo

git clone https://github.com/iacore/janet-graphical-repl  -b f3ceb4e

here's what I see

user@x17 ~/c/g/janet-graphical-repl (debug)
❯ zig build
user@x17 ~/c/g/janet-graphical-repl (debug)
❯ lldb zig-out/bin/janet-dvui
(lldb) target create "zig-out/bin/janet-dvui"
Current executable set to '/home/user/computing/gui/janet-graphical-repl/zig-out/bin/janet-dvui' (x86_64).
(lldb) r
Process 26114 launched: '/home/user/computing/gui/janet-graphical-repl/zig-out/bin/janet-dvui' (x86_64)
Process 26114 stopped and restarted: thread 1 received signal: SIGCHLD
"Linux"
Process 26114 stopped and restarted: thread 1 received signal: SIGCHLD
Process 26114 stopped
* thread #1, name = 'janet-dvui', stop reason = signal SIGTRAP
    frame #0: 0x000000000027d70e janet-dvui`main.main at main.zig:20:5
   17  	       \\(sh/exec-slurp "uname")
   18  	   , "embed");
   19  	   _ = res;
-> 20  	   @breakpoint();
   21  	}
(lldb) p res
(janet.Janet__union_5967) $0 = (u64 = 18444633011384221697, i64 = -2111062325329919, number = NaN, pointer = 0xfff8800000000001)
(lldb) 

0xfff8800000000001 is nil

If you don't believe me you can replace the line \\(sh/exec-slurp "uname") with \\nil.

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.