# Are arrays the same as lists in Julia?

**URL:** https://discourse.julialang.org/t/are-arrays-the-same-as-lists-in-julia/63511
**Category:** New to Julia
**Created:** [June 24, 2021, 7:34pm UTC](https://discourse.julialang.org/t/are-arrays-the-same-as-lists-in-julia/63511 "2021-06-24T19:34:18Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Galaxy\_Being](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/galaxy_being/32/26445_2.png) [@Galaxy\_Being](https://discourse.julialang.org/u/Galaxy_Being)
#### Post date: [June 24, 2021, 7:34pm UTC](https://discourse.julialang.org/t/are-arrays-the-same-as-lists-in-julia/63511/1 "2021-06-24T19:34:18Z")

</div>

Coming from Scheme, Lisp, Haskell, lists are very important and used a lot. Is a Julia array the Julia version of a list, ie, use the same way as a list would be in Haskell or scheme?

---

<div class="post-metadata">

### Author: ![kevbonham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kevbonham/32/216165_2.png) [@kevbonham](https://discourse.julialang.org/u/kevbonham)
#### Post date: [June 24, 2021, 8:16pm UTC](https://discourse.julialang.org/t/are-arrays-the-same-as-lists-in-julia/63511/2 "2021-06-24T20:16:55Z")

</div>

I don’t know those languages, but I would say that a 1D array (also called `Vector`) is similar to a list in python. The major difference from a python list that tripped me up when I first came from python is that arrays are typed, so if you have an array of integers, you can’t put in a string for example.

---

<div class="post-metadata">

### Author: ![Oscar\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oscar_smith/32/25343_2.png) [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)
#### Post date: [June 24, 2021, 8:17pm UTC](https://discourse.julialang.org/t/are-arrays-the-same-as-lists-in-julia/63511/3 "2021-06-24T20:17:41Z")

</div>

TLDR is yes.  
That said they’re are a few alternatives to consider depending on your use case. The biggest 2 are Tuples and StaticArrays

---

<div class="post-metadata">

### Author: ![heliosdrm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/heliosdrm/32/3851_2.png) [@heliosdrm](https://discourse.julialang.org/u/heliosdrm)
#### Post date: [June 24, 2021, 8:47pm UTC](https://discourse.julialang.org/t/are-arrays-the-same-as-lists-in-julia/63511/4 "2021-06-24T20:47:26Z")

</div>

> [@kevbonham](#):
>
> arrays are typed, so if you have an array of integers, you can’t put in a string for example

For the sake of completeness, it should be added that however you can make arrays of type `Any`, where you can put integers together with strings and whatever else you want, e.g. `[1, "hello", false]`…

---

<div class="post-metadata">

### Author: ![dlakelan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlakelan/32/8491_2.png) [@dlakelan](https://discourse.julialang.org/u/dlakelan)
#### Post date: [June 24, 2021, 8:47pm UTC](https://discourse.julialang.org/t/are-arrays-the-same-as-lists-in-julia/63511/5 "2021-06-24T20:47:48Z")

</div>

Julia arrays are like scheme vectors. The closest thing to a scheme pair `(cons a b)` is the tuple `(a,b)` (but they don’t get used in julia in the way you use cons all over the place in scheme)

---

<div class="post-metadata">

### Author: ![oxinabox](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oxinabox/32/206603_2.png) [@oxinabox](https://discourse.julialang.org/u/oxinabox)
#### Post date: [June 24, 2021, 8:48pm UTC](https://discourse.julialang.org/t/are-arrays-the-same-as-lists-in-julia/63511/6 "2021-06-24T20:48:32Z")

</div>

A possibly important or possibly irrelevant difference:  
Lists in Scheme and Haskell are immutable singularly linked lists.  
Julia’s arrays are dynamic arrays. Specialness they have over e.g. C arrays is they are growable, and infact efficiently growable from both ends.  
Julia arrays are more like Java’s, C++'s, scheme etc;s Vector, and like Python’s list.

Arrays and linked lists have very different performance characteristics.  
and different APIs
