1.  

    Does anyone use J? When I looked it up it looks like a code golf language.

    1.  

      @hwayne has done two write-ups on it he submitted here to Lobsters:

      Handwriting Programs in J

      Calculating Burn Rates in J

      1.  

        It’s terse but useable. The environment/REPL is quite nice. I wrote a post about the J FFI a while back.

        1.  

          The environment/REPL is quite nice.

          Less famously than the symbols/terseness, this has been a big part of the APL-family ethos over the years too, which is an interesting combination. There’s an anecdote claiming that the original APL having a conveniently interactive time-sharing interpreter, in the era when most stuff was run as batch jobs, was even the main reason APL became established within IBM:

          The history of APL at IBM has been a curious one. In the early days, those of us who believed in APL were regarded as being a little (perhaps more than a little) strange. Since much of the strangeness was concentrated in IBM Research, this was tolerated. Practical people (the kind of people who make sales and meet payrolls) expect research people to be strange and are usually disappointed when they’re not. So the strange people in Research were written off as overhead and left to amuse themselves with their incomprehensible, impractical symbols.

          What that particular Research group did, of course, was produce the most solid, dependable, useful time-sharing system anyone had ever seen. I wish I could tell you what it felt like in those early days to have the use of a system that was up twenty-four hours a day, seven days a week. No one had ever known such a luxury. People who didn’t bother to investigate never believed us when we told them about it.

          But some people did investigate what the researchers had developed and started to use it to do IBM’s key bread-and-butter applications. This way of doing business was so productive that it spread like wildfire. By the time the practical people found out what had happened; APL was so important a part of how IBM ran its business that it could not possibly be uprooted.

          1.  

            Do you know how to access a global variable from a library? Such as extern WINDOW *stdscr;.

            1.  

              Unfortunately I don’t know of a way, other than wrapping it in a C function to return the pointer, sorry.

          2.  

            I have a simple lbfgs ported to J. If anyone is interested, https://gist.github.com/jxy/9db97e44708d0946c3da2d7e82fefcd0

            1.  

              It makes a fantastic calculator.

            1. 1

              This is nice. There have been ports of Inferno to run on Android before, but not as an app, for example Hellaphone. I’ve often thought a neat project would be to have an Android launcher that used Inferno, so it wouldn’t require rooting a phone to run. This project gives an idea of how it could work.

              On the inferno mailing list there have been suggestions to write apps that expose phone functionality using the Styx protocol to enable Inferno to access it. I gave an example of how sharing resources on the phone could work using Hellaphone a few years ago.

              1. 1

                I tried to install it on my 2012 Nexus 7” running cyanogenmod, system was not happy, will try and follow up with the project and see where the issue lies. Would be cool to have it running.

              1. 2

                that’s pretty exciting! i was just this weekend looking at the oz/mozart home page, wondering if the language were dead or not (i wanted to use it for a small project, just to play with it, but concluded that it did indeed look unmaintained)

                1. 3

                  I use Mozart/Oz in projects and help keep the bitrot away from the 1.3.x and 1.4.x versions. The Mozart 2 version runs but is lacking features - distributed objects and constraints being the most notable. I feel like there needs to be a “1.5” interim release, maintained and with binaries, to show activity.

                  The project tends to suffer from being used as a university/research project. People do work on masters thesis to contribute a feature to it, then they disappear and that feature doesn’t get maintained, extended, made production ready, etc.

                  That said, it’s still a great system to use.

                  1. 2

                    i should have known that if anyone was using it you would be :) do you have a more recent version of 1.4.x than the one in the repo, or have you been pushing all your changes?

                    1. 2

                      I’ve pushed all my changes so it should build on Linux at least. I recommend using the 1.3.x branch as 1.4.x has some annoying bugs. Distributed search is broken, distribution statistics don’t work, due to a switch to a C++ based library to do object distribution and bugs didn’t get ironed out. It only matters if you plan to use those features though. I’ve backported some of the actual bug fixes from 1.4.x to 1.3.x.

                    2. 1

                      What do you use it for?

                      1. 3

                        Originally I wrote a bitcoin mining pool using Mozart/Oz, before transitioning it to ATS. Current usage is for deployment and management of a couple of servers. It uses the distribution features, and constraints solving, to work out what to install, uninstall, etc based on changes to configuration files. It has a user interface using the Roads web framework. It’s a toy system I built to explore ideas as an ansible alternative. I’ve done various incarnations in Prolog and Mozart/Oz.

                        What might interest you is some old articles on using Mozart/Oz for proving things. See “A Program Verification System Based on Oz”, “Compiling Formal Specifications to Oz Programs” and “Deriving Acceptance Tests from Goal Requirements” in Multiparadigm programming in Mozart/Oz.

                        1. 1

                          I saved it for when I have Springer access. I am interested in it as a multiparadigm language as well. Did you find the constraint solving to be as good as an industrial solver integrated with a good 3GL? Or still better for performance or usability to just go with dedicated tools? I know a lot of people liked that Prolog could do some forms of parsing or solving but language made it harder to use some better methods. I figured something similar could happen with Mozart/Oz trying to do too many paradigms at once.

                          1. 4

                            The constraint solver in Mozart/Oz has many interesting features, but in the end it is, IMHO, just too old to be competitive with a modern solver.

                            For constraint solving, I would probably use Gecode, or_tools, or Choco depending on the particular use-case one has and the technical requirements. If money is not an issue, IBM CP Optimizer seems to be very very good.

                            To explore a particular problem, I typically write the model in MiniZinc since it is a reasonably high level modelling language that allows me the switch between solving backends. In particular, I like that I can try out a problem with both a normal solver (such as Gecode) and a lazy clause generation solver such as Chuffed.

                            Of course, the particular problem might be better suited for SMT solving (using Z3), MIP solvers (CPLEX or Gurobi), or perhaps a custom algorithm.

                            Another thing to consider is correctness. Optimization systems such as constraint solvers are a complex pieces of software, with lots of possibilities for bugs. Off-by-one errors in particular are very common. If I were to depend on an optimization system, I would prefer one that is maintained, has been around for a while, and that has a reasonably large set of automated tests.

                            1. 1

                              Thanks for the great summary!

                              On related note, if you’re into CHR, I just submitted a paper that shows how they compile it to C language. MiniZinc and CHR were most interesting languages I found looking for basic info on constraint handling.

                            2. 2

                              I haven’t used an industrial solver in anger - other than using Z3’s integration with ATS. But the Mozart solver seems to work well, and has features to distribute amongst multiple machines for larger problems. It has tools to visualize and explore the solution space and the ability to customize and add features to the solver in Oz. It’s a pretty old system though and I know that Mozart 2 intends to replace the Oz solver with gecode to get some newer features.

                              The “too many paradigms” is an issue in that it can be hard to decide how to approach a problem. Do you use OO, functional, relational, etc. So many choices that it can be paralysing.

                    1. 1

                      Is there an OpenBSD port for Oz anywhere? I can attempt to compile from source, but I’m hoping there’s something easier.

                      1. 2

                        Not that I’m aware of. Hopefully it’s buildable. The main issue is the code base is older C++ so some warnings/errors in current compilers need to be disabled. It’s also 32-bit only. Mozart 2 is 64 bit but lacks the constraints and distribution libraries.

                      1. 2

                        Have you looked into ZeroNet?

                        1. 3

                          I have, but it requires a Bitcoin wallet and downloading a binary. Whatever I end up using needs to be simple and accessible enough for me to convince at least some of my friends to use.

                          It needs to be the kind of thing where privacy is inside the Trojan Horse. The experience is great, and if you happen to care about it, it also has privacy. It can’t be the kind of thing where the user has to jump through hoops.

                          1. 3

                            ZeroNet doesn’t require a bitcoin wallet. In fact it doesn’t use bitcoin at all. I don’t know why this became a thing. Maybe because ZeroNet site addresses are valid bitcoin addresses, and you can import the private key for a site into bitcoin if you want, then people can send coins to your site address and you can receive them. I don’t know of anyone who actually does this though.

                            You don’t need to download a binary. It’s written in Python and open source. Clone the repository and run if you want. If you have non-tech friends there are “bundles” which contain everything needed to run and stay updated.

                            I wrote about using their decentralized microblogging system on a post about ZeroMe if you want to look at it further.

                            1. 2

                              In fact it doesn’t use bitcoin at all.

                              Huh, that’s new to me. I had assumed it was more deeply tied in because the front page mentions bitcoin prominently, and even uses the phrase “your bitcoin wallet” (which seems to imply I have one). Although on closer reading, to be fair, it just says that it uses “the same cryptography as” my bitcoin wallet, not the actual wallet. There’s also another blurb saying “Decentralized domains using Namecoin cryptocurrency”, which added to my impression that I probably needed to be deep into the cryptocurrency scene to use this.

                              I’ll give it another look!

                        1. 4

                          As far as I can tell, underneath the actor model Pony is feeding multiple native threads using a work stealing algorithm? Basically: does Pony have parallelism, and not just green threads?

                          And what is the story with frame pointers? I’d like to know if DTrace can be used on it.

                          1. 5

                            There was actually a pretty interesting article posted the other about dtrace and Pony.

                            https://lobste.rs/s/d5ndrg/dynamic_tracing_pony_python_program_with

                            1. 3

                              Yes, multiple native threads with a work stealing algorithm. Pony has parallelism.

                              1. 3

                                To build on doublec’s comment… there are no green threads in the Pony runtime.

                                1. 1

                                  A few more questions, if you don’t mind. I wasn’t able to find answers to these with preliminary Googling:

                                  Are floats boxed in Pony? Does Pony support multidimensional arrays? Is the GC a copying collector, or do objects stay where they were allocated? How difficult would it be to create objects over existing data in memory (i.e. a mmapped file)? And does Pony use %rbp as a base pointer, or rely entirely on DWARF to figure out a stack frame?

                                  1. 2
                                    • Are floats boxed in Pony?

                                    It depends. A float could end up boxed but F32 and F64 are not boxed by default. https://www.ponylang.org/reference/pony-performance-cheatsheet/#boxing-machine-words

                                    • Does Pony support multidimensional arrays?

                                    You could design a class to do it, but there’s not builtin type for them. There’s a RFC process to can be used to add new features. https://github.com/ponylang/rfcs/

                                    • How difficult would it be to create objects over existing data in memory (i.e. a mmapped file)?

                                    It depends.

                                    You’d might need to have access to be able to operate on pointers to do it. This is currently limited to some builtin classes like String and Array. We are planning on adding a capability that would allow non-builtin classes to use Pointers within Pony (as compared to C-FFI).

                                    OTOH, you might be able to do it now. Really it depends on what you would need to do. If you could represent the memory mapped file as an Array, (which you probably can), then you should be able to leverage existing functionality to do what you want.

                                    • And does Pony use %rbp as a base pointer, or rely entirely on DWARF to figure out a stack frame?

                                    That I can’t answer. I’ve never gone looking. Pony uses LLVM. I’ve never had a need to check out what is happening yet.

                            1. 4

                              Clean had some great documentation compared to some other languages in the early days. I based Factor’s first version of parsing combinators based on a lazy list of successes on the parsing combinators from a chapter in the Clean book which was my first encounter with the subject.

                              1. 3

                                It’s great to see alt-nets grow into something that is user-friendly and has an active seed community. I’m curious about other attempts with similar goals, but based on the current Web (ie. working standalone in a web browser). Does that even exist?

                                1. 3

                                  I believe IPFS is working on an in-browser implementation of their protocol which would enable working on the current web. See js-ipfs.

                                1. 12

                                  No VPN provider is going to go to jail over the illicit use of its services by its users. It’s quite possible that prior to the FBI knocking on their door, they didn’t keep logs. I’d imagine the following scenario:

                                  1. FBI investigates, sees the suspicious traffic coming from PureVPN
                                  2. FBI gets a warrant/subpoena for PureVPN
                                  3. FBI knocks on PureVPN’s door with a warrant/subpoena
                                  4. PureVPN says “can’t fulfill that right now. We don’t keep logs.”
                                  5. FBI responds “You’ll keep logs starting today.”
                                  6. PureVPN complies, eventually providing the logs FBI needs of future accesses of the suspect

                                  This is exactly why people should use Tor before connecting to a VPN and not the other way around. Tor hides you before you connect to an entity that can be coerced to hand over identifying information to law enforcement. But, hey, I could be completely wrong.

                                  1. 3

                                    This is a little tangential but I have to ask…

                                    What do you gain by going home → Tor → VPN → internet instead of going home → Tor → internet? In the latter you have one place (home) which all your connections pass through where a wiretapper could correlate them and glean information about what you are doing from the timing information about how many packets you send when. In the former, you have two (home, VPN). This seems like a net-loss of privacy?

                                    1. 3

                                      There’s only two reasons I’d use a VPN for while behind Tor: to gain UDP support, which Tor lacks; or to ensure that my traffic appears to originate from a certain geographic area.

                                      1. 1

                                        The VPN (before TOR) can hide TOR traffic.

                                        If I remember correctly, in one case of a false bomb threat a suspect was pinned because they were the only ones on the whole school using TOR. That is, the metadata of using TOR can turn you into a suspect, as it’s not a popular service and TOR usage is scarce.

                                        I’m curious about the other way around. How can you connect to a VPN after connecting to TOR? Routing all your traffic throuth TOR using a SOCKS proxy?

                                        So if I’m not mistaken, a full setup (with drawbacks of course) could be:

                                        home -> vpn (hides tor usage) -> tor -> vpn (allows UDP and hides exit node IP)

                                      2. 2

                                        Some sites don’t allow traffic from Tor exit nodes - routing through the VPN works around that. It also avoids the constant Cloudflare CAPTCHAs. And as @lattera said, UDP support. Some Freenet users use an anonymous VPN, via tor, to hide their IP and Freenet is UDP only.

                                      3. 2

                                        A VPN with more foresight could instead use a warrant canary to let its users know whether the FBI may be keeping logs.

                                        1. 6

                                          We looked in to this for our privacy focused VPN service for the higher education and research sector in the Netherlands. Unfortunately, the legal status of warrant canaries is unclear at best. When a intelligence agency (most have quite far-reaching powers) with jurisdiction and a legal ground compells you to cooperate, not updating the canary probably is a violation of the subpoena and/or gag order because there is no real legal difference between saying “We got a gag order!” and not saying something because you had a gag order.

                                          Of course you can calculate the risk and potential consequences when deciding whether a warrant canary would be a good idea or not. Maybe the use of a warrant canary is worth much more to you/your organization than the potential risks of not complying with gag orders.

                                      1. 5

                                        I can’t say enough good things about this talk, it was one of the highlights of the conference for me.

                                        1. 1

                                          Hopefully it encourages more people to give ATS a try.

                                        1. 2

                                          J. I’ve always wanted to try it out, but never made it :(

                                          1. 3

                                            About once every couple of months I try to learn it again, getting a little further each time. Currently on a kick now. One thing that really helps is writing the J code by hand. That way you can do things like use different colors for adverbs, space out the verb clusters, circle points of notes, etc. Consider the legibility difference between

                                            >./@:((0&{ - <./)\.)
                                            

                                            and

                                            >./  @:  (( 0&{   -  <./ )   \.)
                                            -----^-------------------------
                                            
                                            1. 5

                                              Well, in order to make myself give it a more serious look, I got “J for C programmers” from Lulu (the ebook edition).

                                              1. 1

                                                I liked that book, although I found the discussion of array shapes and ranks slow going. I bought the physical book, it has a lovely cover. I also got the J Fractals physical book through Lulu - it’s very nice. There’s a number of J books and PDFs covering learning particular subjects like calculus, statistics, fractals, etc. It seems like a good tool for learning by discovery and play.

                                          1. 43

                                            millennials, if you made it this far, I’ll wait while you show yourselves the door

                                            Glad to see you’re working on sexism – but while you’re at it, maybe check your ageism?

                                            1. 8

                                              If you were offended I apologize sincerely. It was only my intention to poke fun at myself as an oldster.

                                              1. 13

                                                Since we’re on the topic of subtle sexism, ageism, ism-ism, “If you were offended, I apologize” is a classic non-apology form, so if you want an apology to be taken as an apology you might look at alternative ways of stating similar apologies. Not saying you meant it as a non-apology, just pointing it out.

                                                Navigating written text and tone is hard!

                                                1. 4

                                                  Apology accepted :)

                                                  In general, “millennial” tends to be a slur, but “see yourself out” really felt non-welcoming. Just FYI for the future :)

                                                  1. 2

                                                    Way to man up to your mistakes! punches self in face

                                                  2. 0

                                                    Yeah, came here to say this.

                                                  1. 4

                                                    Some more details on it here. It’s an emscripten compiled version of the open source J interpreter from J Software. J is a vector/array oriented programming language.

                                                    1. 6

                                                      I’m trying to learn J. It’s difficult, slow going, but it triggers the same obsessiveness I have with TLA+. Trying to figure out why. I think it’s because both of those were so far outside what I normally experience as “programming” I can’t/couldn’t wrap my mind around them: I can’t physically think in J. That alienness appeals to me. Not only am I learning a new tool, but I’m learning new ways to think about programs.

                                                      Workwise, we’re now knee-deep in the new school year and dealing with launch issues. Mostly on top of it, though. Going to WindyCityRails on Thursday, may give a lightning talk there.

                                                      1. 3

                                                        I’ve been tinkering with J recently too. I’ve found the books, PDFs and journals on J/K/APL to be great reading material for approaching problems differently to how I’d normally approach them in more common toolsets.

                                                        1. 3

                                                          You might use Pony over Rust if:

                                                          1. You prefer opinionated languages designed around specific paradigms - in this case the actor model - vs general purpose use any paradigm languages.
                                                          2. You prefer to use garbage collection.
                                                          3. You want green threads and/or to design a program in a concurrency-oriented style.
                                                          4. The pony community is a better fit for your learning style.
                                                        1. 2

                                                          I changed the title because the original, “Onion Synopsis for Susan Hennessey”, isn’t clear what the article was about and it addresses the question Susan asked in their tweet, which I used as the title.

                                                          1. 3

                                                            With regards to Android, I agree it is hard to tell what apps might not be pinning certs or using plain text traffic. Orbot on Android has a VPN mode that works on non-rooted devices allowing you to select specific apps that run over tor. Some apps have builtin support for Orbot - Facebook is one. Others allow using Orbot via HTTP proxy support - twitter does this. The VPN mode is experimental and it gives a warning it may fail and isn’t recommended if anonymity is important.

                                                            1. 2

                                                              The fact that ATS makes heavy use of the C preprocessor bothers me. Does it have a true module system? Is there a particular reason it doesn’t?

                                                              1. 5

                                                                What use of the C preprocessor are you seeing? Is it the #include? That does work like C’s #include but there are more module like things. See staload. These respect namespacing and local definitions so you can do things like:

                                                                local
                                                                  staload FOO = "somefile.sats"
                                                                in
                                                                  $FOO.dosomething()
                                                                end
                                                                
                                                                1. 1

                                                                  Yes, the include specifically made me think so. Is that actually the CPP? Anyways, reassuring to see there’s other functionality.

                                                                  1. 3

                                                                    No, the #include isn’t handled by the CPP. The C preprocessor is only used if you use #include/#define inside embedded C code blocks:

                                                                    %{
                                                                    #include <foo.h>
                                                                    #define X
                                                                    ...C Code here...
                                                                    %}
                                                                    
                                                                    1. 1

                                                                      Interesting! Seeing as the #include syntax is reused, is it textual substitution or something more complex?

                                                                      1. 3

                                                                        #include in ATS code is textual substitution in ATS code and the code processed by the ATS compiler. Anything in C code blocks is directly inserted into the generated C code (ATS compiles to C which is then compiled by a C compiler) so is handled by the C compiler. ATS doesn’t parse that code. So there are two languages at play there, both using #include for similar functionality.

                                                              1. 1

                                                                Great to see folks using this language- I’ve had my eyes on it for some time, but haven’t tried it out yet.

                                                                Is the book available in text or Epub format?

                                                                1. 2

                                                                  Not yet as far as I can tell. The other ATS documents are available in PDF and epub.

                                                                1. 2

                                                                  Joe Armstrong’s reaction on Twitter to this is roughly how I feel about it:

                                                                  Whatever next - shared mutable state and concurrency + errors is a mess - read my thesis - all is explained

                                                                  A little glib and/or arrogant, but that’s Twitter reactions, I suppose.

                                                                  1. 2

                                                                    Can someone explain this? I’m somewhat familiar with erlang but I don’t get what he’s trying to say. Is he saying that nobody should ever use shared mutable state and he figured it out 20 years ago?

                                                                    If so that seems both disrespectful and untrue. I have no doubt erlang is amazing for certain applications. But programming is very diverse and one size doesn’t fit all. The domain of erlang is almost the opposite of the domain of Swift.

                                                                    1. 2

                                                                      I can agree with this a little. I was surprised by the explicit mention of Rust, which is very fuzzy and doesn’t feel necessary. I also disagree with it somewhat. To replicate my comment from r/rust:

                                                                      On the downside, their ownership model has a higher learning curve than the design described here, their abstractions are typically very low level (great for systems programmers, but not as helpful for higher levels), and they don’t provide much guidance for programmers about which abstractions to choose, how to structure an application, etc. Rust also doesn’t provide an obvious model to scale into distributed applications.

                                                                      I find this a little… too much in one paragraph. I disagree with the level of abstractions: Rust can be very high level, but still give a glimpse of their structure.

                                                                      I hate the characterisation of Ownership as a cliff. It is gradually learnable. It’s just a hill that you have to climb on the journey. Ownership/Borrowing situations in Rust are very much possible to be refactored, which enables gradual learning.

                                                                      The middle parts I agree with. Rust is pretty un-opinionated on the solution. Although this is the case in many other languages (such as Java) and has lead to an ecosystem of layered abstractions.

                                                                      The last part leaves me confused: aside from Erlang/Elixir, I wouldn’t know any language where the model of building distributed applications comes out of the language.

                                                                      1. 1

                                                                        The last part leaves me confused: aside from Erlang/Elixir, I wouldn’t know any language where the model of building distributed applications comes out of the language.

                                                                        For some historical perspective, examples of other languages with distribution built in are Mozart/Oz, AliceML (built on top of Mozart) and E.

                                                                        I think Mozart/Oz is especially cool as data ownership would move around the nodes as necessary. Network partition were also not reflected in the value of the variable itself but rather in a stream that one could subscribe to about the variable. I think the attempted rewrite in Scala was really misdirected, Mozart/Oz was a really cool and fascinating language and it’s unfortunate it couldn’t develope a bigger following to become more of a production language.

                                                                        1. 1

                                                                          It’s unfortunate Mozart/Oz development has slowed. I agree that it’s a fascinating language - I used it in production once and it was nice to write in. There’s still some signs of life. There’s a mozart implementation on graal/truffle in progress as part of some academic work. One of the things I think Mozart/Oz has struggled with is a lot of the development was directed by academic studies and grants and they would stall when the people involved left university. I still use it and try and keep the Mozart 1.3.x and 1.4.x branches building.

                                                                          I wonder why E hasn’t received interest in a production implementation. From what I can see it’s a good language with some nice ideas.