News for hackers. Stuff that matters.
Re:Wapp – A Web-Application Framework for Tcl by gilbetron on Friday June 11, 2021 @12:13PM (#27475168)
I've heavily used TCL twice in my career, and while I find it an interesting experiment in a language, and actually enjoy a lot of it, I would never recommend it to anyone, nor would I ever pick it for a project. The core idea of "everything is a string" just has a lot of failure modes, and you find yourself making common errors even after years of developing with it.

But it's a really neat exploration of a "what if" in programming languages.

Re:Wapp – A Web-Application Framework for Tcl by jcfields on Friday June 11, 2021 @04:43PM (#27478229)
I haven't used Tcl for anything in ages, but I have a book on it that I thumb through sometimes because it's so bizarre and fun to read about.

For example, you can delete or rename procedures on the fly, including built-in procedures. So you can rename a built-in like puts to something else, create your own puts procedure, and then call the old one (under its new name) in your new procedure (in case you wanted to override it to do some pre- or post-processing each time). You can even redefine procedures within themselves.

You can use variables in variable names (PHP does this as well).

The comment character # is a valid name for a variable or a procedure.

"Everything is a string" extends to even lists and code blocks.

Even though we've moved away from the hyperflexibility of languages like Tcl and Perl, they certainly served their purpose, and a lot of their better ideas were refined in their more orderly successors.

Re:Wapp – A Web-Application Framework for Tcl by an1sotropy on Friday June 11, 2021 @03:22PM (#27477401)
In the 1990s, when Tcl was taking off, there was really nothing else that made it as convenient to glue together different C libraries and slap a (Tk-based) GUI on it. It was a welcome revelation, compared to XWindows programming.

In the 1990s.

Re:Wapp – A Web-Application Framework for Tcl by gilbetron on Friday June 11, 2021 @08:26PM (#27480133)
Yeah, my first encounters was the early 90s, where I wrote a gene sequencing support system with TCL/TK - it was pretty fun and worked pretty well, but there wasn't a lot available in the space. Python was still being dreamed up, bash wasn't up for it, and otherwise you had Fortran/C/C++/Pascal/Lisp.

Fast forward 20 years and I found myself using it again, but it felt silly compared to the now-mature Python, Lua, PHP, and Ruby.

Re:Wapp – A Web-Application Framework for Tcl by tyingq on Friday June 11, 2021 @03:43PM (#27477590)
To me, it seems fine in the space of an embedded scripting language where you let end users script within your otherwise "not tcl" application.

These days, maybe lua is a better choice, but I can see lua being more intimidating for smart, but less software-experienced people. "Everything is a string" might be more intuitive for them.

Re:Wapp – A Web-Application Framework for Tcl by AndresNavarro on Friday June 11, 2021 @05:10PM (#27478539)
I was just thinking about this today. I am currently forcing myself to work on TCL for a small project (I've only used it casually before). Coming from lisp I can appreciate some aspects of it, but it can be frustrating at times.
Re:Wapp – A Web-Application Framework for Tcl by doublerabbit on Friday June 11, 2021 @08:04PM (#27480011)
TCL is one of the few languages allowing you to dabble in to and one of the few that caught hook with me. It's friendliness then leads you down a path of voodoo and creativity.

  proc displayHackerNews {} {
  set hn "Hacker News" ;#Fill the variable (hn) with the string "Hacker News"
  puts $hn ;#output the variable ($hn) to terminal
  } ;#end procedure

  displayHackerNews ;#execute the procedure
   displays: Hacker News
If statements are easy

  set hn ""
  if { $hn eq "Hacker News" } { puts $hn } else { 
     set hn "Not Hacker News" 
     puts $hn 
  } ;#end if
Infinite Loops are fun

  set hn "Hacker News" ;#Set a variable
  while { $hn eq "Hacker News" } {
    puts "$hn" ;# print "Hacker News" to terminal in an infinite loop
  } ;#end loop
Multi-threading is a breeze.

  package require Thread
  set MyThreadID [thread::create { 
  puts "Hello from my new thread"
   thread::wait
  } ;#end code-to-run
   ] ;#end thread
And finally, a if-switch-threaded-loop

  set hn "Hacker News"
  if { $hn eq "Hacker News" } {set switch "hn" } else { set switch "" }

  switch $switch {
  hn { 
  set MyThreadID [thread::create { 
  proc displayHackerNews {} {set hn "Hacker News" ; puts $hn} ;#end procedure

  #set aCounter to zero, if aCounter is < 7 execute displayHackerNews procedure
  for {set aCounter 0} {$aCounter < 7} {incr aCounter} { displayHackerNews } 
   thread::wait
  } ;#end threaded-code
  ] ;#end thread
  } ;#end switch-case

  default {puts "It's still not hacker news"}
  } ;#end switch
The simplicity of the language plus it's power enhances it further then python could ever reach. It also powers the Mar's Rover a long with 99% of all industrial technology. I wouldn't be too surprised to find the nuclear launch button is coded in TCL. (that part might not all be true) but

It's a nice language but to diss it that much, don't. It's a fun language to use and creates modern enhancements. I would HIGHLY recommend it to anyone who's confused about programming. Running remotely hosted X applications via novnc natively on most OS is tasty.

If one language that should be dropped is GOlang. Rust wins. It came from Google. Seriously, github links in source? Yes, looks smart and modern but is incredibly stupid. NO programming language should ever pull URL links for dependence. You wouldn't execute a random bash file on the internet to install a script would you? It's no difference.

I create a repo, heres link to repo, people install repo. I maliciously change the code to backdoor your box, you don't notice. Well done, You've compiled remote backdoor new version, none the wiser.

Who really reads the dependency code that that person has wrote?

My home page completely coded in PureTCL. No Databases, No JavaScript, no SSL and no bitching. http://fantasy.tf/