Hacker Newsnew | past | comments | ask | show | jobs | submit | gabrielsroka's commentslogin

Actual title: Elon Musk's SpaceX acquiring AI startup xAI ahead of potential IPO

> The combined company is expected to price shares in an IPO that would value it at $1.25 trillion


$666.66


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



i'm using it here

https://github.com/gabrielsroka/gabrielsroka.github.io/blob/...

it works on Chrome/Chrome for Android, but Brave requires a flag (brave://flags/#file-system-access-api), and i don't think Brave for Android supports it


This goes back to at least 2017 per archive.org


My "Pith" programming language didn't make the cut

https://news.ycombinator.com/item?id=32681150

Webpage using Pith instead of JavaScript to fetch HN Polls using the HN Search API

https://gabrielsroka.github.io/hnpolls_pith.html

Source

https://github.com/gabrielsroka/gabrielsroka.github.io/blob/...


Added now!



my bad, not aware of it. not able to edit and remove now.


I think you're fine. The guidelines also say:

> Please don't use HN primarily for promotion. It's ok to post your own stuff part of the time, but the primary use of the site should be for curiosity.

I also think the old epochconverter UI was dated. I'll switch to yours


> About 10% of people develop muscle aches

> Concerns about statin effects on the brain, such as cognitive impairment or dementia, are unfounded

https://www.health.harvard.edu/heart-health/what-are-the-ris...


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: