SERVING THE QUANTITATIVE FINANCE COMMUNITY

  • 1
  • 5
  • 6
  • 7
  • 8
  • 9
 
User avatar
Cuchulainn
Topic Author
Posts: 62637
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Re: Hello World in all Languages, post here

June 11th, 2020, 11:05 am

There are two kinds of developers: those for whom generics are natural and those who use 1) copy/paste/modify and 2) subtype polymorphism.

You can simulate generics by 1) and 2).
Step over the gap, not into it. Watch the space between platform and train.
http://www.datasimfinancial.com
http://www.datasim.nl
 
User avatar
ISayMoo
Posts: 2340
Joined: September 30th, 2015, 8:30 pm

Re: Hello World in all Languages, post here

June 11th, 2020, 3:17 pm

Copy/paste is sometimes the best choice :)
 
User avatar
Cuchulainn
Topic Author
Posts: 62637
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Re: Hello World in all Languages, post here

June 11th, 2020, 5:44 pm

Copy/paste is sometimes the best choice :)
"All things being equal" of course. It's magic numbers that is worrying. converting Fortran code for Ahrens/Dieter random variates directly to C, GOTOS and all.
What do we have to test?? Scary. The code may work but Fortran is  a different beast from C.

//

A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.

-Robert A. Heinlein
Step over the gap, not into it. Watch the space between platform and train.
http://www.datasimfinancial.com
http://www.datasim.nl
 
User avatar
ISayMoo
Posts: 2340
Joined: September 30th, 2015, 8:30 pm

Re: Hello World in all Languages, post here

June 11th, 2020, 8:00 pm

It is the great multiplication of the productions of all the different arts, in consequence of the division of labour, which occasions, in a well-governed society, that universal opulence which extends itself to the lowest ranks of the people.
- Adam Smith
 
User avatar
katastrofa
Posts: 9460
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

Re: Hello World in all Languages, post here

June 11th, 2020, 10:49 pm

A human being wouldn't be able to "butcher a hog". How about a vegan brownie?
Attachments
36774B3C-E352-45BC-B074-58AA54F706D6.jpeg
 
User avatar
Cuchulainn
Topic Author
Posts: 62637
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Re: Hello World in all Languages, post here

June 12th, 2020, 10:08 am

Heinlein had a great future behind him..
Step over the gap, not into it. Watch the space between platform and train.
http://www.datasimfinancial.com
http://www.datasim.nl
 
User avatar
Cuchulainn
Topic Author
Posts: 62637
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Re: Hello World in all Languages, post here

June 14th, 2020, 3:46 pm

PL/1, my 1st language... you can see it's from IBM
Hello: proc options(main);
     put list ('Hello world');
 end Hello;

Step over the gap, not into it. Watch the space between platform and train.
http://www.datasimfinancial.com
http://www.datasim.nl
 
User avatar
Cuchulainn
Topic Author
Posts: 62637
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Re: Hello World in all Languages, post here

June 16th, 2020, 7:13 pm

Quantum Q# 
namespace Quantum.HelloWorld

{

    open Microsoft.Quantum.Canon;

    open Microsoft.Quantum.Primitive;

    operation SayHello () : Unit {

        Message("Hello World!");

    }

}
Step over the gap, not into it. Watch the space between platform and train.
http://www.datasimfinancial.com
http://www.datasim.nl
 
User avatar
ISayMoo
Posts: 2340
Joined: September 30th, 2015, 8:30 pm

Re: Hello World in all Languages, post here

June 17th, 2020, 9:02 pm

Whoa.
 
User avatar
Cuchulainn
Topic Author
Posts: 62637
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Re: Hello World in all Languages, post here

June 18th, 2020, 8:42 am

Whoa.
Quantum Canons are the future.

Image
Step over the gap, not into it. Watch the space between platform and train.
http://www.datasimfinancial.com
http://www.datasim.nl
 
User avatar
Cuchulainn
Topic Author
Posts: 62637
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Re: Hello World in all Languages, post here

June 29th, 2020, 10:07 am

C++ is..

Because it is the only remaining "computer programming language". Others are ay most "application development languagues". "Computer scientists" must learn how to "program computers".
Step over the gap, not into it. Watch the space between platform and train.
http://www.datasimfinancial.com
http://www.datasim.nl
 
User avatar
ISayMoo
Posts: 2340
Joined: September 30th, 2015, 8:30 pm

Re: Hello World in all Languages, post here

July 4th, 2020, 7:14 pm

Go fills that niche too.
 
User avatar
Cuchulainn
Topic Author
Posts: 62637
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Re: Hello World in all Languages, post here

July 4th, 2020, 7:57 pm

package main

import (
	"fmt"

	"github.com/branda22/blackscholes/blackscholes"
)

func main() {
	option := &blackscholes.Option{
		StrikePrice:      3500,
		TimeToExpiration: 87,
		Type:             "CALL",
	}

	underlying := &blackscholes.Underlying{
		Symbol:     "BTC_USD",
		Price:      4410.00,
		Volatility: .8915,
	}

	bs := blackscholes.NewBlackScholes(option, underlying, .0102)

	fmt.Println("delta", bs.Delta)
	fmt.Println("IV", bs.ImpliedVolatility)
	fmt.Println("Theo price", bs.TheoPrice)
	fmt.Println("Theta", bs.Theta)
}
Step over the gap, not into it. Watch the space between platform and train.
http://www.datasimfinancial.com
http://www.datasim.nl
 
User avatar
ISayMoo
Posts: 2340
Joined: September 30th, 2015, 8:30 pm

Re: Hello World in all Languages, post here

July 6th, 2020, 9:51 am

That's typical Go code. See this library: https://github.com/gonum/gonum
 
User avatar
katastrofa
Posts: 9460
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

Re: Hello World in all Languages, post here

July 6th, 2020, 5:04 pm

to say-hi
   print "Hello, world!"
end
ABOUT WILMOTT

PW by JB

Wilmott.com has been "Serving the Quantitative Finance Community" since 2001. Continued...


Twitter LinkedIn Instagram

JOBS BOARD

JOBS BOARD

Looking for a quant job, risk, algo trading,...? Browse jobs here...


GZIP: On