www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - D mentioned in the Koka language book

reply Dejan Lekic <dejan.lekic gmail.com> writes:
While searching the Internet for "algebraic effect systems" I 
fould this beautiful language called "Koka", and got curious. 
They have a nice book that, believe or not, references the D 
programming language here: 
https://koka-lang.github.io/koka/doc/book.html#sec-with
Mar 09
parent reply Walter Bright <newshound2 digitalmars.com> writes:
On 3/9/2026 3:48 AM, Dejan Lekic wrote:
 While searching the Internet for "algebraic effect systems" I fould this 
 beautiful language called "Koka", and got curious. They have a nice book that, 
 believe or not, references the D programming language here: 
 https://koka-lang.github.io/koka/doc/book.html#sec-with
 
Thanks for the reference! They then go on to not attribute the with statement to D!
Mar 09
next sibling parent reply "H. S. Teoh" <hsteoh qfbox.info> writes:
On Mon, Mar 09, 2026 at 04:43:10PM -0700, Walter Bright via Digitalmars-d wrote:
 On 3/9/2026 3:48 AM, Dejan Lekic wrote:
 While searching the Internet for "algebraic effect systems" I fould
 this beautiful language called "Koka", and got curious. They have a
 nice book that, believe or not, references the D programming
 language here:
 https://koka-lang.github.io/koka/doc/book.html#sec-with
 
Thanks for the reference! They then go on to not attribute the with statement to D!
Because D didn't invent the with-statement? T -- The richest man is not he who has the most, but he who needs the least.
Mar 09
parent reply Kapendev <alexandroskapretsos gmail.com> writes:
On Monday, 9 March 2026 at 23:53:32 UTC, H. S. Teoh wrote:
 On Mon, Mar 09, 2026 at 04:43:10PM -0700, Walter Bright via 
 Digitalmars-d wrote:
 On 3/9/2026 3:48 AM, Dejan Lekic wrote:
 While searching the Internet for "algebraic effect systems" 
 I fould this beautiful language called "Koka", and got 
 curious. They have a nice book that, believe or not, 
 references the D programming language here: 
 https://koka-lang.github.io/koka/doc/book.html#sec-with
 
Thanks for the reference! They then go on to not attribute the with statement to D!
Because D didn't invent the with-statement? T
I think Pascal uses it just to avoid some typing, but D can also use it for resource management with RAII. No idea what the context here is because I did not read the blog lol.
Mar 10
parent Paulo Pinto <pjmlp progtools.org> writes:
On Tuesday, 10 March 2026 at 10:09:35 UTC, Kapendev wrote:
 On Monday, 9 March 2026 at 23:53:32 UTC, H. S. Teoh wrote:
 On Mon, Mar 09, 2026 at 04:43:10PM -0700, Walter Bright via 
 Digitalmars-d wrote:
 On 3/9/2026 3:48 AM, Dejan Lekic wrote:
 While searching the Internet for "algebraic effect systems" 
 I fould this beautiful language called "Koka", and got 
 curious. They have a nice book that, believe or not, 
 references the D programming language here: 
 https://koka-lang.github.io/koka/doc/book.html#sec-with
 
Thanks for the reference! They then go on to not attribute the with statement to D!
Because D didn't invent the with-statement? T
I think Pascal uses it just to avoid some typing, but D can also use it for resource management with RAII. No idea what the context here is because I did not read the blog lol.
Not only Pascal, most Wirth languages, and besides the type saving, in Oberon-2 ( and its descendents is used for type guards. WITH v: T DO statements (* v is treated as type T here *) END Multiple cases are also possible. It appeared in several structured BASICs during the 1990's, a famous one being Visual Basic, https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa266330(v=vs.60) In Python as resource management, it was introduced in 2005. D might have invented a few things, but not everything is taken from D, as it often comes up.
Mar 10
prev sibling parent Dejan Lekic <dejan.lekic gmail.com> writes:
On Monday, 9 March 2026 at 23:43:10 UTC, Walter Bright wrote:

 Thanks for the reference! They then go on to not attribute the 
 with statement to D!
You're welcome. Why would they attribute the `with` statement to D?
Mar 10