frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Ask HN: Weekend Social: Top two programming languages and what they can borrow?

3•susam•15h ago
Hello HN! Just creating a weekend social topic here to see what kind of answers might come up in this thread. Here are the questions:

1. What are your two most favourite programming languages? (Call them A and B below.)

2. What is one feature from A you wish B had? And one feature from B you wish A had?

3. When starting a new project, how do you choose between A and B?

Comments

eimrine•15h ago
1. J, Lisp.

2. There are no such features. But I want all languages to have J in the same manner as they have regexp. I mean a tool like NumPy but with sweeter syntax and more possibilities.

3. J is for number munching, Lisp is for everything else.

damnitbuilds•14h ago
1. Python, C++.

2. Significant indents, Compiles.

3. Ease of coding, Performance.

susam•12h ago
Answering my own questions:

1. Common Lisp, Python.

2. This is not exactly a language feature but more of an attribute of the ecosystems, but I wish Common Lisp had a more comprehensive 'batteries included' standard library. It does have a pretty good standard library [1] for its time, but in the modern day, it fades in comparison to that of mainstream languages like Python or Go. Yes, the availability of Quicklisp compensates for the relatively smaller standard library, but it does not fully replace the value of having a large and cohesive standard library.

For Python, I wish (and this might be controversial) that it used s-expressions instead of whitespace-based delimiter for blocks. I find cutting, pasting, moving around, and in general, manipulating whole s-expressions as individual units very convenient with appropriate editor support (e.g. Paredit). I know there are languages like Racket, Clojure, etc. which fulfil the requirement of extensive batteries included library + s-expressions, but they are much less popular than Python. In my ideal world, one of the top three popular languages would be a Lisp or Lisp-like language with an extensive standard library comparable to Python's.

3. Common Lisp for personal projects. Python for collaborative projects.

[1] https://www.lispworks.com/documentation/HyperSpec/Front/X_Sy...

gabrielsroka•10h ago
1. JS, Python

2. [i know u said 1, but there's so many] JS->Py: Looser type handling, nicer syntax for dicts. Py->JS: Less punctuation, comprehensions

3. I created a hybrid called Pith (https://news.ycombinator.com/item?id=46637033). JS with some nice Python features.

Appendix (Nov 2021)

A version of Python (call it "Pith" [0]) that fixes the annoying things, eg:

no colons

  if bool:
  # should be
  if bool
  
  for thing in things:
  # should be
  for thing in things
nicer dicts

  a_dict['prop']
  # should be
  a_dict.prop
shorter dicts

  a_dict = {'name': 'value'}
  # should be
  a_dict = {name: 'value'} # like in js
  # even
  a_dict = {content-type: 'json'} # ooh, ahh !
auto main function

  if __blah_blah_blah__ == '__main__' # dunder-struck ?
      main()
  # should be
  # nothing -- it just calls main() if it's there
dict.get(prop) by default

  # instead of
  a_dict.get('prop')
  # it should be like JS that returns undefined or None or something nullish or falsey
  a_dict.prop
ternary

  v = a if this else b # barf
  # should be
  v = this ? a : b
  # or (to steal from VB)
  v = iif(this, a, b)
  
  # maybe fix list/dict-compros, too, while i'm at it
elif? elf? what the helf ?

  elif x:
  # should be
  else if x # like any decent language
W T F-string?

  f'{huh}'
  # should be
  `{huh}` # like JS
len (like it's BASIC)

  len(a_string)
  # sb
  a_string.length
a longer example

  # Regular Python              | # Pith uses less punctuation
                                |
  def main():                   | def main
      a_dict = {                |     a_dict =
          'name': 'value'       |         name: 'value' # maybe use = instead of :
      }                         |
      if True:                  |     if true
          print(a_dict['name']) |         print a_dict.name
      elif 1 > 2:               |     else if 1 > 2
          print('ooh')          |         print 'ooh'
                                |  
  main()                        | # no need to call main()
i also like how JS allows you to call a function before it's defined (but Python doesn't -- why !!!)

maybe add a do/while loop, multi-line comments ###, JS-style regex /reg/ instead of r"regex" blah blah blah

etc, etc, etc

it could be a preprocessor (like the C Preprocessor) that takes Pith and converts it to Python

for JS, take out parens, curly braces, semicolons, etc (make it "look" more like Pith)

i know these changes are fraught with peril, but i don't care (do i?). there's no reason (is there?) that i should be stuck with Guido's or Brendan's design choices [1] (i can make my own :) )

i even had an idea that you could write a program in Pith and it could output either Python or JS (or anything else). that might need a little more thought

[0] "Pith" is prolly already in use by something else, just humour me

[1] that's the bigger idea here -- take a language you like, fix all the things you don't like about it. maybe lisp with fewer parens

aristofun•7h ago
1. Typescript, Ruby

2. Elegant typings, native to language syntax. Syntax flexibility.

3. Usually this choice is made for me or before me. And unfortunately it is often neither.

hakfoo•6h ago
1. PHP and C. 2. I wish C had PHP's native "associative array as junk drawer" data structure. Conversely, I wish PHP had more support for a "long lifetime" task that wasn't expected to vanish at the end of a page load. 3. Am I trying to target the web? Then PHP.

Ask HN: Gmail spam filtering suddenly marking everything as spam?

171•goopthink•17h ago•113 comments

Ask HN: What's the current best local/open speech-to-speech setup?

243•dsrtslnd23•1d ago•61 comments

Ask HN: Have we confused efficiency with "100% utilization"?

24•nickevante•13h ago•13 comments

Ask HN: What usually happens after a VC asks for a demo?

12•stijo•14h ago•4 comments

Ask HN: Do you have any evidence that agentic coding works?

454•terabytest•4d ago•450 comments

Ask HN: Career transition question – assistance, MLOps guidance

4•Pierre_Esteves•11h ago•0 comments

Ask HN: May an agent accept a license to produce a build?

26•athrowaway3z•19h ago•47 comments

Tell HN: 2 years building a kids audio app as a solo dev – lessons learned

136•oliverjanssen•3d ago•77 comments

Ask HN: Seeeking help to reverse engineer a PCB

20•Dlg001•2d ago•9 comments

Ask HN: Why does the number of datasets on data.gov vary so much?

7•akudha•13h ago•3 comments

Ask HN: Thinking about memory for AI coding agents

5•hoangnnguyen•22h ago•5 comments

Ask HN: What are some good unintuitive statistics problems?

6•ronbenton•17h ago•6 comments

Ask HN: Rust and AI builders interested in local-first, multi-agent systems?

3•cajazzer•13h ago•8 comments

Coding assistants are slow. So we multitask

3•brunaxLorax•9h ago•8 comments

Ask HN: How to redeem a gift card without risking lock-out?

6•magnetic•15h ago•6 comments

Ask HN: Weekend Social: Top two programming languages and what they can borrow?

3•susam•15h ago•6 comments

Ask HN: Where is society heading, is there a plan for a jobless future?

16•evo_9•1d ago•33 comments

Ask HN: Why are so many rolling out their own AI/LLM agent sandboxing solution?

32•ATechGuy•4d ago•14 comments

Ask HN: General purpose search engine that will respect special characters?

3•what-if•15h ago•3 comments

Ask HN: How do you AI code from your phone?

5•splitbrain•23h ago•1 comments

Ask HN: Do you "micro-manage" your agents?

7•xinbenlv•1d ago•8 comments

Ask HN: Revive a mostly dead Discord server

20•movedx•4d ago•28 comments

Locked out of my GCP account for 3 days, still charged, can't redirect domain

14•lifeoflee•1d ago•3 comments

Ask HN: Where do you look for semiconductor jobs?

4•johncole•1d ago•8 comments

Ask HN: Does DDG no longer honor "site:" prefix?

19•everybodyknows•2d ago•6 comments

Ask HN: LLMs for new job categories?

6•aavci•1d ago•2 comments

Ask HN: Best practice securing secrets on local machines working with agents?

9•xinbenlv•2d ago•11 comments

Tell HN: AI is all about the tools (for now)

3•keepamovin•22h ago•0 comments

ChatGPT has no real-time clock – time awareness is essential

3•Stehpwtimace•23h ago•1 comments

Ask HN: How do you authorize AI agent actions in production?

6•naolbeyene•2d ago•5 comments