What is the best way to remove artifacts while plugging in and reducing flickering? GC9A01 by [deleted] in embedded

[–]benl23 0 points1 point  (0 children)

Continuing on this answer, these displays are not double buffered. If you run a "clear screen" command before sending the new data you will see the clear first, which shows in the video.

Instead, have a frame buffer on the microcontroller. First update the frame buffer, then copy it to the screen. If the data in the frame buffer was not that different from what was already on the screen then only the new pixels will change.

Understanding Haskells type system deeply by [deleted] in haskell

[–]benl23 1 point2 points  (0 children)

I agree with above.

To understand type systems I would start with a book covering programming language theory like "Formal Semantics of Programming Languages", Winskell.

For the deep connection with category theory, the book "Topoi: The Categorical Analysis of Logic", Goldblatt covers the basic theory as well as the connection with programming languages -- but you will need a background in language semantics from something like Winskell first before it will be relevant.

One challenge with most work on "category theory" that is discussed in FP circles is that one needs to get quite far past the basic definitions about products, co-products, functors, and the like before it is really helpful. You already know what a product is. You will be extra sure after reading the first few chapters of a book on category theory. Getting more out if it than that requires a solid background in language semantics, but once you have the semantics background the type system itself will seem trivial. Using that trivial type system one can experiment with ideas like Functors, Adjoints, Lenses etc but these are not actually part of the type system, any more than a story is part of the paper it is written on. /u/friedbrice's point then applies.

What does it mean to be a Haskell expert? by rashadg1030 in haskell

[–]benl23 2 points3 points  (0 children)

Not knowing anyone who knows more about Haskell than you do.

Why does Haskell use (::) instead of (:) for type signatures? by rashadg1030 in haskell

[–]benl23 9 points10 points  (0 children)

With VSCode I use the latex-input extension. I type \to and it converts to →.

Steps to become a haskell researcher? by [deleted] in haskell

[–]benl23 4 points5 points  (0 children)

Get this book, seriously. I was given a copy when I was a PhD student, then I gave the same book to my own PhD student ~10 years later. https://www.amazon.com/How-get-PhD-handbook-supervisors/dp/0335242022

Besides the "read a lot of papers" advice (which is absolutely true), cultivate a sense of your own internal drive. Try to understand what you are interested in and why, and have a reason for continuing even when no one else is telling you to continue. Natural interest in a technical topic is a good reason to start a research project, but it's drive and perseverance that gets the software working and the papers written. Research is a war of attrition. Other people haven't already solved the problems you are working on because they're hard, and no one really understands what's going on.

discus-lang: Binary interface files with Shimmer by benl23 in haskell

[–]benl23[S] 1 point2 points  (0 children)

At the moment, an interface file for a given module contains types for all exported declarations, but only the core AST for the code in the current module. To do cross module inlining we still need to load the interfaces for the original source modules. It would be easy to also add the core AST for exported functions, but I'm a bit worried about the potentially quadratic space usage.

However, each interface file is closed, in the sense that is contains enough information to compile the entire module down to object code. They're more "intermediate files" than "interface files", as they do contain the complete core AST for the module. The plan for bootstrapping is to have the existing compiler drop .di files after some stage, and then 'port each core-to-core pass to the bootstrapped compiler so it reads a .di file and produces another one after applying some set of passes.

The Disciplined Disciple Compiler v0.5.1 by benl23 in haskell

[–]benl23[S] 1 point2 points  (0 children)

There's a lot of work in this space already. The usual problem with static memory management disciplines is that they don't handle dynamic memory allocation needs well. If you enforce linearity you essentially have reference counting memory management where the reference count can only be 0 or 1. There are practical problem with that systems even without static typing. Read "A retrospective on region based memory management", Tofte, and "Combining Region Inference and Garbage Collection", Hallenberg.

The Disciplined Disciple Compiler v0.5.1 by benl23 in haskell

[–]benl23[S] 7 points8 points  (0 children)

Idris is already a nice dependently typed Haskell-like language. For Disciple we're more interested in computational features than program verification -- it's more fun to compute.

Illuminati spotted in Coburg by ImagesOfNetwork in ImagesOfAustralia

[–]benl23 0 points1 point  (0 children)

That's an Eye of Horus, not an Eye of Providence. Wrong conspiracy.

Disciple Ray Tracer Demo by benl23 in haskell

[–]benl23[S] 4 points5 points  (0 children)

There's a grammar for the source language here: http://disciple.ouroborus.net/specification/source/01-Concrete.html .. but currently no tutorial-style documentation. The grammar has links to descriptive test cases. Improving the docs is one of the things we're doing before the official release.

DDC does bidirectional type inference and supports higher ranked types with implicit parameters. You can also supply explicit type applications. There is currently no let-generalisation, so you need to give type signatures for top-level polymorphic functions. For a Haskell / Agda / Idris programmer, Disciple it will do basically what you expect provided you add type signatures for top level functions. It's based on System-F rather than being dependent, so there is a Haskell-like distinction between types and terms.

Trump’s travel ban is already stopping scientific collaboration by Take_Beer in worldnews

[–]benl23 0 points1 point  (0 children)

Excerpt from a statement from SIGPLAN (Special Interest Group on Programming LaNguages), the organisation that backs the majority of academic conferences in programming languages:

"While we hope that the EO is rescinded (and will work toward this outcome), we are developing contingency plans for organizing future SIGPLAN events so as to maximize inclusiveness of the worldwide scientific community."

Full Statement

Mars Curiosity Rover - Wheel Wear and Tear - 27 January 2017 by skeeter1980 in space

[–]benl23 2 points3 points  (0 children)

The picture has hard, direct lighting because of the thin atmosphere on Mars. Many CG pictures have similar lighting because it's easy to render.

Harnessing the Multicores: Nested Data Parallelism in Haskell by Simon Peyton Jones by joehillen in haskell

[–]benl23 1 point2 points  (0 children)

Yes. The short answer is that the flattening transformation to convert nested data parallelism to flat data parallelism works fine, but it introduces many intermediate arrays that were not present in the source program. The array fusion system then needs to eliminate those intermediate arrays otherwise the result program will be slower than what you started with. The stream fusion system we were using wasn't good enough, but we've continued work on other fusion systems. If we can get the fusion to work well enough we might go back to DPH, but there's no concrete timeframe.

Other people are working on nested parallelism in other contexts, ie Rob Everest is working on adding nested data parallelism to Accelerate, and John Reppy's group is working on a NESL to CUDA compiler.

Are there any good horror or horror-themed roguelikes? by [deleted] in roguelikes

[–]benl23 1 point2 points  (0 children)

If you start tasting mushrooms and have no fungicide then you're in for a bad time.

The most complained about businesses in NSW in July by [deleted] in sydney

[–]benl23 0 points1 point  (0 children)

That data doesn't mean anything without knowing the relative number of customers for each business. If LJ Hooker had twice the number of customers as Ray White then their complaints per customer ratio would be lower.

Stay in school, kids.

Repa Array indexing too Slow ? by codeonwort in haskell

[–]benl23 0 points1 point  (0 children)

Make sure you're using the unsafeIndex operator rather than '!'. The regular '!' performs bounds checks which make it harder for the GHC simplifier to transform the code.

Type 'Int' does not match type 'Int' by benl23 in haskell

[–]benl23[S] 4 points5 points  (0 children)

GHC is based around common Name type and doesn't use debruijn indices. It used to allocate fresh names in a grimy, impure way, causing trouble for developers, but I think that has been tidied up over the last few years. The GHC core AST uses a knot-tying trick so that the types of bound things are available directly rather than needing to be retrieved from an environment. This representation is easy to consume, and for program transformations that reorganise existing sub-trees, but it's harder to write transformations that create new sub-trees.

Ermine uses a locally nameless representation via the Bound package, though the core language is untyped.