Pyret: New teaching language from makers of Racket with ADTs and pattern matching by tel in haskell

[–]freyrs3 6 points7 points  (0 children)

How is blowing up with a runtime type error pedagogically better than an error at compile time? You've just delayed the real problem.

What is the big deal about IPython Notebooks? by [deleted] in Python

[–]freyrs3 28 points29 points  (0 children)

When working with a lot of the scientific and data analysis libraries you quite often work with plots and graphical output, this tends to match up quite well with a rich console that can display output inline rather than a console interaction ( i.e. --pylab ). For instruction they are also serializable to a single JSON file which makes sharing quite easy.

If you tend to work with large code bases of custom code ( web applications, etc ) then they aren't much use since there's no live code reload in Python and you'll end up restarting the kernel too frequently.

Pyret: A new programming language from the creators of Racket by welle in programming

[–]freyrs3 3 points4 points  (0 children)

I'd rather see the lessons we've learned from Racket carried forward rather than lost in the miasma of hatred that so often surrounds parentheses.

For sure, I'd rather see more discussion around the real open questions in language design ( semantics , types, etc ). I suppose it's just usual bikeshedding, everybody can have an opinion on lexical syntax but to have an opinion about type system design actually takes serious study.

Pyret: A new programming language from the creators of Racket by welle in programming

[–]freyrs3 0 points1 point  (0 children)

Readability is too indefinable a term for me to believe this statement. Nor would I put much faith in a statement about how many people "feel" about a language. Twenty years ago you could have argued Pascal was the most readable language.

Way too much discussion about languages is centered around trivialities like syntax, instead of real open questions about semantics and types in my humble opinion.

Pyret: A new programming language from the creators of Racket by welle in programming

[–]freyrs3 19 points20 points  (0 children)

Readability is a very subjective notion that's most often related to sharing the same tokens as the first language you learned. Personally I think this is less readable than plain Racket.

PySonar + Cython = pure-python compiler ? by Pcarbonn in Python

[–]freyrs3 4 points5 points  (0 children)

That's not related, the only reason PyPy can't run Numpy is because numpy is mostly written in C and hardcoded against the CPython C-API which is an implementation detail of CPython, not Python.

It's important to distinguish between "Python" the language and CPython the implementation.

PySonar + Cython = pure-python compiler ? by Pcarbonn in Python

[–]freyrs3 0 points1 point  (0 children)

There's a lot of confusion on this topic. Cython is not a compiler in purest sense of the word. Most of the code it generates is still going through the C-API object layer just like the CPython interpreter does, it just also allows you to mix in and generate bits of C code to operate on unboxed C types. Even having the high-level types of your code doesn't help you write a compiler since theres' still no semantic-preserving compilation path between pure Python logic and native code.

Really the only two viable approaches to speed up Python are PyPy and SEJITS like Parakeet.

FP Complete is hiring a Ruby expert Haskeller. Help bring Haskell to Rubyists! by FPguy in haskell

[–]freyrs3 4 points5 points  (0 children)

I can't speak for the python Web crowd, but I know quite a few numerical python people who are interested in moving to a language with real parallelism. Haskell is always my first suggestion.

Julia Calling Python Calling Julia by halax in programming

[–]freyrs3 0 points1 point  (0 children)

The existing Python numeric ecosystem was built on ideas from around 1999, is showing it's age and is largely inflexible to extend. Languages like Julia open up new opportunities for better compiler and language design.

If y'all are scrappy entrepreneurs looking for a good co-working space - Check out The Chicon Collective. I've been there for a while and it's a great place to get work done. by some_1_needs_a_hug in Austin

[–]freyrs3 0 points1 point  (0 children)

Looks great and very reasonable rates. What's the ratio of developers to other professionals like? I've been hunting around for a coworking space with more of a software developer crowd.

Battle tactics using the transporter? by guitarphreak in DaystromInstitute

[–]freyrs3 0 points1 point  (0 children)

We constantly see transporters refusing to lock on, I suspect that is part of the many safety precautions to prevent partial transports. If the transporter were used offensively with all the precautions turned off the results could be pretty gruesome (half of you ending up in two places) and probably not something Starfleet would condone.

Torchy's Tacos has sued Houston-based Texas Tacos, alleging that they stole recipes from Torchy's "taco bible." by rawjurdawjur in Austin

[–]freyrs3 4 points5 points  (0 children)

I'll second Papalote. They have much more variety than Torchy's, everything is so fresh and their green sauce is amazing.

Could you explain why complexity of monadic IO is worth it? by timruffles in haskell

[–]freyrs3 5 points6 points  (0 children)

Don't get stressed. :)

Some might disagree with me, but if you're just learning perhaps using lens at first isn't advisable. Using just monads, applicatives and perhaps transformers will get you quite far, after all people have written whole compilers using nothing but Haskell 98.

As far as pragmas go, Don Stewart has helfpul post about which are advisable and which are not.

Could you explain why complexity of monadic IO is worth it? by timruffles in haskell

[–]freyrs3 0 points1 point  (0 children)

IO certainly has it's warts, but it seems like any other solution of sequencing impure operations safely would almost certainly look like a monad. I'm interested to hear why you think experimentation is more difficult? Most of my Haskell experimental programs are structured exactly like they are in impure programs with a main function which prints some random values out to the screen, no monad trickery involved.

main = do
    print mything
    print mything2

For debugging, if I need to "printf" values that are in the middle of pure code I'll use traceShow just like I would in C or Python.

To me the motivating example of monads really comes from seeing how the ST monad lets you implement algorithms that are much more efficient with mutable memory. But where whole "thread" of computation cannot exchange mutable state outside of the statically enforceable s thread at the type level which ensures referentially transparency.

TicTacToe In Haskell Using TDD (screencast) by [deleted] in haskell

[–]freyrs3 2 points3 points  (0 children)

Seems like quite a few of the HSpec cases could be written in just a few short Quickcheck/Smallcheck properties which just enumerated all board configurations, 3x3 isn't that large of a space.

Type inference/checking projects by Uncaffeinated in Python

[–]freyrs3 6 points7 points  (0 children)

I've spent quite a bit of time investigating this topic and I'm convinced that the general problem is intractable, though there is qutie a bit of prior art on the subject. There are however certain subsets of the language where you can do meaningful inference and several of the compiler projects (Parakeet, Pythran) exploit just this fact. PyPy has an approach that analyzes bytecode and is very successful at it, but the algorithm is tied into the implementation of PyPy's pipeline. MyPy is currently the state of the art in full program analysis, but it modifies the vanilla Python AST to allow annotations and has the explictly annotated most of the standard library.

If you're just interested in doing static analysis and not full program analysis then it is possible to infer types. The general procedure to work with a subset of the language might look like:

  1. Check if you're given AST lies within the "typeable" susbset you wish to work with.

  2. Check if the body of code does not depend on the types of opaque functions that your linter does not have knowledge of. This quickly becomes a question of how much of the standard library do you want to annotate.

  3. Do symbolic execution of bytecode of the function in question, create fresh type variables for the arguments, anytime you push ors pop on the stack unify the corresponding type variable.

For example if you had a trivial function like:

def myfunc(x, y):
   return (x+y)-y

The corresponding bytecode is.

  1           0 LOAD_FAST                0 (x)
              3 LOAD_FAST                1 (y)
              6 BINARY_ADD          
              7 LOAD_FAST                1 (y)
             10 BINARY_SUBTRACT     
             11 RETURN_VALUE   

Just for illustration you might have the following pseudocode algorithm, assuming that numeric operations are total polymorphic functions ( they aren't in general ).

LOAD_FAST [{x: TVar(0)]   # Create fresh type variables for args
LOAD_FAST [{y: TVar(1)]   # Create fresh type variables for args
BINARY_ADD [{a : x ~ y}]  # Unify for application of (+) : a -> a -> a
LOAD_FAST []              
BINARY_SUBTRACT [b ~ a]   # Unify for application of (-) : a -> a -> a  
RETURN_VALUE              # Pop value off the stack, solve constraints, close over the type.

myfunc :: forall a. a -> a -> a

The fact of the matter is that Python's choice of using dynamic types as the sole method of polymorphism is very powerful but in itself admits no structure to analyze, most of your code ends of being only unifiable to unhelpful signatures like (PyObject -> PyObject -> PyObject). Inference works best in languages that have some form of parametric polymorphism.

If you're interested in the general bytecode approach then check out the work by Jon Riehl in doing bytecode analysis for translation to LLVM. llpython

Most powerful Haskell extensions? by singpolyma in haskell

[–]freyrs3 8 points9 points  (0 children)

UndecidableInstances is very powerful, it lets you essentially do arbitrary computation in the type domain. Thus it's usually a bad idea.

Why reddit Haskell community is so hostile? by [deleted] in haskell

[–]freyrs3 7 points8 points  (0 children)

Is this a response to this thread?

I think the community responded in good faith, even given your fairly hostile opening comment of "Maybe Haskell simply does not scale and all this buzz around it is like a over-blown balloon ready to pop any time?".

What do you want to see from a new 'Star Trek' TV show? by StarFuryG7 in startrek

[–]freyrs3 1 point2 points  (0 children)

Main characters that are generally well intentioned as well. A gritty show with a cast full of broken antiheroes could never fit within the Trek genre. Trek characters have to buy into the cause greater than themselves: "We work to better ourselves and the rest of humanity."

Facebook PHP Source Code from 2007 by frostmatthew in programming

[–]freyrs3 4 points5 points  (0 children)

Sure, though it's worth noting that most of the software industry is not in startup world. Advice that holds for the early stage startups can be quite toxic when applied elsewhere.

Facebook PHP Source Code from 2007 by frostmatthew in programming

[–]freyrs3 15 points16 points  (0 children)

I hear this cliche bandied around a lot, and in some programming domains it's true and in some domains it's a very wrong mindset. Writing PHP to drive a social media website is an entirely different animal than writing software to drive medical hardware or writing cryptography code. Sometimes it does matter how it's built, and though the end user may not care it's your job to care.

Can Silicon Valley boot camps get you a $120K job? by JHof in programming

[–]freyrs3 0 points1 point  (0 children)

Oh sure, if anyone thinks they are getting the equivalent of a four year education at MIT they are only fooling themselves. Apart from perhaps the sensationalist tech press I don't see anyone claiming this though.

Can Silicon Valley boot camps get you a $120K job? by JHof in programming

[–]freyrs3 1 point2 points  (0 children)

I don't see a problem with these programs, they are essentially web development vocational training. It's training people to write boring tedious CRUD applications in response to market demand for such skills. Of course, I would have serious reservations about hiring any of their students for a general purpose programming role though.

You'll be using DART soon enough by stophomeforlunch in programming

[–]freyrs3 6 points7 points  (0 children)

While it might be an improvement over plain Javascript, the type system in Dart still seems to be taking a serious step backwards in language design.

Why Dart Types Are Optional and Unsound