Arc Forumnew | comments | leaders | submitlogin
2 points by akkartik 4645 days ago | link | parent

I'm a little lost :) Are you in favor of lexical scope or against it?

The argument that lexical scopes are entangled with our notion of functions, so let's drop them since they're not an orthogonal concept -- that seems internally consistent and worth thinking about.



1 point by FredBrach 4644 days ago | link

Oh sorry if I've not been clear: I'm in favor of dynamic scope :)

>> The argument that lexical scopes are entangled with our notion of functions, so let's drop them since they're not an orthogonal concept

Exactly. In the fun exploration of an ultimate language for good programming, name conflicts should not drive the language design at all. Programmers should manage their name spaces with care. Also, having a tool for this, like namespaces, is not a problem. Seems even pretty good and it fixes everything.

-----

2 points by akkartik 4644 days ago | link

"Programmers should manage their namespaces with care."

Totally. I think I'm closer to your point of view than anybody here (http://arclanguage.org/item?id=15587, footnote 1; http://arclanguage.org/item?id=12777). I've gradually moved to the dark side in several ways: I no longer care about hygiene[1] or making macros easy to compile[2]. But I still hold on to lexical scope for reasons I can't fully articulate. If unit tests are as great as I say they are, do we need lexical scope? Without them changes may break seemingly distant, unrelated code. Something to think about.

[1] http://arclanguage.org/item?id=15907, especially the http://arclanguage.org/item?id=15913 subtree.

[2] http://arclanguage.org/item?id=13585; http://www.arclanguage.org/item?id=14947; http://www.arclanguage.org/item?id=13319.

-----

1 point by FredBrach 4644 days ago | link

>> If unit tests are as great as I say they are, do we need lexical scope?

Very very interesting. Unit testing.. This is such an engineering concept. Why not built in the language with meta tags (I don't know if it's possible at all)?

>> Without them changes may break seemingly distant, unrelated code. Something to think about.

Let's try the fun of an extreme code expansion language without any compromise :)

-----

1 point by FredBrach 4644 days ago | link

>> and it fixes everything.

Oh no I'm completely wrong here.

Some of you were right, there is a sensible problem in names/scope I've not expected. But I've the answer to everything :)

Libraries.

What are libraries? There are application foundations. In other words, applications are built on top of libraries.

So let's make it as it should.

A libraries is a function which takes in arguments an other libraries or an end application.

Let loadlast be a function which bind to a symbol the eval of the last instruction of a file. And let use the arc evaluation syntax.

App.ext:

  ////////////// app.ext ////////////////////

  (loadlast '"lib1.ext" 'MyLib1)

  (loadlast '"lib2.ext" 'MyLib2)

  (loadlast '"lib3.ext" 'MyLib3)

  (= 'MyApp
     '(*put your application here*))

  (MyLib1 '(MyLib2 '(Mylib3 MyApp))) ; This launches the whole

  MyApp ; that makes MyApp a lib. MyApp is working with MyLib1, MyLib2 and MyLib3 and thus must be embed at least on top of a stack which contains them.
Lib1.ext:

  ///////////// lib1.ext ////////////////////

  {

  *blabla*

  {

  arg1; it evaluates (MyLib2 '(Mylib3 MyApp))  which can now  use lib1 via the dynamic scope system

  }

  *blabla*

  }
I'm not saying this is strictly innovative.

-----

2 points by FredBrach 4644 days ago | link

I'm definitly going to write an implementation of my exploration :)

I've decided to call the resulting language Prompt: http://promptlang.org

-----