3 ms·
I would like to see a programming language where there is no distinction between the two. This might sound silly first, but once you start thinking about homoic
by daralthus 4y ago
I would like to see a programming language where there is no distinction between the two. This might sound silly first, but once you start thinking about homoiconicity or about function approximations, like neural nets that can represent any function (as sort of a compressed lookup table) then you can start to imagine how a sufficiently advanced compiler should be able to inline approximate representations, or switch to calculating on the fly depending on needs and available resources.
- amadeuspagel 4y agoLisp?
- wruza 4y agoNot sure if it was irony, but check out Haskell and alikes. Its execution model is different from a regular “it evaluates at where it is”. Infinite lists like all natural numbers are a norm in it. ones = 1 : ones take 3 ones // [1,1,1] odds = 1 : map (+2) odds take 3 odds // [1,3,5] Haskell has a statement-like “do” notation, but it is a syntactic sugar for a structure of specific operators. Lisp is also a beast to be aware of, though it is not exactly what you described.
- remkop22 4y agoRust actually accomplishes this with the unit '()' type which is similar but not the same as void in other languages. Any statement (or expression) produces a value, sometimes that value is just a unit, which can be passed around just as any other value. Currently the exception to this are 'let' statements but there is a nightly feature where this produces a unit value as well.